CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DTTriggerEfficiencyTask Class Reference

#include <DTTriggerEfficiencyTask.h>

Inheritance diagram for DTTriggerEfficiencyTask:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTTriggerEfficiencyTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTTriggerEfficiencyTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
 To reset the MEs. More...
 
void bookChamberHistos (DQMStore::IBooker &ibooker, const DTChamberId &dtCh, std::string histoTag, std::string folder="")
 Book chamber granularity histograms. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookWheelHistos (DQMStore::IBooker &ibooker, int wheel, std::string histoTag, std::string folder="")
 Book wheel granularity histograms. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 BeginRun. More...
 
bool hasRPCTriggers (const edm::Event &e)
 checks for RPC Triggers More...
 
std::string topFolder (std::string source)
 return the top folder More...
 
- 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

std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
 
bool checkRPCtriggers
 
edm::EDGetTokenT< DTLocalTriggerCollectionddu_Token_
 
bool detailedPlots
 
edm::EDGetTokenT< L1MuGMTReadoutCollectiongmt_Token_
 
edm::InputTag inputTagSEG
 
int maxBXDDU
 
int minBXDDU
 
edm::ESHandle< DTGeometrymuonGeom
 
edm::EDGetTokenT< reco::MuonCollectionmuons_Token_
 
int nevents
 
int nMinHitsPhi
 
edm::ParameterSet parameters
 
float phiAccRange
 
bool processDDU
 
std::vector< std::string > processTags
 
bool processTM
 
std::string SegmArbitration
 
edm::EDGetTokenT< L1MuDTChambPhContainertm_Token_
 
DTTrigGeomUtilstrigGeomUtils
 
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 45 of file DTTriggerEfficiencyTask.h.

Constructor & Destructor Documentation

DTTriggerEfficiencyTask::DTTriggerEfficiencyTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 43 of file DTTriggerEfficiencyTask.cc.

References checkRPCtriggers, ddu_Token_, detailedPlots, gmt_Token_, inputTagSEG, LogTrace, maxBXDDU, minBXDDU, muons_Token_, nMinHitsPhi, phiAccRange, processDDU, processTags, processTM, SegmArbitration, AlCaHLTBitMon_QueryRunRegistry::string, and tm_Token_.

43  : trigGeomUtils(nullptr) {
44 
45  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") << "[DTTriggerEfficiencyTask]: Constructor" << endl;
46 
47  parameters = ps;
48 
49  muons_Token_ = consumes<reco::MuonCollection>(
50  parameters.getUntrackedParameter<edm::InputTag>("inputTagMuons"));
51  tm_Token_ = consumes<L1MuDTChambPhContainer>(
52  parameters.getUntrackedParameter<edm::InputTag>("inputTagTM"));
53  ddu_Token_ = consumes<DTLocalTriggerCollection>(
54  parameters.getUntrackedParameter<edm::InputTag>("inputTagDDU"));
55  inputTagSEG = parameters.getUntrackedParameter<edm::InputTag>("inputTagSEG");
56  gmt_Token_ = consumes<L1MuGMTReadoutCollection>(
57  parameters.getUntrackedParameter<edm::InputTag>("inputTagGMT"));
58 
59  SegmArbitration = parameters.getUntrackedParameter<std::string>("SegmArbitration");
60 
61  detailedPlots = parameters.getUntrackedParameter<bool>("detailedAnalysis");
62  processTM = parameters.getUntrackedParameter<bool>("processTM");
63  processDDU = parameters.getUntrackedParameter<bool>("processDDU");
64  minBXDDU = parameters.getUntrackedParameter<int>("minBXDDU");
65  maxBXDDU = parameters.getUntrackedParameter<int>("maxBXDDU");
66 
67  checkRPCtriggers = parameters.getUntrackedParameter<bool>("checkRPCtriggers");
68  nMinHitsPhi = parameters.getUntrackedParameter<int>("nMinHitsPhi");
69  phiAccRange = parameters.getUntrackedParameter<double>("phiAccRange");
70 
71  if (processTM) processTags.push_back("TM");
72  if (processDDU) {processTags.push_back("DDU");
73  ddu_Token_ = consumes<DTLocalTriggerCollection>(
74  parameters.getUntrackedParameter<edm::InputTag>("inputTagDDU"));
75  }
76  if (!processTM && !processDDU) LogError ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") << "[DTTriggerEfficiencyTask]: Error, no trigger source (DDU or Twinmux) has been selected!!" <<endl;
77 
78 }
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmt_Token_
edm::EDGetTokenT< reco::MuonCollection > muons_Token_
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_Token_
#define LogTrace(id)
edm::EDGetTokenT< DTLocalTriggerCollection > ddu_Token_
std::vector< std::string > processTags
DTTriggerEfficiencyTask::~DTTriggerEfficiencyTask ( )
override

