61 dbe->setCurrentFolder(m_dirName);
68 <<
"L1T Monitoring histograms will be saved to "
73 bool disable = pset. getUntrackedParameter<bool>(
"disableROOToutput",
false);
122 pt1Comp = dbe->
book2D(
"pt1Comp",
"Hardware Vs. Emulator #Delta #phi_{12}",256,0,256,256,0,256);
125 pt2Comp = dbe->
book2D(
"pt2Comp",
"Hardware Vs. Emulator #Delta #phi_{23}",16,0,16,16,0,16);
128 pt3Comp = dbe->
book2D(
"pt3Comp",
"Hardware Vs. Emulator #eta",16,0,16,16,0,16);
131 pt4Comp = dbe->
book2D(
"pt4Comp",
"Hardware Vs. Emulator Mode",19,0,19,19,0,19);
175 pt5Comp = dbe->
book2D(
"pt5Comp",
"Hardware Vs. Emulator Sign, FR",4,0,4,4,0,4);
180 phiComp = dbe->
book2D(
"phiComp",
"Hardware Vs. Emulator Track #phi",32,0,32,32,0,32);
183 etaComp = dbe->
book2D(
"etaComp",
"Hardware Vs. Emulator Track #eta",32,0,32,32,0,32);
186 occComp = dbe->
book2D(
"occComp",
"Hardware Vs. Emulator Track Occupancy",5,0,5,5,0,5);
189 ptComp = dbe->
book2D(
"ptComp",
"Hardware Vs. Emulator Pt",32,0,32,32,0,32);
192 qualComp= dbe->
book2D(
"qualComp",
"Hardware Vs. Emulator Quality",4,0,4,4,0,4);
198 dtStubPhi = dbe->
book2D(
"dtStubPhi",
"Hardware Vs. Emulator DT Stub #phi",200,400,2400,200,400,2400);
210 pt1Comp_1d = dbe->
book1D(
"pt1Comp_1d",
"Hardware Vs. Emulator #Delta #phi_{12}",2,0,2);
215 pt2Comp_1d = dbe->
book1D(
"pt2Comp_1d",
"Hardware Vs. Emulator #Delta #phi_{23}",2,0,2);
230 pt5Comp_1d = dbe->
book1D(
"pt5Comp_1d",
"Hardware Vs. Emulator Sign, FR",2,0,2);
237 phiComp_1d = dbe->
book1D(
"phiComp_1d",
"Hardware Vs. Emulator Track #phi",2,0,2);
242 etaComp_1d = dbe->
book1D(
"etaComp_1d",
"Hardware Vs. Emulator Track #eta",2,0,2);
247 occComp_1d = dbe->
book1D(
"occComp_1d",
"Hardware Vs. Emulator Track Occupancy",2,0,2);
263 dtStubPhi_1d = dbe->
book1D(
"dtStubPhi_1d",
"Hardware Vs. Emulator DT Stub #phi",2,0,2);
372 unsigned int nDataMuons = 0;
373 unsigned int nEmulMuons = 0;
374 int dataMuonArray[8][10], emuMuonArray[8][10];
377 for(
int par=0; par<3; par++)
379 dataMuonArray[
muon][par]=0;
380 emuMuonArray[
muon][par] =0;
382 emuMuonArray[
muon][3] =-1;
383 dataMuonArray[
muon][3]=-1;
385 emuMuonArray[
muon][4]=7;
386 dataMuonArray[
muon][4]=7;
388 for(
int par2=5; par2<10; par2++)
390 emuMuonArray[
muon][par2]= -1;
391 dataMuonArray[
muon][par2]= -1;
404 <<
"\n No valid [data tracks] product found: "
405 <<
" L1CSCTrackCollection"
411 for(L1CSCTrackCollection::const_iterator trk=tracks.
product()->begin(); trk!=tracks.
product()->end(); trk++)
415 if( (trk->first.BX() <2) && (trk->first.BX() > -1) )
419 dataMuonArray[nDataMuons][0] = trk->first.ptLUTAddress();
420 dataMuonArray[nDataMuons][1] = trk->first.sector();
421 dataMuonArray[nDataMuons][2] = trk->first.endcap();
422 dataMuonArray[nDataMuons][8] = trk->first.outputLink();
423 dataMuonArray[nDataMuons][4] = trk->first.BX();
424 dataMuonArray[nDataMuons][5] = trk->first.rank();
425 dataMuonArray[nDataMuons][6] = trk->first.localPhi();
426 dataMuonArray[nDataMuons][7] = trk->first.eta_packed();
427 dataMuonArray[nDataMuons][9] = trk->first.modeExtended();
442 <<
"\n No valid [emulator tracks] product found: "
443 <<
" L1CSCTrackCollection"
448 for(L1CSCTrackCollection::const_iterator trk=tracks.
product()->begin(); trk!=tracks.
product()->end(); trk++)
452 if((trk->first.BX() <2) && (trk->first.BX() >-1))
456 emuMuonArray[nEmulMuons][0] = trk->first.ptLUTAddress();
457 emuMuonArray[nEmulMuons][1] = trk->first.sector();
458 emuMuonArray[nEmulMuons][2] = trk->first.endcap();
459 emuMuonArray[nEmulMuons][4] = trk->first.BX();
460 emuMuonArray[nEmulMuons][5] = trk->first.rank();
461 emuMuonArray[nEmulMuons][6] = trk->first.localPhi();
462 emuMuonArray[nEmulMuons][7] = trk->first.eta_packed();
463 emuMuonArray[nEmulMuons][9] = trk->first.modeExtended();
469 if( (nDataMuons!=0)||(nEmulMuons!=0) ) {
475 if(nDataMuons==nEmulMuons)
478 for(
unsigned int mu1=0; mu1<nDataMuons; mu1++)
480 for(
unsigned int mu2=0; mu2<nEmulMuons; mu2++)
481 if((emuMuonArray[mu2][1]==dataMuonArray[mu1][1])&&(emuMuonArray[mu2][2]==dataMuonArray[mu1][2]))
483 if(emuMuonArray[mu2][0]==dataMuonArray[mu1][0])
485 emuMuonArray[mu2][3]=mu1;
486 dataMuonArray[mu1][3]=1;
491 for(
unsigned int c2a=0; c2a<nEmulMuons; c2a++)
493 if(emuMuonArray[c2a][3]==-1)
495 for(
unsigned int cor_a=0; cor_a<nDataMuons; cor_a++)
497 if( (dataMuonArray[cor_a][1]==emuMuonArray[c2a][1]) && (dataMuonArray[cor_a][2]==emuMuonArray[c2a][2]))
499 emuMuonArray[c2a][3]=cor_a;
500 dataMuonArray[cor_a][3]=1;
506 bool multiMap =
false;
509 for(
unsigned int c1a=0; c1a<(nEmulMuons-1); c1a++)
511 for(
unsigned int c1b=(c1a+1); c1b<nEmulMuons; c1b++)
513 if(emuMuonArray[c1a][3]==emuMuonArray[c1b][3])
525 for(
unsigned int mu3=0; mu3<nEmulMuons; mu3++)
527 int mapping = emuMuonArray[mu3][3];
528 if((mapping!=-1)&&(multiMap==
false))
531 int emuPhi12 = (0x0000ff & emuMuonArray[mu3][0]);
532 int datPhi12 = (0x0000ff & dataMuonArray[mapping][0]);
533 int emuPhi23 = (0x000f00 & emuMuonArray[mu3][0])>>8;
534 int datPhi23 = (0x000f00 & dataMuonArray[mapping][0])>>8;
535 int emuEta = (0x00f000 & emuMuonArray[mu3][0])>>12;
536 int datEta = (0x00f000 & dataMuonArray[mapping][0])>>12;
539 int emuFrSin = (0xf00000 & emuMuonArray[mu3][0])>>20;
540 int datFrSin = (0xf00000 & dataMuonArray[mapping][0])>>20;
542 int emuQual = emuMuonArray[mu3][5]>>5;
543 int datQual = dataMuonArray[mapping][5]>>5;
544 int emuPt = 0x1f & emuMuonArray[mu3][5];
545 int datPt = 0x1f & dataMuonArray[mapping][5];
546 int emuModeExtended = emuMuonArray[mu3][9];
547 int datModeExtended = dataMuonArray[mapping][9];
553 if(emuModeExtended==datModeExtended)
561 if(dataMuonArray[mapping][8]==1)
566 phiComp->
Fill(dataMuonArray[mapping][6],emuMuonArray[mu3][6]);
567 etaComp->
Fill(dataMuonArray[mapping][7],emuMuonArray[mu3][7]);
583 for(
int dJ=0; dJ<7; dJ++)
585 for(
int dK=0; dK<15; dK++)
587 eDtStub[dJ][dK] = -55;
588 dDtStub[dJ][dK] = -55;
589 dDtStub[7][dK] = -55;
601 <<
"\n No valid [Data Stubs] product found: "
602 <<
" L1CSCTrackCollection"
609 vector<csctf::TrackStub> stuList = stub_list.
get();
610 vector<csctf::TrackStub>::const_iterator stu= stuList.begin();
611 for(; stu!=stuList.end(); stu++)
615 if((stu->BX()>4) && (stu->BX()<9))
617 dDtStub[0][dDtCounter] = stu->phiPacked();
618 dDtStub[1][dDtCounter] = stu->getQuality();
619 dDtStub[2][dDtCounter] = stu->endcap();
620 dDtStub[3][dDtCounter] = stu->sector();
621 dDtStub[4][dDtCounter] = stu->subsector();
636 <<
"\n No valid [Data Stubs] product found: "
637 <<
" L1CSCTrackCollection"
642 vector<csctf::TrackStub> emuList = emulStub.
get();
643 vector<csctf::TrackStub>::const_iterator eStu=emuList.begin();
644 for(; eStu!=emuList.end(); eStu++)
649 if((eStu->BX()>4) && (eStu->BX()<9) )
651 eDtStub[0][eDtCounter] = eStu->phiPacked();
652 eDtStub[1][eDtCounter] = eStu->getQuality();
653 eDtStub[2][eDtCounter] = eStu->endcap();
654 eDtStub[3][eDtCounter] = eStu->sector();
655 eDtStub[4][eDtCounter] = eStu->subsector();
663 for(
int eS=0; eS<eDtCounter; eS++)
666 for(
int dS=0; dS<dDtCounter; dS++)
669 if(eDtStub[2][eS]==dDtStub[2][dS])
672 if(eDtStub[3][eS]==dDtStub[3][dS])
675 if(eDtStub[4][eS]==dDtStub[4][dS])
678 if( (eDtStub[0][eS]==dDtStub[0][dS]) && (eDtStub[1][eS]==dDtStub[1][dS]) && (eDtStub[6][eS]!=1) && (dDtStub[6][dS]!=1) )
693 for(
int eS2=0; eS2<eDtCounter; eS2++)
695 for(
int dS2=0; dS2<dDtCounter; dS2++)
698 if( (eDtStub[2][eS2]==dDtStub[2][dS2]) && (eDtStub[3][eS2]==dDtStub[3][dS2]) && (eDtStub[4][eS2]==dDtStub[4][dS2]) )
701 if( ((dDtStub[7][eS2]==-55) || (dDtStub[7][dS2]>(
abs(eDtStub[0][eS2]-dDtStub[0][dS2]))) ) && (eDtStub[6][eS2]!=1) && (dDtStub[6][dS2]!=1) )
704 dDtStub[5][dS2] = eS2;
706 eDtStub[5][eS2] = dS2;
708 dDtStub[7][dS2] =
abs(eDtStub[0][eS2]-dDtStub[0][dS2]);
715 bool dtSMulti =
false;
718 for(
int eS3a=0; eS3a<eDtCounter-1; eS3a++)
719 for(
int eS3b=eS3a+1; eS3b<eDtCounter; eS3b++)
721 if( eDtStub[5][eS3a]==eDtStub[5][eS3b] ) dtSMulti=
true;
722 if( eDtStub[5][eS3a]==-55 || eDtStub[5][eS3b]==-55 ) dtUnmap++;
726 for(
int dS3a=0; dS3a<dDtCounter-1; dS3a++)
727 for(
int dS3b=dS3a+1; dS3b<dDtCounter; dS3b++)
729 if( dDtStub[5][dS3a]==dDtStub[5][dS3b] ) dtSMulti=
true;
730 if( dDtStub[5][dS3a]==-55||dDtStub[5][dS3b]==-55 ) dtUnmap++;
737 if(dtSMulti==
false && dtUnmap==0)
739 for(
int phil=0; phil<eDtCounter; phil++)
741 if(eDtStub[6][phil]==1 || eDtStub[6][phil]==2)
743 int indexFil = eDtStub[3][phil]*2+eDtStub[4][phil]-1;
744 dtStubPhi->
Fill(eDtStub[0][phil], dDtStub[0][ eDtStub[5][phil] ]);
746 if( eDtStub[0][phil] != dDtStub[0][ eDtStub[5][phil] ])
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * etaComp_1d
MonitorElement * qualComp
std::vector< T > get() const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
edm::InputTag lctProducer
MonitorElement * qualComp_1d
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * dtStubPhi
edm::InputTag emulTrackProducer
MonitorElement * phiComp_1d
edm::InputTag dataStubProducer
CSCTriggerContainer< csctf::TrackStub > process(const L1MuDTChambPhContainer *)
MonitorElement * ptComp_1d
L1TdeCSCTF(edm::ParameterSet const &pset)
void analyze(edm::Event const &e, edm::EventSetup const &iSetup)
void push_many(const std::vector< T > &data)
MonitorElement * pt1Comp_1d
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * occComp_1d
MonitorElement * dtStubPhi_1d
edm::InputTag emulStubProducer
MonitorElement * pt5Comp_1d
edm::InputTag dataTrackProducer
T const * product() const
MonitorElement * badDtStubSector
MonitorElement * pt4Comp_1d
MonitorElement * pt2Comp_1d
edm::ParameterSet ptLUTset
const L1MuTriggerScales * ts
MonitorElement * pt3Comp_1d
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
CSCTFDTReceiver * my_dtrc