CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
L1TCSCTF Class Reference

#include <L1TCSCTF.h>

Inheritance diagram for L1TCSCTF:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1TCSCTF (const edm::ParameterSet &ps)
 
virtual ~L1TCSCTF ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob (void)
 
void endJob (void)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

int BxInEvent_
 
edm::EDGetTokenT
< CSCCorrelatedLCTDigiCollection
corrlctsToken_
 
MonitorElementcsctfAFerror
 
MonitorElementcsctfbx
 
MonitorElementcsctfbx_H
 
MonitorElementcsctfChamberOccupancies
 
MonitorElementcsctferrors
 
MonitorElementcsctfntrack
 
MonitorElementcsctfoccupancies
 
MonitorElementcsctfoccupancies_H
 
MonitorElementcsctfTrackEta
 
MonitorElementcsctfTrackEta_H
 
MonitorElementcsctfTrackEtaHighQ
 
MonitorElementcsctfTrackEtaLowQ
 
MonitorElementcsctfTrackM
 
MonitorElementcsctfTrackPhi
 
MonitorElementcsctfTrackPhi_H
 
MonitorElementcscTrackStubNumbers
 
DQMStoredbe
 
MonitorElementDTstubsTimeTrackMenTimeArrival [12]
 
edm::EDGetTokenT
< CSCTriggerContainer
< csctf::TrackStub > > 
dtStubsToken_
 
edm::InputTag gmtProducer
 
edm::EDGetTokenT
< L1MuGMTReadoutCollection
gmtProducerToken_
 
bool isCSCcand_
 
int L1ABXN
 
edm::InputTag lctProducer
 
std::ofstream logFile_
 
unsigned long long m_ptScaleCacheID
 
unsigned long long m_scalesCacheID
 
edm::InputTag mbProducer
 
edm::EDGetTokenT
< L1CSCTrackCollection
mbtracksToken_
 
bool monitorDaemon_
 
int nev_
 
std::string outputFile_
 
CSCSectorReceiverLUTsrLUTs_ [5]
 
edm::InputTag statusProducer
 
edm::EDGetTokenT
< L1CSCStatusDigiCollection
statusToken_
 
const L1MuTriggerPtScaletpts
 
MonitorElementtrackModeVsQ
 
edm::InputTag trackProducer
 
edm::EDGetTokenT
< L1CSCTrackCollection
tracksToken_
 
const L1MuTriggerScalests
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 56 of file L1TCSCTF.h.

Constructor & Destructor Documentation

L1TCSCTF::L1TCSCTF ( const edm::ParameterSet ps)

Definition at line 25 of file L1TCSCTF.cc.

References edm::ParameterSet::addUntrackedParameter(), corrlctsToken_, dbe, dtStubsToken_, Reference_intrackfit_cff::endcap, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), gmtProducerToken_, edm::InputTag::instance(), edm::InputTag::label(), lctProducer, mbProducer, mbtracksToken_, NULL, cppFunctionSkipper::operator, outputFile_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), srLUTs_, relativeConstraints::station, statusProducer, statusToken_, AlCaHLTBitMon_QueryRunRegistry::string, trackProducer, tracksToken_, and verbose_.

28  : gmtProducer( ps.getParameter< InputTag >("gmtProducer") ),
29  lctProducer( ps.getParameter< InputTag >("lctProducer") ),
30  trackProducer( ps.getParameter< InputTag >("trackProducer") ),
31  statusProducer( ps.getParameter< InputTag >("statusProducer") ),
32  mbProducer( ps.getParameter< InputTag >("mbProducer") )
33 {
34 
35  // verbosity switch
36  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
37 
38  if(verbose_) edm::LogInfo("DataNotFound") << "L1TCSCTF: constructor...." << endl;
39 
40 
41  dbe = NULL;
42  if ( ps.getUntrackedParameter<bool>("DQMStore", false) )
43  {
45  dbe->setVerbose(0);
46  }
47 
48  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
49  if ( outputFile_.size() != 0 )
50  {
51  edm::LogInfo("DataNotFound") << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
52  }
53 
54  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
55  if(disable){
56  outputFile_="";
57  }
58 
59 
60  if ( dbe !=NULL )
61  {
62  dbe->setCurrentFolder("L1T/L1TCSCTF");
63  }
64 
65  // instantiate standard on-fly SR LUTs from CSC TF emulator package
66  bzero(srLUTs_,sizeof(srLUTs_));
67  int endcap=1, sector=1; // assume SR LUTs are all same for every sector in either of endcaps
68  bool TMB07=true; // specific TMB firmware
69  // Create a dummy pset for SR LUTs
70  edm::ParameterSet srLUTset;
71  srLUTset.addUntrackedParameter<bool>("ReadLUTs", false);
72  srLUTset.addUntrackedParameter<bool>("Binary", false);
73  srLUTset.addUntrackedParameter<std::string>("LUTPath", "./");
74  for(int station=1,fpga=0; station<=4 && fpga<5; station++)
75  {
76  if(station==1)
77  for(int subSector=0; subSector<2 && fpga<5; subSector++)
78  srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, subSector+1, station, srLUTset, TMB07);
79  else
80  srLUTs_[fpga++] = new CSCSectorReceiverLUT(endcap, sector, 0, station, srLUTset, TMB07);
81  }
82 
83  //set Token(-s)
89 
90  gmtProducerToken_ = consumes<L1MuGMTReadoutCollection>(ps.getParameter< InputTag >("gmtProducer"));
91  statusToken_ = consumes<L1CSCStatusDigiCollection>(statusTag_);
92  corrlctsToken_ = consumes<CSCCorrelatedLCTDigiCollection>(corrlctsTag_);
93  tracksToken_ = consumes<L1CSCTrackCollection>(tracksTag_);
94  dtStubsToken_ = consumes<CSCTriggerContainer<csctf::TrackStub> >(dtStubsTag_);
95  mbtracksToken_ = consumes<L1CSCTrackCollection>(mbtracksTag_);
96 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DQMStore * dbe
Definition: L1TCSCTF.h:78
bool verbose_
Definition: L1TCSCTF.h:115
#define NULL
Definition: scimark2.h:8
edm::InputTag mbProducer
Definition: L1TCSCTF.h:118
std::string outputFile_
Definition: L1TCSCTF.h:114
edm::InputTag statusProducer
Definition: L1TCSCTF.h:118
edm::EDGetTokenT< L1CSCStatusDigiCollection > statusToken_
Definition: L1TCSCTF.h:129
void setVerbose(unsigned level)
Definition: DQMStore.cc:549
edm::InputTag lctProducer
Definition: L1TCSCTF.h:118
edm::EDGetTokenT< L1CSCTrackCollection > tracksToken_
Definition: L1TCSCTF.h:131
CSCSectorReceiverLUT * srLUTs_[5]
Definition: L1TCSCTF.h:120
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > corrlctsToken_
Definition: L1TCSCTF.h:130
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:206
edm::EDGetTokenT< L1CSCTrackCollection > mbtracksToken_
Definition: L1TCSCTF.h:133
edm::InputTag trackProducer
Definition: L1TCSCTF.h:118
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmtProducerToken_
Definition: L1TCSCTF.h:128
std::string const & label() const
Definition: InputTag.h:42
std::string const & instance() const
Definition: InputTag.h:43
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > dtStubsToken_
Definition: L1TCSCTF.h:132
edm::InputTag gmtProducer
Definition: L1TCSCTF.h:118
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
L1TCSCTF::~L1TCSCTF ( )
virtual

Definition at line 98 of file L1TCSCTF.cc.

References i, and srLUTs_.

99 {
100 
101  for(int i=0; i<5; i++)
102  delete srLUTs_[i]; //free the array of pointers
103 }
int i
Definition: DBlmapReader.cc:9
CSCSectorReceiverLUT * srLUTs_[5]
Definition: L1TCSCTF.h:120

Member Function Documentation

void L1TCSCTF::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

CAL as Janos adviced

Implements edm::EDAnalyzer.

