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 Member Functions | Private Attributes | Friends
DTLocalTriggerBaseTask Class Reference

#include <DTLocalTriggerBaseTask.h>

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

Public Member Functions

 DTLocalTriggerBaseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTLocalTriggerBaseTask ()
 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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 To reset the MEs. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &)
 Beginrun. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 Perform trend plot operations. 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 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 runDDUAnalysis (edm::Handle< DTLocalTriggerCollection > &trigsDDU)
 Run analysis on ROS data. More...
 
void runDDUvsTMAnalysis ()
 Run analysis on ROS data. More...
 
void runTMAnalysis (std::vector< L1MuDTChambPhDigi > const *phTrigs, std::vector< L1MuDTChambThDigi > const *thTrigs)
 Run analysis on TM data. More...
 
void setQLabels (MonitorElement *me, short int iaxis)
 Set Quality labels. More...
 
std::string & topFolder (std::string const &type)
 Get the Top folder (different between Physics and TP and TM/DDU) More...
 

Private Attributes

std::string baseFolder [2]
 
int bestAccRange
 
std::map< uint32_t, std::map
< std::string, MonitorElement * > > 
chamberHistos
 
edm::EDGetTokenT
< L1MuDTChambPhContainer
dcc_phi_Token_
 
edm::EDGetTokenT
< L1MuDTChambThContainer
dcc_theta_Token_
 
bool detailedAnalysis
 
MonitorElementnEventMonitor
 
int nEvents
 
int nEventsInLS
 
int nLumis
 
bool processDDU
 
bool processTM
 
int targetBXDDU
 
int targetBXTM
 
std::map< uint32_t,
DTTPGCompareUnit
theCompMap
 
edm::ParameterSet theParams
 
DTTrigGeomUtilstheTrigGeomUtils
 
std::vector< std::string > theTypes
 
bool tpMode
 
std::map< uint32_t,
DTTimeEvolutionHisto * > 
trendHistos
 
edm::EDGetTokenT
< DTLocalTriggerCollection
trig_Token_
 
std::map< int, std::map
< std::string, MonitorElement * > > 
wheelHistos
 

Friends

class DTMonitorModule
 

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 DTLocalTriggerBaseTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 63 of file DTLocalTriggerBaseTask.cc.

References bestAccRange, dcc_phi_Token_, dcc_theta_Token_, detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, processDDU, processTM, targetBXDDU, targetBXTM, theParams, theTypes, topFolder(), tpMode, and trig_Token_.

