CMS 3D CMS Logo

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

#include <DTLocalTriggerBaseTask.h>

Inheritance diagram for DTLocalTriggerBaseTask:
DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTLocalTriggerBaseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTLocalTriggerBaseTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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 () noexcept(false) 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 Beginrun. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
 Perform trend plot operations. More...
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookHistos (DQMStore::IBooker &, const DTChamberId &chamb)
 Book the histograms. More...
 
void bookHistos (DQMStore::IBooker &, int wh)
 Book the histograms. More...
 
void runTMAnalysis (std::vector< L1MuDTChambPhDigi > const *phInTrigs, std::vector< L1MuDTChambPhDigi > const *phOutTrigs, std::vector< L1MuDTChambThDigi > const *thTrigs)
 Run analysis on TM data. More...
 
void setQLabels (MonitorElement *me, short int iaxis)
 Set Quality labels. More...
 
void setQLabelsTheta (MonitorElement *me, short int iaxis)
 
std::string & topFolder (std::string const &type)
 Get the Top folder (different between Physics and TP and TM) More...
 

Private Attributes

std::string baseFolder [2]
 
int bestAccRange
 
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
 
bool detailedAnalysis
 
MonitorElementnEventMonitor
 
int nEvents
 
int nEventsInLS
 
int nLumis
 
bool processTM
 
int targetBXTM
 
std::map< uint32_t, DTTPGCompareUnittheCompMapIn
 
std::map< uint32_t, DTTPGCompareUnittheCompMapOut
 
edm::ParameterSet theParams
 
DTTrigGeomUtilstheTrigGeomUtils
 
std::vector< std::string > theTypes
 
edm::EDGetTokenT< L1MuDTChambPhContainertm_phiIn_Token_
 
edm::EDGetTokenT< L1MuDTChambPhContainertm_phiOut_Token_
 
edm::EDGetTokenT< L1MuDTChambThContainertm_theta_Token_
 
bool tpMode
 
std::map< uint32_t, DTTimeEvolutionHisto * > trendHistos
 
edm::EDGetTokenT< DTLocalTriggerCollectiontrig_Token_
 
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
 

Friends

class DTMonitorModule
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- 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 DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 44 of file DTLocalTriggerBaseTask.h.

Constructor & Destructor Documentation

DTLocalTriggerBaseTask::DTLocalTriggerBaseTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 54 of file DTLocalTriggerBaseTask.cc.

References bestAccRange, detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, processTM, targetBXTM, theParams, theTypes, tm_phiIn_Token_, tm_phiOut_Token_, tm_theta_Token_, topFolder(), and tpMode.

55  : nEvents(0), nLumis(0), theTrigGeomUtils(nullptr) {
56  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask") << "[DTLocalTriggerBaseTask]: Constructor" << endl;
57 
58  tpMode = ps.getUntrackedParameter<bool>("testPulseMode");
59  detailedAnalysis = ps.getUntrackedParameter<bool>("detailedAnalysis");
60 
61  targetBXTM = ps.getUntrackedParameter<int>("targetBXTM");
62  bestAccRange = ps.getUntrackedParameter<int>("bestTrigAccRange");
63 
64  processTM = ps.getUntrackedParameter<bool>("processTM");
65 
66  tm_phiIn_Token_ = consumes<L1MuDTChambPhContainer>(ps.getUntrackedParameter<InputTag>("inputTagTMphIn"));
67  tm_phiOut_Token_ = consumes<L1MuDTChambPhContainer>(ps.getUntrackedParameter<InputTag>("inputTagTMphOut"));
68  tm_theta_Token_ = consumes<L1MuDTChambThContainer>(ps.getUntrackedParameter<InputTag>("inputTagTMth"));
69 
70  if (processTM)
71  theTypes.push_back("TM");
72 
73  if (tpMode) {
74  topFolder("TM") = "DT/11-LocalTriggerTP-TM/";
75  } else {
76  topFolder("TM") = "DT/03-LocalTrigger-TM/";
77  }
78 
79  theParams = ps;
80 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > theTypes
DTTrigGeomUtils * theTrigGeomUtils
edm::EDGetTokenT< L1MuDTChambThContainer > tm_theta_Token_
#define LogTrace(id)
std::string & topFolder(std::string const &type)
Get the Top folder (different between Physics and TP and TM)
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_phiIn_Token_
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_phiOut_Token_
DTLocalTriggerBaseTask::~DTLocalTriggerBaseTask ( )
override

Destructor.

Definition at line 82 of file DTLocalTriggerBaseTask.cc.

References LogTrace, nEvents, and theTrigGeomUtils.

82  {
83  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
84  << "[DTLocalTriggerBaseTask]: analyzed " << nEvents << " events" << endl;
85  if (theTrigGeomUtils) {
86  delete theTrigGeomUtils;
87  }
88 }
DTTrigGeomUtils * theTrigGeomUtils
#define LogTrace(id)

Member Function Documentation

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

Analyze.

Definition at line 145 of file DTLocalTriggerBaseTask.cc.

References dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), L1MuDTChambPhContainer::getContainer(), L1MuDTChambThContainer::getContainer(), edm::ParameterSet::getUntrackedParameter(), dtTriggerBaseTask_cfi::inputTagTM, edm::HandleBase::isValid(), nEventMonitor, nEvents, nEventsInLS, processTM, runTMAnalysis(), theCompMapIn, theCompMapOut, theParams, tm_phiIn_Token_, tm_phiOut_Token_, and tm_theta_Token_.