Definition at line 426 of file L1TCSCTF.cc.

References funct::abs(), BxInEvent_, edm::eventsetup::EventSetupRecord::cacheIdentifier(), corrlctsToken_, csctfbx, csctfbx_H, csctfChamberOccupancies, csctferrors, csctfntrack, csctfoccupancies, csctfoccupancies_H, csctfTrackEta, csctfTrackEta_H, csctfTrackEtaHighQ, csctfTrackEtaLowQ, csctfTrackM, csctfTrackPhi, csctfTrackPhi_H, cscTrackStubNumbers, DTstubsTimeTrackMenTimeArrival, dtStubsToken_, Reference_intrackfit_cff::endcap, MonitorElement::Fill(), HcalObjRepresent::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), L1MuScale::getLowEdge(), L1MuTriggerScales::getPhiScale(), L1MuGMTReadoutCollection::getRecords(), CSCSectorReceiverLUT::globalEtaME(), CSCSectorReceiverLUT::globalPhiME(), gmtProducer, gmtProducerToken_, isCSCcand_, edm::HandleBase::isValid(), L1ABXN, edm::InputTag::label(), lctProducer, CSCSectorReceiverLUT::localPhi(), M_PI, m_ptScaleCacheID, m_scalesCacheID, mbProducer, mbtracksToken_, nev_, edm::Handle< T >::product(), edm::ESHandle< class >::product(), CSCTriggerGeometry::setGeometry(), edm::shift, srLUTs_, relativeConstraints::station, ntuplemaker::status, statusProducer, statusToken_, tpts, trackModeVsQ, trackProducer, testEve_cfg::tracks, tracksToken_, CSCTriggerNumbering::triggerSubSectorFromLabels(), ts, and verbose_.