63  :
64  nEvents(0), nLumis(0), theTrigGeomUtils(0) {
65 
66  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
67  << "[DTLocalTriggerBaseTask]: Constructor"<<endl;
68 
69  tpMode = ps.getUntrackedParameter<bool>("testPulseMode");
70  detailedAnalysis = ps.getUntrackedParameter<bool>("detailedAnalysis");
71 
72  targetBXTM = ps.getUntrackedParameter<int>("targetBXTM");
73  targetBXDDU = ps.getUntrackedParameter<int>("targetBXDDU");
74  bestAccRange = ps.getUntrackedParameter<int>("bestTrigAccRange");
75 
76  processTM = ps.getUntrackedParameter<bool>("processTM");
77  processDDU = ps.getUntrackedParameter<bool>("processDDU");
78 
79  dcc_phi_Token_ = consumes<L1MuDTChambPhContainer>(
80  ps.getUntrackedParameter<InputTag>("inputTagTM"));
81  dcc_theta_Token_ = consumes<L1MuDTChambThContainer>(
82  ps.getUntrackedParameter<InputTag>("inputTagTM"));
83  trig_Token_ = consumes<DTLocalTriggerCollection>(
84  ps.getUntrackedParameter<InputTag>("inputTagDDU"));
85 
86  if (processTM) theTypes.push_back("TM");
87  if (processDDU) theTypes.push_back("DDU");
88 
89  if (tpMode) {
90  topFolder("TM") = "DT/11-LocalTriggerTP-TM/";
91  topFolder("DDU") = "DT/12-LocalTriggerTP-DDU/";
92  } else {
93  topFolder("TM") = "DT/03-LocalTrigger-TM/";
94  topFolder("DDU") = "DT/04-LocalTrigger-DDU/";
95  }
96 
97  theParams = ps;
98 
99 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > theTypes
DTTrigGeomUtils * theTrigGeomUtils
edm::EDGetTokenT< L1MuDTChambThContainer > dcc_theta_Token_
edm::EDGetTokenT< DTLocalTriggerCollection > trig_Token_
#define LogTrace(id)
std::string & topFolder(std::string const &type)
Get the Top folder (different between Physics and TP and TM/DDU)
edm::EDGetTokenT< L1MuDTChambPhContainer > dcc_phi_Token_
DTLocalTriggerBaseTask::~DTLocalTriggerBaseTask ( )
virtual

Destructor.

Definition at line 102 of file DTLocalTriggerBaseTask.cc.

References LogTrace, nEvents, and theTrigGeomUtils.

102  {
103 
104  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
105  << "[DTLocalTriggerBaseTask]: analyzed " << nEvents << " events" << endl;
106  if (theTrigGeomUtils) { delete theTrigGeomUtils; }
107 
108 }
DTTrigGeomUtils * theTrigGeomUtils
#define LogTrace(id)

Member Function Documentation

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

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 174 of file DTLocalTriggerBaseTask.cc.

References dcc_phi_Token_, dcc_theta_Token_, MonitorElement::Fill(), edm::Event::getByToken(), edm::ParameterSet::getUntrackedParameter(), edm::HandleBase::isValid(), nEventMonitor, nEvents, nEventsInLS, processDDU, processTM, runDDUAnalysis(), runDDUvsTMAnalysis(), runTMAnalysis(), theCompMap, theParams, and trig_Token_.

174  {
175 
176  nEvents++;
177  nEventsInLS++;
179 
180  theCompMap.clear();
181 
183  Handle<L1MuDTChambThContainer> thetaTrigsTM;
185 
186  if (processTM) {
187  InputTag inputTagTM = theParams.getUntrackedParameter<InputTag>("inputTagTM");
188 
189  e.getByToken(dcc_phi_Token_, phiTrigsTM);
190  e.getByToken(dcc_theta_Token_, thetaTrigsTM);
191 
192  if (phiTrigsTM.isValid() && thetaTrigsTM.isValid()) {
193  runTMAnalysis(phiTrigsTM->getContainer(),thetaTrigsTM->getContainer());
194  } else {
195  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
196  << "[DTLocalTriggerBaseTask]: one or more TM handles for Input Tag "
197  << inputTagTM <<" not found!" << endl;
198  return;
199  }
200  }
201 
202  if (processDDU) {
203  InputTag inputTagDDU = theParams.getUntrackedParameter<InputTag>("inputTagDDU");
204  e.getByToken(trig_Token_, trigsDDU);
205 
206  if (trigsDDU.isValid()) {
207  runDDUAnalysis(trigsDDU);
208  } else {
209  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
210  << "[DTLocalTriggerBaseTask]: one or more DDU handles for Input Tag "
211  << inputTagDDU <<" not found!" << endl;
212  return;
213  }
214  }
215 
216  if (processTM && processDDU)
218 
219 }
T getUntrackedParameter(std::string const &, T const &) const
void runDDUvsTMAnalysis()
Run analysis on ROS data.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
void Fill(long long x)
edm::EDGetTokenT< L1MuDTChambThContainer > dcc_theta_Token_
edm::EDGetTokenT< DTLocalTriggerCollection > trig_Token_
bool isValid() const
Definition: HandleBase.h:75
std::map< uint32_t, DTTPGCompareUnit > theCompMap
void runTMAnalysis(std::vector< L1MuDTChambPhDigi > const *phTrigs, std::vector< L1MuDTChambThDigi > const *thTrigs)
Run analysis on TM data.
void runDDUAnalysis(edm::Handle< DTLocalTriggerCollection > &trigsDDU)
Run analysis on ROS data.
edm::EDGetTokenT< L1MuDTChambPhContainer > dcc_phi_Token_
void DTLocalTriggerBaseTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

To reset the MEs.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 125 of file DTLocalTriggerBaseTask.cc.

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

125  {
126 
127  nEventsInLS=0;
128  nLumis++;
129  int resetCycle = theParams.getUntrackedParameter<int>("ResetCycle");
130 
131  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
132  << "[DTLocalTriggerBaseTask]: Begin of LS transition" << endl;
133 
134  if( nLumis%resetCycle == 0 ) {
135  map<uint32_t,map<string,MonitorElement*> >::const_iterator chambIt = chamberHistos.begin();
136  map<uint32_t,map<string,MonitorElement*> >::const_iterator chambEnd = chamberHistos.end();
137  for(;chambIt!=chambEnd;++chambIt) {
138  map<string,MonitorElement*>::const_iterator histoIt = chambIt->second.begin();
139  map<string,MonitorElement*>::const_iterator histoEnd = chambIt->second.end();
140  for(;histoIt!=histoEnd;++histoIt) {
141  histoIt->second->Reset();
142  }
143  }
144  }
145 
146 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
void DTLocalTriggerBaseTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 110 of file DTLocalTriggerBaseTask.cc.

References DQMStore::IBooker::bookFloat(), bookHistos(), DTChamberId, nEventMonitor, and DQMStore::IBooker::setCurrentFolder().

110  {
111 
112  ibooker.setCurrentFolder("DT/EventInfo/Counters");
113  nEventMonitor = ibooker.bookFloat("nProcessedEventsTrigger");
114  for (int wh=-2;wh<3;++wh){
115  for (int stat=1;stat<5;++stat){
116  for (int sect=1;sect<13;++sect){
117  bookHistos(ibooker, DTChamberId(wh,stat,sect));
118  }
119  }
120  bookHistos(ibooker, wh);
121  }
122 }
void bookHistos(DQMStore::IBooker &, const DTChamberId &chamb)
Book the histograms.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
void DTLocalTriggerBaseTask::bookHistos ( DQMStore::IBooker ibooker,
const DTChamberId chamb 
)
private

Book the histograms.

Definition at line 222 of file DTLocalTriggerBaseTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), chamberHistos, detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, DTTrigGeomUtils::phiRange(), processDDU, processTM, DetId::rawId(), DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), setQLabels(), DTChamberId::station(), relativeConstraints::station, theParams, theTrigGeomUtils, theTypes, topFolder(), tpMode, trendHistos, and DTChamberId::wheel().