145  {
146  nEvents++;
147  nEventsInLS++;
149 
150  theCompMapIn.clear();
151  theCompMapOut.clear();
152 
153  Handle<L1MuDTChambPhContainer> phiInTrigsTM;
154  Handle<L1MuDTChambPhContainer> phiOutTrigsTM;
155  Handle<L1MuDTChambThContainer> thetaTrigsTM;
156 
157  if (processTM) {
159 
160  e.getByToken(tm_phiIn_Token_, phiInTrigsTM);
161  e.getByToken(tm_phiOut_Token_, phiOutTrigsTM);
162  e.getByToken(tm_theta_Token_, thetaTrigsTM);
163 
164  if (phiInTrigsTM.isValid() && phiOutTrigsTM.isValid() && thetaTrigsTM.isValid()) {
165  runTMAnalysis(phiInTrigsTM->getContainer(), phiOutTrigsTM->getContainer(), thetaTrigsTM->getContainer());
166  } else {
167  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
168  << "[DTLocalTriggerBaseTask]: one or more TM handles for Input Tag " << inputTagTM << " not found!" << endl;
169  return;
170  }
171  }
172 }
The_Container const * getContainer() const
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void Fill(long long x)
edm::EDGetTokenT< L1MuDTChambThContainer > tm_theta_Token_
void runTMAnalysis(std::vector< L1MuDTChambPhDigi > const *phInTrigs, std::vector< L1MuDTChambPhDigi > const *phOutTrigs, std::vector< L1MuDTChambThDigi > const *thTrigs)
Run analysis on TM data.
bool isValid() const
Definition: HandleBase.h:70
std::map< uint32_t, DTTPGCompareUnit > theCompMapIn
Phi_Container const * getContainer() const
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_phiIn_Token_
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_phiOut_Token_
std::map< uint32_t, DTTPGCompareUnit > theCompMapOut
void DTLocalTriggerBaseTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

To reset the MEs.

Definition at line 104 of file DTLocalTriggerBaseTask.cc.

References chamberHistos, edm::ParameterSet::getUntrackedParameter(), LogTrace, nEventsInLS, nLumis, and theParams.

104  {
105  nEventsInLS = 0;
106  nLumis++;
107  int resetCycle = theParams.getUntrackedParameter<int>("ResetCycle");
108 
109  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
110  << "[DTLocalTriggerBaseTask]: Begin of LS transition" << endl;
111 
112  if (nLumis % resetCycle == 0) {
113  map<uint32_t, map<string, MonitorElement*> >::const_iterator chambIt = chamberHistos.begin();
114  map<uint32_t, map<string, MonitorElement*> >::const_iterator chambEnd = chamberHistos.end();
115  for (; chambIt != chambEnd; ++chambIt) {
116  map<string, MonitorElement*>::const_iterator histoIt = chambIt->second.begin();
117  map<string, MonitorElement*>::const_iterator histoEnd = chambIt->second.end();
118  for (; histoIt != histoEnd; ++histoIt) {
119  histoIt->second->Reset();
120  }
121  }
122  }
123 }
T getUntrackedParameter(std::string const &, T const &) const
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
#define LogTrace(id)
void DTLocalTriggerBaseTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprivatevirtual

Implements DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 90 of file DTLocalTriggerBaseTask.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::bookFloat(), bookHistos(), nEventMonitor, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), and hgcalPlots::stat.

Referenced by topFolder().

92  {
93  ibooker.setCurrentFolder("DT/EventInfo/Counters");
94  nEventMonitor = ibooker.bookFloat("nProcessedEventsTrigger");
95  for (int wh = -2; wh < 3; ++wh) {
96  for (int stat = 1; stat < 5; ++stat) {
97  for (int sect = 1; sect < 13; ++sect) {
98  bookHistos(ibooker, DTChamberId(wh, stat, sect));
99  }
100  }
101  }
102 }
void bookHistos(DQMStore::IBooker &, const DTChamberId &chamb)
Book the histograms.
void DTLocalTriggerBaseTask::bookHistos ( DQMStore::IBooker ibooker,
const DTChamberId chamb 
)
private

Book the histograms.

Definition at line 174 of file DTLocalTriggerBaseTask.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), chamberHistos, detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), dtResolutionTest_cfi::histoTag, LogTrace, simKBmtfStubs_cfi::maxBX, simKBmtfStubs_cfi::minBX, DTTrigGeomUtils::phiRange(), DetId::rawId(), DTChamberId::sector(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), setQLabels(), setQLabelsTheta(), DTChamberId::station(), relativeConstraints::station, theParams, theTrigGeomUtils, theTypes, topFolder(), tpMode, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms(), and topFolder().

