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:
one::DQMEDAnalyzer< edm::one::WatchLuminosityBlocks > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 DTLocalTriggerBaseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTLocalTriggerBaseTask () override
 Destructor. More...
 
- Public Member Functions inherited from one::DQMEDAnalyzer< edm::one::WatchLuminosityBlocks >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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

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 *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/DDU) 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 processDDU
 
bool processTM
 
int targetBXDDU
 
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
 

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, detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, processDDU, processTM, targetBXDDU, targetBXTM, theParams, theTypes, tm_phiIn_Token_, tm_phiOut_Token_, tm_theta_Token_, topFolder(), tpMode, and trig_Token_.

63  :
64  nEvents(0), nLumis(0), theTrigGeomUtils(nullptr) {
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  tm_phiIn_Token_ = consumes<L1MuDTChambPhContainer>(
80  ps.getUntrackedParameter<InputTag>("inputTagTMphIn"));
81  tm_phiOut_Token_ = consumes<L1MuDTChambPhContainer>(
82  ps.getUntrackedParameter<InputTag>("inputTagTMphOut"));
83  tm_theta_Token_ = consumes<L1MuDTChambThContainer>(
84  ps.getUntrackedParameter<InputTag>("inputTagTMth"));
85  trig_Token_ = consumes<DTLocalTriggerCollection>(
86  ps.getUntrackedParameter<InputTag>("inputTagDDU"));
87 
88  if (processTM) theTypes.push_back("TM");
89  if (processDDU) theTypes.push_back("DDU");
90 
91 
92  if (tpMode) {
93  topFolder("TM") = "DT/11-LocalTriggerTP-TM/";
94  topFolder("DDU") = "DT/12-LocalTriggerTP-DDU/";
95  } else {
96  topFolder("TM") = "DT/03-LocalTrigger-TM/";
97  topFolder("DDU") = "DT/04-LocalTrigger-DDU/";
98  }
99 
100  theParams = ps;
101 
102 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > theTypes
DTTrigGeomUtils * theTrigGeomUtils
edm::EDGetTokenT< L1MuDTChambThContainer > tm_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 > tm_phiIn_Token_
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_phiOut_Token_
DTLocalTriggerBaseTask::~DTLocalTriggerBaseTask ( )
override

Destructor.

Definition at line 105 of file DTLocalTriggerBaseTask.cc.

References LogTrace, nEvents, and theTrigGeomUtils.

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

Member Function Documentation

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

Analyze.

Definition at line 177 of file DTLocalTriggerBaseTask.cc.

References MonitorElement::Fill(), edm::Event::getByToken(), L1MuDTChambPhContainer::getContainer(), L1MuDTChambThContainer::getContainer(), edm::ParameterSet::getUntrackedParameter(), edm::HandleBase::isValid(), nEventMonitor, nEvents, nEventsInLS, processDDU, processTM, runDDUAnalysis(), runDDUvsTMAnalysis(), runTMAnalysis(), theCompMapIn, theCompMapOut, theParams, tm_phiIn_Token_, tm_phiOut_Token_, tm_theta_Token_, and trig_Token_.

177  {
178 
179  nEvents++;
180  nEventsInLS++;
182 
183  theCompMapIn.clear();
184  theCompMapOut.clear();
185 
186  Handle<L1MuDTChambPhContainer> phiInTrigsTM;
187  Handle<L1MuDTChambPhContainer> phiOutTrigsTM;
188  Handle<L1MuDTChambThContainer> thetaTrigsTM;
190 
191  if (processTM) {
192  InputTag inputTagTM = theParams.getUntrackedParameter<InputTag>("inputTagTM");
193 
194  e.getByToken(tm_phiIn_Token_, phiInTrigsTM);
195  e.getByToken(tm_phiOut_Token_, phiOutTrigsTM);
196  e.getByToken(tm_theta_Token_, thetaTrigsTM);
197 
198  if (phiInTrigsTM.isValid() && phiOutTrigsTM.isValid() && thetaTrigsTM.isValid()) {
199  runTMAnalysis(phiInTrigsTM->getContainer(),phiOutTrigsTM->getContainer(),thetaTrigsTM->getContainer());
200  } else {
201  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
202  << "[DTLocalTriggerBaseTask]: one or more TM handles for Input Tag "
203  << inputTagTM <<" not found!" << endl;
204  return;
205  }
206  }
207 
208  if (processDDU) {
209  InputTag inputTagDDU = theParams.getUntrackedParameter<InputTag>("inputTagDDU");
210  e.getByToken(trig_Token_, trigsDDU);
211 
212  if (trigsDDU.isValid()) {
213  runDDUAnalysis(trigsDDU);
214  } else {
215  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
216  << "[DTLocalTriggerBaseTask]: one or more DDU handles for Input Tag "
217  << inputTagDDU <<" not found!" << endl;
218  return;
219  }
220  }
221 
222  if (processTM && processDDU)
224 
225 }
The_Container const * getContainer() const
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:517
void Fill(long long x)
edm::EDGetTokenT< L1MuDTChambThContainer > tm_theta_Token_
std::map< uint32_t, DTTPGCompareUnit > theCompMapOut
edm::EDGetTokenT< DTLocalTriggerCollection > trig_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:74
std::map< uint32_t, DTTPGCompareUnit > theCompMapIn
Phi_Container const * getContainer() const
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_phiIn_Token_
void runDDUAnalysis(edm::Handle< DTLocalTriggerCollection > &trigsDDU)
Run analysis on ROS data.
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_phiOut_Token_
void DTLocalTriggerBaseTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

To reset the MEs.

Definition at line 128 of file DTLocalTriggerBaseTask.cc.

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

128  {
129 
130  nEventsInLS=0;
131  nLumis++;
132  int resetCycle = theParams.getUntrackedParameter<int>("ResetCycle");
133 
134  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
135  << "[DTLocalTriggerBaseTask]: Begin of LS transition" << endl;
136 
137  if( nLumis%resetCycle == 0 ) {
138  map<uint32_t,map<string,MonitorElement*> >::const_iterator chambIt = chamberHistos.begin();
139  map<uint32_t,map<string,MonitorElement*> >::const_iterator chambEnd = chamberHistos.end();
140  for(;chambIt!=chambEnd;++chambIt) {
141  map<string,MonitorElement*>::const_iterator histoIt = chambIt->second.begin();
142  map<string,MonitorElement*>::const_iterator histoEnd = chambIt->second.end();
143  for(;histoIt!=histoEnd;++histoIt) {
144  histoIt->second->Reset();
145  }
146  }
147  }
148 
149 }
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 
)
overrideprivate