Referenced by bookHistograms().

222  {
223 
224  uint32_t rawId = dtCh.rawId();
225 
226  stringstream wheel; wheel << dtCh.wheel();
227  stringstream station; station << dtCh.station();
228  stringstream sector; sector << dtCh.sector();
229 
230  map<string,int> minBX;
231  map<string,int> maxBX;
232 
233  minBX["TM"] = theParams.getUntrackedParameter<int>("minBXTM");
234  maxBX["TM"] = theParams.getUntrackedParameter<int>("maxBXTM");
235  minBX["DDU"] = theParams.getUntrackedParameter<int>("minBXDDU");
236  maxBX["DDU"] = theParams.getUntrackedParameter<int>("maxBXDDU");
237 
238  int nTimeBins = theParams.getUntrackedParameter<int>("nTimeBins");
239  int nLSTimeBin = theParams.getUntrackedParameter<int>("nLSTimeBin");
240 
241  string chTag = "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
242 
243  vector<string>::const_iterator typeIt = theTypes.begin();
244  vector<string>::const_iterator typeEnd = theTypes.end();
245 
246  for (; typeIt!=typeEnd; ++typeIt) {
247 
248  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
249  << "[DTLocalTriggerBaseTask]: booking histos for " << topFolder((*typeIt)) << "Wheel"
250  << wheel.str() << "/Sector" << sector.str() << "/Station"<< station.str() << endl;
251 
252  // Book Phi View Related Plots
253  ibooker.setCurrentFolder(topFolder(*typeIt) + "Wheel" + wheel.str() + "/Sector"
254  + sector.str() + "/Station" + station.str() + "/LocalTriggerPhi");
255 
256  string histoTag = (*typeIt) + "_BXvsQual";
257  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,"BX vs trigger quality",
258  7,-0.5,6.5,(int)(maxBX[(*typeIt)]-minBX[*typeIt]+1),minBX[*typeIt]-.5,maxBX[*typeIt]+.5);
259  setQLabels((chamberHistos[rawId])[histoTag],1);
260 
261  if (!tpMode) {
262  histoTag = (*typeIt) + "_BestQual";
263  chamberHistos[rawId][histoTag] = ibooker.book1D(histoTag+chTag,
264  "Trigger quality of best primitives",7,-0.5,6.5);
265  setQLabels(chamberHistos[rawId][histoTag],1);
266 
267  histoTag = (*typeIt) + "_Flag1stvsQual";
268  chamberHistos[dtCh.rawId()][histoTag] = ibooker.book2D(histoTag+chTag,
269  "1st/2nd trig flag vs quality",7,-0.5,6.5,2,-0.5,1.5);
270  setQLabels(chamberHistos[rawId][histoTag],1);
271  }
272 
273  if (*typeIt=="TM") {
274  float minPh, maxPh; int nBinsPh;
275  theTrigGeomUtils->phiRange(dtCh,minPh,maxPh,nBinsPh);
276 
277  histoTag = (*typeIt) + "_QualvsPhirad";
278  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,
279  "Trigger quality vs local position",nBinsPh,minPh,maxPh,7,-0.5,6.5);
280  setQLabels(chamberHistos[rawId][histoTag],2);
281 
282  if (detailedAnalysis && !tpMode) {
283  histoTag = (*typeIt) + "_QualvsPhibend";
284  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,
285  "Trigger quality vs local direction",200,-40.,40.,7,-0.5,6.5);
286  setQLabels((chamberHistos[dtCh.rawId()])[histoTag],2);
287  }
288  }
289 
290  // Book Theta View Related Plots
291  ibooker.setCurrentFolder(topFolder(*typeIt) + "Wheel" + wheel.str() + "/Sector"
292  + sector.str() + "/Station" + station.str() + "/LocalTriggerTheta");
293 
294  if((*typeIt)=="TM") {
295  histoTag = (*typeIt) + "_PositionvsBX";
296  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,"Theta trigger position vs BX",
297  (int)(maxBX[(*typeIt)]-minBX[*typeIt]+1),minBX[*typeIt]-.5,maxBX[*typeIt]+.5,7,-0.5,6.5);
298  } else {
299  histoTag = (*typeIt) + "_ThetaBXvsQual";
300  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,"BX vs trigger quality",7,-0.5,6.5,
301  (int)(maxBX[(*typeIt)]-minBX[*typeIt]+1),minBX[*typeIt]-.5,maxBX[*typeIt]+.5);
302  setQLabels((chamberHistos[dtCh.rawId()])[histoTag],1);
303 
304  histoTag = (*typeIt) + "_ThetaBestQual";
305  chamberHistos[rawId][histoTag] = ibooker.book1D(histoTag+chTag,
306  "Trigger quality of best primitives (theta)",7,-0.5,6.5);
307  setQLabels((chamberHistos[dtCh.rawId()])[histoTag],1);
308  }
309 
310  }
311 
312  if (processTM && processDDU) {
313  // Book TM/DDU Comparison Plots
314  ibooker.setCurrentFolder(topFolder("DDU") + "Wheel" + wheel.str() + "/Sector"
315  + sector.str() + "/Station" + station.str() + "/LocalTriggerPhi");
316 
317  string histoTag = "COM_QualDDUvsQualTM";
318  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,
319  "DDU quality vs TM quality",8,-1.5,6.5,8,-1.5,6.5);
320  setQLabels((chamberHistos[rawId])[histoTag],1);
321  setQLabels((chamberHistos[rawId])[histoTag],2);
322 
323  histoTag = "COM_MatchingTrend";
324  trendHistos[rawId] = new DTTimeEvolutionHisto(ibooker,histoTag+chTag,
325  "Fraction of DDU-TM matches w.r.t. proc evts",
326  nTimeBins,nLSTimeBin,true,0);
327  }
328 
329 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > theTypes
DTTrigGeomUtils * theTrigGeomUtils
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
#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/DDU)
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void setQLabels(MonitorElement *me, short int iaxis)
Set Quality labels.
std::map< uint32_t, DTTimeEvolutionHisto * > trendHistos
void DTLocalTriggerBaseTask::bookHistos ( DQMStore::IBooker ibooker,
int  wh 
)
private