174  {
175  uint32_t rawId = dtCh.rawId();
176 
177  stringstream wheel;
178  wheel << dtCh.wheel();
179  stringstream station;
180  station << dtCh.station();
181  stringstream sector;
182  sector << dtCh.sector();
183 
184  map<string, int> minBX;
185  map<string, int> maxBX;
186 
187  minBX["TM"] = theParams.getUntrackedParameter<int>("minBXTM");
188  maxBX["TM"] = theParams.getUntrackedParameter<int>("maxBXTM");
189 
190  string chTag = "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
191  string labelInOut = "";
192 
193  vector<string>::const_iterator typeIt = theTypes.begin();
194  vector<string>::const_iterator typeEnd = theTypes.end();
195 
196  for (; typeIt != typeEnd; ++typeIt) {
197  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
198  << "[DTLocalTriggerBaseTask]: booking histos for " << topFolder((*typeIt)) << "Wheel" << wheel.str()
199  << "/Sector" << sector.str() << "/Station" << station.str() << endl;
200 
201  for (int InOut = 0; InOut < 2; InOut++) {
202  // Book Phi View Related Plots
203 
204  if (InOut == 0) {
205  ibooker.setCurrentFolder(topFolder(*typeIt) + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" +
206  station.str() + "/LocalTriggerPhiIn");
207  labelInOut = "_In";
208  } else if (InOut == 1) {
209  ibooker.setCurrentFolder(topFolder(*typeIt) + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" +
210  station.str() + "/LocalTriggerPhiOut");
211  labelInOut = "_Out";
212  }
213 
214  string histoTag = (*typeIt) + "_BXvsQual" + labelInOut;
215  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag + chTag,
216  "BX vs trigger quality",
217  7,
218  -0.5,
219  6.5,
220  (int)(maxBX[(*typeIt)] - minBX[*typeIt] + 1),
221  minBX[*typeIt] - .5,
222  maxBX[*typeIt] + .5);
223  setQLabels((chamberHistos[rawId])[histoTag], 1);
224 
225  if (!tpMode) {
226  histoTag = (*typeIt) + "_BestQual" + labelInOut;
227  chamberHistos[rawId][histoTag] =
228  ibooker.book1D(histoTag + chTag, "Trigger quality of best primitives", 7, -0.5, 6.5);
229  setQLabels(chamberHistos[rawId][histoTag], 1);
230 
231  histoTag = (*typeIt) + "_Flag1stvsQual" + labelInOut;
232  chamberHistos[dtCh.rawId()][histoTag] =
233  ibooker.book2D(histoTag + chTag, "1st/2nd trig flag vs quality", 7, -0.5, 6.5, 2, -0.5, 1.5);
234  setQLabels(chamberHistos[rawId][histoTag], 1);
235 
236  histoTag = (*typeIt) + "_FlagUpDownvsQual" + labelInOut;
237  chamberHistos[dtCh.rawId()][histoTag] =
238  ibooker.book2D(histoTag + chTag, "Up/Down trig flag vs quality", 7, -0.5, 6.5, 2, -0.5, 1.5);
239  setQLabels(chamberHistos[rawId][histoTag], 1);
240  }
241 
242  if (*typeIt == "TM") {
243  float minPh, maxPh;
244  int nBinsPh;
245  theTrigGeomUtils->phiRange(dtCh, minPh, maxPh, nBinsPh);
246 
247  histoTag = (*typeIt) + "_QualvsPhirad" + labelInOut;
248  chamberHistos[rawId][histoTag] =
249  ibooker.book2D(histoTag + chTag, "Trigger quality vs local position", nBinsPh, minPh, maxPh, 7, -0.5, 6.5);
250  setQLabels(chamberHistos[rawId][histoTag], 2);
251 
252  if (detailedAnalysis && !tpMode) {
253  histoTag = (*typeIt) + "_QualvsPhibend" + labelInOut;
254  chamberHistos[rawId][histoTag] =
255  ibooker.book2D(histoTag + chTag, "Trigger quality vs local direction", 200, -40., 40., 7, -0.5, 6.5);
256  setQLabels((chamberHistos[dtCh.rawId()])[histoTag], 2);
257  }
258  }
259  } //InOut loop
260 
261  // Book Theta View Related Plots
262  ibooker.setCurrentFolder(topFolder(*typeIt) + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" +
263  station.str() + "/LocalTriggerTheta");
264 
265  string histoTag = "";
266  if ((*typeIt) == "TM" && dtCh.station() != 4) {
267  histoTag = (*typeIt) + "_PositionvsBX";
268  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag + chTag,
269  "Theta trigger position vs BX",
270  (int)(maxBX[(*typeIt)] - minBX[*typeIt] + 1),
271  minBX[*typeIt] - .5,
272  maxBX[*typeIt] + .5,
273  7,
274  -0.5,
275  6.5);
276  histoTag = (*typeIt) + "_PositionvsQual";
277  chamberHistos[rawId][histoTag] =
278  ibooker.book2D(histoTag + chTag, "Theta trigger position vs quality", 2, 0.5, 2.5, 7, -0.5, 6.5);
279  setQLabelsTheta(chamberHistos[rawId][histoTag], 1);
280  histoTag = (*typeIt) + "_ThetaBXvsQual";
281  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag + chTag,
282  "BX vs trigger quality",
283  2,
284  0.5,
285  2.5,
286  (int)(maxBX[(*typeIt)] - minBX[*typeIt] + 1),
287  minBX[*typeIt] - .5,
288  maxBX[*typeIt] + .5);
289  setQLabelsTheta(chamberHistos[rawId][histoTag], 1);
290  // histoTag = (*typeIt) + "_ThetaBestQual";
291  // chamberHistos[rawId][histoTag] = ibooker.book1D(histoTag+chTag,
292  // "Trigger quality of best primitives (theta)",2,0.5,2.5); // 0 = not fired, 1 = L, 2 = H
293  // setQLabelsTheta(chamberHistos[rawId][histoTag],1);
294  } else {
295  if (dtCh.station() != 4) {
296  histoTag = (*typeIt) + "_ThetaBXvsQual";
297  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag + chTag,
298  "BX vs trigger quality",
299  7,
300  -0.5,
301  6.5,
302  (int)(maxBX[(*typeIt)] - minBX[*typeIt] + 1),
303  minBX[*typeIt] - .5,
304  maxBX[*typeIt] + .5);
305  setQLabels((chamberHistos[dtCh.rawId()])[histoTag], 1);
306 
307  histoTag = (*typeIt) + "_ThetaBestQual";
308  chamberHistos[rawId][histoTag] =
309  ibooker.book1D(histoTag + chTag, "Trigger quality of best primitives (theta)", 7, -0.5, 6.5);
310  setQLabels((chamberHistos[dtCh.rawId()])[histoTag], 1);
311  }
312  }
313  }
314 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > theTypes
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
DTTrigGeomUtils * theTrigGeomUtils
#define LogTrace(id)
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
std::string & topFolder(std::string const &type)
Get the Top folder (different between Physics and TP and TM)
void setQLabelsTheta(MonitorElement *me, short int iaxis)
void setQLabels(MonitorElement *me, short int iaxis)
Set Quality labels.
void DTLocalTriggerBaseTask::bookHistos ( DQMStore::IBooker ,
int  wh 
)
private