427 {
428 
430  c.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != m_ptScaleCacheID ){
431 
433  c.get< L1MuTriggerScalesRcd >().get(scales);
434  ts = scales.product();
436  c.get< L1MuTriggerPtScaleRcd >().get(ptscales);
437  tpts = ptscales.product();
438  m_scalesCacheID = c.get< L1MuTriggerScalesRcd >().cacheIdentifier();
439  m_ptScaleCacheID = c.get< L1MuTriggerPtScaleRcd >().cacheIdentifier();
440 
441  edm::LogInfo("L1TCSCTF") << "Changing triggerscales and triggerptscales...";
442  }
443 
444  int NumCSCTfTracksRep = 0;
445  nev_++;
446  if(verbose_) edm::LogInfo("DataNotFound") << "L1TCSCTF: analyze...." << endl;
447 
449  if( gmtProducer.label() != "null" )
450  { // GMT block
451  e.getByToken(gmtProducerToken_, pCollection);
452  if (!pCollection.isValid())
453  {
454  edm::LogInfo("DataNotFound") << "can't find L1MuGMTReadoutCollection with label "; // << csctfSource_.label() ;
455  return;
456  }
457 
458  L1MuGMTReadoutCollection const* gmtrc = pCollection.product();
459  vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
460  vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
461 
462  // Look if the readout window contains one (and only one CSC cands)
463  // to make it simpler I reject events with more than a CSC cand in the
464  // same readout window
465 
466  // count non-empty candidates in this bx
467  int bxWindow = 0;
468  int nCands = 0;
469 
470  for( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++ ) {
471  bxWindow++;
472 
473  // get the csc candidates
474  vector<L1MuRegionalCand> INPCands = RRItr->getCSCCands();
475  vector<L1MuRegionalCand>::const_iterator INPItr;
476 
477  BxInEvent_ = 0;
478  isCSCcand_ = false;
479  int nCandsBx = 0;
480 
481  for( INPItr = INPCands.begin(); INPItr != INPCands.end(); ++INPItr ) {
482  if(!INPItr->empty())
483  {
484  nCandsBx++;
485  nCands++;
486  BxInEvent_ = RRItr->getBxInEvent();
487  if (verbose_) edm::LogInfo("DataNotFound") << "cand " << nCandsBx << " -> assigned CSCTF bx: " << INPItr->bx() << endl;
488  }
489  }
490  if (verbose_)
491  if(nCandsBx) edm::LogInfo("DataNotFound") << nCandsBx << " cands in bx: " << BxInEvent_ << endl;
492  }
493 
494  if (nCands != 1) return;
495  else isCSCcand_ = true;
496  if (verbose_) edm::LogInfo("DataNotFound") << "bxWindow: " << bxWindow << endl;
497 
498  int ncsctftrack = 0;
499  if (verbose_)
500  {
501  edm::LogInfo("DataNotFound") << "\tCSCTFCand ntrack " << ncsctftrack << endl;
502  }
503  } // end of GMT block
504 
505  L1ABXN = -999;
506  if( statusProducer.label() != "null" )
507  {
509  e.getByToken(statusToken_, status);
510  bool integrity=status->first, se=false, sm=false, bx=false, af=false, fmm=false;
511  int nStat = 0;
512 
513  for(std::vector<L1CSCSPStatusDigi>::const_iterator stat=status->second.begin(); stat!=status->second.end(); stat++)
514  {
515  se |= stat->SEs()&0xFFF;
516  sm |= stat->SMs()&0xFFF;
517  bx |= stat->BXs()&0xFFF;
518  af |= stat->AFs()&0xFFF;
519  fmm|= stat->FMM()!=8;
520 
521  if(stat->VPs() != 0)
522  {
523  L1ABXN += stat->BXN();
524  nStat++;
525  }
526  }
527  // compute the average
528  if(nStat!=0) L1ABXN /= nStat;
529  if(integrity) csctferrors->Fill(0.5);
530  if(se) csctferrors->Fill(1.5);
531  if(sm) csctferrors->Fill(2.5);
532  if(bx) csctferrors->Fill(3.5);
533  if(af) csctferrors->Fill(4.5);
534  if(fmm) csctferrors->Fill(5.5);
535  }
536 
537  if( lctProducer.label() != "null" )
538  {
540  c.get<MuonGeometryRecord>().get( pDD );
542 
544  e.getByToken(corrlctsToken_, corrlcts);
545 
546  for(CSCCorrelatedLCTDigiCollection::DigiRangeIterator csc=corrlcts.product()->begin(); csc!=corrlcts.product()->end(); csc++)
547  {
548  CSCCorrelatedLCTDigiCollection::Range range1 = corrlcts.product()->get((*csc).first);
549  for(CSCCorrelatedLCTDigiCollection::const_iterator lct=range1.first; lct!=range1.second; lct++)
550  {
551  int endcap = (*csc).first.endcap()-1;
552  int station = (*csc).first.station()-1;
553  int sector = (*csc).first.triggerSector()-1;
554  int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels((*csc).first);
555  int cscId = (*csc).first.triggerCscId()-1;
556  int fpga = ( subSector ? subSector-1 : station+1 );
557 
558  int endcapAssignment = 1;
559  int shift = 1;
560  float sectorArg = sector;
561  //float sectorArg = j;
562 
563  if( endcap == 1 ){
564  endcapAssignment = -1;
565  shift = 2;
566  //sectorArg = sector - 6;
567  }
568 
569  int signedStation = (station + shift)* endcapAssignment;
570  if( (station == 0) && (endcap == 0)) signedStation = subSector - 1;
571  if( (station == 0) && (endcap == 1)) signedStation = (-1)*subSector;
572 
573  float chamberArg1 = cscId * 0.1 + sectorArg;
574  //float chamberArg1 = i*0.1 + sectorArg;
575  //std::cout << "First" << i << " " << sectorArg << " " << chamberArg1 << std::endl;
576 
577  float chamberArg11 = chamberArg1;
578  if(sectorArg == 1) chamberArg1 = chamberArg11 - 0.1;
579  if(sectorArg == 2) chamberArg1 = chamberArg11 - 0.2;
580  if(sectorArg == 3) chamberArg1 = chamberArg11 - 0.3;
581  if(sectorArg == 4) chamberArg1 = chamberArg11 - 0.4;
582  if(sectorArg == 5) chamberArg1 = chamberArg11 - 0.5;
583 
584  //std::cout << "cscId, station, sector, endcap, sectorArg, chamber Arg: " << cscId << ", " << station << ", " <<sector << ", " << endcap << ", " << chamberArg1 << ", " << signedStation << std::endl;
585 
586  csctfChamberOccupancies->Fill(chamberArg1, signedStation);
587  //int bunchX = ( (lct->getBX()) - 6 );
588 
589  //int timingSectorArg = 3*(sector) + (lct->getMPCLink());
590  //if( endcap == 1) timingSectorArg = 3*(sector + 6) + (lct->getMPCLink());
591  //std::cout << "Sector, MPCLink, TSA, endcap: " << sector << ", " << lct->getMPCLink() << ", " << timingSectorArg << ", " << endcap << std::endl;
592 
593  //csctfbx->Fill(timingSectorArg, bunchX );
594  //std::cout << "LCT'S, encap: " << endcap << ", station: " << station << ", sector: " << sector << ", subSector: " << subSector << ", cscId: " << cscId << std:: endl;
595  //End JAG
596 
597  // Check if Det Id is within pysical range:
598  if( endcap<0||endcap>1 || sector<0||sector>6 || station<0||station>3 || cscId<0||cscId>8 || fpga<0||fpga>4)
599  {
600  edm::LogError("L1CSCTF: CSC TP are out of range: ")<<" endcap: "<<(endcap+1)<<" station: "<<(station+1) <<" sector: "<<(sector+1)<<" subSector: "<<subSector<<" fpga: "<<fpga<<" cscId: "<<(cscId+1);
601  continue;
602  }
603  lclphidat lclPhi;
604  try {
605  lclPhi = srLUTs_[fpga]->localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend());
606  } catch(cms::Exception &) {
607  bzero(&lclPhi,sizeof(lclPhi));
608  }
609 
610  gblphidat gblPhi;
611  try {
612  gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, lct->getKeyWG(), cscId+1);
613  } catch(cms::Exception &) {
614  bzero(&gblPhi,sizeof(gblPhi));
615  }
616 
617  gbletadat gblEta;
618  try {
619  gblEta = srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1);
620  } catch(cms::Exception &) {
621  bzero(&gblEta,sizeof(gblEta));
622  }
623 
624  // SR LUT gives packed eta and phi values -> normilize them to 1 by scale them to 'max' and shift by 'min'
625  //float etaP = gblEta.global_eta/127*1.5 + 0.9;
626  //float phiP = (gblPhi.global_phi);// + ( sector )*4096 + station*4096*12) * 1./(4*4096*12);
627  //std::cout << "LCT Eta & Phi Coordinates: " << etaP << ", " << phiP << "." << std::endl;
628  //csctfoccupancies->Fill( gblEta.global_eta/127. * 1.5 + 0.9, (gblPhi.global_phi + ( sector + (endcap?0:6) )*4096 + station*4096*12) * 1./(4*4096*12) );
629  }//lct != range1.scond
630  }//csc!=corrlcts.product()->end()
631  }// lctProducer.label() != "null"
632 
633 
634 
635  if( trackProducer.label() != "null" )
636  {
638  e.getByToken(tracksToken_, tracks);
639  for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
640  {
641 
642  NumCSCTfTracksRep++;
643  long LUTAdd = trk->first.ptLUTAddress();
644  int trigMode = ( (LUTAdd)&0xf0000 ) >> 16;
645  int trEta = (trk->first.eta_packed() );
646 
647 
648  // trk->first.endcap() = 2 for - endcap
649  // = 1 for + endcap
650  //int trEndcap = (trk->first.endcap()==2 ? trk->first.endcap()-3 : trk->first.endcap());
651  if( trk->first.endcap() != 1)
652  {
653  int holder = trEta;
654  trEta = -1*holder;
655  trEta -= 1;
656  }
657 
658  int trSector = 6*(trk->first.endcap()-1)+trk->first.sector();
659  int trBX = trk->first.BX();
660 
661  //Here is what is done with output phi value:
662  //output_phi = (phi / 32) * 3 /16
663  //where:
664  //phi is 12-bit phi, 4096 bins covering 62 degrees
665  //output_phi is 5-bit value
666 
667  //Easy to see that output_phi can have values from 0 to 23, or 24 total combinations.
668  //This gives per-bin phi value of 62/24 = 2.583333 degrees.
669 
670  // Sector 1 nominally starts at 15 degrees but there 1 degree overlap between sectors so 14 degrees effectively
671  //double trPhi = trk->first.localPhi() * 62. / 24.;
672  double trPhi = ts->getPhiScale()->getLowEdge(trk->first.localPhi());
673  double trPhi02PI = fmod(trPhi +
674  ((trSector-1)*M_PI/3) +
675  (M_PI*14/180.), 2*M_PI);
676 
677  if (trigMode == 15) {
678  csctfTrackPhi_H -> Fill( trPhi02PI );
679  csctfTrackEta_H -> Fill( trEta );
680  csctfoccupancies_H -> Fill( trEta, trPhi02PI );
681  csctfbx_H -> Fill( trSector, trBX );
682  }
683  else{
684  csctfTrackPhi -> Fill( trPhi02PI );
685  csctfTrackEta -> Fill( trEta );
686  csctfoccupancies -> Fill( trEta, trPhi02PI );
687  csctfbx -> Fill( trSector, trBX );
688 
689  // Low Quality / High Quality Eta Distributions
690  //|eta| < 2.1
691  if (abs(trEta) < 24) {
692  if (trigMode == 2 ||
693  trigMode == 3 ||
694  trigMode == 4 ||
695  trigMode == 5 ||
696  trigMode == 6 ||
697  trigMode == 7 ||
698  trigMode == 11 ||
699  trigMode == 12 ||
700  trigMode == 13 ||
701  trigMode == 14 ) csctfTrackEtaHighQ -> Fill (trEta);
702 
703  if (trigMode == 8 ||
704  trigMode == 9 ||
705  trigMode == 10 ) csctfTrackEtaLowQ -> Fill (trEta);
706  }
707  else {//|eta| > 2.1
708  if (trigMode == 2 ||
709  trigMode == 3 ||
710  trigMode == 4 ||
711  trigMode == 5 ) csctfTrackEtaHighQ -> Fill (trEta);
712  else
713  csctfTrackEtaLowQ -> Fill (trEta);
714  }
715  }
716 
717  csctfTrackM->Fill( trk->first.modeExtended() );
718 
719  // we monitor the track quality only on the first link
720  // so let's make sure to fill the plot if there is something that
721  // is read from the hardware
722  int trRank = trk->first.rank();
723  if (trRank) {
724  int trQuality = ((trRank>>5)&0x3);
725  trackModeVsQ->Fill( trk->first.modeExtended(), trQuality );
726  }
727 
728  /*
729  OLD METHOD FOR FILLING HALO PLOTS, IMPROVED METHOD USING ASSOCIATED TRACK STUBS
730  BELOW ~LINE 605
731  if( trigMode == 15 )
732  {
733 
734  double haloVals[4][4];
735  for( int i = 0; i < 4; i++)
736  {
737  haloVals[i][0] = 0;
738  }
739 
740  edm::Handle<CSCCorrelatedLCTDigiCollection> corrlcts;
741  for(CSCCorrelatedLCTDigiCollection::DigiRangeIterator csc=corrlcts.product()->begin(); csc!=corrlcts.product()->end(); csc++)
742  {
743  CSCCorrelatedLCTDigiCollection::Range range1 = corrlcts.product()->get((*csc).first);
744  for(CSCCorrelatedLCTDigiCollection::const_iterator lct=range1.first; lct!=range1.second; lct++)
745  {
746  int endcap = (*csc).first.endcap()-1;
747  int station = (*csc).first.station()-1;
748  int sector = (*csc).first.triggerSector()-1;
749  int cscId = (*csc).first.triggerCscId()-1;
750  int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels((*csc).first);
751  int fpga = ( subSector ? subSector-1 : station+1 );
752 
753  if(station != 4)
754  {
755  int modEnd = 1;
756  if( endcap == 0 ) modEnd = -1;
757  int indexHalo = modEnd + station;
758  if(haloVals[indexHalo][0] == 1.0) haloVals[indexHalo][3] = 1.0;
759  if(haloVals[indexHalo][0] == 0) haloVals[indexHalo][0] = 1.0;
760  haloVals[indexHalo][1] = sector*1.0;
761 
762  lclphidat lclPhi;
763  lclPhi = srLUTs_[fpga]->localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend());
764  gblphidat gblPhi;
765  gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, lct->getKeyWG(), cscId+1);
766  gbletadat gblEta;
767  gblEta = srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1);
768 
769  haloVals[indexHalo][2] = gblEta.global_eta/127. * 1.5 + 0.9;
770  } //station1 or 2
771  } //lct first to second
772  } //corrlcts
773 
774  if( (haloVals[0][0] == 1.) && (haloVals[1][0] == 1.) && (haloVals[0][3] != 1.) && (haloVals[1][3] != 1.) )
775  {
776  if( haloVals[0][1] == haloVals[1][1] ){
777  double delEta23 = haloVals[1][2] - haloVals[0][2];
778  haloDelEta23->Fill( delEta23 );
779  }
780  }
781 
782  if( (haloVals[2][0] == 1.) && (haloVals[3][0] == 1.) && (haloVals[2][3] != 1.) && (haloVals[3][3] != 1.) )
783  {
784  if( haloVals[2][1] == haloVals[3][1] ){
785  double delEta23 = haloVals[3][2] - haloVals[2][2];
786  haloDelEta23->Fill( delEta23 );
787  }
788  }
789  } //halo trigger
790  */
791 
792  int cscTrackStub = 0;
793  //float haloEta[3];
794  //for(int i=0; i<3; i++) haloEta[i]=-1.0;
795  //bool haloME11 = false;
796  CSCCorrelatedLCTDigiCollection lctsOfTracks=trk->second;
797  for(CSCCorrelatedLCTDigiCollection::DigiRangeIterator trackStub=lctsOfTracks.begin(); trackStub!=lctsOfTracks.end(); trackStub++)
798  {
799  CSCCorrelatedLCTDigiCollection::Range range2 = lctsOfTracks.get((*trackStub).first);
800  for(CSCCorrelatedLCTDigiCollection::const_iterator lct=range2.first; lct!=range2.second; lct++)
801  {
802 // int station = (*trackStub).first.station()-1;
803 // if(station != 4)
804 // {
805 // // int endcap = (*trackStub).first.endcap()-1;
806 // // int sector = (*trackStub).first.triggerSector()-1;
807 // int cscId = (*trackStub).first.triggerCscId()-1;
808 // int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels((*trackStub).first);
809 // int fpga = ( subSector ? subSector-1 : station+1 );
810 
811 // lclphidat lclPhi;
812 // lclPhi = srLUTs_[fpga]->localPhi(lct->getStrip(), lct->getPattern(), lct->getQuality(), lct->getBend());
813 // gblphidat gblPhi;
814 // gblPhi = srLUTs_[fpga]->globalPhiME(lclPhi.phi_local, lct->getKeyWG(), cscId+1);
815 // gbletadat gblEta;
816 // gblEta = srLUTs_[fpga]->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, lct->getKeyWG(), cscId+1);
817 // haloEta[station-1] = gblEta.global_eta/127. * 1.5 + 0.9;
818 // if(station==1 && cscId<2) haloME11 = true;
819 // }
820  cscTrackStub++;
821  }
822  }
823  cscTrackStubNumbers->Fill(cscTrackStub);
824 
825 // if(trigMode == 15)
826 // {
827 // float dEta13 = haloEta[2]-haloEta[0];
828 // float dEta12 = haloEta[1]-haloEta[0];
829 // if(haloME11)
830 // {
831 // if(haloEta[1]!=-1.0) haloDelEta112->Fill(dEta12);
832 // if(haloEta[2]!=-1.0) haloDelEta113->Fill(dEta13);
833 // } else {
834 // if(haloEta[1]!=-1.0) haloDelEta12->Fill(dEta12);
835 // if(haloEta[2]!=-1.0) haloDelEta13->Fill(dEta13);
836 // }
837 // }
838  //
839 
840 
841 
842  }
843  }
844  csctfntrack->Fill(NumCSCTfTracksRep);
845 
846 
847  if( mbProducer.label() != "null" )
848  {
849  // handle to needed collections
851  e.getByToken(dtStubsToken_, dtStubs);
853  e.getByToken(mbtracksToken_, tracks);
854 
855  // loop on the DT stubs
856  std::vector<csctf::TrackStub> vstubs = dtStubs->get();
857  for(std::vector<csctf::TrackStub>::const_iterator stub=vstubs.begin();
858  stub!=vstubs.end(); stub++)
859  {
860  if (verbose_)
861  {
862  edm::LogInfo("DataNotFound") << "\n mbEndcap: " << stub->endcap();
863  edm::LogInfo("DataNotFound") << "\n stub->getStrip()[FLAG]: " << stub->getStrip();
864  edm::LogInfo("DataNotFound") << "\n stub->getKeyWG()[CAL]: " << stub->getKeyWG();
865  edm::LogInfo("DataNotFound") << "\n stub->BX(): " << stub->BX();
866  edm::LogInfo("DataNotFound") << "\n stub->sector(): " << stub->sector();
867  edm::LogInfo("DataNotFound") << "\n stub->subsector(): " << stub->subsector();
868  edm::LogInfo("DataNotFound") << "\n stub->station(): " << stub->station();
869  edm::LogInfo("DataNotFound") << "\n stub->phiPacked(): " << stub->phiPacked();
870  edm::LogInfo("DataNotFound") << "\n stub->getBend(): " << stub->getBend();
871  edm::LogInfo("DataNotFound") << "\n stub->getQuality(): " << stub->getQuality();
872  edm::LogInfo("DataNotFound") << "\n stub->cscid(): " << stub->cscid() << endl;
873  }
874  // define the sector ID
875  int mbId = (stub->endcap()==2) ? 6 : 0;
876  mbId += stub->sector();
877  // *** do not fill if CalMB variable is set ***
878  // horrible! They used the same class to write up the LCT and MB info,
879  // but given the MB does not have strip and WG they replaced this two
880  // with the flag and cal bits... :S
881  if (stub->getKeyWG() == 0)
882  {
883  // if FLAG =1, muon belong to previous BX
884  int bxDT = stub->BX()-stub->getStrip(); // correct by the FLAG
885  int subDT = stub->subsector();
886 
887  // Fill the event only if CSC had or would have triggered
888  if (isCSCcand_)
889  {
890  //look for tracks in the event and compare the matching DT stubs
891  int trkBX = 0;
892  for(L1CSCTrackCollection::const_iterator trk=tracks->begin(); trk<tracks->end(); trk++)
893  {
894  trkBX = trk->first.BX();
895  int trkId = (trk->first.endcap()==2) ? 6 : 0;
896  trkId += trk->first.sector();
897  if (verbose_){
898  edm::LogInfo("DataNotFound") << "\n trk BX: " << trkBX
899  << " Sector: " << trkId
900  << " SubSector: " << trk->first.subsector()
901  << " Endcap: " << trk->first.endcap();
902 
903  edm::LogInfo("DataNotFound") << "\n DT BX: " << stub->BX()
904  << " Sector: " << mbId
905  << " SubSector: " << stub->subsector()
906  << " Endcap: " << stub->endcap() << endl;
907  }
908 
909  if (mbId == trkId)
910  {
911  if (verbose_) {
912  edm::LogInfo("DataNotFound") << " --> MATCH" << endl;
913  edm::LogInfo("DataNotFound") << "Fill :" << trkBX+6-bxDT << " -- " << subDT << " -- cands" << endl;
914  }
915  // DT bx ranges from 3 to 9
916  // trk bx ranges from -3 to 3
917  DTstubsTimeTrackMenTimeArrival[mbId-1]->Fill(bxDT-trkBX-6,subDT);//subsec
918  }
919  }// loop on the tracks
920  }//if (isCSCcand_){
921  }//if (stub->getKeyWG() == 0) {
922  }
923  }
924 }
MonitorElement * DTstubsTimeTrackMenTimeArrival[12]
Definition: L1TCSCTF.h:107
MonitorElement * csctfoccupancies
Definition: L1TCSCTF.h:85
unsigned long long cacheIdentifier() const
MonitorElement * csctfTrackEtaHighQ
Definition: L1TCSCTF.h:97
MonitorElement * csctfTrackPhi
Definition: L1TCSCTF.h:94
bool verbose_
Definition: L1TCSCTF.h:115
unsigned long long m_scalesCacheID
Definition: L1TCSCTF.h:124
MonitorElement * csctfTrackPhi_H
Definition: L1TCSCTF.h:98
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
MonitorElement * csctfbx
Definition: L1TCSCTF.h:81
MonitorElement * csctfTrackEtaLowQ
Definition: L1TCSCTF.h:96
edm::InputTag mbProducer
Definition: L1TCSCTF.h:118
gbletadat globalEtaME(int phi_bend, int phi_local, int wire_group, int cscid) const
static void setGeometry(const edm::ESHandle< CSCGeometry > &thegeom)
MonitorElement * csctfTrackEta
Definition: L1TCSCTF.h:95
void Fill(long long x)
edm::InputTag statusProducer
Definition: L1TCSCTF.h:118
edm::EDGetTokenT< L1CSCStatusDigiCollection > statusToken_
Definition: L1TCSCTF.h:129
MonitorElement * csctfTrackEta_H
Definition: L1TCSCTF.h:99
const L1MuTriggerScales * ts
Definition: L1TCSCTF.h:122
MonitorElement * cscTrackStubNumbers
Definition: L1TCSCTF.h:100
lclphidat localPhi(int strip, int pattern, int quality, int lr) const
Geometry Lookup Tables.
int L1ABXN
Definition: L1TCSCTF.h:111
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int BxInEvent_
Definition: L1TCSCTF.h:108
const L1MuScale * getPhiScale() const
get the phi scale
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int nev_
Definition: L1TCSCTF.h:113
MonitorElement * csctfChamberOccupancies
Definition: L1TCSCTF.h:93
bool isValid() const
Definition: HandleBase.h:76
edm::InputTag lctProducer
Definition: L1TCSCTF.h:118
edm::EDGetTokenT< L1CSCTrackCollection > tracksToken_
Definition: L1TCSCTF.h:131
CSCSectorReceiverLUT * srLUTs_[5]
Definition: L1TCSCTF.h:120
#define M_PI
Definition: BFit3D.cc:3
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > corrlctsToken_
Definition: L1TCSCTF.h:130
MonitorElement * csctferrors
Definition: L1TCSCTF.h:84
tuple tracks
Definition: testEve_cfg.py:39
bool isCSCcand_
Definition: L1TCSCTF.h:109
class global_phi_data gblphidat
const T & get() const
Definition: EventSetup.h:55
MonitorElement * csctfTrackM
Definition: L1TCSCTF.h:101
edm::EDGetTokenT< L1CSCTrackCollection > mbtracksToken_
Definition: L1TCSCTF.h:133
T const * product() const
Definition: ESHandle.h:62
MonitorElement * csctfbx_H
Definition: L1TCSCTF.h:82
std::vector< CSCCorrelatedLCTDigi >::const_iterator const_iterator
class local_phi_data lclphidat
Data Types.
static int triggerSubSectorFromLabels(int station, int chamber)
T const * product() const
Definition: Handle.h:81
MonitorElement * csctfntrack
Definition: L1TCSCTF.h:80
edm::InputTag trackProducer
Definition: L1TCSCTF.h:118
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmtProducerToken_
Definition: L1TCSCTF.h:128
std::string const & label() const
Definition: InputTag.h:42
MonitorElement * trackModeVsQ
Definition: L1TCSCTF.h:102
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
MonitorElement * csctfoccupancies_H
Definition: L1TCSCTF.h:86
static unsigned int const shift
std::pair< const_iterator, const_iterator > Range
const L1MuTriggerPtScale * tpts
Definition: L1TCSCTF.h:123
unsigned long long m_ptScaleCacheID
Definition: L1TCSCTF.h:125
tuple status
Definition: ntuplemaker.py:245
class global_eta_data gbletadat
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > dtStubsToken_
Definition: L1TCSCTF.h:132
edm::InputTag gmtProducer
Definition: L1TCSCTF.h:118
gblphidat globalPhiME(int phi_local, int wire_group, int cscid) const
void L1TCSCTF::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 105 of file L1TCSCTF.cc.

