132 |
|
|
133 |
|
for(int iw=0;iw<5;iw++) |
134 |
|
if(doWheel[iw]) |
135 |
< |
cout<< "Wheeel"<< iw-2 << " will be analyze "<< endl; |
135 |
> |
cout<< "Wheeel "<< iw-2 << " will be analyzed "<< endl; |
136 |
|
|
137 |
|
|
138 |
|
// Create the root file |
139 |
< |
// theFile = new TFile(theRootFileName.c_str(), "RECREATE"); |
139 |
> |
//theFile = new TFile(theRootFileName.c_str(), "RECREATE"); |
140 |
|
|
141 |
|
theDQMStore = edm::Service<DQMStore>().operator->(); |
142 |
|
|
165 |
|
} |
166 |
|
} |
167 |
|
// segments (in whole detector) |
168 |
< |
if(doSegs) createTH1F("hnSegDT","Num seg DT","", 50,0.,50.); |
168 |
> |
if(doSegs) { |
169 |
> |
createTH1F("hnSegDT","Num of DT segs","", 50,0.,50.); |
170 |
> |
createTH1F("hnHSegDT","Num of high qual. DT segs","", 50,0.,50.); |
171 |
> |
histo("hnHSegDT")->SetLineColor(2); |
172 |
> |
|
173 |
> |
createTH1F("hnSegMB1","Num of MB1 segs","", 50,0.,50.); |
174 |
> |
createTH1F("hnHSegMB1","Num of high qual. MB1 segs","", 50,0.,50.); |
175 |
> |
histo("hnHSegMB1")->SetLineColor(2); |
176 |
> |
|
177 |
> |
createTH1F("segphi","phi of segment position","",72,-180.,180.); |
178 |
> |
createTH2F("segphivsz","phi vs z of segment position","",160,-800,800,180,-180.,180.); |
179 |
> |
|
180 |
> |
for (int iMB=0; iMB<4; iMB++) { |
181 |
> |
stringstream histoobj1; stringstream histoname1; |
182 |
> |
histoobj1<<"segphiMB"<<iMB+1; |
183 |
> |
histoname1<<"phi of segment position in MB"<<iMB+1; |
184 |
> |
createTH1F(histoobj1.str(),histoname1.str(),"",72,-180.,180.); |
185 |
> |
histo(histoobj1.str())->GetXaxis()->SetTitle("deg."); |
186 |
> |
histo(histoobj1.str())->SetLineColor(iMB+1); |
187 |
> |
|
188 |
> |
stringstream histoobj2; stringstream histoname2; |
189 |
> |
histoobj2<<"segzMB"<<iMB+1; |
190 |
> |
histoname2<<"z of segment position in MB"<<iMB+1; |
191 |
> |
createTH1F(histoobj2.str(),histoname2.str(),"",64,-800,800.); |
192 |
> |
histo(histoobj2.str())->GetXaxis()->SetTitle("cm"); |
193 |
> |
histo(histoobj2.str())->SetLineColor(iMB+1); |
194 |
> |
} |
195 |
> |
|
196 |
> |
createTH1F("DifPhi4_1_top","phi pos. in MB4 - MB1, top sects","",40,-40.,40.); |
197 |
> |
createTH1F("DifPhi4_1_bot","phi pos. in MB4 - MB1, bottom sects","",40,-40.,40.); |
198 |
> |
createTH1F("DifPhi4_1","phi pos. in MB4 - MB1","",40,-40.,40.); |
199 |
> |
histo("DifPhi4_1_top")->GetXaxis()->SetTitle("deg."); |
200 |
> |
histo("DifPhi4_1_bot")->GetXaxis()->SetTitle("deg."); |
201 |
> |
histo("DifPhi4_1")->GetXaxis()->SetTitle("deg."); |
202 |
> |
histo("DifPhi4_1_bot")->SetLineColor(2); |
203 |
> |
} |
204 |
|
// segments Sector by Secto |
205 |
|
if(doSegs){ |
206 |
|
for(int iw=0;iw<5;iw++) |
219 |
|
// Trigger: |
220 |
|
if(doTrig) |
221 |
|
{ |
222 |
+ |
createTH1F("TriggerQuality","Local Trigger quality","",8,-0.5,7.5); |
223 |
+ |
createTH1F("TriggerQualityMB4","Local Trigger quality, MB4","",8,-0.5,7.5); |
224 |
+ |
histo("TriggerQualityMB4")->SetLineColor(2); |
225 |
+ |
|
226 |
|
for(int iw=0;iw<5;iw++) |
227 |
|
{ |
228 |
|
if(doWheel[iw]){ |
265 |
|
hNameTrigMat << "TriggerMatrix" << Whname[iw] << "_S" << sect ; |
266 |
|
hTitleTrigMat << "Trigger Matrix, " << Whname[iw] << " Sector " << sect ; |
267 |
|
createTH1F (hNameTrigMat.str(),hTitleTrigMat.str(),"",20,-0.5,19.5); |
268 |
+ |
|
269 |
|
}//end if doTrig |
270 |
|
|
271 |
|
|
372 |
|
hTitlePhiHL << "Phi local " << Whname[iw] << " S" << sect << "/MB" << jst << "(>7 hits)"; |
373 |
|
createTH1F(hNamePhiHL.str(),hTitlePhiHL.str(),"",90,phimin, phimax); // *** histos: hPhiHL_S1_MB1, ecc... ********** |
374 |
|
// localposition of phi rec segments HH/HL |
335 |
– |
//float xposmin = -201., xposmax = 201.; |
375 |
|
float xposmin = -150., xposmax = 150.; |
376 |
|
stringstream hNamePosHL; |
377 |
|
stringstream hTitlePosHL; |
378 |
|
hNamePosHL << "hTrg_effdenum_" << Whname[iw] << "_S" << sect << "_MB" << jst ; |
379 |
|
hTitlePosHL << "Phi local Position " << Whname[iw] << " S" << sect << "/MB" << jst << "(>7 hits)"; |
341 |
– |
//createTH1F(hNamePosHL.str(),hTitlePosHL.str(),"",67,xposmin, xposmax); // *** histos: hTrg_effdenum_S1_MB1, ecc... ********** |
380 |
|
createTH1F(hNamePosHL.str(),hTitlePosHL.str(),"",50,xposmin, xposmax); // *** histos: hTrg_effdenum_S1_MB1, ecc... ********** |
381 |
|
|
382 |
|
// localposition of HH/HL Triggers for phi rec segments HH/HL |
384 |
|
stringstream hTitlePosTrigHL; |
385 |
|
hNamePosTrigHL << "hTrg_effnum_" << Whname[iw] << "_S" << sect << "_MB" << jst ; |
386 |
|
hTitlePosTrigHL << "Phi local Position " << Whname[iw] << " S" << sect << "/MB" << jst << "(>7 hits & HH/HL trig)"; |
349 |
– |
//createTH1F(hNamePosTrigHL.str(),hTitlePosTrigHL.str(),"",67,xposmin, xposmax); // *** histos: hTrg_effnum_S1_MB1, ecc... ********** |
387 |
|
createTH1F(hNamePosTrigHL.str(),hTitlePosTrigHL.str(),"",50,xposmin, xposmax); // *** histos: hTrg_effnum_S1_MB1, ecc... ********** |
388 |
|
// hits in track segments |
389 |
|
stringstream hNameHits; |
429 |
|
createTH1F("hChi2SA","#chi^{2}/NDoF for SA tracks","", 100, 0, 100.); |
430 |
|
createTH1F("hPIPSA","p for SA tracks @ IP","", 100, 0., 100); |
431 |
|
createTH1F("hPtIPSA","pt for SA tracks @ IP","", 100, 0., 100); |
395 |
– |
// createTH1F("hPhiIPSA","#phi for SA tracks @ IP","", 100, -M_PI_2, M_PI_2); |
432 |
|
createTH1F("hPhiIPSA","#phi for SA tracks @ IP","", 100, -3.14, 3.14); |
433 |
|
createTH1F("hEtaIPSA","#eta for SA tracks @ IP","", 100, -2.5, 2.5); |
434 |
|
createTH1F("hrIPSA"," r at IP","",100,0.,500.); |
437 |
|
|
438 |
|
createTH1F("hPInnerTSOSSA","p for SA tracks @ innermost TSOS","", 100, 0., 100); |
439 |
|
createTH1F("hPtInnerTSOSSA","pt for SA tracks @ innermost TSOS","", 100, 0., 100); |
404 |
– |
// createTH1F("hPhiInnerTSOSSA","#phi for SA tracks @ innermost TSOS","", 100, -M_PI_2, M_PI_2); |
440 |
|
createTH1F("hPhiInnerTSOSSA","#phi for SA tracks @ innermost TSOS","", 100, -3.14, 3.14); |
441 |
|
createTH1F("hEtaInnerTSOSSA","#eta for SA tracks @ innermost TSOS","", 100, -2.5, 2.5); |
442 |
|
createTH1F("hInnerRSA","Radius of innermost TSOS for SA tracks","", 100, 400, 1000.); |
536 |
|
/* Destructor */ |
537 |
|
DTOfflineAnalyzer::~DTOfflineAnalyzer() { |
538 |
|
if(doTrig)LabelTriggerMatrix(); // Trigger Matrix Labels |
539 |
< |
theDQMStore->rmdir("DT/DTOfflineAnalyzer");// theFile->cd(); |
505 |
< |
// theFile->Write(); |
506 |
< |
// theFile->Close(); |
539 |
> |
theDQMStore->rmdir("DT/DTOfflineAnalyzer"); |
540 |
|
} // end destructor ================================================================ |
541 |
|
|
542 |
|
// tools for trigger analysis.....============================================== |
581 |
|
|
582 |
|
stringstream hname; |
583 |
|
hname << "SectorTriggerMatrix" << Whname[iw] ; |
584 |
< |
for (int ibin=1; ibin<21; ibin++) histo(hname.str())->GetXaxis()->SetBinLabel(ibin,lab1[ibin-1].c_str()); |
584 |
> |
// for (int ibin=1; ibin<21; ibin++) histo(hname.str())->GetXaxis()->SetBinLabel(ibin,lab1[ibin-1].c_str()); |
585 |
|
} |
586 |
|
} |
587 |
|
|
588 |
|
// Labels for TriggerMatrix: |
589 |
|
|
590 |
< |
string lab[]={"no trig"," ","MB1","MB2","MB3","MB4"," ","1 & 2","1 & 3","1 & 4","2 & 3","2 & 4", |
591 |
< |
"3 & 4"," ","1 & 2 & 3","1 & 2 & 4","1 & 3 & 4","2 & 3 & 4"," ","1 & 2 & 3 & 4"}; |
590 |
> |
//char * lab[]={"no trig"," ","MB1","MB2","MB3","MB4"," ","1 & 2","1 & 3","1 & 4","2 & 3","2 & 4", |
591 |
> |
// "3 & 4"," ","1 & 2 & 3","1 & 2 & 4","1 & 3 & 4","2 & 3 & 4"," ","1 & 2 & 3 & 4"}; |
592 |
> |
//char lab[20][100]={"no trig"," ","MB1","MB2","MB3","MB4"," ","1 & 2","1 & 3","1 & 4","2 & 3","2 & 4", |
593 |
> |
// "3 & 4"," ","1 & 2 & 3","1 & 2 & 4","1 & 3 & 4","2 & 3 & 4"," ","1 & 2 & 3 & 4"}; |
594 |
|
for(int iw=0;iw<5;iw++){ |
595 |
|
if(doWheel[iw]){ |
596 |
|
for (int ise=1; ise<13; ise++) { |
597 |
|
stringstream hName; |
598 |
|
hName << "TriggerMatrix" << Whname[iw] << "_S" << ise ; |
599 |
< |
for (int ibin=1; ibin<21; ibin++) histo(hName.str())->GetXaxis()->SetBinLabel(ibin,(lab[ibin-1]).c_str()); |
599 |
> |
//for (int ibin=1; ibin<21; ibin++) histo(hName.str())->GetXaxis()->SetBinLabel(ibin,lab[ibin-1]); |
600 |
|
} |
601 |
|
}} |
602 |
|
|
609 |
|
sprintf (label,"S%uMB%u",ise,ibin); |
610 |
|
stringstream hname; |
611 |
|
hname << "TriggerInclusive" << Whname[iw] ; |
612 |
< |
histo(hname.str())->GetXaxis()->SetBinLabel((ise-1)*5+ibin,label); |
612 |
> |
// histo(hname.str())->GetXaxis()->SetBinLabel((ise-1)*5+ibin,label); |
613 |
|
} |
614 |
|
stringstream hname2; |
615 |
|
hname2 << "TriggerInclusive" << Whname[iw] ; |
616 |
< |
histo(hname2.str())->GetXaxis()->SetBinLabel(ise*5," "); |
616 |
> |
// histo(hname2.str())->GetXaxis()->SetBinLabel(ise*5," "); |
617 |
|
} |
618 |
|
} |
619 |
|
} |
695 |
|
digi != digiRange.second; |
696 |
|
digi++) { |
697 |
|
const DTWireId wireId(layerId, (*digi).wire()); |
663 |
– |
/* cout << "Wire: " << wireId << endl; |
664 |
– |
cout << " wheel " << wireId.wheel() << endl; |
665 |
– |
cout << " sector " << wireId.sector() << endl; |
666 |
– |
cout << " chamber " << wireId.station() << endl; |
667 |
– |
cout << " SL " << wireId.superlayer() << endl; |
668 |
– |
cout << " layer " << wireId.layer() << endl; |
669 |
– |
cout << " wire " << wireId.wire() << endl; */ |
670 |
– |
// int ix = 100*wireId.sector() + wireId.wire(); |
698 |
|
int ix = wireId.wire(); |
699 |
|
int iy = 20*(wireId.station()-1) + 4*(wireId.superlayer()-1) + wireId.layer(); |
700 |
|
int se = wireId.sector(); |
707 |
|
// the ttrigg used for this channel |
708 |
|
float ttrig = theSync->offset(wireId); |
709 |
|
|
683 |
– |
// float TDCtime = (*digi).time()/ 0.78125 ; |
684 |
– |
// float TDCtime = (*digi).time() ; |
710 |
|
float TDCtime = (*digi).time() - ttrig ; // plot the TDC times ttrigg-subtracted.... |
711 |
|
|
712 |
|
|
752 |
|
DTWireId wireId = (*hit).wireId(); |
753 |
|
int iwI=2+wireId.wheel(); |
754 |
|
if(doWheel[iwI])nHitDTWh[iwI]++; |
730 |
– |
/* |
731 |
– |
cout << "Wire: " << wireId << endl; |
732 |
– |
cout << " wheel " << wireId.wheel() << endl; |
733 |
– |
cout << " sector " << wireId.sector() << endl; |
734 |
– |
cout << " chamber " << wireId.station() << endl; |
735 |
– |
cout << " SL " << wireId.superlayer() << endl; |
736 |
– |
cout << " layer " << wireId.layer() << endl; |
737 |
– |
cout << " wire " << wireId.wire() << endl; |
738 |
– |
|
739 |
– |
float ttrig = theSync->offset(wireId); |
740 |
– |
//cout << "TTrig " << ttrig << endl; |
741 |
– |
float time = (*hit).digiTime() - ttrig ; |
742 |
– |
double xLeft = (*hit).localPosition(DTEnums::Left).x(); |
743 |
– |
double xRight = (*hit).localPosition(DTEnums::Right).x(); |
744 |
– |
*/ |
755 |
|
} // ********* end recHits loop ******************* |
756 |
|
|
757 |
|
for(int iw=0;iw<5;iw++){ |
789 |
|
event.getByLabel(theRecHits4DLabel, segs); |
790 |
|
if (debug) cout << "4d segments: " << segs->size() << endl; |
791 |
|
|
782 |
– |
// Not being used after |
783 |
– |
// Get the 2D rechit collection from the event ------------------- |
784 |
– |
//edm::Handle<DTRecSegment2DCollection> segs2d; |
785 |
– |
//event.getByLabel(theRecHits2DLabel, segs2d); |
786 |
– |
//if (debug) cout << "2d segments:" << segs2d->size() << endl; |
787 |
– |
|
792 |
|
// Get the 1D rechits from the event -------------- |
793 |
|
Handle<DTRecHitCollection> dtRecHits; |
794 |
|
event.getByLabel(theRecHits1DLabel, dtRecHits); |
799 |
|
const std::vector<DTChamber*> & chs = dtGeom->chambers(); |
800 |
|
|
801 |
|
|
802 |
+ |
int qual[5][5][15]; |
803 |
+ |
for (int iw=0; iw<5; iw++) // Wheel 1-5 |
804 |
+ |
for (int sec=1; sec<15; ++sec) // section 1 to 14 |
805 |
+ |
for (int ist=1; ist<5; ++ist) { |
806 |
+ |
qual[iw][ist-1][sec-1] = -1; |
807 |
+ |
} |
808 |
+ |
|
809 |
+ |
if(doTrig) |
810 |
+ |
{ |
811 |
|
// ====================================== |
812 |
|
// local trigger analysis |
813 |
|
//======================================= |
814 |
|
// get the DT local trigger collection ======================= |
815 |
|
edm::Handle<DTLocalTriggerCollection> allLocalTriggers; |
803 |
– |
//event.getByLabel("dtunpacker", allLocalTriggers); |
816 |
|
event.getByLabel(theDTLocalTriggerLabel, allLocalTriggers); |
817 |
|
DTLocalTriggerCollection::DigiRangeIterator chambIt; |
818 |
|
// Loop over chambers present in DTLocalTriggerCollection |
807 |
– |
//#not used //bool hasTr[]={false,false,false,false,false}; |
808 |
– |
//#not used //bool hasTrOut[]={false,false,false,false,false}; |
809 |
– |
//#not used // int bx[4][5]; |
810 |
– |
int qual[5][4][14]; |
811 |
– |
for (int iw=0; iw<5; iw++) // Wheel 1-5 |
812 |
– |
for (int sec=1; sec<15; ++sec) // section 1 to 14 |
813 |
– |
for (int ist=0; ist<5; ++ist) { |
814 |
– |
qual[iw][ist-1][sec-1] = -1; |
815 |
– |
} |
816 |
– |
|
819 |
|
int SCsect=0; int SCst=0; |
820 |
|
for (chambIt=allLocalTriggers->begin();chambIt!=allLocalTriggers->end();++chambIt){ // loop on chambers ------ |
821 |
|
const DTChamberId& id = (*chambIt).first; |
824 |
|
int iw=2+id.wheel(); |
825 |
|
|
826 |
|
if(doWheel[iw]){ |
825 |
– |
//#not used //bx[SCst-1][0]=0; bx[SCst-1][1]=0; |
827 |
|
const DTLocalTriggerCollection::Range& range = (*chambIt).second; |
828 |
|
int ntrCh=0; |
829 |
|
// loop over triggers of this chamber |
830 |
|
for (DTLocalTriggerCollection::const_iterator trigtrack = range.first;trigtrack!=range.second;++trigtrack){ |
830 |
– |
//#not used //if (trigtrack->trOut()) hasTrOut[SCst-1]=true; |
831 |
|
if (trigtrack->quality()<7) { |
832 |
– |
//#not used //hasTr[SCst-1]=true; // SCst = numero stazione : la stazione ha un trigger |
833 |
– |
//#not used bx[SCst-1][ntrCh]=trigtrack->bx(); // dice a che bx c'e' stato trigger .. |
834 |
– |
// float ibx=trigtrack->bx(); |
832 |
|
ntrCh++; |
836 |
– |
// cout << " SCsect: " << SCsect << " SCst: " << SCst << " quality " << trigtrack->quality() << endl; |
833 |
|
if (ntrCh>4) break; |
834 |
|
if (qual[iw][SCst-1][SCsect-1]!=-2) { |
835 |
|
int iQual=trigtrack->quality(); |
840 |
|
} // end if(doWheel[iw]) |
841 |
|
|
842 |
|
} //end loop on chambers ------- |
843 |
< |
|
843 |
> |
} |
844 |
|
// ===== end local trigger analysis ========================================= |
845 |
|
|
846 |
|
// counters for segments in sectors |
851 |
|
} |
852 |
|
|
853 |
|
|
854 |
+ |
int NsegmH=0; int NsMB1=0; int NsHMB1=0; |
855 |
+ |
double phi1[10]; double phi4[10]; int where1[10][2]; int where4[10][2]; int N1=0; int N4=0; |
856 |
+ |
|
857 |
|
// loop on chambers ============================================== |
858 |
|
for (std::vector<DTChamber*>::const_iterator ch = chs.begin(); |
859 |
|
ch!=chs.end() ; ++ch) { |
860 |
|
DTChamberId chid((*ch)->id()); |
862 |
– |
//cout << "chid " << chid << endl; |
863 |
– |
//int w= chid.wheel(); |
864 |
– |
// int se= chid.sector(); |
865 |
– |
//int st= chid.station(); |
861 |
|
int iw= 2+chid.wheel(); |
862 |
|
DTRecSegment4DCollection::range segsch= segs->get(chid); |
863 |
|
|
867 |
|
|
868 |
|
// ********** loop on 4D segments ********************************* |
869 |
|
|
870 |
+ |
|
871 |
|
for (DTRecSegment4DCollection::const_iterator seg=segsch.first ; |
872 |
|
seg!=segsch.second ; ++seg ) { |
873 |
|
|
874 |
|
int ist = seg->chamberId().station(); |
875 |
< |
// int iwheel = seg->chamberId().wheel() + 3; // Wheel -2,.+2 => 1,...5 |
875 |
> |
if (ist==1) NsMB1++; |
876 |
> |
// int iwheel = seg->chamberId().wheel() + 3; // Wheel -2,.+2 => 1,...5 |
877 |
|
int isect = seg->chamberId().sector(); |
878 |
|
int iisect = isect; |
879 |
|
if (isect == 13 ) isect = 4; |
880 |
|
if (isect == 14 ) isect = 10; |
881 |
|
|
882 |
< |
const DTChamber* ch = dtGeom->chamber(seg->chamberId()); |
883 |
< |
GlobalPoint glbPoint = ch->toGlobal((*seg).localPosition()); |
884 |
< |
GlobalVector glbDir = ch->toGlobal((*seg).localDirection()); |
882 |
> |
const DTChamber* ch = dtGeom->chamber(seg->chamberId()); |
883 |
> |
GlobalPoint glbPoint = ch->toGlobal((*seg).localPosition()); |
884 |
> |
//GlobalVector glbDir = ch->toGlobal((*seg).localDirection()); |
885 |
> |
|
886 |
> |
float radtodeg = 57.296; |
887 |
> |
|
888 |
> |
float phiglobal = glbPoint.phi(); // phi position of reco segments |
889 |
> |
float zglobal = glbPoint.z(); // zed position of reco segments |
890 |
> |
histo2d("segphivsz")->Fill(zglobal,radtodeg*phiglobal); |
891 |
> |
histo("segphi")->Fill(radtodeg*phiglobal); |
892 |
> |
stringstream histoobj1; |
893 |
> |
histoobj1<<"segphiMB"<<ist; |
894 |
> |
histo(histoobj1.str())->Fill(radtodeg*phiglobal); |
895 |
> |
stringstream histoobj2; |
896 |
> |
histoobj2<<"segzMB"<<ist; |
897 |
> |
histo(histoobj2.str())->Fill(zglobal); |
898 |
> |
|
899 |
> |
if (ist==1) { |
900 |
> |
if (N1<10) { |
901 |
> |
phi1[N1]=radtodeg*phiglobal; |
902 |
> |
where1[N1][0]=iw; |
903 |
> |
where1[N1][1]=isect; |
904 |
> |
N1++; |
905 |
> |
} |
906 |
> |
} |
907 |
> |
else if (ist==4) { |
908 |
> |
if (N4<10) { |
909 |
> |
phi4[N4]=radtodeg*phiglobal; |
910 |
> |
where4[N4][0]=iw; |
911 |
> |
where4[N4][1]=isect; |
912 |
> |
N4++; |
913 |
> |
} |
914 |
> |
} |
915 |
|
|
916 |
|
// first the the two projection separately ----------------- |
917 |
|
// phi segment |
918 |
|
if(debug) cout << seg->chamberId() << endl; |
892 |
– |
// if(debug) cout << " 4D segm: " << *seg << endl; |
919 |
|
if(debug) cout << " 4D segm: x " << glbPoint.x() << " y " << glbPoint.y() << " z " << glbPoint.z() << endl; |
920 |
|
const DTChamberRecSegment2D* phiSeg= (*seg).phiSegment(); |
895 |
– |
// cout << (*seg).localDirection() << endl; |
921 |
|
// cout << -atan(glbDir.x()/ glbDir.y()) << endl; |
922 |
|
float localPhi = (*seg).localDirection().x(); |
898 |
– |
float radtodeg = 57.296 ; |
923 |
|
float localPhideg = radtodeg * atan(localPhi); |
900 |
– |
// vector<DTRecHit1D> phiHits; |
924 |
|
std::vector<DTRecHit1D> phiHits; |
925 |
|
int NtkHit = 0; |
926 |
|
if (phiSeg) { |
904 |
– |
// if(debug) cout << "Phi segm: " << *phiSeg << endl; |
927 |
|
phiHits = phiSeg->specificRecHits(); |
928 |
|
if(debug) cout << " Nhits in Phi-segment " << phiHits.size() << endl; |
929 |
|
NtkHit = phiHits.size(); |
930 |
|
if (phiHits.size()>=6) { // Nhits > 6 |
909 |
– |
// cout << " Event " << event.id().event() << " Sect " << isect << " MB" << ist << " Philocal " << localPhideg << endl; |
931 |
|
stringstream hTitlePhi; |
932 |
|
hTitlePhi << "hPhi_" << Whname[iw] << "_S" << isect << "_MB" << ist; |
933 |
|
histo(hTitlePhi.str())->Fill( localPhideg ); // *** histos: hPhiS1_MB1, ecc... ********** |
938 |
|
stringstream hTitlePhiHL; |
939 |
|
hTitlePhiHL << "hPhiHL_" << Whname[iw] << "_S" << iisect << "_MB" << ist; |
940 |
|
histo(hTitlePhiHL.str())->Fill( phiLocal ); |
941 |
+ |
NsegmH++; |
942 |
+ |
if (ist==1) NsHMB1++; |
943 |
+ |
|
944 |
|
} |
945 |
|
int MBeffSec = 0; // don't use this station [ist,isec ] |
946 |
|
for ( int ist1=1; ist1 < 5; ++ist1) |
974 |
|
} // next station |
975 |
|
} // next sector |
976 |
|
|
953 |
– |
// if( MBeff[ist-1][iisect-1] == 1) { // event triggered by other stations |
977 |
|
if( MBeff == 1) { // event triggered by other stations |
978 |
|
float phiglobal = glbPoint.phi(); // phi position of reco segments |
979 |
|
if (phiHits.size()>=7) { // HH & HL potential candidates |
983 |
|
hTitlePhiTrigg << "hPhiTrigg_"<< Whname[iw] << "_MB" << ist; |
984 |
|
histo(hTitlePhiGlob.str())->Fill( phiglobal*radtodeg ); // *** histos: hPhiGlob_MB1, ecc... ********** |
985 |
|
if( qual[iw][ist-1][iisect-1] > 4) histo(hTitlePhiTrigg.str())->Fill( phiglobal*radtodeg ); // *** hPhiTrigg_MB1, ... |
986 |
< |
} |
986 |
> |
} |
987 |
|
} |
988 |
|
// end trigger efficiency analysis ------------ |
989 |
|
// prepare vectors for re-fitting |
990 |
< |
float xfit[12], yfit [12]; |
991 |
< |
float sfit[12]; // flag (-1 or +1) for left/right semicell, input to fitline_t0 function |
969 |
< |
// for (unsigned int sphit = 0; sphit < phiHits.size(); ++sphit){ // loop on segment hits |
970 |
< |
// if(debug) cout <<(phiHits[sphit]).wireId() << endl; |
971 |
< |
// } // next hit in 2D phi segment |
990 |
> |
//float xfit[12], yfit [12]; |
991 |
> |
//float sfit[12]; // flag (-1 or +1) for left/right semicell, input to fitline_t0 function |
992 |
|
DTSuperLayerId slid1(phiSeg->chamberId(),1); |
993 |
|
/// Mean timer analysis |
994 |
|
DTMeanTimer meanTimer1(dtGeom->superLayer(slid1), phiHits, eventSetup, theSync); |
1012 |
|
(specificHits[sphit]).wireId().layer() == il ) { |
1013 |
|
float xhit = (specificHits[sphit]).localPosition().x() + laylocal.x() ; // localPosition is in the layer (not in the cell) |
1014 |
|
DTWireId wireId = (specificHits[sphit]).wireId(); |
995 |
– |
// cout << " digiTime " << (specificHits[sphit]).digiTime() << " xlocal " << (specificHits[sphit]).localPosition().x() << endl; |
1015 |
|
float ttrig = theSync->offset(wireId); |
1016 |
< |
// cout << "Sect " << isect << " MB" << ist << " SL" << isl << |
1017 |
< |
// " digiTime " << (specificHits[sphit]).digiTime() << " ttrigg " << ttrig << endl; |
999 |
< |
int ill = il; |
1000 |
< |
if ( isl > 1) ill = il + 4; |
1016 |
> |
//int ill = il; |
1017 |
> |
//if ( isl > 1) ill = il + 4; |
1018 |
|
if (il == 1 || il == 3 ) tmax123[isl] = tmax123[isl] + 0.5*( (specificHits[sphit]).digiTime() - ttrig ); |
1019 |
|
if (il == 2) tmax123[isl] = tmax123[isl] + (specificHits[sphit]).digiTime() - ttrig; |
1020 |
< |
xfit[nhitfit] = laylocal.z(); // input to fitline function |
1021 |
< |
yfit[nhitfit] = xhit; // input to fitline function |
1022 |
< |
sfit[nhitfit] = 1.; // mark left/right semi-cell (1=Right) input to fitline_t0 function ) |
1023 |
< |
if( (specificHits[sphit]).lrSide() == 2 ) sfit[nhitfit] = -1.; // -1 = Left |
1020 |
> |
//xfit[nhitfit] = laylocal.z(); // input to fitline function |
1021 |
> |
//yfit[nhitfit] = xhit; // input to fitline function |
1022 |
> |
//sfit[nhitfit] = 1.; // mark left/right semi-cell (1=Right) input to fitline_t0 function ) |
1023 |
> |
//if( (specificHits[sphit]).lrSide() == 2 ) sfit[nhitfit] = -1.; // -1 = Left |
1024 |
|
nhitfit++; |
1025 |
|
// ============== histograms of residuals ====================== |
1026 |
|
stringstream hTitle; |
1038 |
|
histo(hTitle1.str())->Fill( tmax123[1]); |
1039 |
|
hTitle2 << "htmax_" << Whname[iw] << "_S"<< isect << "_MB" << ist << "_SL3"; |
1040 |
|
histo(hTitle2.str())->Fill( tmax123[3]); |
1024 |
– |
// hTitle3 << "hdtmaxMB" << ist << "_" << isect; |
1025 |
– |
// histo(hTitle3.str())->Fill( tmax123[3]-tmax123[1]); |
1041 |
|
// =========================================================== |
1042 |
|
} // endif abs(phiLocal) < 35 deg |
1043 |
|
} // endif phiHts.size() >= 6 |
1048 |
|
//cout << "zedSeg " << zedSeg << endl; |
1049 |
|
vector<DTRecHit1D> zedHits; |
1050 |
|
if (zedSeg) { |
1036 |
– |
// if(debug) cout << "Zed segm: " << *zedSeg << endl; |
1051 |
|
zedHits = zedSeg->specificRecHits(); |
1052 |
|
if(debug) cout << " Nhits in z-segment " << zedHits.size() << endl; |
1053 |
|
NtkHit = NtkHit + zedHits.size(); |
1040 |
– |
// for (unsigned int sphit = 0; sphit < zedHits.size(); ++sphit){ // loop on segment hits |
1041 |
– |
// if(debug) cout <<(zedHits[sphit]).wireId() << endl; |
1042 |
– |
// } // next hit in 2D zed segment |
1054 |
|
} // endif zedSeg |
1055 |
|
|
1056 |
|
|
1066 |
|
|
1067 |
|
} // end loop on all chambers ========================= |
1068 |
|
|
1069 |
+ |
histo("hnHSegDT")->Fill(float(NsegmH)); |
1070 |
+ |
histo("hnSegMB1")->Fill(float(NsMB1)); |
1071 |
+ |
histo("hnHSegMB1")->Fill(float(NsHMB1)); |
1072 |
+ |
|
1073 |
+ |
for (int iph4=0; iph4<N4; iph4++) { |
1074 |
+ |
for (int iph1=0; iph1<N1; iph1++) { |
1075 |
+ |
|
1076 |
+ |
if (where1[iph1][0]<where4[iph4][0]+2 && where1[iph1][0]>where4[iph4][0]-2 && |
1077 |
+ |
where1[iph1][1]<where4[iph4][1]+2 && where1[iph1][1]>where4[iph4][1]-2 ) { |
1078 |
+ |
if (where4[iph4][1]<7 && where4[iph4][1]>1) histo("DifPhi4_1_top")->Fill(phi4[iph4]-phi1[iph1]); |
1079 |
+ |
else if (where4[iph4][1]>7) histo("DifPhi4_1_bot")->Fill(phi4[iph4]-phi1[iph1]); |
1080 |
+ |
histo("DifPhi4_1")->Fill(phi4[iph4]-phi1[iph1]); |
1081 |
+ |
} |
1082 |
+ |
} |
1083 |
+ |
} |
1084 |
+ |
|
1085 |
|
|
1086 |
|
// ==== fill segment multiplicity histos per sector =============== |
1087 |
|
for (int iw=0; iw<5; iw++) // Wheels -2 (0) to 2 (4) |
1116 |
|
eventSetup.get<MuonGeometryRecord>().get(dtGeom); |
1117 |
|
// const std::vector<DTChamber*> & chs = dtGeom->chambers(); |
1118 |
|
|
1092 |
– |
|
1119 |
|
// Get the 4D rechit collection from the event ------------------- |
1120 |
|
edm::Handle<DTRecSegment4DCollection> segs; |
1121 |
|
event.getByLabel(theRecHits4DLabel, segs); |
1122 |
|
|
1097 |
– |
// Get the 2D rechit collection from the event ------------------- |
1098 |
– |
//edm::Handle<DTRecSegment2DCollection> segs2d; |
1099 |
– |
//event.getByLabel(theRecHits2DLabel, segs2d); |
1100 |
– |
|
1123 |
|
// Get the 1D rechits from the event -------------- |
1124 |
|
Handle<DTRecHitCollection> dtRecHits; |
1125 |
|
event.getByLabel(theRecHits1DLabel, dtRecHits); |
1140 |
|
double recPt=0.; |
1141 |
|
histo("hNSA")->Fill(staTracks->size()); |
1142 |
|
histo2d("hNSAVsNHits")->Fill(dtRecHits->size(),staTracks->size()); |
1121 |
– |
// histo2d("hNSAVsNSegs2D")->Fill(segs2d->size(),staTracks->size()); |
1143 |
|
histo2d("hNSAVsNSegs4D")->Fill(segs->size(),staTracks->size()); |
1144 |
|
|
1145 |
|
if (debug && staTracks->size() ) |
1154 |
|
if (debug) { |
1155 |
|
cout << muonDumper.dumpFTS(track.impactPointTSCP().theState()); |
1156 |
|
|
1136 |
– |
// double posx = track.impactPointTSCP().position().x(); |
1157 |
|
recPt = track.impactPointTSCP().momentum().perp(); |
1138 |
– |
// cout<<" x = " << posx << endl; |
1158 |
|
cout<<" p: "<<track.impactPointTSCP().momentum().mag()<< " pT: "<<recPt<<endl; |
1159 |
|
cout<<" normalized chi2: "<<track.normalizedChi2()<<endl; |
1160 |
|
} |
1161 |
|
|
1143 |
– |
double posx = track.impactPointTSCP().position().x(); |
1144 |
– |
double posy = track.impactPointTSCP().position().y(); |
1145 |
– |
double posz = track.impactPointTSCP().position().z(); |
1146 |
– |
double radius = sqrt( posx*posx + posy*posy ); |
1147 |
– |
|
1148 |
– |
// total hits in STA |
1149 |
– |
histo("hNhitsSA")->Fill(staTrack->recHitsSize()); |
1150 |
– |
histo2d("hNHitsSAVsNHits")->Fill(dtRecHits->size(),staTrack->recHitsSize()); |
1151 |
– |
// histo2d("hNHitsSAVsNSegs2D")->Fill(segs2d->size(),staTrack->recHitsSize()); |
1152 |
– |
histo2d("hNHitsSAVsNSegs4D")->Fill(segs->size(),staTrack->recHitsSize()); |
1153 |
– |
|
1154 |
– |
// chi2... |
1155 |
– |
histo("hChi2SA")->Fill(track.normalizedChi2()); |
1156 |
– |
|
1157 |
– |
// plots at Impact Point |
1158 |
– |
histo("hPIPSA")->Fill(track.impactPointTSCP().momentum().mag()); |
1159 |
– |
histo("hPtIPSA")->Fill(recPt); |
1160 |
– |
histo("hPhiIPSA")->Fill(track.impactPointTSCP().momentum().phi()); |
1161 |
– |
histo("hEtaIPSA")->Fill(track.impactPointTSCP().momentum().eta()); |
1162 |
– |
histo("hrIPSA")->Fill(radius); |
1163 |
– |
histo("hzIPSA")->Fill(posz); |
1164 |
– |
histo2d("hrVszIPSA")->Fill(posz,radius); |
1165 |
– |
|
1166 |
– |
TrajectoryStateOnSurface innerTSOS = track.innermostMeasurementState(); |
1167 |
– |
if (debug) { |
1168 |
– |
cout << "Inner TSOS:"<<endl; |
1169 |
– |
cout << muonDumper.dumpTSOS(innerTSOS); |
1170 |
– |
cout<<" p: "<<innerTSOS.globalMomentum().mag()<< " pT: "<<innerTSOS.globalMomentum().perp()<<endl; |
1171 |
– |
} |
1172 |
– |
|
1173 |
– |
histo("hPInnerTSOSSA")->Fill(innerTSOS.globalMomentum().mag()); |
1174 |
– |
histo("hPtInnerTSOSSA")->Fill(innerTSOS.globalMomentum().perp()); |
1175 |
– |
histo("hPhiInnerTSOSSA")->Fill(innerTSOS.globalMomentum().phi()); |
1176 |
– |
histo("hEtaInnerTSOSSA")->Fill(innerTSOS.globalMomentum().eta()); |
1177 |
– |
|
1178 |
– |
histo("hInnerRSA")->Fill(sqrt(staTrack->innerPosition().perp2())); |
1179 |
– |
histo("hOuterRSA")->Fill(sqrt(staTrack->outerPosition().perp2())); |
1180 |
– |
histo2d("hInnerOuterRSA")->Fill(sqrt(staTrack->innerPosition().perp2()), |
1181 |
– |
sqrt(staTrack->outerPosition().perp2())); |
1182 |
– |
|
1162 |
|
|
1163 |
|
if (debug) cout<<" Associated RecHits:"<<endl; |
1164 |
|
|
1172 |
|
for(trackingRecHit_iterator recHit = rhbegin; recHit != rhend; ++recHit){ |
1173 |
|
const GeomDet* geomDet = theTrackingGeometry->idToDet((*recHit)->geographicalId()); |
1174 |
|
GlobalPoint gpos=geomDet->toGlobal((*recHit)->localPosition()); |
1175 |
< |
// cout << (*recHit)->geographicalId() << endl; |
1176 |
< |
// const TrackingRecHit* trh = (*recHit)->recHits(); |
1175 |
> |
|
1176 |
> |
DetId theDetector=(*recHit)->geographicalId(); |
1177 |
> |
if (theDetector.det() == 2 && theDetector.subdetId() == 1) // MUON && DT |
1178 |
> |
{ |
1179 |
|
NHass++; |
1180 |
|
DTWireId wireId ; |
1181 |
|
if ( const DTRecHit1D* dthit = dynamic_cast< const DTRecHit1D*> ((*recHit)->clone()) ) { |
1182 |
|
wireId = dthit ->wireId(); |
1202 |
– |
/* cout << " Wire: " << wireId << endl; |
1203 |
– |
cout << " wheel " << wireId.wheel() << endl; |
1204 |
– |
cout << " sector " << wireId.sector() << endl; |
1205 |
– |
cout << " chamber " << wireId.station() << endl; |
1206 |
– |
cout << " SL " << wireId.superlayer() << endl; |
1207 |
– |
cout << " layer " << wireId.layer() << endl; |
1208 |
– |
cout << " wire " << wireId.wire() << endl; */ |
1183 |
|
} |
1184 |
< |
if (NHass == 1) sect = wireId.sector(); |
1185 |
< |
if (NHass == 1) iw = 2+wireId.wheel(); |
1184 |
> |
if (NHass == 1 || sect==0) sect = wireId.sector(); // SomeTimes problems with hits, to recover if first is bad |
1185 |
> |
if (NHass == 1 || iw==-1) iw = 2+wireId.wheel(); // SomeTimes problems with hits, to recover if first is bad |
1186 |
|
if (debug) cout<< wireId << " r: "<< gpos.perp() <<" x,y,z: "<< gpos.x() << " " << gpos.y() << " " << gpos.z() << " " << gpos.phi() << endl; |
1187 |
|
histo2d("hHitsPosXYSA")->Fill(gpos.x(),gpos.y()); |
1188 |
|
histo2d("hHitsPosXYSA_1")->Fill(gpos.x(),gpos.y()); |
1207 |
|
stringstream hTitlePhihit; |
1208 |
|
hTitlePhihit << "hPhiHit_" << Whname[iw] << "_MB" << wireId.station() ; |
1209 |
|
if(doWheel[iw])if(wireId.superlayer() != 2) histo(hTitlePhihit.str())->Fill( radtodeg*phi); // hPhiHit_MB1, ....ecc |
1210 |
+ |
}// if Rechit = MUON && DT |
1211 |
|
} // next associated rechit -------------------------------- |
1212 |
|
|
1213 |
|
// ==== fill ass hit multiplicity histos per sector =============== |
1214 |
+ |
if(NHass>0 && iw>-1) // Only Fill Tracks with DT Hits and containing hits with wire info |
1215 |
+ |
{ |
1216 |
|
stringstream hTitle; |
1217 |
|
hTitle << "hNhass_" << Whname[iw] << "_S" << sect ; |
1218 |
|
if(doWheel[iw])histo(hTitle.str())->Fill( NHass); // hNhass_S1_MB1, ....ecc |
1219 |
|
|
1220 |
< |
|
1221 |
< |
// ---- start extrapolation analysis ------------------ |
1222 |
< |
// try to extrapolate using thePropagator ------ |
1223 |
< |
if (!thePropagator){ |
1224 |
< |
ESHandle<Propagator> prop; |
1225 |
< |
eventSetup.get<TrackingComponentsRecord>().get(thePropagatorName, prop); |
1226 |
< |
thePropagator = prop->clone(); |
1227 |
< |
thePropagator->setPropagationDirection(anyDirection); |
1228 |
< |
} |
1229 |
< |
|
1230 |
< |
float radtodeg = 57.296 ; |
1231 |
< |
// Get a surface (here a cylinder of radius 1290mm) : ECAL |
1232 |
< |
float radiusECAL = 129.0; // radius in centimeter |
1233 |
< |
Cylinder::PositionType pos0; |
1234 |
< |
Cylinder::RotationType rot0; |
1235 |
< |
const Cylinder::CylinderPointer ecal = Cylinder::build(pos0, rot0,radiusECAL); |
1236 |
< |
//cout << "Cyl " << ecal->radius() << endl; |
1237 |
< |
TrajectoryStateOnSurface tsosAtEcal = |
1238 |
< |
thePropagator->propagate(*innerTSOS.freeState(), *ecal); |
1239 |
< |
if (tsosAtEcal.isValid()) { |
1240 |
< |
// cout << "extrap to ECAL : " << tsosAtEcal.globalPosition() << " r " << |
1241 |
< |
// tsosAtEcal.globalPosition().perp() << endl; |
1242 |
< |
float phiEcal = -radtodeg*acos(tsosAtEcal.globalPosition().x()/tsosAtEcal.globalPosition().perp()); |
1243 |
< |
float zEcal = tsosAtEcal.globalPosition().z(); |
1244 |
< |
if (abs(zEcal) < 290. ) histo2d("hphivszECAL")->Fill(zEcal,phiEcal); |
1245 |
< |
} |
1246 |
< |
// else |
1247 |
< |
// cout << "Extrapolation to ECAL failed" << endl; |
1271 |
< |
|
1272 |
< |
// Get a surface (here a cylinder of radius 1811 mm): HCAL |
1273 |
< |
float radiusHCAL = 181.1; // radius in centimeter |
1274 |
< |
const Cylinder::CylinderPointer hcal = Cylinder::build(pos0, rot0,radiusHCAL); |
1275 |
< |
//cout << "Cyl " << hcal->radius() << endl; |
1276 |
< |
TrajectoryStateOnSurface tsosAtHcal = |
1277 |
< |
thePropagator->propagate(*innerTSOS.freeState(), *hcal); |
1278 |
< |
if (tsosAtHcal.isValid()) { |
1279 |
< |
// cout << "extrap to HCAL : " << tsosAtHcal.globalPosition() << " r " << |
1280 |
< |
// tsosAtHcal.globalPosition().perp() << endl; |
1281 |
< |
float phiHcal = -radtodeg*acos(tsosAtHcal.globalPosition().x()/tsosAtHcal.globalPosition().perp()); |
1282 |
< |
float zHcal = tsosAtHcal.globalPosition().z(); |
1283 |
< |
if (abs(zHcal) < 390. ) histo2d("hphivszHCAL")->Fill(zHcal,phiHcal); |
1220 |
> |
double radius = 0; |
1221 |
> |
double posz = 0; |
1222 |
> |
if(track.impactPointTSCP().isValid()) |
1223 |
> |
{ |
1224 |
> |
double posx = track.impactPointTSCP().position().x(); |
1225 |
> |
double posy = track.impactPointTSCP().position().y(); |
1226 |
> |
posz = track.impactPointTSCP().position().z(); |
1227 |
> |
radius = sqrt( posx*posx + posy*posy ); |
1228 |
> |
} |
1229 |
> |
|
1230 |
> |
// total hits in STA |
1231 |
> |
histo("hNhitsSA")->Fill(staTrack->recHitsSize()); |
1232 |
> |
histo2d("hNHitsSAVsNHits")->Fill(dtRecHits->size(),staTrack->recHitsSize()); |
1233 |
> |
histo2d("hNHitsSAVsNSegs4D")->Fill(segs->size(),staTrack->recHitsSize()); |
1234 |
> |
|
1235 |
> |
// chi2... |
1236 |
> |
histo("hChi2SA")->Fill(track.normalizedChi2()); |
1237 |
> |
|
1238 |
> |
// plots at Impact Point |
1239 |
> |
if(track.impactPointTSCP().isValid()) |
1240 |
> |
{ |
1241 |
> |
histo("hPIPSA")->Fill(track.impactPointTSCP().momentum().mag()); |
1242 |
> |
histo("hPtIPSA")->Fill(recPt); |
1243 |
> |
histo("hPhiIPSA")->Fill(track.impactPointTSCP().momentum().phi()); |
1244 |
> |
histo("hEtaIPSA")->Fill(track.impactPointTSCP().momentum().eta()); |
1245 |
> |
histo("hrIPSA")->Fill(radius); |
1246 |
> |
histo("hzIPSA")->Fill(posz); |
1247 |
> |
histo2d("hrVszIPSA")->Fill(posz,radius); |
1248 |
|
} |
1249 |
< |
// else |
1250 |
< |
// cout << "Extrapolation to HCAL failed" << endl; |
1251 |
< |
// --- end extraploation analysis ------------------------- |
1249 |
> |
//else |
1250 |
> |
// cout << "[DTOfflineAnalyzer]track.impactPointTSCP() not valid!!! Skiping the fill of histograms Ev:" |
1251 |
> |
// << event.id().event() << endl; |
1252 |
> |
|
1253 |
> |
TrajectoryStateOnSurface innerTSOS = track.innermostMeasurementState(); |
1254 |
> |
if (debug) { |
1255 |
> |
cout << "Inner TSOS:"<<endl; |
1256 |
> |
cout << muonDumper.dumpTSOS(innerTSOS); |
1257 |
> |
cout<<" p: "<<innerTSOS.globalMomentum().mag()<< " pT: "<<innerTSOS.globalMomentum().perp()<<endl; |
1258 |
> |
} |
1259 |
> |
|
1260 |
> |
histo("hPInnerTSOSSA")->Fill(innerTSOS.globalMomentum().mag()); |
1261 |
> |
histo("hPtInnerTSOSSA")->Fill(innerTSOS.globalMomentum().perp()); |
1262 |
> |
histo("hPhiInnerTSOSSA")->Fill(innerTSOS.globalMomentum().phi()); |
1263 |
> |
histo("hEtaInnerTSOSSA")->Fill(innerTSOS.globalMomentum().eta()); |
1264 |
> |
|
1265 |
> |
histo("hInnerRSA")->Fill(sqrt(staTrack->innerPosition().perp2())); |
1266 |
> |
histo("hOuterRSA")->Fill(sqrt(staTrack->outerPosition().perp2())); |
1267 |
> |
histo2d("hInnerOuterRSA")->Fill(sqrt(staTrack->innerPosition().perp2()), |
1268 |
> |
sqrt(staTrack->outerPosition().perp2())); |
1269 |
> |
|
1270 |
> |
|
1271 |
> |
// ---- start extrapolation analysis ------------------ |
1272 |
> |
// try to extrapolate using thePropagator ------ |
1273 |
> |
if (!thePropagator){ |
1274 |
> |
ESHandle<Propagator> prop; |
1275 |
> |
eventSetup.get<TrackingComponentsRecord>().get(thePropagatorName, prop); |
1276 |
> |
thePropagator = prop->clone(); |
1277 |
> |
thePropagator->setPropagationDirection(anyDirection); |
1278 |
> |
} |
1279 |
> |
|
1280 |
> |
float radtodeg = 57.296 ; |
1281 |
> |
// Get a surface (here a cylinder of radius 1290mm) : ECAL |
1282 |
> |
float radiusECAL = 129.0; // radius in centimeter |
1283 |
> |
Cylinder::PositionType pos0; |
1284 |
> |
Cylinder::RotationType rot0; |
1285 |
> |
const Cylinder::CylinderPointer ecal = Cylinder::build(pos0, rot0,radiusECAL); |
1286 |
> |
TrajectoryStateOnSurface tsosAtEcal = |
1287 |
> |
thePropagator->propagate(*innerTSOS.freeState(), *ecal); |
1288 |
> |
if (tsosAtEcal.isValid()) { |
1289 |
> |
float phiEcal = -radtodeg*acos(tsosAtEcal.globalPosition().x()/tsosAtEcal.globalPosition().perp()); |
1290 |
> |
float zEcal = tsosAtEcal.globalPosition().z(); |
1291 |
> |
if (abs(zEcal) < 290. ) histo2d("hphivszECAL")->Fill(zEcal,phiEcal); |
1292 |
> |
} |
1293 |
> |
// else |
1294 |
> |
// cout << "Extrapolation to ECAL failed" << endl; |
1295 |
> |
|
1296 |
> |
// Get a surface (here a cylinder of radius 1811 mm): HCAL |
1297 |
> |
float radiusHCAL = 181.1; // radius in centimeter |
1298 |
> |
const Cylinder::CylinderPointer hcal = Cylinder::build(pos0, rot0,radiusHCAL); |
1299 |
> |
TrajectoryStateOnSurface tsosAtHcal = |
1300 |
> |
thePropagator->propagate(*innerTSOS.freeState(), *hcal); |
1301 |
> |
if (tsosAtHcal.isValid()) { |
1302 |
> |
// cout << "extrap to HCAL : " << tsosAtHcal.globalPosition() << " r " << |
1303 |
> |
// tsosAtHcal.globalPosition().perp() << endl; |
1304 |
> |
float phiHcal = -radtodeg*acos(tsosAtHcal.globalPosition().x()/tsosAtHcal.globalPosition().perp()); |
1305 |
> |
float zHcal = tsosAtHcal.globalPosition().z(); |
1306 |
> |
if (abs(zHcal) < 390. ) histo2d("hphivszHCAL")->Fill(zHcal,phiHcal); |
1307 |
> |
} |
1308 |
> |
// else |
1309 |
> |
// cout << "Extrapolation to HCAL failed" << endl; |
1310 |
> |
// --- end extraploation analysis ------------------------- |
1311 |
> |
} |
1312 |
> |
else |
1313 |
> |
if (debug)cout << " [DTOfflineAnalyzer]: Track has not DT Triggers" << endl; |
1314 |
|
|
1315 |
|
|
1316 |
|
} // next SA track ============================================ |
1334 |
|
|
1335 |
|
// get the DT local trigger collection ======================= |
1336 |
|
edm::Handle<DTLocalTriggerCollection> allLocalTriggers; |
1311 |
– |
//event.getByLabel("dtunpacker", allLocalTriggers); |
1337 |
|
event.getByLabel(theDTLocalTriggerLabel, allLocalTriggers); |
1338 |
|
|
1339 |
|
bool hasTr[5][12][4]; |
1342 |
|
for(int ist=0;ist<4;ist++) hasTr[iw][ise][ist]=false; |
1343 |
|
//bool SecthasTr[]={false,false,false,false,false,false,false,false,false,false,false,false}; |
1344 |
|
bool SecthasTr[5][12]={{false,false,false,false,false,false,false,false,false,false,false,false} |
1345 |
< |
,{false,false,false,false,false,false,false,false,false,false,false,false} |
1346 |
< |
,{false,false,false,false,false,false,false,false,false,false,false,false} |
1347 |
< |
,{false,false,false,false,false,false,false,false,false,false,false,false} |
1348 |
< |
,{false,false,false,false,false,false,false,false,false,false,false,false}}; |
1345 |
> |
,{false,false,false,false,false,false,false,false,false,false,false,false} |
1346 |
> |
,{false,false,false,false,false,false,false,false,false,false,false,false} |
1347 |
> |
,{false,false,false,false,false,false,false,false,false,false,false,false} |
1348 |
> |
,{false,false,false,false,false,false,false,false,false,false,false,false}}; |
1349 |
|
|
1350 |
|
int SCsect=0; int SCst=0; |
1351 |
|
|
1352 |
< |
int bx[5][4][5]; |
1352 |
> |
// int bx[5][4][5]; |
1353 |
|
float bxbest[5][4][14]; |
1354 |
|
// float qual[]={-1,-1,-1,-1}; |
1355 |
|
int qual[5][4][14]; |
1372 |
|
|
1373 |
|
if(doWheel[iw]) |
1374 |
|
{ |
1375 |
< |
bx[iw][SCst-1][0]=0; bx[iw][SCst-1][1]=0; |
1375 |
> |
//bx[iw][SCst-1][0]=0; bx[iw][SCst-1][1]=0; |
1376 |
|
|
1377 |
|
int countsec=-1; |
1378 |
|
for (int ns=0; ns<12; ns++) { |
1399 |
|
hasTr[iw][SCsect-1][SCst-1]=true; |
1400 |
|
} |
1401 |
|
if (trigtrack->quality()<7) { |
1402 |
< |
bx[iw][SCst-1][ntrCh]=trigtrack->bx(); // dice a che bx c'e' stato trigger |
1402 |
> |
//bx[iw][SCst-1][ntrCh]=trigtrack->bx(); // dice a che bx c'e' stato trigger |
1403 |
|
float ibx=trigtrack->bx(); |
1404 |
|
ntrCh++; |
1405 |
|
if (ntrCh>4) break; |
1406 |
|
int iQual=trigtrack->quality(); |
1407 |
+ |
if (SCst==4) histo("TriggerQualityMB4")->Fill(iQual); |
1408 |
+ |
else histo("TriggerQuality")->Fill(iQual); |
1409 |
+ |
|
1410 |
+ |
|
1411 |
|
if( iQual > qual[iw][SCst-1][SCsect-1] ) { |
1412 |
|
qual[iw][SCst-1][SCsect-1]= iQual; // store the quality for this station |
1413 |
|
bxbest[iw][SCst-1][SCsect-1] = ibx; |
1578 |
|
hTitle << title << suffix; |
1579 |
|
theDQMStore->setCurrentFolder("DT/DTOfflineAnalyzer"); |
1580 |
|
theDQMStore->book1D(hName.str().c_str(), hTitle.str().c_str(), nbin,binMin,binMax); |
1581 |
< |
// TH1F * _h=new TH1F(hName.str().c_str(), hTitle.str().c_str(), nbin,binMin,binMax); |
1582 |
< |
// _h->SetDirectory(theFile); // Needed when the input is a root file |
1581 |
> |
//TH1F * _h=new TH1F(hName.str().c_str(), hTitle.str().c_str(), nbin,binMin,binMax); |
1582 |
> |
//_h->SetDirectory(theFile); // Needed when the input is a root file |
1583 |
|
} |
1584 |
|
|
1585 |
|
void DTOfflineAnalyzer::createTH2F(const std::string& name, |
1597 |
|
hTitle << title << suffix; |
1598 |
|
theDQMStore->setCurrentFolder("DT/DTOfflineAnalyzer"); |
1599 |
|
theDQMStore->book2D(hName.str().c_str(), hTitle.str().c_str(), nBinX,binXMin,binXMax, nBinY,binYMin,binYMax); |
1600 |
< |
// TH2F * _h=new TH2F(hName.str().c_str(), hTitle.str().c_str(), nBinX,binXMin,binXMax, nBinY,binYMin,binYMax); |
1601 |
< |
// _h->SetDirectory(theFile); // Needed when the input is a root file |
1600 |
> |
//TH2F * _h=new TH2F(hName.str().c_str(), hTitle.str().c_str(), nBinX,binXMin,binXMax, nBinY,binYMin,binYMax); |
1601 |
> |
//_h->SetDirectory(theFile); // Needed when the input is a root file |
1602 |
|
} |
1603 |
|
|
1604 |
|
|
1605 |
|
// end utilities ...####################################################### |
1577 |
– |
|
1578 |
– |
DEFINE_FWK_MODULE(DTOfflineAnalyzer); |