| 1 |
`/** |
/** |
| 2 |
* FTrkCalibQLookExpert.cxx |
* FTrkCalibQLookExpert.cxx |
| 3 |
* |
* |
| 4 |
* autor: D.Fedele |
* autor: D.Fedele |
| 5 |
* version v1r23 |
* version v1r28 |
| 6 |
* Parameters: |
* Parameters: |
| 7 |
* file - the data file to analyze |
* file - the data file to analyze |
| 8 |
* step - select =1 in order to analyze one event at time |
* step - select =1 in order to analyze one event at time |
| 23 |
#include <TGraph.h> |
#include <TGraph.h> |
| 24 |
#include <TStyle.h> |
#include <TStyle.h> |
| 25 |
#include <TString.h> |
#include <TString.h> |
| 26 |
|
#include <TAxis.h> |
| 27 |
|
#include <TH1F.h> |
| 28 |
|
#include <TROOT.h> |
| 29 |
|
#include <cstdlib> |
| 30 |
// |
// |
| 31 |
#include <PscuHeader.h> |
#include <PscuHeader.h> |
| 32 |
#include <EventHeader.h> |
#include <EventHeader.h> |
| 34 |
#include <CalibTrk2Event.h> |
#include <CalibTrk2Event.h> |
| 35 |
// |
// |
| 36 |
|
|
| 37 |
typedef struct caltrk_def{ |
struct caltrk_def{ |
| 38 |
Int_t good0[2]; |
Int_t good0[2]; |
| 39 |
Int_t daqmode[12]; |
Int_t daqmode[12]; |
| 40 |
Int_t dspnum[12]; |
Int_t dspnum[12]; |
| 81 |
Int_t nevents=0; |
Int_t nevents=0; |
| 82 |
Int_t minevent = 0; |
Int_t minevent = 0; |
| 83 |
Int_t maxevent = 0; |
Int_t maxevent = 0; |
| 84 |
ULong64_t FOBT[2]; |
ULong_t FOBT[2]; |
| 85 |
|
|
| 86 |
FOBT[0]=0; |
FOBT[0]=0; |
| 87 |
FOBT[1]=0; |
FOBT[1]=0; |
| 192 |
|
|
| 193 |
Int_t hcevent=hotr->GetEntries(); |
Int_t hcevent=hotr->GetEntries(); |
| 194 |
Int_t tcevent=totr->GetEntries(); |
Int_t tcevent=totr->GetEntries(); |
| 195 |
ULong64_t HOBT[hcevent], TOBT[tcevent]; |
ULong_t HOBT[hcevent], TOBT[tcevent]; |
| 196 |
for (Int_t i = 0; i < hcevent; i++){ |
for (Int_t i = 0; i < hcevent; i++){ |
| 197 |
hotr->GetEntry(i); |
hotr->GetEntry(i); |
| 198 |
ph = eh4->GetPscuHeader(); |
ph = eh4->GetPscuHeader(); |
| 279 |
// other variables definitions |
// other variables definitions |
| 280 |
|
|
| 281 |
Int_t risposta=0; |
Int_t risposta=0; |
| 282 |
stringstream fromfile; |
stringstream fromfile,isfile; |
| 283 |
|
|
| 284 |
fromfile<<"FTrkCalibQLook_EXPERT File: "<<ffile<<" -- CalibHeader OBT= "<<HOBT[(cod->Get(pctp->CalibHeader))-1]<<" -- Calib pkt OBT= "<<FOBT[0]<<" -- CalibTrailer OBT= "<<TOBT[(cod->Get(pctp->CalibTrailer))]<<" --"; |
fromfile<<"FTrkCalibQLook_EXPERT File: "<<ffile<<" -- CalibHeader OBT= "<<HOBT[(cod->Get(pctp->CalibHeader))-1]<<" -- Calib pkt OBT= "<<FOBT[0]<<" -- CalibTrailer OBT= "<<TOBT[(cod->Get(pctp->CalibTrailer))]<<" --"; |
| 285 |
|
|
| 309 |
Int_t canvasy=900; |
Int_t canvasy=900; |
| 310 |
TCanvas *c1 = new TCanvas("c1","FTrkCalibQLook_EXPERT_ped",canvasx,canvasy); |
TCanvas *c1 = new TCanvas("c1","FTrkCalibQLook_EXPERT_ped",canvasx,canvasy); |
| 311 |
c1->SetFillColor(10); |
c1->SetFillColor(10); |
| 312 |
tzz->DrawLatex(.01,0.98,fromfile.str().c_str()); |
tzz->DrawLatex(.01,.98,fromfile.str().c_str()); |
| 313 |
tzz->DrawLatex(.90,0.98,"PEDESTAL"); |
tzz->DrawLatex(.90,.98,"PEDESTAL"); |
| 314 |
|
|
| 315 |
|
isfile<<"Chips with white line at least once showed anomalous behaviour"; |
| 316 |
|
tzz->SetTextColor(17); |
| 317 |
|
tzz->SetTextSize(0.018); |
| 318 |
|
tzz->DrawLatex(.01,.96,isfile.str().c_str()); |
| 319 |
|
isfile.str(""); |
| 320 |
|
|
| 321 |
|
isfile<<"Boxes so colored point out anomalous chips (not necessarily broken)"; |
| 322 |
|
tzz->SetTextColor(107); |
| 323 |
|
// tzz->DrawLatex(.05,.96,isfile.str().c_str()); |
| 324 |
|
isfile.str(""); |
| 325 |
|
|
| 326 |
TCanvas *c2 = new TCanvas("c2","FTrkCalibQLook_EXPERT_sig",canvasx,canvasy); |
TCanvas *c2 = new TCanvas("c2","FTrkCalibQLook_EXPERT_sig",canvasx,canvasy); |
| 327 |
c2->SetFillColor(10); |
c2->SetFillColor(10); |
| 328 |
tzz->DrawLatex(.01,0.98,fromfile.str().c_str()); |
tzz->SetTextColor(1); |
| 329 |
tzz->DrawLatex(.90,0.98,"SIGMA"); |
tzz->DrawLatex(.01,.98,fromfile.str().c_str()); |
| 330 |
|
tzz->DrawLatex(.90,.98,"SIGMA"); |
| 331 |
|
|
| 332 |
|
isfile<<"Chips with white line at least once showed anomalous behaviour"; |
| 333 |
|
tzz->SetTextColor(17); |
| 334 |
|
tzz->SetTextSize(0.018); |
| 335 |
|
tzz->DrawLatex(.01,.96,isfile.str().c_str()); |
| 336 |
|
isfile.str(""); |
| 337 |
|
|
| 338 |
|
isfile<<"Boxes so colored point out anomalous chips (not necessarily broken)"; |
| 339 |
|
tzz->SetTextColor(107); |
| 340 |
|
// tzz->DrawLatex(.05,.96,isfile.str().c_str()); |
| 341 |
|
isfile.str(""); |
| 342 |
|
|
| 343 |
|
|
| 344 |
TCanvas *sig=new TCanvas("sig","FTrkCalibQLook_EXPERT_histosig",canvasx,canvasy); |
TCanvas *sig=new TCanvas("sig","FTrkCalibQLook_EXPERT_histosig",canvasx,canvasy); |
| 345 |
sig->SetFillColor(10); |
sig->SetFillColor(10); |
| 346 |
tzz->DrawLatex(.01,0.98,fromfile.str().c_str()); |
tzz->SetTextColor(1); |
| 347 |
tzz->DrawLatex(.85,0.97,"Histograms of the sigmas"); |
tzz->DrawLatex(.01,.98,fromfile.str().c_str()); |
| 348 |
|
tzz->DrawLatex(.85,.97,"Histograms of the sigmas"); |
| 349 |
|
|
| 350 |
|
|
| 351 |
|
|
| 545 |
liva1.SetLineStyle(3); |
liva1.SetLineStyle(3); |
| 546 |
liva1.SetLineWidth(1); |
liva1.SetLineWidth(1); |
| 547 |
|
|
| 548 |
Float_t maxhist=0,va1x=0; |
Float_t maxhist=0,va1x=0,minhist=0.; |
| 549 |
TBox b; |
TBox b; |
| 550 |
/* plot PEDESTAL */ |
/* plot PEDESTAL */ |
| 551 |
c1->cd(); |
c1->cd(); |
| 564 |
if((nn+1)%2==0) histoped[nn]->GetYaxis()->SetRangeUser(700,1700); |
if((nn+1)%2==0) histoped[nn]->GetYaxis()->SetRangeUser(700,1700); |
| 565 |
histoaped[nn]->SetLineColor(5); |
histoaped[nn]->SetLineColor(5); |
| 566 |
histoaped[nn]->SetLineWidth(1); |
histoaped[nn]->SetLineWidth(1); |
| 567 |
// if(ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
// if(ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
| 568 |
histoped[nn]->Draw("b"); |
histoped[nn]->Draw("b"); |
| 569 |
maxhist=histoped[nn]->GetMaximum(); |
maxhist=histoped[nn]->GetMaximum(); |
| 570 |
if(nn==0){ |
if(nn%2==0) minhist=2200; |
| 571 |
b.SetFillColor(107); |
else minhist=700; |
| 572 |
b.SetFillStyle(3945); |
b.SetFillColor(19); |
| 573 |
b.DrawBox(256.,2200.,384.,maxhist); |
b.SetFillStyle(3954); |
| 574 |
b.DrawBox(768.,2200.,2047.,maxhist); |
if(nn==0){ |
| 575 |
} |
b.DrawBox(0.,minhist,2047.,maxhist); |
| 576 |
else if(nn==1){ |
} |
| 577 |
b.SetFillColor(6); |
else if(nn==1){ |
| 578 |
b.SetFillStyle(3945); |
b.DrawBox(128.,minhist,256.,maxhist); |
| 579 |
b.DrawBox(2944.,700.,3060.,maxhist); |
b.DrawBox(384.,minhist,512.,maxhist); |
| 580 |
|
b.DrawBox(896.,minhist,1024.,maxhist); |
| 581 |
b.SetFillColor(107); |
b.DrawBox(2048.,minhist,2432.,maxhist); |
| 582 |
b.SetFillStyle(3954); |
b.DrawBox(2816.,minhist,2944.,maxhist); |
| 583 |
b.DrawBox(384.,700.,512.,maxhist); |
b.DrawBox(2944.,minhist,3070.,maxhist); |
| 584 |
b.DrawBox(2048.,700.,2432.,maxhist); |
} |
| 585 |
b.DrawBox(2816.,700.,2944.,maxhist); |
else if(nn==3){ |
| 586 |
} |
b.DrawBox(0.,minhist,256.,maxhist); |
| 587 |
else if(nn==3){ |
b.DrawBox(2816.,minhist,3070.,maxhist); |
| 588 |
b.SetFillColor(107); |
} |
| 589 |
b.SetFillStyle(3954); |
else if(nn==4){ |
| 590 |
b.DrawBox(2816.,700.,3070.,maxhist); |
b.DrawBox(256.,minhist,512.,maxhist); |
| 591 |
} |
b.DrawBox(1792.,minhist,1920.,maxhist); |
| 592 |
else if(nn==4){ |
b.DrawBox(2816.,minhist,3070.,maxhist); |
| 593 |
b.SetFillColor(107); |
} |
| 594 |
b.SetFillStyle(3954); |
else if(nn==5){ |
| 595 |
b.DrawBox(256.,2200.,512.,maxhist); |
b.DrawBox(0.,minhist,256.,maxhist); |
| 596 |
b.DrawBox(2816.,2200.,3070.,maxhist); |
b.DrawBox(896.,minhist,1024.,maxhist); |
| 597 |
} |
b.DrawBox(1664.,minhist,1792.,maxhist); |
| 598 |
else if(nn==6){ |
} |
| 599 |
b.SetFillColor(6); |
else if(nn==6){ |
| 600 |
b.SetFillStyle(3945); |
b.DrawBox(512.,minhist,768.,maxhist); |
| 601 |
b.DrawBox(1024.,2200.,1280.,maxhist); |
b.DrawBox(1024.,minhist,1280.,maxhist); |
| 602 |
|
b.DrawBox(1280.,minhist,1792.,maxhist); |
| 603 |
b.SetFillColor(107); |
b.DrawBox(2560.,minhist,2816.,maxhist); |
| 604 |
b.SetFillStyle(3954); |
} |
| 605 |
b.DrawBox(512.,2200.,768.,maxhist); |
else if(nn==7){ |
| 606 |
b.DrawBox(1280.,2200.,1792.,maxhist); |
b.DrawBox(0.,minhist,1535.,maxhist); |
| 607 |
b.DrawBox(2560.,2200.,2816.,maxhist); |
b.DrawBox(2024.,minhist,2280.,maxhist); |
| 608 |
} |
} |
| 609 |
else if(nn==7){ |
else if(nn==8){ |
| 610 |
b.SetFillColor(107); |
b.DrawBox(512.,minhist,768.,maxhist); |
| 611 |
b.SetFillStyle(3954); |
} |
| 612 |
b.DrawBox(512.,700.,768.,maxhist); |
else if(nn==9){ |
| 613 |
b.DrawBox(1024.,700.,1535.,maxhist); |
b.DrawBox(0.,minhist,128.,maxhist); |
| 614 |
} |
b.DrawBox(256.,minhist,384.,maxhist); |
| 615 |
else if(nn==8){ |
b.DrawBox(512.,minhist,640.,maxhist); |
| 616 |
b.SetFillColor(107); |
b.DrawBox(896.,minhist,1152.,maxhist); |
| 617 |
b.SetFillStyle(3954); |
b.DrawBox(1280.,minhist,1535.,maxhist); |
| 618 |
b.DrawBox(512.,2200.,768.,maxhist); |
b.DrawBox(1664.,minhist,1920.,maxhist); |
| 619 |
} |
b.DrawBox(2048.,minhist,2304.,maxhist); |
| 620 |
else if(nn==9){ |
} |
| 621 |
b.SetFillColor(107); |
else if(nn==10){ |
| 622 |
b.SetFillStyle(3954); |
b.DrawBox(0.,minhist,512.,maxhist); |
| 623 |
b.DrawBox(256.,700.,384.,maxhist); |
b.DrawBox(1024.,minhist,3070.,maxhist); |
| 624 |
b.DrawBox(1280.,700.,1535.,maxhist); |
} |
| 625 |
b.DrawBox(1792.,700.,1920.,maxhist); |
else if(nn==11){ |
| 626 |
} |
b.DrawBox(0.,minhist,512.,maxhist); |
| 627 |
else if(nn==10){ |
b.DrawBox(768.,minhist,1024.,maxhist); |
| 628 |
b.SetFillColor(107); |
b.DrawBox(1536.,minhist,1664.,maxhist); |
| 629 |
b.SetFillStyle(3954); |
b.DrawBox(1920.,minhist,2560.,maxhist); |
| 630 |
b.DrawBox(1024.,2200.,1152.,maxhist); |
b.DrawBox(2816.,minhist,3070.,maxhist); |
| 631 |
b.DrawBox(2048.,2200.,3070.,maxhist); |
} |
| 632 |
} |
// } |
| 633 |
else if(nn==11){ |
// else histoped[nn]->Draw("axis"); |
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
|
b.DrawBox(768.,700.,1024.,maxhist); |
|
|
|
|
|
b.SetFillColor(107); |
|
|
b.SetFillStyle(3954); |
|
|
b.DrawBox(0.,700.,512.,maxhist); |
|
|
b.DrawBox(1920.,700.,2560.,maxhist); |
|
|
} |
|
|
// } |
|
|
// else histoped[nn]->Draw("axis"); |
|
| 634 |
histoaped[nn]->Draw("same"); |
histoaped[nn]->Draw("same"); |
| 635 |
if((nn+1)%2==1) { |
if((nn+1)%2==1) { |
| 636 |
for(int va=1; va<24; va++){ |
for(int va=1; va<24; va++){ |
| 671 |
histosig[nn]->GetYaxis()->CenterTitle(); |
histosig[nn]->GetYaxis()->CenterTitle(); |
| 672 |
histoasig[nn]->SetLineColor(5); |
histoasig[nn]->SetLineColor(5); |
| 673 |
histoasig[nn]->SetLineWidth(1); |
histoasig[nn]->SetLineWidth(1); |
| 674 |
// if(ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
// if(ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
| 675 |
histosig[nn]->Draw("b"); |
histosig[nn]->Draw("b"); |
| 676 |
maxhist=histosig[nn]->GetMaximum(); |
maxhist=histosig[nn]->GetMaximum(); |
| 677 |
if(nn==0){ |
minhist=0.; |
| 678 |
b.SetFillColor(107); |
b.SetFillColor(19); |
| 679 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
| 680 |
b.DrawBox(256.,0.,384.,maxhist); |
if(nn==0){ |
| 681 |
b.DrawBox(768.,0.,2047.,maxhist); |
b.DrawBox(0.,minhist,2047.,maxhist); |
| 682 |
} |
} |
| 683 |
else if(nn==1){ |
else if(nn==1){ |
| 684 |
b.SetFillColor(6); |
b.DrawBox(128.,minhist,256.,maxhist); |
| 685 |
b.SetFillStyle(3945); |
b.DrawBox(384.,minhist,512.,maxhist); |
| 686 |
b.DrawBox(2944.,0.,3070.,maxhist); |
b.DrawBox(896.,minhist,1024.,maxhist); |
| 687 |
|
b.DrawBox(2048.,minhist,2432.,maxhist); |
| 688 |
b.SetFillColor(107); |
b.DrawBox(2816.,minhist,2944.,maxhist); |
| 689 |
b.SetFillStyle(3954); |
b.DrawBox(2944.,minhist,3070.,maxhist); |
| 690 |
b.DrawBox(384.,0.,512.,maxhist); |
} |
| 691 |
b.DrawBox(2048.,0.,2432.,maxhist); |
else if(nn==3){ |
| 692 |
b.DrawBox(2816.,0.,2944.,maxhist); |
b.DrawBox(0.,minhist,256.,maxhist); |
| 693 |
} |
b.DrawBox(2816.,minhist,3070.,maxhist); |
| 694 |
else if(nn==3){ |
} |
| 695 |
b.SetFillColor(107); |
else if(nn==4){ |
| 696 |
b.SetFillStyle(3954); |
b.DrawBox(256.,minhist,512.,maxhist); |
| 697 |
b.DrawBox(2816.,0.,3070.,maxhist); |
b.DrawBox(1792.,minhist,1920.,maxhist); |
| 698 |
} |
b.DrawBox(2816.,minhist,3070.,maxhist); |
| 699 |
else if(nn==4){ |
} |
| 700 |
b.SetFillColor(107); |
else if(nn==5){ |
| 701 |
b.SetFillStyle(3954); |
b.DrawBox(0.,minhist,256.,maxhist); |
| 702 |
b.DrawBox(256.,0.,512.,maxhist); |
b.DrawBox(896.,minhist,1024.,maxhist); |
| 703 |
b.DrawBox(2816.,0.,3070.,maxhist); |
b.DrawBox(1664.,minhist,1792.,maxhist); |
| 704 |
} |
} |
| 705 |
else if(nn==6){ |
else if(nn==6){ |
| 706 |
b.SetFillColor(6); |
b.DrawBox(512.,minhist,768.,maxhist); |
| 707 |
b.SetFillStyle(3945); |
b.DrawBox(1024.,minhist,1280.,maxhist); |
| 708 |
b.DrawBox(1024.,0.,1280.,maxhist); |
b.DrawBox(1280.,minhist,1792.,maxhist); |
| 709 |
|
b.DrawBox(2560.,minhist,2816.,maxhist); |
| 710 |
b.SetFillColor(107); |
} |
| 711 |
b.SetFillStyle(3954); |
else if(nn==7){ |
| 712 |
b.DrawBox(512.,0.,768.,maxhist); |
b.DrawBox(0.,minhist,1535.,maxhist); |
| 713 |
b.DrawBox(1280.,0.,1792.,maxhist); |
b.DrawBox(2024.,minhist,2280.,maxhist); |
| 714 |
b.DrawBox(2560.,0.,2816.,maxhist); |
} |
| 715 |
} |
else if(nn==8){ |
| 716 |
else if(nn==7){ |
b.DrawBox(512.,minhist,768.,maxhist); |
| 717 |
b.SetFillColor(107); |
} |
| 718 |
b.SetFillStyle(3954); |
else if(nn==9){ |
| 719 |
b.DrawBox(512.,0.,768.,maxhist); |
b.DrawBox(0.,minhist,128.,maxhist); |
| 720 |
b.DrawBox(1024.,0.,1535.,maxhist); |
b.DrawBox(256.,minhist,384.,maxhist); |
| 721 |
} |
b.DrawBox(512.,minhist,640.,maxhist); |
| 722 |
else if(nn==8){ |
b.DrawBox(896.,minhist,1152.,maxhist); |
| 723 |
b.SetFillColor(107); |
b.DrawBox(1280.,minhist,1535.,maxhist); |
| 724 |
b.SetFillStyle(3954); |
b.DrawBox(1664.,minhist,1920.,maxhist); |
| 725 |
b.DrawBox(512.,0.,768.,maxhist); |
b.DrawBox(2048.,minhist,2304.,maxhist); |
| 726 |
} |
} |
| 727 |
else if(nn==9){ |
else if(nn==10){ |
| 728 |
b.SetFillColor(107); |
b.DrawBox(0.,minhist,512.,maxhist); |
| 729 |
b.SetFillStyle(3954); |
b.DrawBox(1024.,minhist,3070.,maxhist); |
| 730 |
b.DrawBox(256.,0.,384.,maxhist); |
} |
| 731 |
b.DrawBox(1280.,0.,1535.,maxhist); |
else if(nn==11){ |
| 732 |
b.DrawBox(1792.,0.,1920.,maxhist); |
b.DrawBox(0.,minhist,512.,maxhist); |
| 733 |
} |
b.DrawBox(768.,minhist,1024.,maxhist); |
| 734 |
else if(nn==10){ |
b.DrawBox(1536.,minhist,1664.,maxhist); |
| 735 |
b.SetFillColor(107); |
b.DrawBox(1920.,minhist,2560.,maxhist); |
| 736 |
b.SetFillStyle(3954); |
b.DrawBox(2816.,minhist,3070.,maxhist); |
| 737 |
b.DrawBox(1024.,0.,1152.,maxhist); |
} |
| 738 |
b.DrawBox(2048.,0.,3070.,maxhist); |
// } |
| 739 |
} |
// else histosig[nn]->Draw("axis"); |
|
else if(nn==11){ |
|
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
|
b.DrawBox(768.,0.,1024.,maxhist); |
|
|
|
|
|
b.SetFillColor(107); |
|
|
b.SetFillStyle(3954); |
|
|
b.DrawBox(0.,0.,512.,maxhist); |
|
|
b.DrawBox(1920.,0.,2560.,maxhist); |
|
|
} |
|
|
// } |
|
|
// else histosig[nn]->Draw("axis"); |
|
| 740 |
histoasig[nn]->Draw("same"); |
histoasig[nn]->Draw("same"); |
| 741 |
for(int va=1; va<24; va++){ |
for(int va=1; va<24; va++){ |
| 742 |
va1x=128*va; |
va1x=128*va; |