Destructor.

Definition at line 81 of file DTTriggerEfficiencyTask.cc.

References LogTrace, and nevents.

81  {
82 
83  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") << "[DTTriggerEfficiencyTask]: analyzed " << nevents << " events" << endl;
84 
85 }
#define LogTrace(id)

Member Function Documentation

void DTTriggerEfficiencyTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotected

Analyze.

Definition at line 125 of file DTTriggerEfficiencyTask.cc.

References reco::MuonSegmentMatch::BelongsToTrackByCleaning, reco::MuonSegmentMatch::BelongsToTrackByDR, reco::MuonSegmentMatch::BestInChamberByDR, relativeConstraints::chamber, chamberHistos, checkRPCtriggers, DTTrigGeomUtils::computeSCCoordinates(), ddu_Token_, detailedPlots, MuonSubdetId::DT, edm::Event::getByToken(), L1MuDTChambPhContainer::getContainer(), hasRPCTriggers(), triggerObjects_cff::id, RPCpg::mu, nano_cff::muons, muons_Token_, nevents, nMinHitsPhi, phiAccRange, processDDU, processTags, jets_cff::quality, DetId::rawId(), SegmArbitration, relativeConstraints::station, tm_Token_, trigGeomUtils, makeMuonMisalignmentScenario::wheel, wheelHistos, x, xdir, y, and ydir.

Referenced by topFolder().

