112 : dttpgSource_( ps.getParameter<
InputTag >(
"dttpgSource") )
118 if(
verbose_)
cout <<
"L1TDTTPG: constructor...." << endl;
130 cout <<
"L1T Monitoring histograms will be saved to " <<
outputFile_.c_str() << endl;
160 dbe->
rmdir(
"L1T/L1TDTTPG");
171 "Bunch encoding DTTF Phi",11,0,11);
174 "Bunch encoding DTTF Output",11,0,11);
178 "Number of segments for bunch -1 Dttf Phi",
182 "Number of segments for bunch 0 Dttf Phi",
186 "Number of segments for bunch 1 Dttf Phi",
191 "Number of segments for bunch -1 Dttf Output",
195 "Number of segments for bunch 0 Dttf Output",
199 "Number of segments for bunch 1 Dttf Output",
202 for(
int i=0;
i<2;
i++){
214 "Bunch encoding: DTTF Phi vs. Output",
218 for(
int i=1;
i<=2;
i++){
230 "DT TPG phi ntrack", 20, -0.5, 19.5 ) ;
232 "DT TPG theta ntrack", 20, -0.5, 19.5 ) ;
234 for (
int ibx=0 ; ibx<=2; ibx++) {
242 bxn =
"+" + bxnum.str();
246 "DT TPG phi wheel number "+bxn, 5, -2.5, 2.5 ) ;
248 "DT TPG phi sector number "+bxn, 12, -0.5, 11.5 );
250 "DT TPG phi station number "+bxn, 5, 0.5, 4.5 ) ;
256 "DT TPG phi quality "+bxn, 8, -0.5, 7.5 ) ;
258 "DT TPG phi Ts2Tag "+bxn, 2, -0.5, 1.5 ) ;
262 "Map of triggers per station (BX="+bxn+
")",20,1,21,12,0,12);
267 "DT TPG theta bx "+bxn, 50, -24.5, 24.5 ) ;
269 "DT TPG theta wheel number "+bxn, 5, -2.5, 2.5 ) ;
271 "DT TPG theta sector number "+bxn, 12, -0.5, 11.5 ) ;
273 "DT TPG theta station number "+bxn, 5, -0.5, 4.5 ) ;
275 "DT TPG theta "+bxn, 20, -0.5, 19.5 ) ;
277 "DT TPG theta quality "+bxn, 8, -0.5, 7.5 ) ;
279 "Map of triggers per station (BX="+bxn+
")",15,1,16,12,0,12);
283 dttf_p_phi[ibx] = dbe->
book1D(
"dttf_p_phi_"+bxn,
"dttf phi output #phi "+bxn, 256,
285 dttf_p_qual[ibx] = dbe->
book1D(
"dttf_p_qual_"+bxn,
"dttf phi output qual "+bxn, 8, -0.5, 7.5);
286 dttf_p_q[ibx] = dbe->
book1D(
"dttf_p_q_"+bxn,
"dttf phi output q "+bxn, 2, -0.5, 1.5);
287 dttf_p_pt[ibx] = dbe->
book1D(
"dttf_p_pt_"+bxn,
"dttf phi output p_{t} "+bxn, 32, -0.5, 31.5);
292 "Map of triggers per station",20,1,21,12,0,12);
294 "Map of correlated triggers per station",20,1,21,12,0,12);
296 "Map of second tracks per station",20,1,21,12,0,12);
298 "Map of best triggers per station",20,1,21,12,0,12);
300 "Map of correlated best triggers per station",20,1,21,12,0,12);
310 "Map of triggers per station",15,1,16,12,0,12);
312 "Map of H quality triggers per station",15,1,16,12,0,12);
314 "Map of besttriggers per station",15,1,16,12,0,12);
316 "Map of H quality best triggers per station",15,1,16,12,0,12);
330 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
346 if (!myL1MuDTChambPhContainer.
isValid()) {
347 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuDTChambPhContainer with label "
352 myL1MuDTChambPhContainer->getContainer();
357 if (!myL1MuDTChambThContainer.
isValid()) {
358 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuDTChambThContainer with label "
360 edm::LogInfo(
"DataNotFound") <<
"if this fails try to add DATA to the process name." ;
365 myL1MuDTChambThContainer->getContainer();
367 int ndttpgphtrack = 0;
368 int ndttpgthtrack = 0;
369 int NumberOfSegmentsPhi[3]={0,0,0};
371 for( L1MuDTChambPhContainer::Phi_Container::const_iterator
372 DTPhDigiItr = myPhContainer->begin() ;
373 DTPhDigiItr != myPhContainer->end() ;
376 int bx = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag();
378 NumberOfSegmentsPhi[0]++;
380 NumberOfSegmentsPhi[1]++;
382 NumberOfSegmentsPhi[2]++;
386 for(
int k=0;
k<3;
k++){
389 int bxCounterDttfPhi=0;
390 for (
int k=0;
k<3;
k++){
391 if (NumberOfSegmentsPhi[
k]>0)
398 if(bxCounterDttfPhi==0){
400 }
else if(bxCounterDttfPhi==1){
401 for(
int k=0;
k<3;
k++){
402 if(NumberOfSegmentsPhi[
k]>0)
405 }
else if(bxCounterDttfPhi==2){
406 for(
int k=0;
k<3;
k++){
407 if(NumberOfSegmentsPhi[
k]==0)
410 }
else if(bxCounterDttfPhi==3){
421 for( L1MuDTChambPhContainer::Phi_Container::const_iterator
422 DTPhDigiItr = myPhContainer->begin() ;
423 DTPhDigiItr != myPhContainer->end() ;
429 int bxindex = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag() + 1;
434 cout <<
"DTTPG phi wheel number " << DTPhDigiItr->whNum() << endl;
439 cout <<
"DTTPG phi station number " << DTPhDigiItr->stNum() << endl;
444 cout <<
"DTTPG phi sector number " << DTPhDigiItr->scNum() << endl;
459 cout <<
"DTTPG phi quality " << DTPhDigiItr->code() << endl;
464 cout <<
"DTTPG phi ts2tag " << DTPhDigiItr->Ts2Tag() << endl;
472 int ypos = DTPhDigiItr->scNum();
473 int xpos = DTPhDigiItr->stNum()+4*(DTPhDigiItr->whNum()+2);
475 if (DTPhDigiItr->Ts2Tag())
478 if (DTPhDigiItr->code()>3)
481 if (bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]==0 ||
482 bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]->
code()<DTPhDigiItr->code())
484 bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]=&(*DTPhDigiItr);
489 for (
int iwh=0; iwh<5; iwh++){
490 for (
int isec=0; isec<12; isec++){
491 for (
int ist=0; ist<4; ist++){
492 if (bestPhQualMap[iwh][isec][ist]){
493 int xpos = iwh*4+ist+1;
495 if(bestPhQualMap[iwh][isec][ist]->code()>3)
503 int bestThQualMap[5][12][3];
504 memset(bestThQualMap,0,180*
sizeof(
int));
506 for( L1MuDTChambThContainer::The_Container::const_iterator
507 DTThDigiItr = myThContainer->begin() ;
508 DTThDigiItr != myThContainer->end() ;
513 int bxindex = DTThDigiItr->bxNum() + 1;
518 cout <<
"DTTPG theta wheel number " << DTThDigiItr->whNum() << endl;
523 cout <<
"DTTPG theta station number " << DTThDigiItr->stNum() << endl;
528 cout <<
"DTTPG theta sector number " << DTThDigiItr->scNum() << endl;
533 cout <<
"DTTPG theta bx number " << DTThDigiItr->bxNum() << endl;
535 int thcode[7]= {0,0,0,0,0,0,0};
536 for (
int j = 0;
j < 7;
j++)
541 cout <<
"DTTPG theta position " << DTThDigiItr->position(
j) << endl;
543 thcode[
j]=DTThDigiItr->code(
j);
547 cout <<
"DTTPG theta quality " << DTThDigiItr->code(j) << endl;
551 int ypos = DTThDigiItr->scNum();
552 int xpos = DTThDigiItr->stNum()+4*(DTThDigiItr->whNum()+2);
557 if (thcode[
pos]>bestqual)
558 bestqual=thcode[
pos];
563 if (bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1] < bestqual)
565 bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1]=bestqual;
569 for (
int iwh=0; iwh<5; iwh++){
570 for (
int isec=0; isec<12; isec++){
571 for (
int ist=0; ist<3; ist++){
572 if (bestThQualMap[iwh][isec][ist]){
573 int xpos = iwh*4+ist+1;
575 if(bestThQualMap[iwh][isec][ist]==2)
586 cout <<
"DTTPG phi ntrack " << ndttpgphtrack << endl;
590 cout <<
"DTTPG theta ntrack " << ndttpgthtrack << endl;
596 std::string trstring;
599 e.
getByLabel(trInputTag,myL1MuDTTrackContainer);
601 if (!myL1MuDTTrackContainer.
isValid()) {
602 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuDTTrackContainer with label "
611 int NumberOfSegmentsOut[3]={0,0,0};
612 for ( L1MuDTTrackContainer::TrackContainer::const_iterator
i
613 = t->begin();
i != t->end(); ++
i ) {
615 NumberOfSegmentsOut[0]++;
617 NumberOfSegmentsOut[1]++;
619 NumberOfSegmentsOut[2]++;
624 for(
int k=0;
k<3;
k++){
630 int bxCounterDttfOut=0;
631 for (
int k=0;
k<3;
k++){
632 if (NumberOfSegmentsOut[
k]>0)
637 if(bxCounterDttfOut==0){
639 }
else if(bxCounterDttfOut==1){
640 for(
int k=0;
k<3;
k++){
641 if(NumberOfSegmentsOut[
k]>0)
644 }
else if(bxCounterDttfOut==2){
645 for(
int k=0;
k<3;
k++){
646 if(NumberOfSegmentsOut[
k]==0)
649 }
else if(bxCounterDttfOut==3){
662 for ( L1MuDTTrackContainer::TrackContainer::const_iterator
i
663 = t->begin();
i != t->end(); ++
i ) {
667 std::cout <<
"quality (packed) = " <<
i->quality_packed()
669 std::cout <<
"pt (packed) = " <<
i->pt_packed()
671 std::cout <<
"phi (packed) = " <<
i->phi_packed()
673 std::cout <<
"charge (packed) = " <<
i->charge_packed()
678 int bxindex =
i->bx() + 1;
691 for(
int i=0;
i<5;
i++){
703 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]
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")
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
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * dttpgphbestmap
MonitorElement * dttpgthntrack
edm::InputTag dttpgSource_
MonitorElement * dttpgphts2tag[3]
MonitorElement * dttpgphntrack
MonitorElement * dttf_p_q[3]
void setMapThLabel(MonitorElement *me)
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]