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
DTTriggerEfficiencyTask Class Reference

#include <DTTriggerEfficiencyTask.h>

Inheritance diagram for DTTriggerEfficiencyTask:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTTriggerEfficiencyTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTTriggerEfficiencyTask ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & 
itemsToGetFromEvent () 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
 
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
< DTLocalTriggerCollection
ddu_Token_
 
bool detailedPlots
 
edm::EDGetTokenT
< L1MuGMTReadoutCollection
gmt_Token_
 
edm::InputTag inputTagSEG
 
int maxBXDDU
 
int minBXDDU
 
edm::ESHandle< DTGeometrymuonGeom
 
edm::EDGetTokenT
< reco::MuonCollection
muons_Token_
 
int nevents
 
int nMinHitsPhi
 
edm::ParameterSet parameters
 
float phiAccRange
 
bool processDDU
 
std::vector< std::string > processTags
 
bool processTM
 
std::string SegmArbitration
 
edm::EDGetTokenT
< L1MuDTChambPhContainer
tm_Token_
 
DTTrigGeomUtilstrigGeomUtils
 
std::map< int, std::map
< std::string, MonitorElement * > > 
wheelHistos
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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, edm::ParameterSet::getUntrackedParameter(), gmt_Token_, inputTagSEG, LogTrace, maxBXDDU, minBXDDU, muons_Token_, nMinHitsPhi, parameters, phiAccRange, processDDU, processTags, processTM, SegmArbitration, AlCaHLTBitMon_QueryRunRegistry::string, and tm_Token_.