125  {
126 
127  nevents++;
128 
129  if (checkRPCtriggers){ //For pre-2016 Era compatibility
130  if (!hasRPCTriggers(e)) { return; }
131  }
132  map<DTChamberId,const L1MuDTChambPhDigi*> phBestTM;
133  map<DTChamberId,const DTLocalTrigger*> phBestDDU;
134  // Getting best TM Stuff
136  e.getByToken(tm_Token_, l1DTTPGPh);
137  vector<L1MuDTChambPhDigi> const* phTrigs = l1DTTPGPh->getContainer();
138  //empty from dttfDigis, needs emulator working?
139  vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
140  vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
141  for(; iph !=iphe ; ++iph) {
142 
143  int phwheel = iph->whNum();
144  int phsec = iph->scNum() + 1; // DTTF numbering [0:11] -> DT numbering [1:12]
145  int phst = iph->stNum();
146  int phcode = iph->code();
147 
148  DTChamberId chId(phwheel,phst,phsec);
149 
150  if( phcode < 7 && (phBestTM.find(chId) == phBestTM.end() ||
151  phcode>phBestTM[chId]->code()) ) phBestTM[chId] = &(*iph);
152  }
153 
154  //Getting Best DDU Stuff
155  if (processDDU){
157  e.getByToken(ddu_Token_, trigsDDU);
159 
160  for (detUnitIt=trigsDDU->begin();detUnitIt!=trigsDDU->end();++detUnitIt){
161 
162  const DTChamberId& id = (*detUnitIt).first;
163  const DTLocalTriggerCollection::Range& range = (*detUnitIt).second;
164 
165  DTLocalTriggerCollection::const_iterator trigIt = range.first;
166  DTLocalTriggerCollection::const_iterator trigEnd = range.second;
167  for (; trigIt!= trigEnd;++trigIt){
168  int quality = trigIt->quality();
169  if(quality>-1 && quality<7 &&
170  (phBestDDU.find(id) == phBestDDU.end() ||
171  quality>phBestDDU[id]->quality()) ) phBestDDU[id] = &(*trigIt);
172  }
173 
174  }
175  }//processDDU
176 
177  //Getting Best Segments
178  vector<const DTRecSegment4D*> best4DSegments;
179 
181  e.getByToken(muons_Token_, muons);
182  reco::MuonCollection::const_iterator mu;
183 
184  for( mu = muons->begin(); mu != muons->end(); ++mu ) {
185 
186  // Make sure that is standalone muon
187  if( !((*mu).isStandAloneMuon()) ) {continue;}
188 
189  // Get the chambers compatible with the muon
190  const vector<reco::MuonChamberMatch> matchedChambers = (*mu).matches();
191  vector<reco::MuonChamberMatch>::const_iterator chamber;
192 
193  for( chamber = matchedChambers.begin(); chamber != matchedChambers.end(); ++chamber ) {
194 
195  // look only in DTs
196  if( chamber->detector() != MuonSubdetId::DT ) {continue;}
197 
198  // Get the matched segments in the chamber
199  const vector<reco::MuonSegmentMatch> matchedSegments = (*chamber).segmentMatches;
200  vector<reco::MuonSegmentMatch>::const_iterator segment;
201 
202  for( segment = matchedSegments.begin(); segment != matchedSegments.end(); ++segment ) {
203 
204  edm::Ref<DTRecSegment4DCollection> dtSegment = segment->dtSegmentRef;
205 
206  // Segment Arbitration
207  if( SegmArbitration == "SegmentArbitration"
208  && !((*segment).isMask(reco::MuonSegmentMatch::BestInChamberByDR)) ) {continue;}
209 
210  if( SegmArbitration == "SegmentAndTrackArbitration"
211  && (!((*segment).isMask(reco::MuonSegmentMatch::BestInChamberByDR)) ||
212  !((*segment).isMask(reco::MuonSegmentMatch::BelongsToTrackByDR))) ) {continue;}
213 
214  if( SegmArbitration == "SegmentAndTrackArbitrationCleaned"
215  && (!((*segment).isMask(reco::MuonSegmentMatch::BestInChamberByDR)) ||
216  !((*segment).isMask(reco::MuonSegmentMatch::BelongsToTrackByDR)) ||
217  !((*segment).isMask(reco::MuonSegmentMatch::BelongsToTrackByCleaning))) ) {continue;}
218 
219 
220  if( (*dtSegment).hasPhi() ) {
221  best4DSegments.push_back(&(*dtSegment));
222  }
223 
224  }// end loop on matched segments
225  }// end loop on compatible chambers
226  }// end loop on muons
227 
228  // Plot filling
229  vector<const DTRecSegment4D*>::const_iterator btrack;
230  for ( btrack = best4DSegments.begin(); btrack != best4DSegments.end(); ++btrack ){
231  int wheel = (*btrack)->chamberId().wheel();
232  int station = (*btrack)->chamberId().station();
233  int scsector = 0;
234  float x, xdir, y, ydir;
235  trigGeomUtils->computeSCCoordinates((*btrack),scsector,x,xdir,y,ydir);
236  int nHitsPhi = (*btrack)->phiSegment()->degreesOfFreedom()+2;
237  DTChamberId dtChId(wheel,station,scsector);
238  uint32_t indexCh = dtChId.rawId();
239  map<string, MonitorElement*> &innerChME = chamberHistos[indexCh];
240  map<string, MonitorElement*> &innerWhME = wheelHistos[wheel];
241 
242  if (fabs(xdir)<phiAccRange && nHitsPhi>=nMinHitsPhi){
243  vector<string>::const_iterator tagIt = processTags.begin();
244  vector<string>::const_iterator tagEnd = processTags.end();
245  for (; tagIt!=tagEnd; ++tagIt) {
246  int qual = (*tagIt) == "TM" ?
247  phBestTM.find(dtChId) != phBestTM.end() ? phBestTM[dtChId]->code() : -1 :
248  phBestDDU.find(dtChId) != phBestDDU.end() ? phBestDDU[dtChId]->quality() : -1;
249  innerWhME.find((*tagIt) + "_TrigEffDenum")->second->Fill(scsector,station);
250 
251  if ( qual>=0 && qual<7 ) {
252  innerWhME.find((*tagIt) + "_TrigEffNum")->second->Fill(scsector,station);
253  if ( qual>=4 ) {
254  innerWhME.find((*tagIt) + "_TrigEffCorrNum")->second->Fill(scsector,station);
255  }
256  }
257  if (detailedPlots) {
258  innerChME.find((*tagIt) + "_TrackPosvsAngle")->second->Fill(xdir,x);
259  if ( qual>=0 && qual<7 ) {
260  innerChME.find((*tagIt) + "_TrackPosvsAngleAnyQual")->second->Fill(xdir,x);
261  if ( qual>=4 ) {
262  innerChME.find((*tagIt) + "_TrackPosvsAngleCorr")->second->Fill(xdir,x);
263  }
264  }
265  }
266  }
267  }
268  }
269 
270 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
edm::EDGetTokenT< reco::MuonCollection > muons_Token_
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_Token_
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
const int mu
Definition: Constants.h:22
static const unsigned int BestInChamberByDR
static const unsigned int BelongsToTrackByCleaning
edm::EDGetTokenT< DTLocalTriggerCollection > ddu_Token_
bool hasRPCTriggers(const edm::Event &e)
checks for RPC Triggers
std::vector< DTLocalTrigger >::const_iterator const_iterator
Phi_Container const * getContainer() const
std::vector< std::string > processTags
static const unsigned int BelongsToTrackByDR
std::pair< const_iterator, const_iterator > Range
static const int DT
Definition: MuonSubdetId.h:12
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
void computeSCCoordinates(const DTRecSegment4D *track, int &scsec, float &x, float &xdir, float &y, float &ydir)
Compute track coordinates with SC sector numbering.
void DTTriggerEfficiencyTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

To reset the MEs.

Definition at line 119 of file DTTriggerEfficiencyTask.cc.

References LogTrace.

Referenced by topFolder().

119  {
120 
121  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<"[DTTriggerEfficiencyTask]: Begin of LS transition"<<endl;
122 
123 }
#define LogTrace(id)
void DTTriggerEfficiencyTask::bookChamberHistos ( DQMStore::IBooker ibooker,
const DTChamberId dtCh,
std::string  histoTag,
std::string  folder = "" 
)
protected

Book chamber granularity histograms.

Definition at line 301 of file DTTriggerEfficiencyTask.cc.

References DQMStore::IBooker::book2D(), chamberHistos, printsummarytable::folder, fftjetimagerecorder_cfi::histoLabel, LogTrace, SiStripPI::max, min(), pileupCalc::nbins, DTTrigGeomUtils::phiRange(), DetId::rawId(), SimDataFormats::CaloAnalysis::sc, DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, topFolder(), trigGeomUtils, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

302  {
303 
304  int wh = dtCh.wheel();
305  int sc = dtCh.sector();
306  int st = dtCh.station();
307  stringstream wheel; wheel << wh;
308  stringstream station; station << st;
309  stringstream sector; sector << sc;
310 
311  string hwFolder = topFolder(histoType);
312  string bookingFolder = hwFolder + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() + "/" + folder;
313  string histoTag = "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
314 
315  ibooker.setCurrentFolder(bookingFolder);
316 
317  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
318  << "[DTTriggerEfficiencyTask]: booking histos in " << bookingFolder << endl;
319 
320  float min, max;
321  int nbins;
322  trigGeomUtils->phiRange(dtCh,min,max,nbins,20);
323 
324  string histoName = histoType + "_TrackPosvsAngle" + histoTag;
325  string histoLabel = "Position vs Angle (phi)";
326 
327  (chamberHistos[dtCh.rawId()])[histoType + "_TrackPosvsAngle"] =
328  ibooker.book2D(histoName,histoLabel,12,-30.,30.,nbins,min,max);
329 
330  histoName = histoType + "_TrackPosvsAngleAnyQual" + histoTag;
331  histoLabel = "Position vs Angle (phi) for any qual triggers";
332 
333  (chamberHistos[dtCh.rawId()])[histoType + "_TrackPosvsAngleAnyQual"] =
334  ibooker.book2D(histoName,histoLabel,12,-30.,30.,nbins,min,max);
335 
336  histoName = histoType + "_TrackPosvsAngleCorr" + histoTag;
337  histoLabel = "Position vs Angle (phi) for correlated triggers";
338 
339  (chamberHistos[dtCh.rawId()])[histoType + "_TrackPosvsAngleCorr"] =
340  ibooker.book2D(histoName,histoLabel,12,-30.,30.,nbins,min,max);
341 
342 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
T min(T a, T b)
Definition: MathUtil.h:58
#define LogTrace(id)
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
int sector() const
Definition: DTChamberId.h:61
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
std::string topFolder(std::string source)
return the top folder
void DTTriggerEfficiencyTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 95 of file DTTriggerEfficiencyTask.cc.

References bookChamberHistos(), bookWheelHistos(), detailedPlots, LogTrace, nevents, processTags, and trackingPlots::stat.

97  {
98 
99  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") << "[DTTriggerEfficiencyTask]: bookHistograms" << endl;
100 
101  nevents = 0;
102  for (int wh=-2;wh<=2;++wh){
103  vector<string>::const_iterator tagIt = processTags.begin();
104  vector<string>::const_iterator tagEnd = processTags.end();
105  for (; tagIt!=tagEnd; ++tagIt) {
106 
107  bookWheelHistos(ibooker,wh,(*tagIt),"Task");
108  if (detailedPlots) {
109  for (int stat=1;stat<=4;++stat){
110  for (int sect=1;sect<=12;++sect){
111  bookChamberHistos(ibooker,DTChamberId(wh,stat,sect),(*tagIt),"Segment");
112  }
113  }
114  }
115  }
116  }
117 }
void bookWheelHistos(DQMStore::IBooker &ibooker, int wheel, std::string histoTag, std::string folder="")
Book wheel granularity histograms.
void bookChamberHistos(DQMStore::IBooker &ibooker, const DTChamberId &dtCh, std::string histoTag, std::string folder="")
Book chamber granularity histograms.
#define LogTrace(id)
std::vector< std::string > processTags
void DTTriggerEfficiencyTask::bookWheelHistos ( DQMStore::IBooker ibooker,
int  wheel,
std::string  histoTag,
std::string  folder = "" 
)
protected

Book wheel granularity histograms.

Definition at line 344 of file DTTriggerEfficiencyTask.cc.

References DQMStore::IBooker::book2D(), LogTrace, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), topFolder(), makeMuonMisalignmentScenario::wheel, and wheelHistos.

Referenced by bookHistograms().

345  {
346 
347  stringstream wh; wh << wheel;
348  string basedir;
349  if (hTag.find("Summary") != string::npos ) {
350  basedir = topFolder(hTag); //Book summary histo outside folder directory
351  } else {
352  basedir = topFolder(hTag) + folder + "/" ;
353  }
354 
355  ibooker.setCurrentFolder(basedir);
356 
357  string hTagName = "_W" + wh.str();
358 
359  LogTrace("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
360  << "[DTTriggerEfficiencyTask]: booking histos in "<< basedir << endl;
361 
362  string hName = hTag + "_TrigEffDenum" + hTagName;
363 
364  MonitorElement* me = ibooker.book2D(hName.c_str(),hName.c_str(),12,1,13,4,1,5);
365 
366  me->setBinLabel(1,"MB1",2);
367  me->setBinLabel(2,"MB2",2);
368  me->setBinLabel(3,"MB3",2);
369  me->setBinLabel(4,"MB4",2);
370  me->setAxisTitle("Sector",1);
371 
372  wheelHistos[wheel][hTag + "_TrigEffDenum"] = me;
373 
374  hName = hTag + "_TrigEffNum" + hTagName;
375  me = ibooker.book2D(hName.c_str(),hName.c_str(),12,1,13,4,1,5);
376 
377  me->setBinLabel(1,"MB1",2);
378  me->setBinLabel(2,"MB2",2);
379  me->setBinLabel(3,"MB3",2);
380  me->setBinLabel(4,"MB4",2);
381  me->setAxisTitle("Sector",1);
382 
383  wheelHistos[wheel][hTag + "_TrigEffNum"] = me;
384 
385  hName = hTag + "_TrigEffCorrNum" + hTagName;
386  me = ibooker.book2D(hName.c_str(),hName.c_str(),12,1,13,4,1,5);
387 
388  me->setBinLabel(1,"MB1",2);
389  me->setBinLabel(2,"MB2",2);
390  me->setBinLabel(3,"MB3",2);
391  me->setBinLabel(4,"MB4",2);
392  me->setAxisTitle("Sector",1);
393 
394  wheelHistos[wheel][hTag + "_TrigEffCorrNum"] = me;
395 
396  return;
397 }
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)
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
#define LogTrace(id)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::string topFolder(std::string source)
return the top folder
void DTTriggerEfficiencyTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
overrideprotected

BeginRun.

Definition at line 87 of file DTTriggerEfficiencyTask.cc.

References edm::EventSetup::get(), muonGeom, and trigGeomUtils.

87  {
88 
89  // Get the geometry
90  context.get<MuonGeometryRecord>().get(muonGeom);
92 
93 }
edm::ESHandle< DTGeometry > muonGeom
const T & get() const
Definition: EventSetup.h:59
bool DTTriggerEfficiencyTask::hasRPCTriggers ( const edm::Event e)
protected

checks for RPC Triggers

Definition at line 272 of file DTTriggerEfficiencyTask.cc.

References edm::Event::getByToken(), L1MuGMTReadoutCollection::getRecords(), gmt_Token_, and jets_cff::quality.

Referenced by analyze().

272  {
273 
275  e.getByToken(gmt_Token_, gmtrc);
276 
277  std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
278  std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr = gmt_records.begin();
279  std::vector<L1MuGMTReadoutRecord>::const_iterator egmtrr = gmt_records.end();
280  for(; igmtrr!=egmtrr; igmtrr++) {
281 
282  std::vector<L1MuGMTExtendedCand> candsGMT = igmtrr->getGMTCands();
283  std::vector<L1MuGMTExtendedCand>::const_iterator candGMTIt = candsGMT.begin();
284  std::vector<L1MuGMTExtendedCand>::const_iterator candGMTEnd = candsGMT.end();
285 
286  for(; candGMTIt!=candGMTEnd; ++candGMTIt){
287  if(!candGMTIt->empty()) {
288  int quality = candGMTIt->quality();
289  if(candGMTIt->bx()==0 &&
290  (quality == 5 || quality == 7)){
291  return true;
292  }
293  }
294  }
295  }
296 
297  return false;
298 
299 }
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmt_Token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
std::string DTTriggerEfficiencyTask::topFolder ( std::string  source)
inlineprotected

return the top folder

Definition at line 72 of file DTTriggerEfficiencyTask.h.

References analyze(), beginLuminosityBlock(), and EnergyCorrector::c.

Referenced by bookChamberHistos(), and bookWheelHistos().

72 { return source=="TM" ? "DT/03-LocalTrigger-TM/" : "DT/04-LocalTrigger-DDU/"; }
static std::string const source
Definition: EdmProvDump.cc:43

Member Data Documentation

std::map<uint32_t, std::map<std::string, MonitorElement*> > DTTriggerEfficiencyTask::chamberHistos
private

Definition at line 102 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and bookChamberHistos().

bool DTTriggerEfficiencyTask::checkRPCtriggers
private

Definition at line 86 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and DTTriggerEfficiencyTask().

edm::EDGetTokenT<DTLocalTriggerCollection> DTTriggerEfficiencyTask::ddu_Token_
private

Definition at line 95 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and DTTriggerEfficiencyTask().

bool DTTriggerEfficiencyTask::detailedPlots
private

Definition at line 86 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), bookHistograms(), and DTTriggerEfficiencyTask().