Definition at line 113 of file DTLocalTriggerBaseTask.cc.

References DQMStore::IBooker::bookFloat(), bookHistos(), nEventMonitor, processDDU, DQMStore::IBooker::setCurrentFolder(), and trackingPlots::stat.

Referenced by topFolder().

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

Book the histograms.

Definition at line 228 of file DTLocalTriggerBaseTask.cc.

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

Referenced by bookHistograms(), and topFolder().

228  {
229 
230  uint32_t rawId = dtCh.rawId();
231 
232  stringstream wheel; wheel << dtCh.wheel();
233  stringstream station; station << dtCh.station();
234  stringstream sector; sector << dtCh.sector();
235 
236  map<string,int> minBX;
237  map<string,int> maxBX;
238 
239  minBX["TM"] = theParams.getUntrackedParameter<int>("minBXTM");
240  maxBX["TM"] = theParams.getUntrackedParameter<int>("maxBXTM");
241  minBX["DDU"] = theParams.getUntrackedParameter<int>("minBXDDU");
242  maxBX["DDU"] = theParams.getUntrackedParameter<int>("maxBXDDU");
243 
244  int nTimeBins = theParams.getUntrackedParameter<int>("nTimeBins");
245  int nLSTimeBin = theParams.getUntrackedParameter<int>("nLSTimeBin");
246 
247  string chTag = "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
248  string labelInOut = "";
249 
250  vector<string>::const_iterator typeIt = theTypes.begin();
251  vector<string>::const_iterator typeEnd = theTypes.end();
252 
253  for (; typeIt!=typeEnd; ++typeIt) {
254 
255  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
256  << "[DTLocalTriggerBaseTask]: booking histos for " << topFolder((*typeIt)) << "Wheel"
257  << wheel.str() << "/Sector" << sector.str() << "/Station"<< station.str() << endl;
258 
259  for (int InOut=0; InOut<2;InOut++){
260  // Book Phi View Related Plots
261 
262  if(InOut==0)
263  {ibooker.setCurrentFolder(topFolder(*typeIt) + "Wheel" + wheel.str() + "/Sector"
264  + sector.str() + "/Station" + station.str() + "/LocalTriggerPhiIn");
265  labelInOut = "_In";}
266  else if (InOut==1){
267  ibooker.setCurrentFolder(topFolder(*typeIt) + "Wheel" + wheel.str() + "/Sector"
268  + sector.str() + "/Station" + station.str() + "/LocalTriggerPhiOut");
269  labelInOut = "_Out";}
270 
271 
272  string histoTag = (*typeIt) + "_BXvsQual" + labelInOut;
273  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,"BX vs trigger quality",
274  7,-0.5,6.5,(int)(maxBX[(*typeIt)]-minBX[*typeIt]+1),minBX[*typeIt]-.5,maxBX[*typeIt]+.5);
275  setQLabels((chamberHistos[rawId])[histoTag],1);
276 
277  if (!tpMode) {
278  histoTag = (*typeIt) + "_BestQual" + labelInOut;
279  chamberHistos[rawId][histoTag] = ibooker.book1D(histoTag+chTag,
280  "Trigger quality of best primitives",7,-0.5,6.5);
281  setQLabels(chamberHistos[rawId][histoTag],1);
282 
283  histoTag = (*typeIt) + "_Flag1stvsQual" + labelInOut;
284  chamberHistos[dtCh.rawId()][histoTag] = ibooker.book2D(histoTag+chTag,
285  "1st/2nd trig flag vs quality",7,-0.5,6.5,2,-0.5,1.5);
286  setQLabels(chamberHistos[rawId][histoTag],1);
287 
288  histoTag = (*typeIt) + "_FlagUpDownvsQual" + labelInOut;
289  chamberHistos[dtCh.rawId()][histoTag] = ibooker.book2D(histoTag+chTag,
290  "Up/Down trig flag vs quality",7,-0.5,6.5,2,-0.5,1.5);
291  setQLabels(chamberHistos[rawId][histoTag],1);
292 
293  }
294 
295  if (*typeIt=="TM") {
296  float minPh, maxPh; int nBinsPh;
297  theTrigGeomUtils->phiRange(dtCh,minPh,maxPh,nBinsPh);
298 
299  histoTag = (*typeIt) + "_QualvsPhirad" + labelInOut;
300  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,
301  "Trigger quality vs local position",nBinsPh,minPh,maxPh,7,-0.5,6.5);
302  setQLabels(chamberHistos[rawId][histoTag],2);
303 
304  if (detailedAnalysis && !tpMode) {
305  histoTag = (*typeIt) + "_QualvsPhibend" + labelInOut;
306  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,
307  "Trigger quality vs local direction",200,-40.,40.,7,-0.5,6.5);
308  setQLabels((chamberHistos[dtCh.rawId()])[histoTag],2);
309  }
310  }
311  } //InOut loop
312 
313  // Book Theta View Related Plots
314  ibooker.setCurrentFolder(topFolder(*typeIt) + "Wheel" + wheel.str() + "/Sector"
315  + sector.str() + "/Station" + station.str() + "/LocalTriggerTheta");
316 
317  string histoTag = "";
318  if((*typeIt)=="TM" && dtCh.station()!=4) {
319  histoTag = (*typeIt) + "_PositionvsBX";
320  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,"Theta trigger position vs BX",
321  (int)(maxBX[(*typeIt)]-minBX[*typeIt]+1),minBX[*typeIt]-.5,maxBX[*typeIt]+.5,7,-0.5,6.5);
322  histoTag = (*typeIt) + "_PositionvsQual";
323  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,"Theta trigger position vs quality",
324  2,0.5,2.5,7,-0.5,6.5);
325  setQLabelsTheta(chamberHistos[rawId][histoTag],1);
326  histoTag = (*typeIt) + "_ThetaBXvsQual";
327  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,"BX vs trigger quality",
328  2,0.5,2.5,(int)(maxBX[(*typeIt)]-minBX[*typeIt]+1),minBX[*typeIt]-.5,maxBX[*typeIt]+.5);
329  setQLabelsTheta(chamberHistos[rawId][histoTag],1);
330 // histoTag = (*typeIt) + "_ThetaBestQual";
331 // chamberHistos[rawId][histoTag] = ibooker.book1D(histoTag+chTag,
332 // "Trigger quality of best primitives (theta)",2,0.5,2.5); // 0 = not fired, 1 = L, 2 = H
333 // setQLabelsTheta(chamberHistos[rawId][histoTag],1);
334  } else {
335  if(dtCh.station()!=4){
336  histoTag = (*typeIt) + "_ThetaBXvsQual";
337  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,"BX vs trigger quality",7,-0.5,6.5,
338  (int)(maxBX[(*typeIt)]-minBX[*typeIt]+1),minBX[*typeIt]-.5,maxBX[*typeIt]+.5);
339  setQLabels((chamberHistos[dtCh.rawId()])[histoTag],1);
340 
341  histoTag = (*typeIt) + "_ThetaBestQual";
342  chamberHistos[rawId][histoTag] = ibooker.book1D(histoTag+chTag,
343  "Trigger quality of best primitives (theta)",7,-0.5,6.5);
344  setQLabels((chamberHistos[dtCh.rawId()])[histoTag],1);
345  }
346  }
347 
348  }
349 
350  if (processTM && processDDU) {
351  // Book TM/DDU Comparison Plots
352  // NOt needed In and Out comparison, only IN in DDU....
353  ibooker.setCurrentFolder(topFolder("DDU") + "Wheel" + wheel.str() + "/Sector"
354  + sector.str() + "/Station" + station.str() + "/LocalTriggerPhiIn");
355 
356 
357  string histoTag = "COM_QualDDUvsQualTM";
358  chamberHistos[rawId][histoTag] = ibooker.book2D(histoTag+chTag,
359  "DDU quality vs TM quality",8,-1.5,6.5,8,-1.5,6.5);
360  setQLabels((chamberHistos[rawId])[histoTag],1);
361  setQLabels((chamberHistos[rawId])[histoTag],2);
362 
363  histoTag = "COM_MatchingTrend";
364  trendHistos[rawId] = new DTTimeEvolutionHisto(ibooker,histoTag+chTag,
365  "Fraction of DDU-TM matches w.r.t. proc evts",
366  nTimeBins,nLSTimeBin,true,0);
367  }
368 
369 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > theTypes
DTTrigGeomUtils * theTrigGeomUtils
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
#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 setQLabelsTheta(MonitorElement *me, short int iaxis)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
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 371 of file DTLocalTriggerBaseTask.cc.

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