References DQMStore::book1D(), DQMStore::book2D(), csctfbx, csctfbx_H, csctfChamberOccupancies, csctferrors, csctfntrack, csctfoccupancies, csctfoccupancies_H, csctfTrackEta, csctfTrackEta_H, csctfTrackEtaHighQ, csctfTrackEtaLowQ, csctfTrackM, csctfTrackPhi, csctfTrackPhi_H, cscTrackStubNumbers, dbe, DTstubsTimeTrackMenTimeArrival, MonitorElement::getTH2F(), i, M_PI, m_ptScaleCacheID, m_scalesCacheID, nev_, cppFunctionSkipper::operator, DQMStore::rmdir(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and trackModeVsQ.

106 {
107  m_scalesCacheID = -999;
108  m_ptScaleCacheID = -999;
109 
110  nev_ = 0;
111 
112  // get hold of back-end interface
113  DQMStore* dbe = 0;
114  dbe = Service<DQMStore>().operator->();
115 
116  if( dbe )
117  {
118  dbe->setCurrentFolder("L1T/L1TCSCTF");
119  dbe->rmdir("L1T/L1TCSCTF");
120  }
121 
122 
123  if( dbe )
124  {
125  dbe->setCurrentFolder("L1T/L1TCSCTF");
126 
127  // Error counting histogram:
128  // 1) checks TF data integrity (error rate - first bin),
129  // 2) monitors sychronization on input links (4 errors types: SE/SM/BX/AF; ORed for all time bins, links, and SPs),
130  // 3) reports FMM status (if in any SP FMM status != "Ready" - fill the last bin)
131  csctferrors = dbe->book1D("CSCTF_errors","CSCTF Errors",6,0,6);
132  csctferrors->setAxisTitle("Error type",1);
133  csctferrors->setAxisTitle("Number of Errors",2);
134  csctferrors->setBinLabel(1,"Corruptions",1);
135  csctferrors->setBinLabel(2,"Synch. Err.",1);
136  csctferrors->setBinLabel(3,"Synch. Mod.",1);
137  csctferrors->setBinLabel(4,"BX mismatch",1);
138  csctferrors->setBinLabel(5,"Time misalign.",1);
139  csctferrors->setBinLabel(6,"FMM != Ready",1);
140 
141  // Occupancy histogram Eta x Y, where Y:
142  // 1) Phi_packed of input LCTs from 1st, 2nd, 3rd, and 4th stations
143  // 2) Phi_packed of output tracks
144  // (all 12 SPs - 360 degree coveradge)
145  csctfoccupancies = dbe->book2D("CSCTF_occupancies", "CSCTF Occupancies", 64,-32,31,32,0,6.2);
146  csctfoccupancies->setAxisTitle("#eta",1);
147  csctfoccupancies->setAxisTitle("#phi",2);
148  csctfoccupancies->setBinLabel( 1,"-2.5", 1);
149  csctfoccupancies->setBinLabel( 8,"-2.1", 1);
150  csctfoccupancies->setBinLabel(18,"-1.6", 1);
151  csctfoccupancies->setBinLabel(26,"-1.2", 1);
152  csctfoccupancies->setBinLabel(32,"-0.9", 1);
153  csctfoccupancies->setBinLabel(33, "0.9", 1);
154  csctfoccupancies->setBinLabel(39, "1.2", 1);
155  csctfoccupancies->setBinLabel(47, "1.6", 1);
156  csctfoccupancies->setBinLabel(57, "2.1", 1);
157  csctfoccupancies->setBinLabel(64, "2.5", 1);
158 
159  // ... and for halo muons only
160  csctfoccupancies_H = dbe->book2D("CSCTF_occupancies_H", "CSCTF Halo Occupancies", 64,-32,31,32,0,6.2);
161  csctfoccupancies_H->setAxisTitle("#eta",1);
162  csctfoccupancies_H->setAxisTitle("#phi",2);
163  csctfoccupancies_H->setBinLabel( 1,"-2.5", 1);
164  csctfoccupancies_H->setBinLabel( 8,"-2.1", 1);
165  csctfoccupancies_H->setBinLabel(18,"-1.6", 1);
166  csctfoccupancies_H->setBinLabel(26,"-1.2", 1);
167  csctfoccupancies_H->setBinLabel(32,"-0.9", 1);
168  csctfoccupancies_H->setBinLabel(33, "0.9", 1);
169  csctfoccupancies_H->setBinLabel(39, "1.2", 1);
170  csctfoccupancies_H->setBinLabel(47, "1.6", 1);
171  csctfoccupancies_H->setBinLabel(57, "2.1", 1);
172  csctfoccupancies_H->setBinLabel(64, "2.5", 1);
173 
174  //haloDelEta12 = dbe->book1D("CSCTF_Halo_Eta12", "#Delta #eta_{12} for Halo Muons", 40, -0.20,0.30);
175  //haloDelEta112 = dbe->book1D("CSCTF_Halo_Eta112","#Delta #eta_{112} for Halo Muons", 40, -0.20,0.30);
176  //haloDelEta13 = dbe->book1D("CSCTF_Halo_Eta13", "#Delta #eta_{13} for Halo Muons", 40, -0.20,0.30);
177  //haloDelEta113 = dbe->book1D("CSCTF_Halo_Eta113","#Delta #eta_{113} for Halo Muons", 40, -0.20,0.30);
178 
179  // Quality VS Mode
180  trackModeVsQ = dbe->book2D("CSCTF_Track_ModeVsQual","CSC Track Mode Vs Quality", 19, -0.5, 18.5, 4, 0, 4);
181  trackModeVsQ->setAxisTitle("Track Type", 1);
182  trackModeVsQ->setBinLabel(1,"No Track",1);
183  trackModeVsQ->setBinLabel(2,"Bad Phi/Single",1);
184  trackModeVsQ->setBinLabel(3,"ME1-2-3",1);
185  trackModeVsQ->setBinLabel(4,"ME1-2-4",1);
186  trackModeVsQ->setBinLabel(5,"ME1-3-4",1);
187  trackModeVsQ->setBinLabel(6,"ME2-3-4",1);
188  trackModeVsQ->setBinLabel(7,"ME1-2",1);
189  trackModeVsQ->setBinLabel(8,"ME1-3",1);
190  trackModeVsQ->setBinLabel(9,"ME2-3",1);
191  trackModeVsQ->setBinLabel(10,"ME2-4",1);
192  trackModeVsQ->setBinLabel(11,"ME3-4",1);
193  trackModeVsQ->setBinLabel(12,"MB1-ME3",1);
194  trackModeVsQ->setBinLabel(13,"MB1-ME2",1);
195  trackModeVsQ->setBinLabel(14,"ME1-4",1);
196  trackModeVsQ->setBinLabel(15,"MB1-ME1",1);
197  trackModeVsQ->setBinLabel(16,"Halo Trigger",1);
198  trackModeVsQ->setBinLabel(17,"MB1-ME1-2",1);
199  trackModeVsQ->setBinLabel(18,"MB1-ME1-3",1);
200  trackModeVsQ->setBinLabel(19,"MB1-ME2-3",1);
201 
202  trackModeVsQ->setAxisTitle("Quality",2);
203  trackModeVsQ->setBinLabel(1,"0",2);
204  trackModeVsQ->setBinLabel(2,"1",2);
205  trackModeVsQ->setBinLabel(3,"2",2);
206  trackModeVsQ->setBinLabel(4,"3",2);
207 
208  // Mode
209  csctfTrackM = dbe->book1D("CSCTF_Track_Mode","CSC Track Mode", 19, -0.5, 18.5);
210  csctfTrackM->setAxisTitle("Track Type", 1);
211  csctfTrackM->setBinLabel(1,"No Track",1);
212  csctfTrackM->setBinLabel(2,"Bad Phi/Single",1);
213  csctfTrackM->setBinLabel(3,"ME1-2-3",1);
214  csctfTrackM->setBinLabel(4,"ME1-2-4",1);
215  csctfTrackM->setBinLabel(5,"ME1-3-4",1);
216  csctfTrackM->setBinLabel(6,"ME2-3-4",1);
217  csctfTrackM->setBinLabel(7,"ME1-2",1);
218  csctfTrackM->setBinLabel(8,"ME1-3",1);
219  csctfTrackM->setBinLabel(9,"ME2-3",1);
220  csctfTrackM->setBinLabel(10,"ME2-4",1);
221  csctfTrackM->setBinLabel(11,"ME3-4",1);
222  csctfTrackM->setBinLabel(12,"MB1-ME3",1);
223  csctfTrackM->setBinLabel(13,"MB1-ME2",1);
224  csctfTrackM->setBinLabel(14,"ME1-4",1);
225  csctfTrackM->setBinLabel(15,"MB1-ME1",1);
226  csctfTrackM->setBinLabel(16,"Halo Trigger",1);
227  csctfTrackM->setBinLabel(17,"MB1-ME1-2",1);
228  csctfTrackM->setBinLabel(18,"MB1-ME1-3",1);
229  csctfTrackM->setBinLabel(19,"MB1-ME2-3",1);
230 
231  // Chamber Occupancy
232  csctfChamberOccupancies = dbe->book2D("CSCTF_Chamber_Occupancies","CSCTF Chamber Occupancies", 54, -0.05, 5.35, 10, -5.5, 4.5);
233  csctfChamberOccupancies->setAxisTitle("Sector, (chambers 1-9 not labeled)",1);
237  csctfChamberOccupancies->setBinLabel(4,"ME-1b",2);
238  csctfChamberOccupancies->setBinLabel(5,"ME-1a",2);
239  csctfChamberOccupancies->setBinLabel(6,"ME+1a",2);
240  csctfChamberOccupancies->setBinLabel(7,"ME+1b",2);
243  csctfChamberOccupancies->setBinLabel(10,"ME+4",2);
250 
251  // Track Phi
252  csctfTrackPhi = dbe->book1D("CSCTF_Track_Phi", "CSCTF Track #phi",144,0,2*M_PI);
253  csctfTrackPhi->setAxisTitle("Track #phi", 1);
254 
255  // Track Eta
256  csctfTrackEta = dbe->book1D("CSCTF_Track_Eta", "CSCTF Track #eta",64,-32,32);
257  csctfTrackEta->setAxisTitle("Track #eta", 1);
258  csctfTrackEta->setBinLabel( 1,"-2.5", 1);
259  csctfTrackEta->setBinLabel( 8,"-2.1", 1);
260  csctfTrackEta->setBinLabel(18,"-1.6", 1);
261  csctfTrackEta->setBinLabel(26,"-1.2", 1);
262  csctfTrackEta->setBinLabel(32,"-0.9", 1);
263  csctfTrackEta->setBinLabel(33, "0.9", 1);
264  csctfTrackEta->setBinLabel(39, "1.2", 1);
265  csctfTrackEta->setBinLabel(47, "1.6", 1);
266  csctfTrackEta->setBinLabel(57, "2.1", 1);
267  csctfTrackEta->setBinLabel(64, "2.5", 1);
268 
269  // Track Eta Low Quality
270  csctfTrackEtaLowQ = dbe->book1D("CSCTF_Track_Eta_LowQ", "CSCTF Track #eta LQ",64,-32,32);
271  csctfTrackEtaLowQ->setAxisTitle("Track #eta", 1);
272  csctfTrackEtaLowQ->setBinLabel( 1,"-2.5", 1);
273  csctfTrackEtaLowQ->setBinLabel( 8,"-2.1", 1);
274  csctfTrackEtaLowQ->setBinLabel(18,"-1.6", 1);
275  csctfTrackEtaLowQ->setBinLabel(26,"-1.2", 1);
276  csctfTrackEtaLowQ->setBinLabel(32,"-0.9", 1);
277  csctfTrackEtaLowQ->setBinLabel(33, "0.9", 1);
278  csctfTrackEtaLowQ->setBinLabel(39, "1.2", 1);
279  csctfTrackEtaLowQ->setBinLabel(47, "1.6", 1);
280  csctfTrackEtaLowQ->setBinLabel(57, "2.1", 1);
281  csctfTrackEtaLowQ->setBinLabel(64, "2.5", 1);
282 
283 
284  // Track Eta High Quality
285  csctfTrackEtaHighQ = dbe->book1D("CSCTF_Track_Eta_HighQ", "CSCTF Track #eta HQ",64,-32,32);
286  csctfTrackEtaHighQ->setAxisTitle("Track #eta", 1);
287  csctfTrackEtaHighQ->setBinLabel( 1,"-2.5", 1);
288  csctfTrackEtaHighQ->setBinLabel( 8,"-2.1", 1);
289  csctfTrackEtaHighQ->setBinLabel(18,"-1.6", 1);
290  csctfTrackEtaHighQ->setBinLabel(26,"-1.2", 1);
291  csctfTrackEtaHighQ->setBinLabel(32,"-0.9", 1);
292  csctfTrackEtaHighQ->setBinLabel(33, "0.9", 1);
293  csctfTrackEtaHighQ->setBinLabel(39, "1.2", 1);
294  csctfTrackEtaHighQ->setBinLabel(47, "1.6", 1);
295  csctfTrackEtaHighQ->setBinLabel(57, "2.1", 1);
296  csctfTrackEtaHighQ->setBinLabel(64, "2.5", 1);
297 
298 
299  // Halo Phi
300  csctfTrackPhi_H = dbe->book1D("CSCTF_Track_Phi_H", "CSCTF Halo #phi",144,0,2*M_PI);
301  csctfTrackPhi_H->setAxisTitle("Track #phi", 1);
302 
303  // Halo Eta
304  csctfTrackEta_H = dbe->book1D("CSCTF_Track_Eta_H", "CSCTF Halo #eta",64,-32,32);
305  csctfTrackEta_H->setAxisTitle("Track #eta", 1);
306  csctfTrackEta_H->setBinLabel( 1,"-2.5", 1);
307  csctfTrackEta_H->setBinLabel( 8,"-2.1", 1);
308  csctfTrackEta_H->setBinLabel(18,"-1.6", 1);
309  csctfTrackEta_H->setBinLabel(26,"-1.2", 1);
310  csctfTrackEta_H->setBinLabel(32,"-0.9", 1);
311  csctfTrackEta_H->setBinLabel(33, "0.9", 1);
312  csctfTrackEta_H->setBinLabel(39, "1.2", 1);
313  csctfTrackEta_H->setBinLabel(47, "1.6", 1);
314  csctfTrackEta_H->setBinLabel(57, "2.1", 1);
315  csctfTrackEta_H->setBinLabel(64, "2.5", 1);
316 
317  // Track Timing
318  csctfbx = dbe->book2D("CSCTF_bx","CSCTF BX", 12,1,13, 7,-3,3) ;
319  csctfbx->setAxisTitle("Sector (Endcap)", 1);
320  csctfbx->setBinLabel( 1," 1 (+)",1);
321  csctfbx->setBinLabel( 2," 2 (+)",1);
322  csctfbx->setBinLabel( 3," 3 (+)",1);
323  csctfbx->setBinLabel( 4," 4 (+)",1);
324  csctfbx->setBinLabel( 5," 5 (+)",1);
325  csctfbx->setBinLabel( 6," 6 (+)",1);
326  csctfbx->setBinLabel( 7," 7 (-)",1);
327  csctfbx->setBinLabel( 8," 8 (-)",1);
328  csctfbx->setBinLabel( 9," 9 (-)",1);
329  csctfbx->setBinLabel(10,"10 (-)",1);
330  csctfbx->setBinLabel(11,"11 (-)",1);
331  csctfbx->setBinLabel(12,"12 (-)",1);
332 
333  csctfbx->setAxisTitle("CSCTF BX", 2);
334  csctfbx->setBinLabel( 1, "-3", 2);
335  csctfbx->setBinLabel( 2, "-2", 2);
336  csctfbx->setBinLabel( 3, "-1", 2);
337  csctfbx->setBinLabel( 4, "-0", 2);
338  csctfbx->setBinLabel( 5, " 1", 2);
339  csctfbx->setBinLabel( 6, " 2", 2);
340  csctfbx->setBinLabel( 7, " 3", 2);
341 
342  // Halo Timing
343  csctfbx_H = dbe->book2D("CSCTF_bx_H","CSCTF HALO BX", 12,1,13, 7,-3,3) ;
344  csctfbx_H->setAxisTitle("Sector (Endcap)", 1);
345  csctfbx_H->setBinLabel( 1," 1 (+)",1);
346  csctfbx_H->setBinLabel( 2," 2 (+)",1);
347  csctfbx_H->setBinLabel( 3," 3 (+)",1);
348  csctfbx_H->setBinLabel( 4," 4 (+)",1);
349  csctfbx_H->setBinLabel( 5," 5 (+)",1);
350  csctfbx_H->setBinLabel( 6," 6 (+)",1);
351  csctfbx_H->setBinLabel( 7," 7 (-)",1);
352  csctfbx_H->setBinLabel( 8," 8 (-)",1);
353  csctfbx_H->setBinLabel( 9," 9 (-)",1);
354  csctfbx_H->setBinLabel(10,"10 (-)",1);
355  csctfbx_H->setBinLabel(11,"11 (-)",1);
356  csctfbx_H->setBinLabel(12,"12 (-)",1);
357 
358  csctfbx_H->setAxisTitle("CSCTF BX", 2);
359  csctfbx_H->setBinLabel( 1, "-3", 2);
360  csctfbx_H->setBinLabel( 2, "-2", 2);
361  csctfbx_H->setBinLabel( 3, "-1", 2);
362  csctfbx_H->setBinLabel( 4, "-0", 2);
363  csctfbx_H->setBinLabel( 5, " 1", 2);
364  csctfbx_H->setBinLabel( 6, " 2", 2);
365  csctfbx_H->setBinLabel( 7, " 3", 2);
366 
367  // Number of Tracks Stubs
368  cscTrackStubNumbers = dbe->book1D("CSCTF_TrackStubs", "Number of Stubs in CSCTF Tracks", 5, 0, 5);
369  cscTrackStubNumbers->setBinLabel( 1, "0", 1);
370  cscTrackStubNumbers->setBinLabel( 2, "1", 1);
371  cscTrackStubNumbers->setBinLabel( 3, "2", 1);
372  cscTrackStubNumbers->setBinLabel( 4, "3", 1);
373  cscTrackStubNumbers->setBinLabel( 5, "4", 1);
374 
375  // Number of Tracks
376  csctfntrack = dbe->book1D("CSCTF_ntrack","Number of CSCTracks found per event", 5, 0, 5 ) ;
377  csctfntrack->setBinLabel( 1, "0", 1);
378  csctfntrack->setBinLabel( 2, "1", 1);
379  csctfntrack->setBinLabel( 3, "2", 1);
380  csctfntrack->setBinLabel( 4, "3", 1);
381  csctfntrack->setBinLabel( 5, "4", 1);
382  }
383 
384  char hname [200];
385  char htitle[200];
386 
387  for(int i=0; i<12; i++) {
388 
389  sprintf(hname ,"DTstubsTimeTrackMenTimeArrival_%d",i+1);
390  sprintf(htitle,"T_{track} - T_{DT stub} sector %d",i+1);
391 
392  DTstubsTimeTrackMenTimeArrival[i] = dbe->book2D(hname,htitle, 7,-3,3, 2,1,3);
393  DTstubsTimeTrackMenTimeArrival[i]->getTH2F()->SetMinimum(0);
394 
395  // axis makeup
396  DTstubsTimeTrackMenTimeArrival[i]->setAxisTitle("bx_{CSC track} - bx_{DT stub}",1);
398 
406 
409 
410  }
411 
412 }
MonitorElement * DTstubsTimeTrackMenTimeArrival[12]
Definition: L1TCSCTF.h:107
MonitorElement * csctfoccupancies
Definition: L1TCSCTF.h:85
MonitorElement * csctfTrackEtaHighQ
Definition: L1TCSCTF.h:97
int i
Definition: DBlmapReader.cc:9
DQMStore * dbe
Definition: L1TCSCTF.h:78
MonitorElement * csctfTrackPhi
Definition: L1TCSCTF.h:94
unsigned long long m_scalesCacheID
Definition: L1TCSCTF.h:124
MonitorElement * csctfTrackPhi_H
Definition: L1TCSCTF.h:98
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:873
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2731
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 * csctfbx
Definition: L1TCSCTF.h:81
MonitorElement * csctfTrackEtaLowQ
Definition: L1TCSCTF.h:96
MonitorElement * csctfTrackEta
Definition: L1TCSCTF.h:95
MonitorElement * csctfTrackEta_H
Definition: L1TCSCTF.h:99
MonitorElement * cscTrackStubNumbers
Definition: L1TCSCTF.h:100
int nev_
Definition: L1TCSCTF.h:113
MonitorElement * csctfChamberOccupancies
Definition: L1TCSCTF.h:93
#define M_PI
Definition: BFit3D.cc:3
MonitorElement * csctferrors
Definition: L1TCSCTF.h:84
MonitorElement * csctfTrackM
Definition: L1TCSCTF.h:101
MonitorElement * csctfbx_H
Definition: L1TCSCTF.h:82
MonitorElement * csctfntrack
Definition: L1TCSCTF.h:80
MonitorElement * trackModeVsQ
Definition: L1TCSCTF.h:102
MonitorElement * csctfoccupancies_H
Definition: L1TCSCTF.h:86
unsigned long long m_ptScaleCacheID
Definition: L1TCSCTF.h:125
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1001
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)
Definition: DQMStore.cc:585
void L1TCSCTF::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 415 of file L1TCSCTF.cc.