edm::EDGetTokenT<L1MuGMTReadoutCollection> DTTriggerEfficiencyTask::gmt_Token_
private

Definition at line 97 of file DTTriggerEfficiencyTask.h.

Referenced by DTTriggerEfficiencyTask(), and hasRPCTriggers().

edm::InputTag DTTriggerEfficiencyTask::inputTagSEG
private

Definition at line 96 of file DTTriggerEfficiencyTask.h.

Referenced by DTTriggerEfficiencyTask().

int DTTriggerEfficiencyTask::maxBXDDU
private

Definition at line 88 of file DTTriggerEfficiencyTask.h.

Referenced by DTTriggerEfficiencyTask().

int DTTriggerEfficiencyTask::minBXDDU
private

Definition at line 88 of file DTTriggerEfficiencyTask.h.

Referenced by DTTriggerEfficiencyTask().

edm::ESHandle<DTGeometry> DTTriggerEfficiencyTask::muonGeom
private

Definition at line 100 of file DTTriggerEfficiencyTask.h.

Referenced by dqmBeginRun().

edm::EDGetTokenT<reco::MuonCollection> DTTriggerEfficiencyTask::muons_Token_
private

Definition at line 93 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and DTTriggerEfficiencyTask().

int DTTriggerEfficiencyTask::nevents
private

