96 dttpgSource_( ps.getParameter<
InputTag >(
"dttpgSource") )
104 if(verbose_)
cout <<
"L1TDTTPG: constructor...." << endl;
116 cout <<
"L1T Monitoring histograms will be saved to " <<
outputFile_.c_str() << endl;
145 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
167 "Bunch encoding DTTF Phi",11,0,11);
170 "Bunch encoding DTTF Output",11,0,11);
174 "Number of segments for bunch -1 Dttf Phi",
178 "Number of segments for bunch 0 Dttf Phi",
182 "Number of segments for bunch 1 Dttf Phi",
187 "Number of segments for bunch -1 Dttf Output",
191 "Number of segments for bunch 0 Dttf Output",
195 "Number of segments for bunch 1 Dttf Output",
198 for(
int i=0;
i<2;
i++){
210 "Bunch encoding: DTTF Phi vs. Output",
214 for(
int i=1;
i<=2;
i++){
226 "DT TPG phi ntrack", 20, -0.5, 19.5 ) ;
228 "DT TPG theta ntrack", 20, -0.5, 19.5 ) ;
230 for (
int ibx=0 ; ibx<=2; ibx++) {
238 bxn =
"+" + bxnum.str();
242 "DT TPG phi wheel number "+bxn, 5, -2.5, 2.5 ) ;
244 "DT TPG phi sector number "+bxn, 12, -0.5, 11.5 );
246 "DT TPG phi station number "+bxn, 5, 0.5, 4.5 ) ;
252 "DT TPG phi quality "+bxn, 8, -0.5, 7.5 ) ;
254 "DT TPG phi Ts2Tag "+bxn, 2, -0.5, 1.5 ) ;
258 "Map of triggers per station (BX="+bxn+
")",20,1,21,12,0,12);
263 "DT TPG theta bx "+bxn, 50, -24.5, 24.5 ) ;
265 "DT TPG theta wheel number "+bxn, 5, -2.5, 2.5 ) ;
267 "DT TPG theta sector number "+bxn, 12, -0.5, 11.5 ) ;
269 "DT TPG theta station number "+bxn, 5, -0.5, 4.5 ) ;
271 "DT TPG theta "+bxn, 20, -0.5, 19.5 ) ;
273 "DT TPG theta quality "+bxn, 8, -0.5, 7.5 ) ;
275 "Map of triggers per station (BX="+bxn+
")",15,1,16,12,0,12);
282 dttf_p_q[ibx] =
dbe->
book1D(
"dttf_p_q_"+bxn,
"dttf phi output q "+bxn, 2, -0.5, 1.5);
283 dttf_p_pt[ibx] =
dbe->
book1D(
"dttf_p_pt_"+bxn,
"dttf phi output p_{t} "+bxn, 32, -0.5, 31.5);
288 "Map of triggers per station",20,1,21,12,0,12);
290 "Map of correlated triggers per station",20,1,21,12,0,12);
292 "Map of second tracks per station",20,1,21,12,0,12);
294 "Map of best triggers per station",20,1,21,12,0,12);
296 "Map of correlated best triggers per station",20,1,21,12,0,12);
306 "Map of triggers per station",15,1,16,12,0,12);
308 "Map of H quality triggers per station",15,1,16,12,0,12);
310 "Map of besttriggers per station",15,1,16,12,0,12);
312 "Map of H quality best triggers per station",15,1,16,12,0,12);
332 if (!myL1MuDTChambPhContainer.
isValid()) {
333 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuDTChambPhContainer with label "
338 myL1MuDTChambPhContainer->getContainer();
343 if (!myL1MuDTChambThContainer.
isValid()) {
344 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuDTChambThContainer with label "
346 edm::LogInfo(
"DataNotFound") <<
"if this fails try to add DATA to the process name." ;
351 myL1MuDTChambThContainer->getContainer();
353 int ndttpgphtrack = 0;
354 int ndttpgthtrack = 0;
355 int NumberOfSegmentsPhi[3]={0,0,0};
357 for( L1MuDTChambPhContainer::Phi_Container::const_iterator
358 DTPhDigiItr = myPhContainer->begin() ;
359 DTPhDigiItr != myPhContainer->end() ;
362 int bx = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag();
364 NumberOfSegmentsPhi[0]++;
366 NumberOfSegmentsPhi[1]++;
368 NumberOfSegmentsPhi[2]++;
372 for(
int k=0;
k<3;
k++){
375 int bxCounterDttfPhi=0;
376 for (
int k=0;
k<3;
k++){
377 if (NumberOfSegmentsPhi[
k]>0)
384 if(bxCounterDttfPhi==0){
386 }
else if(bxCounterDttfPhi==1){
387 for(
int k=0;
k<3;
k++){
388 if(NumberOfSegmentsPhi[
k]>0)
391 }
else if(bxCounterDttfPhi==2){
392 for(
int k=0;
k<3;
k++){
393 if(NumberOfSegmentsPhi[
k]==0)
396 }
else if(bxCounterDttfPhi==3){
407 for( L1MuDTChambPhContainer::Phi_Container::const_iterator
408 DTPhDigiItr = myPhContainer->begin() ;
409 DTPhDigiItr != myPhContainer->end() ;
415 int bxindex = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag() + 1;
420 cout <<
"DTTPG phi wheel number " << DTPhDigiItr->whNum() << endl;
425 cout <<
"DTTPG phi station number " << DTPhDigiItr->stNum() << endl;
430 cout <<
"DTTPG phi sector number " << DTPhDigiItr->scNum() << endl;
445 cout <<
"DTTPG phi quality " << DTPhDigiItr->code() << endl;
450 cout <<
"DTTPG phi ts2tag " << DTPhDigiItr->Ts2Tag() << endl;
458 int ypos = DTPhDigiItr->scNum();
459 int xpos = DTPhDigiItr->stNum()+4*(DTPhDigiItr->whNum()+2);
461 if (DTPhDigiItr->Ts2Tag())
464 if (DTPhDigiItr->code()>3)
467 if (bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]==0 ||
468 bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]->
code()<DTPhDigiItr->code())
470 bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]=&(*DTPhDigiItr);
475 for (
int iwh=0; iwh<5; iwh++){
476 for (
int isec=0; isec<12; isec++){
477 for (
int ist=0; ist<4; ist++){
478 if (bestPhQualMap[iwh][isec][ist]){
479 int xpos = iwh*4+ist+1;
481 if(bestPhQualMap[iwh][isec][ist]->code()>3)
489 int bestThQualMap[5][12][3];
490 memset(bestThQualMap,0,180*
sizeof(
int));
492 for( L1MuDTChambThContainer::The_Container::const_iterator
493 DTThDigiItr = myThContainer->begin() ;
494 DTThDigiItr != myThContainer->end() ;
499 int bxindex = DTThDigiItr->bxNum() + 1;
504 cout <<
"DTTPG theta wheel number " << DTThDigiItr->whNum() << endl;
509 cout <<
"DTTPG theta station number " << DTThDigiItr->stNum() << endl;
514 cout <<
"DTTPG theta sector number " << DTThDigiItr->scNum() << endl;
519 cout <<
"DTTPG theta bx number " << DTThDigiItr->bxNum() << endl;
521 int thcode[7]= {0,0,0,0,0,0,0};
522 for (
int j = 0;
j < 7;
j++)
527 cout <<
"DTTPG theta position " << DTThDigiItr->position(
j) << endl;
529 thcode[
j]=DTThDigiItr->code(
j);
533 cout <<
"DTTPG theta quality " << DTThDigiItr->code(j) << endl;
537 int ypos = DTThDigiItr->scNum();
538 int xpos = DTThDigiItr->stNum()+4*(DTThDigiItr->whNum()+2);
542 for (
int pos = 0; pos < 7; pos++){
543 if (thcode[pos]>bestqual)
544 bestqual=thcode[pos];
549 if (bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1] < bestqual)
551 bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1]=bestqual;
555 for (
int iwh=0; iwh<5; iwh++){
556 for (
int isec=0; isec<12; isec++){
557 for (
int ist=0; ist<3; ist++){
558 if (bestThQualMap[iwh][isec][ist]){
559 int xpos = iwh*4+ist+1;
561 if(bestThQualMap[iwh][isec][ist]==2)
572 cout <<
"DTTPG phi ntrack " << ndttpgphtrack << endl;
576 cout <<
"DTTPG theta ntrack " << ndttpgthtrack << endl;
582 if (!myL1MuDTTrackContainer.
isValid()) {
583 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuDTTrackContainer with label "
592 int NumberOfSegmentsOut[3]={0,0,0};
593 for ( L1MuDTTrackContainer::TrackContainer::const_iterator
i
594 = t->begin();
i != t->end(); ++
i ) {
596 NumberOfSegmentsOut[0]++;
598 NumberOfSegmentsOut[1]++;
600 NumberOfSegmentsOut[2]++;
605 for(
int k=0;
k<3;
k++){
611 int bxCounterDttfOut=0;
612 for (
int k=0;
k<3;
k++){
613 if (NumberOfSegmentsOut[
k]>0)
618 if(bxCounterDttfOut==0){
620 }
else if(bxCounterDttfOut==1){
621 for(
int k=0;
k<3;
k++){
622 if(NumberOfSegmentsOut[
k]>0)
625 }
else if(bxCounterDttfOut==2){
626 for(
int k=0;
k<3;
k++){
627 if(NumberOfSegmentsOut[
k]==0)
630 }
else if(bxCounterDttfOut==3){
643 for ( L1MuDTTrackContainer::TrackContainer::const_iterator
i
644 = t->begin();
i != t->end(); ++
i ) {
648 std::cout <<
"quality (packed) = " <<
i->quality_packed()
650 std::cout <<
"pt (packed) = " <<
i->pt_packed()
652 std::cout <<
"phi (packed) = " <<
i->phi_packed()
654 std::cout <<
"charge (packed) = " <<
i->charge_packed()
659 int bxindex =
i->bx() + 1;
672 for(
int i=0;
i<5;
i++){
684 for(
int i=0;
i<5;
i++){
void analyze(const edm::Event &e, const edm::EventSetup &c)
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * dttpgthbestmaph
MonitorElement * dttf_p_phi[3]
L1TDTTPG(const edm::ParameterSet &ps)
MonitorElement * dttpgphmap
MonitorElement * dttpgphbestmapcorr
MonitorElement * dttpgphmapcorr
void setMapPhLabel(MonitorElement *me)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
MonitorElement * dttpgphbx[8]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< L1MuDTChambThContainer > dttpgSourceThContainer_token_
MonitorElement * dttpgththeta[3]
MonitorElement * dttpgphwheel[3]
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 * dttpgthbestmap
MonitorElement * dttpgphbxcomp
edm::EDGetTokenT< L1MuDTTrackContainer > trToken_
void beginRun(edm::Run const &iRun, edm::EventSetup const &iSetup)
MonitorElement * dttpgthmaph
MonitorElement * dttpgthsector[3]
MonitorElement * dttpgthmapbx[3]
MonitorElement * dttpgthwheel[3]
MonitorElement * dttpgthmap
std::vector< L1MuDTTrackCand > TrackContainer
MonitorElement * dttf_p_qual[3]
MonitorElement * dttpgthbx[3]
MonitorElement * dttpgthquality[3]
std::vector< L1MuDTChambPhDigi > Phi_Container
void setVerbose(unsigned level)
MonitorElement * dttf_p_pt[3]
std::vector< L1MuDTChambThDigi > The_Container
MonitorElement * dttpgphbestmap
MonitorElement * dttpgthntrack
edm::InputTag dttpgSource_
MonitorElement * dttpgphts2tag[3]
MonitorElement * dttpgphntrack
edm::EDGetTokenT< L1MuDTChambPhContainer > dttpgSourcePhContainer_token_
MonitorElement * dttf_p_q[3]
void setMapThLabel(MonitorElement *me)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
MonitorElement * dttpgphmapbx[3]
MonitorElement * dttpgthstation[3]
MonitorElement * dttpgphsector[3]
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)
MonitorElement * dttpgphquality[3]
MonitorElement * dttpgphmap2nd
void setCurrentFolder(const std::string &fullpath)
MonitorElement * dttpgphstation[3]