Book the histograms.

void DTLocalTriggerBaseTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
overrideprotected

Beginrun.

Definition at line 137 of file DTLocalTriggerBaseTask.cc.

References edm::EventSetup::get(), LogTrace, and theTrigGeomUtils.

137  {
138  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask") << "[DTLocalTriggerBaseTask]: BeginRun" << endl;
139 
140  ESHandle<DTGeometry> theGeom;
141  context.get<MuonGeometryRecord>().get(theGeom);
142  theTrigGeomUtils = new DTTrigGeomUtils(theGeom);
143 }
DTTrigGeomUtils * theTrigGeomUtils
#define LogTrace(id)
T get() const
Definition: EventSetup.h:73
void DTLocalTriggerBaseTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

Perform trend plot operations.

Definition at line 125 of file DTLocalTriggerBaseTask.cc.

References gather_cfg::cout, LogTrace, edm::LuminosityBlockBase::luminosityBlock(), nEventsInLS, and trendHistos.

125  {
126  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask") << "[DTLocalTriggerBaseTask]: End of LS transition" << endl;
127 
128  map<uint32_t, DTTimeEvolutionHisto*>::const_iterator chambIt = trendHistos.begin();
129  map<uint32_t, DTTimeEvolutionHisto*>::const_iterator chambEnd = trendHistos.end();
130  for (; chambIt != chambEnd; ++chambIt) {
131  cout << "updating time slot in DTLocalTriggerBaseTask" << endl;
132  chambIt->second->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
133  cout << "updated time slot in DTLocalTriggerBaseTask" << endl;
134  }
135 }
std::map< uint32_t, DTTimeEvolutionHisto * > trendHistos
LuminosityBlockNumber_t luminosityBlock() const
#define LogTrace(id)
void DTLocalTriggerBaseTask::runTMAnalysis ( std::vector< L1MuDTChambPhDigi > const *  phInTrigs,
std::vector< L1MuDTChambPhDigi > const *  phOutTrigs,
std::vector< L1MuDTChambThDigi > const *  thTrigs 
)
private

Run analysis on TM data.

Definition at line 316 of file DTLocalTriggerBaseTask.cc.

References funct::abs(), bestAccRange, l1GtPatternGenerator_cfi::bx, chamberHistos, detailedAnalysis, DeadROC_duringRun::dir, DetId::rawId(), fileinputsource_cfi::sec, targetBXTM, theCompMapIn, theCompMapOut, theTrigGeomUtils, tpMode, DTTrigGeomUtils::trigDir(), and DTTrigGeomUtils::trigPos().

Referenced by analyze().