Definition at line 82 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), bookHistograms(), and ~DTTriggerEfficiencyTask().

int DTTriggerEfficiencyTask::nMinHitsPhi
private

Definition at line 91 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and DTTriggerEfficiencyTask().

edm::ParameterSet DTTriggerEfficiencyTask::parameters
private
float DTTriggerEfficiencyTask::phiAccRange
private

Definition at line 90 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and DTTriggerEfficiencyTask().

bool DTTriggerEfficiencyTask::processDDU
private

Definition at line 86 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and DTTriggerEfficiencyTask().

std::vector<std::string> DTTriggerEfficiencyTask::processTags
private

Definition at line 87 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), bookHistograms(), and DTTriggerEfficiencyTask().

bool DTTriggerEfficiencyTask::processTM
private

Definition at line 86 of file DTTriggerEfficiencyTask.h.

Referenced by DTTriggerEfficiencyTask().

std::string DTTriggerEfficiencyTask::SegmArbitration
private

Definition at line 84 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and DTTriggerEfficiencyTask().

edm::EDGetTokenT<L1MuDTChambPhContainer> DTTriggerEfficiencyTask::tm_Token_
private

Definition at line 94 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and DTTriggerEfficiencyTask().

DTTrigGeomUtils* DTTriggerEfficiencyTask::trigGeomUtils
private

Definition at line 101 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), bookChamberHistos(), and dqmBeginRun().

std::map<int, std::map<std::string, MonitorElement*> > DTTriggerEfficiencyTask::wheelHistos
private

Definition at line 103 of file DTTriggerEfficiencyTask.h.

Referenced by analyze(), and bookWheelHistos().