References dbe, nev_, outputFile_, DQMStore::save(), and verbose_.

416 {
417 
418  if(verbose_) edm::LogInfo("DataNotFound") << "L1TCSCTF: end job...." << endl;
419  LogInfo("EndJob") << "analyzed " << nev_ << " events";
420 
421  if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_);
422 
423  return;
424 }
DQMStore * dbe
Definition: L1TCSCTF.h:78
bool verbose_
Definition: L1TCSCTF.h:115
std::string outputFile_
Definition: L1TCSCTF.h:114
int nev_
Definition: L1TCSCTF.h:113
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2297

Member Data Documentation

int L1TCSCTF::BxInEvent_
private

Definition at line 108 of file L1TCSCTF.h.

Referenced by analyze().

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> L1TCSCTF::corrlctsToken_
private

Definition at line 130 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

MonitorElement* L1TCSCTF::csctfAFerror
private

Definition at line 103 of file L1TCSCTF.h.

MonitorElement* L1TCSCTF::csctfbx
private

Definition at line 81 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfbx_H
private

Definition at line 82 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfChamberOccupancies
private

Definition at line 93 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctferrors
private

Definition at line 84 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfntrack
private

Definition at line 80 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfoccupancies
private

Definition at line 85 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfoccupancies_H
private

Definition at line 86 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfTrackEta
private