371  {
372 
373  stringstream wheel; wheel << wh;
374  ibooker.setCurrentFolder(topFolder("DDU") + "Wheel" + wheel.str() + "/");
375  string whTag = "_W" + wheel.str();
376 
377  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
378  << "[DTLocalTriggerBaseTask]: booking wheel histos for "
379  << topFolder("DDU") << "Wheel" << wh << endl;
380 
381  string histoTag = "COM_BXDiff";
382  MonitorElement *me = ibooker.bookProfile2D(histoTag+whTag,
383  "DDU-TM BX Difference",12,1,13,4,1,5,0.,20.);
384  me->setAxisTitle("Sector",1);
385  me->setAxisTitle("station",2);
386  wheelHistos[wh][histoTag] = me;
387 
388 }
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:114
#define LogTrace(id)
std::string & topFolder(std::string const &type)
Get the Top folder (different between Physics and TP and TM/DDU)
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 
)
overrideprotected

Beginrun.

Definition at line 165 of file DTLocalTriggerBaseTask.cc.

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

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

Perform trend plot operations.

Definition at line 151 of file DTLocalTriggerBaseTask.cc.

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

151  {
152 
153  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
154  << "[DTLocalTriggerBaseTask]: End of LS transition" << endl;
155 
156  map<uint32_t,DTTimeEvolutionHisto* >::const_iterator chambIt = trendHistos.begin();
157  map<uint32_t,DTTimeEvolutionHisto* >::const_iterator chambEnd = trendHistos.end();
158  for(;chambIt!=chambEnd;++chambIt) {
159  chambIt->second->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
160  }
161 
162 }
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 528 of file DTLocalTriggerBaseTask.cc.

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