318  {
319  vector<L1MuDTChambPhDigi>::const_iterator iph = phInTrigs->begin();
320  vector<L1MuDTChambPhDigi>::const_iterator iphe = phInTrigs->end();
321 
322  for (; iph != iphe; ++iph) {
323  int wh = iph->whNum();
324  int sec = iph->scNum() + 1; // DTTF->DT Convention
325  int st = iph->stNum();
326  int qual = iph->code();
327  int is1st = iph->Ts2Tag() ? 1 : 0;
328  int bx = iph->bxNum() - is1st;
329  int updown = iph->UpDownTag();
330 
331  if (qual < 0 || qual > 6)
332  continue; // Check that quality is in a valid range
333 
334  DTChamberId dtChId(wh, st, sec);
335  uint32_t rawId = dtChId.rawId();
336 
337  float pos = theTrigGeomUtils->trigPos(&(*iph));
338  float dir = theTrigGeomUtils->trigDir(&(*iph));
339 
340  if (abs(bx - targetBXTM) <= bestAccRange && theCompMapIn[rawId].qualTM() <= qual)
341  theCompMapIn[rawId].setTM(qual, bx);
342 
343  map<string, MonitorElement*>& innerME = chamberHistos[rawId];
344  if (tpMode) {
345  innerME["TM_BXvsQual_In"]->Fill(qual, bx); // SM BX vs Qual Phi view (1st tracks)
346  innerME["TM_QualvsPhirad_In"]->Fill(pos, qual); // SM Qual vs radial angle Phi view
347  } else {
348  innerME["TM_BXvsQual_In"]->Fill(qual, bx); // SM BX vs Qual Phi view (1st tracks)
349  innerME["TM_Flag1stvsQual_In"]->Fill(qual, is1st); // SM Qual 1st/2nd track flag Phi view
350  innerME["TM_FlagUpDownvsQual_In"]->Fill(qual, updown); // SM Qual Up/Down track flag Phi view
351  if (!is1st)
352  innerME["TM_QualvsPhirad_In"]->Fill(pos, qual); // SM Qual vs radial angle Phi view ONLY for 1st tracks
353  if (detailedAnalysis) {
354  innerME["TM_QualvsPhibend_In"]->Fill(dir, qual); // SM Qual vs bending Phi view
355  }
356  }
357  }
358 
359  iph = phOutTrigs->begin();
360  iphe = phOutTrigs->end();
361 
362  for (; iph != iphe; ++iph) {
363  int wh = iph->whNum();
364  int sec = iph->scNum() + 1; // DTTF->DT Convention
365  int st = iph->stNum();
366  int qual = iph->code();
367  int is1st = iph->Ts2Tag() ? 1 : 0;
368  int bx = iph->bxNum() - is1st;
369  int updown = iph->UpDownTag();
370  if (qual < 0 || qual > 6)
371  continue; // Check that quality is in a valid range
372 
373  DTChamberId dtChId(wh, st, sec);
374  uint32_t rawId = dtChId.rawId();
375 
376  float pos = theTrigGeomUtils->trigPos(&(*iph));
377  float dir = theTrigGeomUtils->trigDir(&(*iph));
378 
379  if (abs(bx - targetBXTM) <= bestAccRange && theCompMapOut[rawId].qualTM() <= qual)
380  theCompMapOut[rawId].setTM(qual, bx);
381 
382  map<string, MonitorElement*>& innerME = chamberHistos[rawId];
383  if (tpMode) {
384  innerME["TM_BXvsQual_Out"]->Fill(qual, bx); // SM BX vs Qual Phi view (1st tracks)
385  innerME["TM_QualvsPhirad_Out"]->Fill(pos, qual); // SM Qual vs radial angle Phi view
386  } else {
387  innerME["TM_BXvsQual_Out"]->Fill(qual, bx); // SM BX vs Qual Phi view (1st tracks)
388  innerME["TM_Flag1stvsQual_Out"]->Fill(qual, is1st); // SM Qual 1st/2nd track flag Phi view
389  innerME["TM_FlagUpDownvsQual_Out"]->Fill(qual, updown); // SM Qual Up/Down track flag Phi view
390 
391  if (!is1st)
392  innerME["TM_QualvsPhirad_Out"]->Fill(pos, qual); // SM Qual vs radial angle Phi view ONLY for 1st tracks
393  if (detailedAnalysis) {
394  innerME["TM_QualvsPhibend_Out"]->Fill(dir, qual); // SM Qual vs bending Phi view
395  }
396  }
397  }
398 
399  vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin();
400  vector<L1MuDTChambThDigi>::const_iterator ithe = thTrigs->end();
401 
402  for (; ith != ithe; ++ith) {
403  int wh = ith->whNum();
404  int sec = ith->scNum() + 1; // DTTF -> DT Convention
405  int st = ith->stNum();
406  int bx = ith->bxNum();
407 
408  int thcode[7];
409 
410  for (int pos = 0; pos < 7; pos++)
411  thcode[pos] = ith->code(pos);
412 
413  DTChamberId dtChId(wh, st, sec);
414  uint32_t rawId = dtChId.rawId();
415 
416  map<string, MonitorElement*>& innerME = chamberHistos[rawId];
417 
418  for (int pos = 0; pos < 7; pos++)
419  if (thcode[pos] > 0) { //Fired
420  innerME["TM_PositionvsBX"]->Fill(bx, pos); // SM BX vs Position Theta view
421  innerME["TM_PositionvsQual"]->Fill(thcode[pos], pos); //code = pos + qual; so 0, 1, 2 for 0, L, H resp.
422  innerME["TM_ThetaBXvsQual"]->Fill(thcode[pos], bx); //code = pos + qual; so 0, 1, 2 for 0, L, H resp.
423  }
424  }
425  // Fill Quality plots with best TM triggers (phi view In)
426  if (!tpMode) {
427  map<uint32_t, DTTPGCompareUnit>::const_iterator compIt = theCompMapIn.begin();
428  map<uint32_t, DTTPGCompareUnit>::const_iterator compEnd = theCompMapIn.end();
429  for (; compIt != compEnd; ++compIt) {
430  int bestQual = compIt->second.qualTM();
431  if (bestQual > -1)
432  chamberHistos[compIt->first]["TM_BestQual_In"]->Fill(bestQual); // SM Best Qual Trigger Phi view
433  }
434  }
435 
436  // Fill Quality plots with best TM triggers (phi view Out)
437  if (!tpMode) {
438  map<uint32_t, DTTPGCompareUnit>::const_iterator compIt = theCompMapOut.begin();
439  map<uint32_t, DTTPGCompareUnit>::const_iterator compEnd = theCompMapOut.end();
440  for (; compIt != compEnd; ++compIt) {
441  int bestQual = compIt->second.qualTM();
442  if (bestQual > -1)
443  chamberHistos[compIt->first]["TM_BestQual_Out"]->Fill(bestQual); // SM Best Qual Trigger Phi view
444  }
445  }
446 }
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
DTTrigGeomUtils * theTrigGeomUtils
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::map< uint32_t, DTTPGCompareUnit > theCompMapIn
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
std::map< uint32_t, DTTPGCompareUnit > theCompMapOut
void DTLocalTriggerBaseTask::setQLabels ( MonitorElement me,
short int  iaxis 
)
private

