106 : dttpgSource_( ps.getParameter<
InputTag >(
"dttpgSource") )
112 if(
verbose_)
cout <<
"L1TDTTPG: constructor...." << endl;
124 cout <<
"L1T Monitoring histograms will be saved to " <<
outputFile_.c_str() << endl;
154 dbe->
rmdir(
"L1T/L1TDTTPG");
165 "Bunch encoding DTTF Phi",11,0,11);
168 "Bunch encoding DTTF Output",11,0,11);
172 "Number of segments for bunch -1 Dttf Phi",
176 "Number of segments for bunch 0 Dttf Phi",
180 "Number of segments for bunch 1 Dttf Phi",
185 "Number of segments for bunch -1 Dttf Output",
189 "Number of segments for bunch 0 Dttf Output",
193 "Number of segments for bunch 1 Dttf Output",
196 for(
int i=0;
i<2;
i++){
208 "Bunch encoding: DTTF Phi vs. Output",
212 for(
int i=1;
i<=2;
i++){
224 "DT TPG phi ntrack", 20, -0.5, 19.5 ) ;
226 "DT TPG theta ntrack", 20, -0.5, 19.5 ) ;
228 for (
int ibx=0 ; ibx<=2; ibx++) {
236 bxn =
"+" + bxnum.str();
240 "DT TPG phi wheel number "+bxn, 5, -2.5, 2.5 ) ;
242 "DT TPG phi sector number "+bxn, 12, -0.5, 11.5 );
244 "DT TPG phi station number "+bxn, 5, 0.5, 4.5 ) ;
250 "DT TPG phi quality "+bxn, 8, -0.5, 7.5 ) ;
252 "DT TPG phi Ts2Tag "+bxn, 2, -0.5, 1.5 ) ;
256 "Map of triggers per station (BX="+bxn+
")",20,1,21,12,0,12);
261 "DT TPG theta bx "+bxn, 50, -24.5, 24.5 ) ;
263 "DT TPG theta wheel number "+bxn, 5, -2.5, 2.5 ) ;
265 "DT TPG theta sector number "+bxn, 12, -0.5, 11.5 ) ;
267 "DT TPG theta station number "+bxn, 5, -0.5, 4.5 ) ;
269 "DT TPG theta "+bxn, 20, -0.5, 19.5 ) ;
271 "DT TPG theta quality "+bxn, 8, -0.5, 7.5 ) ;
273 "Map of triggers per station (BX="+bxn+
")",15,1,16,12,0,12);
277 dttf_p_phi[ibx] = dbe->
book1D(
"dttf_p_phi_"+bxn,
"dttf phi output #phi "+bxn, 256,
279 dttf_p_qual[ibx] = dbe->
book1D(
"dttf_p_qual_"+bxn,
"dttf phi output qual "+bxn, 8, -0.5, 7.5);
280 dttf_p_q[ibx] = dbe->
book1D(
"dttf_p_q_"+bxn,
"dttf phi output q "+bxn, 2, -0.5, 1.5);
281 dttf_p_pt[ibx] = dbe->
book1D(
"dttf_p_pt_"+bxn,
"dttf phi output p_{t} "+bxn, 32, -0.5, 31.5);
286 "Map of triggers per station",20,1,21,12,0,12);
288 "Map of correlated triggers per station",20,1,21,12,0,12);
290 "Map of second tracks per station",20,1,21,12,0,12);
292 "Map of best triggers per station",20,1,21,12,0,12);
294 "Map of correlated best triggers per station",20,1,21,12,0,12);
304 "Map of triggers per station",15,1,16,12,0,12);
306 "Map of H quality triggers per station",15,1,16,12,0,12);
308 "Map of besttriggers per station",15,1,16,12,0,12);
310 "Map of H quality best triggers per station",15,1,16,12,0,12);
324 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
340 if (!myL1MuDTChambPhContainer.
isValid()) {
341 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuDTChambPhContainer with label "
346 myL1MuDTChambPhContainer->getContainer();
351 if (!myL1MuDTChambThContainer.
isValid()) {
352 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuDTChambThContainer with label "
354 edm::LogInfo(
"DataNotFound") <<
"if this fails try to add DATA to the process name." ;
359 myL1MuDTChambThContainer->getContainer();
361 int ndttpgphtrack = 0;
362 int ndttpgthtrack = 0;
363 int NumberOfSegmentsPhi[3]={0,0,0};
365 for( L1MuDTChambPhContainer::Phi_Container::const_iterator
366 DTPhDigiItr = myPhContainer->begin() ;
367 DTPhDigiItr != myPhContainer->end() ;
370 int bx = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag();
372 NumberOfSegmentsPhi[0]++;
374 NumberOfSegmentsPhi[1]++;
376 NumberOfSegmentsPhi[2]++;
380 for(
int k=0;
k<3;
k++){
383 int bxCounterDttfPhi=0;
384 for (
int k=0;
k<3;
k++){
385 if (NumberOfSegmentsPhi[
k]>0)
392 if(bxCounterDttfPhi==0){
394 }
else if(bxCounterDttfPhi==1){
395 for(
int k=0;
k<3;
k++){
396 if(NumberOfSegmentsPhi[
k]>0)
399 }
else if(bxCounterDttfPhi==2){
400 for(
int k=0;
k<3;
k++){
401 if(NumberOfSegmentsPhi[
k]==0)
404 }
else if(bxCounterDttfPhi==3){
415 for( L1MuDTChambPhContainer::Phi_Container::const_iterator
416 DTPhDigiItr = myPhContainer->begin() ;
417 DTPhDigiItr != myPhContainer->end() ;
423 int bxindex = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag() + 1;
428 cout <<
"DTTPG phi wheel number " << DTPhDigiItr->whNum() << endl;
433 cout <<
"DTTPG phi station number " << DTPhDigiItr->stNum() << endl;
438 cout <<
"DTTPG phi sector number " << DTPhDigiItr->scNum() << endl;
453 cout <<
"DTTPG phi quality " << DTPhDigiItr->code() << endl;
458 cout <<
"DTTPG phi ts2tag " << DTPhDigiItr->Ts2Tag() << endl;
466 int ypos = DTPhDigiItr->scNum();
467 int xpos = DTPhDigiItr->stNum()+4*(DTPhDigiItr->whNum()+2);
469 if (DTPhDigiItr->Ts2Tag())
472 if (DTPhDigiItr->code()>3)
475 if (bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]==0 ||
476 bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]->
code()<DTPhDigiItr->code())
478 bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]=&(*DTPhDigiItr);
483 for (
int iwh=0; iwh<5; iwh++){
484 for (
int isec=0; isec<12; isec++){
485 for (
int ist=0; ist<4; ist++){
486 if (bestPhQualMap[iwh][isec][ist]){
487 int xpos = iwh*4+ist+1;
489 if(bestPhQualMap[iwh][isec][ist]->code()>3)
497 int bestThQualMap[5][12][3];
498 memset(bestThQualMap,0,180*
sizeof(
int));
500 for( L1MuDTChambThContainer::The_Container::const_iterator
501 DTThDigiItr = myThContainer->begin() ;
502 DTThDigiItr != myThContainer->end() ;
507 int bxindex = DTThDigiItr->bxNum() + 1;
512 cout <<
"DTTPG theta wheel number " << DTThDigiItr->whNum() << endl;
517 cout <<
"DTTPG theta station number " << DTThDigiItr->stNum() << endl;
522 cout <<
"DTTPG theta sector number " << DTThDigiItr->scNum() << endl;
527 cout <<
"DTTPG theta bx number " << DTThDigiItr->bxNum() << endl;
529 int thcode[7]= {0,0,0,0,0,0,0};
530 for (
int j = 0;
j < 7;
j++)
535 cout <<
"DTTPG theta position " << DTThDigiItr->position(
j) << endl;
537 thcode[
j]=DTThDigiItr->code(
j);
541 cout <<
"DTTPG theta quality " << DTThDigiItr->code(j) << endl;
545 int ypos = DTThDigiItr->scNum();
546 int xpos = DTThDigiItr->stNum()+4*(DTThDigiItr->whNum()+2);
551 if (thcode[
pos]>bestqual)
552 bestqual=thcode[
pos];
557 if (bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1] < bestqual)
559 bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1]=bestqual;
563 for (
int iwh=0; iwh<5; iwh++){
564 for (
int isec=0; isec<12; isec++){
565 for (
int ist=0; ist<3; ist++){
566 if (bestThQualMap[iwh][isec][ist]){
567 int xpos = iwh*4+ist+1;
569 if(bestThQualMap[iwh][isec][ist]==2)
580 cout <<
"DTTPG phi ntrack " << ndttpgphtrack << endl;
584 cout <<
"DTTPG theta ntrack " << ndttpgthtrack << endl;
590 std::string trstring;
593 e.
getByLabel(trInputTag,myL1MuDTTrackContainer);
595 if (!myL1MuDTTrackContainer.
isValid()) {
596 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuDTTrackContainer with label "
605 int NumberOfSegmentsOut[3]={0,0,0};
606 for ( L1MuDTTrackContainer::TrackContainer::const_iterator
i
607 = t->begin();
i != t->end(); ++
i ) {
609 NumberOfSegmentsOut[0]++;
611 NumberOfSegmentsOut[1]++;
613 NumberOfSegmentsOut[2]++;
618 for(
int k=0;
k<3;
k++){
624 int bxCounterDttfOut=0;
625 for (
int k=0;
k<3;
k++){
626 if (NumberOfSegmentsOut[
k]>0)
631 if(bxCounterDttfOut==0){
633 }
else if(bxCounterDttfOut==1){
634 for(
int k=0;
k<3;
k++){
635 if(NumberOfSegmentsOut[
k]>0)
638 }
else if(bxCounterDttfOut==2){
639 for(
int k=0;
k<3;
k++){
640 if(NumberOfSegmentsOut[
k]==0)
643 }
else if(bxCounterDttfOut==3){
656 for ( L1MuDTTrackContainer::TrackContainer::const_iterator
i
657 = t->begin();
i != t->end(); ++
i ) {
661 std::cout <<
"quality (packed) = " <<
i->quality_packed()
663 std::cout <<
"pt (packed) = " <<
i->pt_packed()
665 std::cout <<
"phi (packed) = " <<
i->phi_packed()
667 std::cout <<
"charge (packed) = " <<
i->charge_packed()
672 int bxindex =
i->bx() + 1;
685 for(
int i=0;
i<5;
i++){
697 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]