Book the histograms.

Definition at line 331 of file DTLocalTriggerBaseTask.cc.

References DQMStore::IBooker::bookProfile2D(), LogTrace, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), topFolder(), and wheelHistos.

331  {
332 
333  stringstream wheel; wheel << wh;
334  ibooker.setCurrentFolder(topFolder("DDU") + "Wheel" + wheel.str() + "/");
335  string whTag = "_W" + wheel.str();
336 
337  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
338  << "[DTLocalTriggerBaseTask]: booking wheel histos for "
339  << topFolder("DDU") << "Wheel" << wh << endl;
340 
341  string histoTag = "COM_BXDiff";
342  MonitorElement *me = ibooker.bookProfile2D(histoTag+whTag,
343  "DDU-TM BX Difference",12,1,13,4,1,5,0.,20.);
344  me->setAxisTitle("Sector",1);
345  me->setAxisTitle("station",2);
346  wheelHistos[wh][histoTag] = me;
347 
348 }
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
#define LogTrace(id)
std::string & topFolder(std::string const &type)
Get the Top folder (different between Physics and TP and TM/DDU)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void DTLocalTriggerBaseTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
protectedvirtual

Beginrun.

Reimplemented from DQMEDAnalyzer.

Definition at line 162 of file DTLocalTriggerBaseTask.cc.

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