Definition at line 95 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfTrackEta_H
private

Definition at line 99 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfTrackEtaHighQ
private

Definition at line 97 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfTrackEtaLowQ
private

Definition at line 96 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfTrackM
private

Definition at line 101 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfTrackPhi
private

Definition at line 94 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::csctfTrackPhi_H
private

Definition at line 98 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTF::cscTrackStubNumbers
private

Definition at line 100 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

DQMStore* L1TCSCTF::dbe
private

Definition at line 78 of file L1TCSCTF.h.

Referenced by beginJob(), endJob(), and L1TCSCTF().

MonitorElement* L1TCSCTF::DTstubsTimeTrackMenTimeArrival[12]
private

Definition at line 107 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

edm::EDGetTokenT<CSCTriggerContainer<csctf::TrackStub> > L1TCSCTF::dtStubsToken_
private

Definition at line 132 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

edm::InputTag L1TCSCTF::gmtProducer
private

Definition at line 118 of file L1TCSCTF.h.

Referenced by analyze().

edm::EDGetTokenT<L1MuGMTReadoutCollection> L1TCSCTF::gmtProducerToken_
private

Definition at line 128 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

bool L1TCSCTF::isCSCcand_
private

Definition at line 109 of file L1TCSCTF.h.

Referenced by analyze().