Set Quality labels.

Definition at line 448 of file DTLocalTriggerBaseTask.cc.

References dqm::impl::MonitorElement::getTH1(), timingPdfMaker::histo, mps_fire::i, and SummaryClient_cfi::labels.

Referenced by bookHistos(), and topFolder().

448  {
449  TH1* histo = me->getTH1();
450  if (!histo)
451  return;
452 
453  TAxis* axis = nullptr;
454  if (iaxis == 1) {
455  axis = histo->GetXaxis();
456  } else if (iaxis == 2) {
457  axis = histo->GetYaxis();
458  }
459  if (!axis)
460  return;
461 
462  string labels[7] = {"LI", "LO", "HI", "HO", "LL", "HL", "HH"};
463  int istart = axis->GetXmin() < -1 ? 2 : 1;
464  for (int i = 0; i < 7; i++) {
465  axis->SetBinLabel(i + istart, labels[i].c_str());
466  }
467 }
virtual TH1 * getTH1() const
void DTLocalTriggerBaseTask::setQLabelsTheta ( MonitorElement me,
short int  iaxis 
)
private

Definition at line 469 of file DTLocalTriggerBaseTask.cc.

References dqm::impl::MonitorElement::getTH1(), timingPdfMaker::histo, mps_fire::i, and SummaryClient_cfi::labels.

Referenced by bookHistos(), and topFolder().

469  {
470  TH1* histo = me->getTH1();
471  if (!histo)
472  return;
473 
474  TAxis* axis = nullptr;
475  if (iaxis == 1) {
476  axis = histo->GetXaxis();
477  } else if (iaxis == 2) {
478  axis = histo->GetYaxis();
479  }
480  if (!axis)
481  return;
482 
483  string labels[2] = {"L", "H"};
484  int istart = axis->GetXmin() < -1 ? 2 : 1;
485  for (int i = 0; i < 2; i++) {
486  axis->SetBinLabel(i + istart, labels[i].c_str());
487  }
488 }
virtual TH1 * getTH1() const
std::string& DTLocalTriggerBaseTask::topFolder ( std::string const &  type)
inlineprivate