162  {
163 
164  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
165  << "[DTLocalTriggerBaseTask]: BeginRun" << endl;
166 
167  ESHandle<DTGeometry> theGeom;
168  context.get<MuonGeometryRecord>().get(theGeom);
169  theTrigGeomUtils = new DTTrigGeomUtils(theGeom);
170 
171 }
DTTrigGeomUtils * theTrigGeomUtils
#define LogTrace(id)
const T & get() const
Definition: EventSetup.h:56
void DTLocalTriggerBaseTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Perform trend plot operations.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 148 of file DTLocalTriggerBaseTask.cc.

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

148  {
149 
150  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
151  << "[DTLocalTriggerBaseTask]: End of LS transition" << endl;
152 
153  map<uint32_t,DTTimeEvolutionHisto* >::const_iterator chambIt = trendHistos.begin();
154  map<uint32_t,DTTimeEvolutionHisto* >::const_iterator chambEnd = trendHistos.end();
155  for(;chambIt!=chambEnd;++chambIt) {
156  chambIt->second->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
157  }
158 
159 }
LuminosityBlockNumber_t luminosityBlock() const
#define LogTrace(id)
std::map< uint32_t, DTTimeEvolutionHisto * > trendHistos
void DTLocalTriggerBaseTask::runDDUAnalysis ( edm::Handle< DTLocalTriggerCollection > &  trigsDDU)
private

Run analysis on ROS data.

Definition at line 432 of file DTLocalTriggerBaseTask.cc.

References funct::abs(), bestAccRange, chamberHistos, DetId::rawId(), targetBXDDU, theCompMap, and tpMode.

Referenced by analyze().