int L1TCSCTF::L1ABXN
private

Definition at line 111 of file L1TCSCTF.h.

Referenced by analyze().

edm::InputTag L1TCSCTF::lctProducer
private

Definition at line 118 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

std::ofstream L1TCSCTF::logFile_
private

Definition at line 117 of file L1TCSCTF.h.

unsigned long long L1TCSCTF::m_ptScaleCacheID
private

Definition at line 125 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

unsigned long long L1TCSCTF::m_scalesCacheID
private

Definition at line 124 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

edm::InputTag L1TCSCTF::mbProducer
private

Definition at line 118 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

edm::EDGetTokenT<L1CSCTrackCollection> L1TCSCTF::mbtracksToken_
private

Definition at line 133 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

bool L1TCSCTF::monitorDaemon_
private

Definition at line 116 of file L1TCSCTF.h.

int L1TCSCTF::nev_
private

Definition at line 113 of file L1TCSCTF.h.

Referenced by analyze(), beginJob(), and endJob().

std::string L1TCSCTF::outputFile_
private

Definition at line 114 of file L1TCSCTF.h.

Referenced by endJob(), and L1TCSCTF().

CSCSectorReceiverLUT* L1TCSCTF::srLUTs_[5]
private

Definition at line 120 of file L1TCSCTF.h.

Referenced by analyze(), L1TCSCTF(), and ~L1TCSCTF().

edm::InputTag L1TCSCTF::statusProducer
private

Definition at line 118 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

edm::EDGetTokenT<L1CSCStatusDigiCollection> L1TCSCTF::statusToken_
private

Definition at line 129 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

const L1MuTriggerPtScale* L1TCSCTF::tpts
private

Definition at line 123 of file L1TCSCTF.h.

Referenced by analyze().

MonitorElement* L1TCSCTF::trackModeVsQ
private

Definition at line 102 of file L1TCSCTF.h.

Referenced by analyze(), and beginJob().

edm::InputTag L1TCSCTF::trackProducer
private

Definition at line 118 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

edm::EDGetTokenT<L1CSCTrackCollection> L1TCSCTF::tracksToken_
private

Definition at line 131 of file L1TCSCTF.h.

Referenced by analyze(), and L1TCSCTF().

const L1MuTriggerScales* L1TCSCTF::ts
private

Definition at line 122 of file L1TCSCTF.h.

Referenced by analyze().

bool L1TCSCTF::verbose_
private

Definition at line 115 of file L1TCSCTF.h.

Referenced by analyze(), endJob(), and L1TCSCTF().