43  : trigGeomUtils(0) {
44 
45  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") << "[DTTriggerEfficiencyTask]: Constructor" << endl;
46 
47  parameters = ps;
48 
49  muons_Token_ = consumes<reco::MuonCollection>(
51  tm_Token_ = consumes<L1MuDTChambPhContainer>(
53  ddu_Token_ = consumes<DTLocalTriggerCollection>(
56  gmt_Token_ = consumes<L1MuGMTReadoutCollection>(
58 
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 
74 }
T getUntrackedParameter(std::string const &, T const &) const
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 ( )
virtual

Destructor.

Definition at line 77 of file DTTriggerEfficiencyTask.cc.

References LogTrace, and nevents.

77  {
78 
79  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") << "[DTTriggerEfficiencyTask]: analyzed " << nevents << " events" << endl;
80 
81 }
#define LogTrace(id)

Member Function Documentation

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

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 121 of file DTTriggerEfficiencyTask.cc.

References reco::MuonSegmentMatch::BelongsToTrackByCleaning, reco::MuonSegmentMatch::BelongsToTrackByDR, reco::MuonSegmentMatch::BestInChamberByDR, chamberHistos, checkRPCtriggers, DTTrigGeomUtils::computeSCCoordinates(), ddu_Token_, detailedPlots, MuonSubdetId::DT, edm::Event::getByToken(), hasRPCTriggers(), RPCpg::mu, patZpeak::muons, muons_Token_, nevents, nMinHitsPhi, phiAccRange, processTags, TrackCollections2monitor_cff::quality, DetId::rawId(), SegmArbitration, relativeConstraints::station, tm_Token_, trigGeomUtils, wheelHistos, x, xdir, y, and ydir.

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

To reset the MEs.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 115 of file DTTriggerEfficiencyTask.cc.

References LogTrace.

115  {
116 
117  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<"[DTTriggerEfficiencyTask]: Begin of LS transition"<<endl;
118 
119 }
#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 294 of file DTTriggerEfficiencyTask.cc.

References DQMStore::IBooker::book2D(), chamberHistos, hlt_dqm_clientPB-live_cfg::folder, LogTrace, bookConverter::max, min(), hlt_dqm_clientPB-live_cfg::nbins, DTTrigGeomUtils::phiRange(), DetId::rawId(), SimDataFormats::CaloAnalysis::sc, DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, topFolder(), trigGeomUtils, and DTChamberId::wheel().

Referenced by bookHistograms().

295  {
296 
297  int wh = dtCh.wheel();
298  int sc = dtCh.sector();
299  int st = dtCh.station();
300  stringstream wheel; wheel << wh;
301  stringstream station; station << st;
302  stringstream sector; sector << sc;
303 
304  string hwFolder = topFolder(histoType);
305  string bookingFolder = hwFolder + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() + "/" + folder;
306  string histoTag = "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
307 
308  ibooker.setCurrentFolder(bookingFolder);
309 
310  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
311  << "[DTTriggerEfficiencyTask]: booking histos in " << bookingFolder << endl;
312 
313  float min, max;
314  int nbins;
315  trigGeomUtils->phiRange(dtCh,min,max,nbins,20);
316 
317  string histoName = histoType + "_TrackPosvsAngle" + histoTag;
318  string histoLabel = "Position vs Angle (phi)";
319 
320  (chamberHistos[dtCh.rawId()])[histoType + "_TrackPosvsAngle"] =
321  ibooker.book2D(histoName,histoLabel,12,-30.,30.,nbins,min,max);
322 
323  histoName = histoType + "_TrackPosvsAngleAnyQual" + histoTag;
324  histoLabel = "Position vs Angle (phi) for any qual triggers";
325 
326  (chamberHistos[dtCh.rawId()])[histoType + "_TrackPosvsAngleAnyQual"] =
327  ibooker.book2D(histoName,histoLabel,12,-30.,30.,nbins,min,max);
328 
329  histoName = histoType + "_TrackPosvsAngleCorr" + histoTag;
330  histoLabel = "Position vs Angle (phi) for correlated triggers";
331 
332  (chamberHistos[dtCh.rawId()])[histoType + "_TrackPosvsAngleCorr"] =
333  ibooker.book2D(histoName,histoLabel,12,-30.,30.,nbins,min,max);
334 
335 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
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:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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
tuple folder
Histograms Source for live online DQM in P5
void DTTriggerEfficiencyTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 91 of file DTTriggerEfficiencyTask.cc.

References bookChamberHistos(), bookWheelHistos(), detailedPlots, DTChamberId, LogTrace, nevents, and processTags.

93  {
94 
95  LogTrace ("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") << "[DTTriggerEfficiencyTask]: bookHistograms" << endl;
96 
97  nevents = 0;
98  for (int wh=-2;wh<=2;++wh){
99  vector<string>::const_iterator tagIt = processTags.begin();
100  vector<string>::const_iterator tagEnd = processTags.end();
101  for (; tagIt!=tagEnd; ++tagIt) {
102 
103  bookWheelHistos(ibooker,wh,(*tagIt),"Task");
104  if (detailedPlots) {
105  for (int stat=1;stat<=4;++stat){
106  for (int sect=1;sect<=12;++sect){
107  bookChamberHistos(ibooker,DTChamberId(wh,stat,sect),(*tagIt),"Segment");
108  }
109  }
110  }
111  }
112  }
113 }
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 337 of file DTTriggerEfficiencyTask.cc.

References DQMStore::IBooker::book2D(), LogTrace, hlt_dqm_clientPB-live_cfg::me, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), topFolder(), and wheelHistos.

Referenced by bookHistograms().

338  {
339 
340  stringstream wh; wh << wheel;
341  string basedir;
342  if (hTag.find("Summary") != string::npos ) {
343  basedir = topFolder(hTag); //Book summary histo outside folder directory
344  } else {
345  basedir = topFolder(hTag) + folder + "/" ;
346  }
347 
348  ibooker.setCurrentFolder(basedir);
349 
350  string hTagName = "_W" + wh.str();
351 
352  LogTrace("DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
353  << "[DTTriggerEfficiencyTask]: booking histos in "<< basedir << endl;
354 
355  string hName = hTag + "_TrigEffDenum" + hTagName;
356 
357  MonitorElement* me = ibooker.book2D(hName.c_str(),hName.c_str(),12,1,13,4,1,5);
358 
359  me->setBinLabel(1,"MB1",2);
360  me->setBinLabel(2,"MB2",2);
361  me->setBinLabel(3,"MB3",2);
362  me->setBinLabel(4,"MB4",2);
363  me->setAxisTitle("Sector",1);
364 
365  wheelHistos[wheel][hTag + "_TrigEffDenum"] = me;
366 
367  hName = hTag + "_TrigEffNum" + hTagName;
368  me = ibooker.book2D(hName.c_str(),hName.c_str(),12,1,13,4,1,5);
369 
370  me->setBinLabel(1,"MB1",2);
371  me->setBinLabel(2,"MB2",2);
372  me->setBinLabel(3,"MB3",2);
373  me->setBinLabel(4,"MB4",2);
374  me->setAxisTitle("Sector",1);
375 
376  wheelHistos[wheel][hTag + "_TrigEffNum"] = me;
377 
378  hName = hTag + "_TrigEffCorrNum" + hTagName;
379  me = ibooker.book2D(hName.c_str(),hName.c_str(),12,1,13,4,1,5);
380 
381  me->setBinLabel(1,"MB1",2);
382  me->setBinLabel(2,"MB2",2);
383  me->setBinLabel(3,"MB3",2);
384  me->setBinLabel(4,"MB4",2);
385  me->setAxisTitle("Sector",1);
386 
387  wheelHistos[wheel][hTag + "_TrigEffCorrNum"] = me;
388 
389  return;
390 }
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:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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
tuple folder
Histograms Source for live online DQM in P5
void DTTriggerEfficiencyTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
overrideprotectedvirtual

BeginRun.

Reimplemented from DQMEDAnalyzer.

Definition at line 83 of file DTTriggerEfficiencyTask.cc.

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

83  {
84 
85  // Get the geometry
86  context.get<MuonGeometryRecord>().get(muonGeom);
88 
89 }
edm::ESHandle< DTGeometry > muonGeom
const T & get() const
Definition: EventSetup.h:56
bool DTTriggerEfficiencyTask::hasRPCTriggers ( const edm::Event e)
protected

checks for RPC Triggers

Definition at line 265 of file DTTriggerEfficiencyTask.cc.

References edm::Event::getByToken(), gmt_Token_, and TrackCollections2monitor_cff::quality.

Referenced by analyze().

265  {
266 
268  e.getByToken(gmt_Token_, gmtrc);
269 
270  std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
271  std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr = gmt_records.begin();
272  std::vector<L1MuGMTReadoutRecord>::const_iterator egmtrr = gmt_records.end();
273  for(; igmtrr!=egmtrr; igmtrr++) {
274 
275  std::vector<L1MuGMTExtendedCand> candsGMT = igmtrr->getGMTCands();
276  std::vector<L1MuGMTExtendedCand>::const_iterator candGMTIt = candsGMT.begin();
277  std::vector<L1MuGMTExtendedCand>::const_iterator candGMTEnd = candsGMT.end();
278 
279  for(; candGMTIt!=candGMTEnd; ++candGMTIt){
280  if(!candGMTIt->empty()) {
281  int quality = candGMTIt->quality();
282  if(candGMTIt->bx()==0 &&
283  (quality == 5 || quality == 7)){
284  return true;
285  }
286  }
287  }
288  }
289 
290  return false;
291 
292 }
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmt_Token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
tuple quality
[pTError/pT]*max(1,normChi2) &lt;= ptErrorCut
std::string DTTriggerEfficiencyTask::topFolder ( std::string  source)
inlineprotected

return the top folder

Definition at line 72 of file DTTriggerEfficiencyTask.h.

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 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().