432  {
433 
434  DTLocalTriggerCollection::DigiRangeIterator detUnitIt = trigsDDU->begin();
435  DTLocalTriggerCollection::DigiRangeIterator detUnitEnd = trigsDDU->end();
436 
437  for (; detUnitIt!=detUnitEnd; ++detUnitIt){
438 
439  const DTChamberId& chId = (*detUnitIt).first;
440  uint32_t rawId = chId.rawId();
441 
442  const DTLocalTriggerCollection::Range& range = (*detUnitIt).second;
443  DTLocalTriggerCollection::const_iterator trigIt = range.first;
444  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
445 
446  int bestQualTheta = -1;
447 
448  for (; trigIt!=range.second; ++trigIt){
449 
450  int qualPhi = trigIt->quality();
451  int qualTheta = trigIt->trTheta();
452  int flag1st = trigIt->secondTrack() ? 1 : 0;
453  int bx = trigIt->bx();
454  int bxPhi = bx - flag1st; // phi BX assign is different for 1st & 2nd tracks
455 
456  if( qualPhi>-1 && qualPhi<7 ) { // it is a phi trigger
457  if (abs(bx-targetBXDDU) <= bestAccRange &&
458  theCompMap[rawId].qualDDU()<= qualPhi)
459  theCompMap[rawId].setDDU(qualPhi,bxPhi);
460  if(tpMode) {
461  innerME["DDU_BXvsQual"]->Fill(qualPhi,bxPhi); // SM BX vs Qual Phi view
462  } else {
463  innerME["DDU_BXvsQual"]->Fill(qualPhi,bxPhi); // SM BX vs Qual Phi view
464  innerME["DDU_Flag1stvsQual"]->Fill(qualPhi,flag1st); // SM Quality vs 1st/2nd track flag Phi view
465  }
466  }
467 
468  if( qualTheta>0 && !tpMode ){// it is a theta trigger & is not TP
469  if (qualTheta > bestQualTheta){
470  bestQualTheta = qualTheta;
471  }
472  innerME["DDU_ThetaBXvsQual"]->Fill(qualTheta,bx); // SM BX vs Qual Theta view
473  }
474  }
475 
476  // Fill Quality plots with best ddu triggers
477  if (!tpMode && theCompMap.find(rawId)!= theCompMap.end()) {
478  int bestQualPhi = theCompMap[rawId].qualDDU();
479  if (bestQualPhi>-1)
480  innerME["DDU_BestQual"]->Fill(bestQualPhi); // SM Best Qual Trigger Phi view
481  if(bestQualTheta>0) {
482  innerME["DDU_ThetaBestQual"]->Fill(bestQualTheta); // SM Best Qual Trigger Theta view
483  }
484  }
485  }
486 
487 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
std::vector< DTLocalTrigger >::const_iterator const_iterator
std::map< uint32_t, DTTPGCompareUnit > theCompMap
std::pair< const_iterator, const_iterator > Range
void DTLocalTriggerBaseTask::runDDUvsTMAnalysis ( )
private

Run analysis on ROS data.

Definition at line 490 of file DTLocalTriggerBaseTask.cc.

References chamberHistos, DTTPGCompareUnit::deltaBX(), DTTPGCompareUnit::hasBoth(), DTTPGCompareUnit::hasOne(), DTTPGCompareUnit::hasSameQual(), DTTPGCompareUnit::qualDDU(), DTTPGCompareUnit::qualTM(), DTChamberId::sector(), DTChamberId::station(), theCompMap, trendHistos, DTChamberId::wheel(), and wheelHistos.

Referenced by analyze().

490  {
491 
492  map<uint32_t,DTTPGCompareUnit>::const_iterator compIt = theCompMap.begin();
493  map<uint32_t,DTTPGCompareUnit>::const_iterator compEnd = theCompMap.end();
494 
495  for (; compIt!=compEnd; ++compIt) {
496 
497  uint32_t rawId = compIt->first;
498  DTChamberId chId(rawId);
499  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
500 
501  const DTTPGCompareUnit & compUnit = compIt->second;
502  if ( compUnit.hasOne() ){
503  innerME["COM_QualDDUvsQualTM"]->Fill(compUnit.qualTM(),compUnit.qualDDU());
504  }
505  if ( compUnit.hasBoth() ){
506  wheelHistos[chId.wheel()]["COM_BXDiff"]->Fill(chId.sector(),chId.station(),compUnit.deltaBX());
507  if ( compUnit.hasSameQual() ) {
508  trendHistos[rawId]->accumulateValueTimeSlot(1);
509  }
510  }
511  }
512 
513 }
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
std::map< uint32_t, DTTPGCompareUnit > theCompMap
std::map< uint32_t, DTTimeEvolutionHisto * > trendHistos
void DTLocalTriggerBaseTask::runTMAnalysis ( std::vector< L1MuDTChambPhDigi > const *  phTrigs,
std::vector< L1MuDTChambThDigi > const *  thTrigs 
)
private

Run analysis on TM data.

Definition at line 351 of file DTLocalTriggerBaseTask.cc.

References funct::abs(), bestAccRange, chamberHistos, detailedAnalysis, dir, DetId::rawId(), targetBXTM, theCompMap, theTrigGeomUtils, tpMode, DTTrigGeomUtils::trigDir(), and DTTrigGeomUtils::trigPos().

Referenced by analyze().

353 {
354  vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
355  vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
356 
357  for(; iph !=iphe ; ++iph) {
358 
359  int wh = iph->whNum();
360  int sec = iph->scNum() + 1; // DTTF->DT Convention
361  int st = iph->stNum();
362  int qual = iph->code();
363  int is1st = iph->Ts2Tag() ? 1 : 0;
364  int bx = iph->bxNum() - is1st;
365 
366  if (qual <0 || qual>6) continue; // Check that quality is in a valid range
367 
368  DTChamberId dtChId(wh,st,sec);
369  uint32_t rawId = dtChId.rawId();
370 
371  float pos = theTrigGeomUtils->trigPos(&(*iph));
372  float dir = theTrigGeomUtils->trigDir(&(*iph));
373 
374  if (abs(bx-targetBXTM)<= bestAccRange &&
375  theCompMap[rawId].qualTM() <= qual)
376  theCompMap[rawId].setTM(qual,bx);
377 
378  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
379  if (tpMode) {
380  innerME["TM_BXvsQual"]->Fill(qual,bx); // SM BX vs Qual Phi view (1st tracks)
381  innerME["TM_QualvsPhirad"]->Fill(pos,qual); // SM Qual vs radial angle Phi view
382  } else {
383  innerME["TM_BXvsQual"]->Fill(qual,bx); // SM BX vs Qual Phi view (1st tracks)
384  innerME["TM_Flag1stvsQual"]->Fill(qual,is1st); // SM Qual 1st/2nd track flag Phi view
385  if (!is1st) innerME["TM_QualvsPhirad"]->Fill(pos,qual); // SM Qual vs radial angle Phi view ONLY for 1st tracks
386  if (detailedAnalysis) {
387  innerME["TM_QualvsPhibend"]->Fill(dir,qual); // SM Qual vs bending Phi view
388  }
389  }
390 
391  }
392 
393  vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin();
394  vector<L1MuDTChambThDigi>::const_iterator ithe = thTrigs->end();
395 
396  for(; ith != ithe; ++ith) {
397  int wh = ith->whNum();
398  int sec = ith->scNum() + 1; // DTTF -> DT Convention
399  int st = ith->stNum();
400  int bx = ith->bxNum();
401 
402  int thcode[7];
403 
404  for (int pos=0; pos<7; pos++)
405  thcode[pos] = ith->code(pos);
406 
407  DTChamberId dtChId(wh,st,sec);
408  uint32_t rawId = dtChId.rawId();
409 
410  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
411 
412  for (int pos=0; pos<7; pos++)
413  if (thcode[pos])
414  innerME["TM_PositionvsBX"]->Fill(bx,pos); // SM BX vs Position Theta view
415 
416  }
417 
418  // Fill Quality plots with best TM triggers (phi view)
419  if (!tpMode) {
420  map<uint32_t,DTTPGCompareUnit>::const_iterator compIt = theCompMap.begin();
421  map<uint32_t,DTTPGCompareUnit>::const_iterator compEnd = theCompMap.end();
422  for (; compIt!=compEnd; ++compIt) {
423  int bestQual = compIt->second.qualTM();
424  if (bestQual > -1)
425  chamberHistos[compIt->first]["TM_BestQual"]->Fill(bestQual); // SM Best Qual Trigger Phi view
426  }
427  }
428 
429 }
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
DTTrigGeomUtils * theTrigGeomUtils
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
std::map< uint32_t, DTTPGCompareUnit > theCompMap
dbl *** dir
Definition: mlp_gen.cc:35
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
void DTLocalTriggerBaseTask::setQLabels ( MonitorElement me,
short int  iaxis 
)
private

Set Quality labels.

Definition at line 516 of file DTLocalTriggerBaseTask.cc.

References MonitorElement::getTH1(), timingPdfMaker::histo, i, and HLT_25ns10e33_v2_cff::labels.

Referenced by bookHistos().

516  {
517 
518  TH1* histo = me->getTH1();
519  if (!histo) return;
520 
521  TAxis* axis=0;
522  if (iaxis==1) {
523  axis=histo->GetXaxis();
524  }
525  else if(iaxis==2) {
526  axis=histo->GetYaxis();
527  }
528  if (!axis) return;
529 
530  string labels[7] = {"LI","LO","HI","HO","LL","HL","HH"};
531  int istart = axis->GetXmin()<-1 ? 2 : 1;
532  for (int i=0;i<7;i++) {
533  axis->SetBinLabel(i+istart,labels[i].c_str());
534  }
535 
536 }
int i
Definition: DBlmapReader.cc:9
TH1 * getTH1(void) const
std::string& DTLocalTriggerBaseTask::topFolder ( std::string const &  type)
inlineprivate

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

Definition at line 83 of file DTLocalTriggerBaseTask.h.

References baseFolder.

Referenced by bookHistos(), and DTLocalTriggerBaseTask().

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

Friends And Related Function Documentation

friend class DTMonitorModule
friend

Definition at line 47 of file DTLocalTriggerBaseTask.h.

Member Data Documentation

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

Definition at line 100 of file DTLocalTriggerBaseTask.h.

Referenced by topFolder().

int DTLocalTriggerBaseTask::bestAccRange
private

Definition at line 108 of file DTLocalTriggerBaseTask.h.

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

std::map<uint32_t,std::map<std::string,MonitorElement*> > DTLocalTriggerBaseTask::chamberHistos
private
edm::EDGetTokenT<L1MuDTChambPhContainer> DTLocalTriggerBaseTask::dcc_phi_Token_
private

Definition at line 120 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

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

Definition at line 121 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

bool DTLocalTriggerBaseTask::detailedAnalysis
private

Definition at line 102 of file DTLocalTriggerBaseTask.h.

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

MonitorElement* DTLocalTriggerBaseTask::nEventMonitor
private

Definition at line 118 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and bookHistograms().

int DTLocalTriggerBaseTask::nEvents
private

Definition at line 96 of file DTLocalTriggerBaseTask.h.

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

int DTLocalTriggerBaseTask::nEventsInLS
private

Definition at line 97 of file DTLocalTriggerBaseTask.h.

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

int DTLocalTriggerBaseTask::nLumis
private

Definition at line 98 of file DTLocalTriggerBaseTask.h.

Referenced by beginLuminosityBlock().

bool DTLocalTriggerBaseTask::processDDU
private

Definition at line 104 of file DTLocalTriggerBaseTask.h.

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

bool DTLocalTriggerBaseTask::processTM
private

Definition at line 103 of file DTLocalTriggerBaseTask.h.

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

int DTLocalTriggerBaseTask::targetBXDDU
private

Definition at line 106 of file DTLocalTriggerBaseTask.h.

Referenced by DTLocalTriggerBaseTask(), and runDDUAnalysis().

int DTLocalTriggerBaseTask::targetBXTM
private

Definition at line 107 of file DTLocalTriggerBaseTask.h.

Referenced by DTLocalTriggerBaseTask(), and runTMAnalysis().

std::map<uint32_t,DTTPGCompareUnit> DTLocalTriggerBaseTask::theCompMap
private
edm::ParameterSet DTLocalTriggerBaseTask::theParams
private
DTTrigGeomUtils* DTLocalTriggerBaseTask::theTrigGeomUtils
private
std::vector<std::string> DTLocalTriggerBaseTask::theTypes
private

Definition at line 112 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), and DTLocalTriggerBaseTask().

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

Definition at line 117 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), endLuminosityBlock(), and runDDUvsTMAnalysis().

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

Definition at line 122 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

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

Definition at line 115 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), and runDDUvsTMAnalysis().