Get the Top folder (different between Physics and TP and TM)

Definition at line 74 of file DTLocalTriggerBaseTask.h.

References baseFolder, bookHistograms(), bookHistos(), hlt_dqm_clientPB-live_cfg::me, setQLabels(), and setQLabelsTheta().

Referenced by bookHistos(), and DTLocalTriggerBaseTask().

74 { return baseFolder[type == "TM"]; }
type
Definition: HCALResponse.h:21

Friends And Related Function Documentation

friend class DTMonitorModule
friend

Definition at line 45 of file DTLocalTriggerBaseTask.h.

Member Data Documentation

std::string DTLocalTriggerBaseTask::baseFolder[2]
private

Definition at line 92 of file DTLocalTriggerBaseTask.h.

Referenced by topFolder().

int DTLocalTriggerBaseTask::bestAccRange
private

Definition at line 98 of file DTLocalTriggerBaseTask.h.

Referenced by DTLocalTriggerBaseTask(), and runTMAnalysis().

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

Definition at line 107 of file DTLocalTriggerBaseTask.h.

Referenced by beginLuminosityBlock(), bookHistos(), and runTMAnalysis().

bool DTLocalTriggerBaseTask::detailedAnalysis
private

Definition at line 94 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), DTLocalTriggerBaseTask(), and runTMAnalysis().

MonitorElement* DTLocalTriggerBaseTask::nEventMonitor
private

Definition at line 109 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and bookHistograms().

int DTLocalTriggerBaseTask::nEvents
private

Definition at line 88 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), looper.Looper::loop(), and ~DTLocalTriggerBaseTask().

int DTLocalTriggerBaseTask::nEventsInLS
private

Definition at line 89 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), beginLuminosityBlock(), and endLuminosityBlock().

int DTLocalTriggerBaseTask::nLumis
private

Definition at line 90 of file DTLocalTriggerBaseTask.h.

Referenced by beginLuminosityBlock().

bool DTLocalTriggerBaseTask::processTM
private

Definition at line 95 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

int DTLocalTriggerBaseTask::targetBXTM
private

Definition at line 97 of file DTLocalTriggerBaseTask.h.

Referenced by DTLocalTriggerBaseTask(), and runTMAnalysis().

std::map<uint32_t, DTTPGCompareUnit> DTLocalTriggerBaseTask::theCompMapIn
private

Definition at line 104 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and runTMAnalysis().

std::map<uint32_t, DTTPGCompareUnit> DTLocalTriggerBaseTask::theCompMapOut
private

Definition at line 105 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and runTMAnalysis().

edm::ParameterSet DTLocalTriggerBaseTask::theParams
private
DTTrigGeomUtils* DTLocalTriggerBaseTask::theTrigGeomUtils
private
std::vector<std::string> DTLocalTriggerBaseTask::theTypes
private

Definition at line 102 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), and DTLocalTriggerBaseTask().

edm::EDGetTokenT<L1MuDTChambPhContainer> DTLocalTriggerBaseTask::tm_phiIn_Token_
private

Definition at line 111 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

edm::EDGetTokenT<L1MuDTChambPhContainer> DTLocalTriggerBaseTask::tm_phiOut_Token_
private

Definition at line 112 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

edm::EDGetTokenT<L1MuDTChambThContainer> DTLocalTriggerBaseTask::tm_theta_Token_
private

Definition at line 113 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

bool DTLocalTriggerBaseTask::tpMode
private

Definition at line 93 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), DTLocalTriggerBaseTask(), and runTMAnalysis().

std::map<uint32_t, DTTimeEvolutionHisto*> DTLocalTriggerBaseTask::trendHistos
private

Definition at line 108 of file DTLocalTriggerBaseTask.h.

Referenced by endLuminosityBlock().

edm::EDGetTokenT<DTLocalTriggerCollection> DTLocalTriggerBaseTask::trig_Token_
private

Definition at line 114 of file DTLocalTriggerBaseTask.h.

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

Definition at line 106 of file DTLocalTriggerBaseTask.h.