Referenced by analyze().

528  {
529 
530  DTLocalTriggerCollection::DigiRangeIterator detUnitIt = trigsDDU->begin();
531  DTLocalTriggerCollection::DigiRangeIterator detUnitEnd = trigsDDU->end();
532 
533  for (; detUnitIt!=detUnitEnd; ++detUnitIt){
534 
535  const DTChamberId& chId = (*detUnitIt).first;
536  uint32_t rawId = chId.rawId();
537 
538  const DTLocalTriggerCollection::Range& range = (*detUnitIt).second;
539  DTLocalTriggerCollection::const_iterator trigIt = range.first;
540  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
541 
542  int bestQualTheta = -1;
543 
544  for (; trigIt!=range.second; ++trigIt){
545 
546  int qualPhi = trigIt->quality();
547  int qualTheta = trigIt->trTheta();
548  int flag1st = trigIt->secondTrack() ? 1 : 0;
549  int bx = trigIt->bx();
550  int bxPhi = bx - flag1st; // phi BX assign is different for 1st & 2nd tracks
551 
552  if( qualPhi>-1 && qualPhi<7 ) { // it is a phi trigger
553  if (abs(bx-targetBXDDU) <= bestAccRange &&
554  theCompMapIn[rawId].qualDDU()<= qualPhi)
555  theCompMapIn[rawId].setDDU(qualPhi,bxPhi);
556  if(tpMode) {
557  innerME["DDU_BXvsQual"]->Fill(qualPhi,bxPhi); // SM BX vs Qual Phi view
558  } else {
559  innerME["DDU_BXvsQual"]->Fill(qualPhi,bxPhi); // SM BX vs Qual Phi view
560  innerME["DDU_Flag1stvsQual"]->Fill(qualPhi,flag1st); // SM Quality vs 1st/2nd track flag Phi view
561  }
562  }
563 
564  if( qualTheta>0 && !tpMode ){// it is a theta trigger & is not TP
565  if (qualTheta > bestQualTheta){
566  bestQualTheta = qualTheta;
567  }
568  innerME["DDU_ThetaBXvsQual"]->Fill(qualTheta,bx); // SM BX vs Qual Theta view
569  }
570  }
571 
572  // Fill Quality plots with best ddu triggers
573  if (!tpMode && theCompMapIn.find(rawId)!= theCompMapIn.end()) {
574  int bestQualPhi = theCompMapIn[rawId].qualDDU();
575  if (bestQualPhi>-1)
576  innerME["DDU_BestQual"]->Fill(bestQualPhi); // SM Best Qual Trigger Phi view
577  if(bestQualTheta>0) {
578  innerME["DDU_ThetaBestQual"]->Fill(bestQualTheta); // SM Best Qual Trigger Theta view
579  }
580  }
581  }
582 
583 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::map< uint32_t, DTTPGCompareUnit > theCompMapIn
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
std::vector< DigiType >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
void DTLocalTriggerBaseTask::runDDUvsTMAnalysis ( )
private

Run analysis on ROS data.

Definition at line 586 of file DTLocalTriggerBaseTask.cc.

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

Referenced by analyze().

586  {
587 
588  map<uint32_t,DTTPGCompareUnit>::const_iterator compIt = theCompMapIn.begin();
589  map<uint32_t,DTTPGCompareUnit>::const_iterator compEnd = theCompMapIn.end();
590 
591  for (; compIt!=compEnd; ++compIt) {
592 
593  uint32_t rawId = compIt->first;
594  DTChamberId chId(rawId);
595  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
596 
597  const DTTPGCompareUnit & compUnit = compIt->second;
598  if ( compUnit.hasOne() ){
599  innerME["COM_QualDDUvsQualTM"]->Fill(compUnit.qualTM(),compUnit.qualDDU());
600  }
601  if ( compUnit.hasBoth() ){
602  wheelHistos[chId.wheel()]["COM_BXDiff"]->Fill(chId.sector(),chId.station(),compUnit.deltaBX());
603  if ( compUnit.hasSameQual() ) {
604  trendHistos[rawId]->accumulateValueTimeSlot(1);
605  }
606  }
607  }
608 
609 }
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
std::map< uint32_t, DTTPGCompareUnit > theCompMapIn
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
std::map< uint32_t, DTTimeEvolutionHisto * > trendHistos
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 391 of file DTLocalTriggerBaseTask.cc.

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

Referenced by analyze().

394 {
395  vector<L1MuDTChambPhDigi>::const_iterator iph = phInTrigs->begin();
396  vector<L1MuDTChambPhDigi>::const_iterator iphe = phInTrigs->end();
397 
398  for(; iph !=iphe ; ++iph) {
399 
400  int wh = iph->whNum();
401  int sec = iph->scNum() + 1; // DTTF->DT Convention
402  int st = iph->stNum();
403  int qual = iph->code();
404  int is1st = iph->Ts2Tag() ? 1 : 0;
405  int bx = iph->bxNum() - is1st;
406  int updown = iph->UpDownTag();
407 
408  if (qual <0 || qual>6) continue; // Check that quality is in a valid range
409 
410  DTChamberId dtChId(wh,st,sec);
411  uint32_t rawId = dtChId.rawId();
412 
413  float pos = theTrigGeomUtils->trigPos(&(*iph));
414  float dir = theTrigGeomUtils->trigDir(&(*iph));
415 
416  if (abs(bx-targetBXTM)<= bestAccRange &&
417  theCompMapIn[rawId].qualTM() <= qual)
418  theCompMapIn[rawId].setTM(qual,bx);
419 
420  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
421  if (tpMode) {
422  innerME["TM_BXvsQual_In"]->Fill(qual,bx); // SM BX vs Qual Phi view (1st tracks)
423  innerME["TM_QualvsPhirad_In"]->Fill(pos,qual); // SM Qual vs radial angle Phi view
424  } else {
425  innerME["TM_BXvsQual_In"]->Fill(qual,bx); // SM BX vs Qual Phi view (1st tracks)
426  innerME["TM_Flag1stvsQual_In"]->Fill(qual,is1st); // SM Qual 1st/2nd track flag Phi view
427  innerME["TM_FlagUpDownvsQual_In"]->Fill(qual,updown); // SM Qual Up/Down track flag Phi view
428  if (!is1st) innerME["TM_QualvsPhirad_In"]->Fill(pos,qual); // SM Qual vs radial angle Phi view ONLY for 1st tracks
429  if (detailedAnalysis) {
430  innerME["TM_QualvsPhibend_In"]->Fill(dir,qual); // SM Qual vs bending Phi view
431  }
432  }
433 
434  }
435 
436  iph = phOutTrigs->begin();
437  iphe = phOutTrigs->end();
438 
439  for(; iph !=iphe ; ++iph) {
440 
441  int wh = iph->whNum();
442  int sec = iph->scNum() + 1; // DTTF->DT Convention
443  int st = iph->stNum();
444  int qual = iph->code();
445  int is1st = iph->Ts2Tag() ? 1 : 0;
446  int bx = iph->bxNum() - is1st;
447  int updown = iph->UpDownTag();
448  if (qual <0 || qual>6) continue; // Check that quality is in a valid range
449 
450  DTChamberId dtChId(wh,st,sec);
451  uint32_t rawId = dtChId.rawId();
452 
453  float pos = theTrigGeomUtils->trigPos(&(*iph));
454  float dir = theTrigGeomUtils->trigDir(&(*iph));
455 
456  if (abs(bx-targetBXTM)<= bestAccRange &&
457  theCompMapOut[rawId].qualTM() <= qual)
458  theCompMapOut[rawId].setTM(qual,bx);
459 
460  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
461  if (tpMode) {
462  innerME["TM_BXvsQual_Out"]->Fill(qual,bx); // SM BX vs Qual Phi view (1st tracks)
463  innerME["TM_QualvsPhirad_Out"]->Fill(pos,qual); // SM Qual vs radial angle Phi view
464  } else {
465  innerME["TM_BXvsQual_Out"]->Fill(qual,bx); // SM BX vs Qual Phi view (1st tracks)
466  innerME["TM_Flag1stvsQual_Out"]->Fill(qual,is1st); // SM Qual 1st/2nd track flag Phi view
467  innerME["TM_FlagUpDownvsQual_Out"]->Fill(qual,updown); // SM Qual Up/Down track flag Phi view
468 
469  if (!is1st) innerME["TM_QualvsPhirad_Out"]->Fill(pos,qual); // SM Qual vs radial angle Phi view ONLY for 1st tracks
470  if (detailedAnalysis) {
471  innerME["TM_QualvsPhibend_Out"]->Fill(dir,qual); // SM Qual vs bending Phi view
472  }
473  }
474 
475  }
476 
477  vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin();
478  vector<L1MuDTChambThDigi>::const_iterator ithe = thTrigs->end();
479 
480  for(; ith != ithe; ++ith) {
481  int wh = ith->whNum();
482  int sec = ith->scNum() + 1; // DTTF -> DT Convention
483  int st = ith->stNum();
484  int bx = ith->bxNum();
485 
486  int thcode[7];
487 
488  for (int pos=0; pos<7; pos++)
489  thcode[pos] = ith->code(pos);
490 
491  DTChamberId dtChId(wh,st,sec);
492  uint32_t rawId = dtChId.rawId();
493 
494  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
495 
496  for (int pos=0; pos<7; pos++)
497  if (thcode[pos]>0) {//Fired
498  innerME["TM_PositionvsBX"]->Fill(bx,pos); // SM BX vs Position Theta view
499  innerME["TM_PositionvsQual"]->Fill(thcode[pos],pos); //code = pos + qual; so 0, 1, 2 for 0, L, H resp.
500  innerME["TM_ThetaBXvsQual"]->Fill(thcode[pos],bx); //code = pos + qual; so 0, 1, 2 for 0, L, H resp.
501  }
502  }
503  // Fill Quality plots with best TM triggers (phi view In)
504  if (!tpMode) {
505  map<uint32_t,DTTPGCompareUnit>::const_iterator compIt = theCompMapIn.begin();
506  map<uint32_t,DTTPGCompareUnit>::const_iterator compEnd = theCompMapIn.end();
507  for (; compIt!=compEnd; ++compIt) {
508  int bestQual = compIt->second.qualTM();
509  if (bestQual > -1)
510  chamberHistos[compIt->first]["TM_BestQual_In"]->Fill(bestQual); // SM Best Qual Trigger Phi view
511  }
512  }
513 
514  // Fill Quality plots with best TM triggers (phi view Out)
515  if (!tpMode) {
516  map<uint32_t,DTTPGCompareUnit>::const_iterator compIt = theCompMapOut.begin();
517  map<uint32_t,DTTPGCompareUnit>::const_iterator compEnd = theCompMapOut.end();
518  for (; compIt!=compEnd; ++compIt) {
519  int bestQual = compIt->second.qualTM();
520  if (bestQual > -1)
521  chamberHistos[compIt->first]["TM_BestQual_Out"]->Fill(bestQual); // SM Best Qual Trigger Phi view
522  }
523  }
524 
525 }
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, DTTPGCompareUnit > theCompMapOut
std::map< uint32_t, DTTPGCompareUnit > theCompMapIn
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
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 612 of file DTLocalTriggerBaseTask.cc.

References MonitorElement::getTH1(), trackerHits::histo, mps_fire::i, and tablePrinter::labels.

Referenced by bookHistos(), and topFolder().

612  {
613 
614  TH1* histo = me->getTH1();
615  if (!histo) return;
616 
617  TAxis* axis=nullptr;
618  if (iaxis==1) {
619  axis=histo->GetXaxis();
620  }
621  else if(iaxis==2) {
622  axis=histo->GetYaxis();
623  }
624  if (!axis) return;
625 
626  string labels[7] = {"LI","LO","HI","HO","LL","HL","HH"};
627  int istart = axis->GetXmin()<-1 ? 2 : 1;
628  for (int i=0;i<7;i++) {
629  axis->SetBinLabel(i+istart,labels[i].c_str());
630  }
631 
632 }
TH1 * getTH1() const
void DTLocalTriggerBaseTask::setQLabelsTheta ( MonitorElement me,
short int  iaxis 
)
private

Definition at line 634 of file DTLocalTriggerBaseTask.cc.

References MonitorElement::getTH1(), trackerHits::histo, mps_fire::i, and tablePrinter::labels.

Referenced by bookHistos(), and topFolder().

634  {
635 
636  TH1* histo = me->getTH1();
637  if (!histo) return;
638 
639  TAxis* axis=nullptr;
640  if (iaxis==1) {
641  axis=histo->GetXaxis();
642  }
643  else if(iaxis==2) {
644  axis=histo->GetYaxis();
645  }
646  if (!axis) return;
647 
648  string labels[2] = {"L","H"};
649  int istart = axis->GetXmin()<-1 ? 2 : 1;
650  for (int i=0;i<2;i++) {
651  axis->SetBinLabel(i+istart,labels[i].c_str());
652  }
653 
654 }
TH1 * getTH1() 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, bookHistograms(), bookHistos(), setQLabels(), and setQLabelsTheta().

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 101 of file DTLocalTriggerBaseTask.h.

Referenced by topFolder().

int DTLocalTriggerBaseTask::bestAccRange
private

Definition at line 109 of file DTLocalTriggerBaseTask.h.

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

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

Definition at line 103 of file DTLocalTriggerBaseTask.h.

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

MonitorElement* DTLocalTriggerBaseTask::nEventMonitor
private

Definition at line 120 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and bookHistograms().

int DTLocalTriggerBaseTask::nEvents
private

Definition at line 97 of file DTLocalTriggerBaseTask.h.

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

int DTLocalTriggerBaseTask::nEventsInLS
private

Definition at line 98 of file DTLocalTriggerBaseTask.h.

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

int DTLocalTriggerBaseTask::nLumis
private

Definition at line 99 of file DTLocalTriggerBaseTask.h.

Referenced by beginLuminosityBlock().

bool DTLocalTriggerBaseTask::processDDU
private
bool DTLocalTriggerBaseTask::processTM
private

Definition at line 104 of file DTLocalTriggerBaseTask.h.

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

int DTLocalTriggerBaseTask::targetBXDDU
private

Definition at line 107 of file DTLocalTriggerBaseTask.h.

Referenced by DTLocalTriggerBaseTask(), and runDDUAnalysis().

int DTLocalTriggerBaseTask::targetBXTM
private

Definition at line 108 of file DTLocalTriggerBaseTask.h.

Referenced by DTLocalTriggerBaseTask(), and runTMAnalysis().

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

Definition at line 116 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 113 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), and DTLocalTriggerBaseTask().

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

Definition at line 122 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

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

Definition at line 123 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

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

Definition at line 124 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

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

Definition at line 119 of file DTLocalTriggerBaseTask.h.

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

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

Definition at line 125 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

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

Definition at line 117 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), and runDDUvsTMAnalysis().