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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DTLocalTriggerBaseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTLocalTriggerBaseTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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 beginJob ()
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 To reset the MEs. More...
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 Beginrun. More...
 
void endJob (void)
 EndJob. 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 bookHistos (const DTChamberId &chamb)
 Book the histograms. More...
 
void bookHistos (int wh)
 Book the histograms. More...
 
void runDCCAnalysis (std::vector< L1MuDTChambPhDigi > const *phTrigs, std::vector< L1MuDTChambThDigi > const *thTrigs)
 Run analysis on DCC data. More...
 
void runDDUAnalysis (edm::Handle< DTLocalTriggerCollection > &trigsDDU)
 Run analysis on ROS data. More...
 
void runDDUvsDCCAnalysis ()
 Run analysis on ROS 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 DCC/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 processDCC
 
bool processDDU
 
int targetBXDCC
 
int targetBXDDU
 
std::map< uint32_t,
DTTPGCompareUnit
theCompMap
 
DQMStoretheDQMStore
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 43 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, cppFunctionSkipper::operator, processDCC, processDDU, targetBXDCC, targetBXDDU, theDQMStore, 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  targetBXDCC = ps.getUntrackedParameter<int>("targetBXDCC");
73  targetBXDDU = ps.getUntrackedParameter<int>("targetBXDDU");
74  bestAccRange = ps.getUntrackedParameter<int>("bestTrigAccRange");
75 
76  processDCC = ps.getUntrackedParameter<bool>("processDCC");
77  processDDU = ps.getUntrackedParameter<bool>("processDDU");
78 
79  dcc_phi_Token_ = consumes<L1MuDTChambPhContainer>(
80  ps.getUntrackedParameter<InputTag>("inputTagDCC"));
81  dcc_theta_Token_ = consumes<L1MuDTChambThContainer>(
82  ps.getUntrackedParameter<InputTag>("inputTagDCC"));
83  trig_Token_ = consumes<DTLocalTriggerCollection>(
84  ps.getUntrackedParameter<InputTag>("inputTagDDU"));
85 
86  if (processDCC) theTypes.push_back("DCC");
87  if (processDDU) theTypes.push_back("DDU");
88 
89  if (tpMode) {
90  topFolder("DCC") = "DT/11-LocalTriggerTP-DCC/";
91  topFolder("DDU") = "DT/12-LocalTriggerTP-DDU/";
92  } else {
93  topFolder("DCC") = "DT/03-LocalTrigger-DCC/";
94  topFolder("DDU") = "DT/04-LocalTrigger-DDU/";
95  }
96 
97  theParams = ps;
99 
100 }
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 DCC/DDU)
edm::EDGetTokenT< L1MuDTChambPhContainer > dcc_phi_Token_
DTLocalTriggerBaseTask::~DTLocalTriggerBaseTask ( )
virtual

Destructor.

Definition at line 103 of file DTLocalTriggerBaseTask.cc.

References LogTrace, nEvents, and theTrigGeomUtils.

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

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 191 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, processDCC, processDDU, runDCCAnalysis(), runDDUAnalysis(), runDDUvsDCCAnalysis(), theCompMap, theParams, and trig_Token_.

191  {
192 
193  nEvents++;
194  nEventsInLS++;
196 
197  theCompMap.clear();
198 
199  Handle<L1MuDTChambPhContainer> phiTrigsDCC;
200  Handle<L1MuDTChambThContainer> thetaTrigsDCC;
202 
203  if (processDCC) {
204  InputTag inputTagDCC = theParams.getUntrackedParameter<InputTag>("inputTagDCC");
205 
206  e.getByToken(dcc_phi_Token_, phiTrigsDCC);
207  e.getByToken(dcc_theta_Token_, thetaTrigsDCC);
208 
209  if (phiTrigsDCC.isValid() && thetaTrigsDCC.isValid()) {
210  runDCCAnalysis(phiTrigsDCC->getContainer(),thetaTrigsDCC->getContainer());
211  } else {
212  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
213  << "[DTLocalTriggerBaseTask]: one or more DCC handles for Input Tag "
214  << inputTagDCC <<" not found!" << endl;
215  return;
216  }
217  }
218 
219  if (processDDU) {
220  InputTag inputTagDDU = theParams.getUntrackedParameter<InputTag>("inputTagDDU");
221  e.getByToken(trig_Token_, trigsDDU);
222 
223  if (trigsDDU.isValid()) {
224  runDDUAnalysis(trigsDDU);
225  } else {
226  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
227  << "[DTLocalTriggerBaseTask]: one or more DDU handles for Input Tag "
228  << inputTagDDU <<" not found!" << endl;
229  return;
230  }
231  }
232 
233  if (processDCC && processDDU)
235 
236 }
T getUntrackedParameter(std::string const &, T const &) const
void runDCCAnalysis(std::vector< L1MuDTChambPhDigi > const *phTrigs, std::vector< L1MuDTChambThDigi > const *thTrigs)
Run analysis on DCC data.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
void Fill(long long x)
void runDDUvsDCCAnalysis()
Run analysis on ROS data.
edm::EDGetTokenT< L1MuDTChambThContainer > dcc_theta_Token_
edm::EDGetTokenT< DTLocalTriggerCollection > trig_Token_
bool isValid() const
Definition: HandleBase.h:76
std::map< uint32_t, DTTPGCompareUnit > theCompMap
void runDDUAnalysis(edm::Handle< DTLocalTriggerCollection > &trigsDDU)
Run analysis on ROS data.
edm::EDGetTokenT< L1MuDTChambPhContainer > dcc_phi_Token_
void DTLocalTriggerBaseTask::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 112 of file DTLocalTriggerBaseTask.cc.

References LogTrace.

112  {
113 
114  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
115  << "[DTLocalTriggerBaseTask]: BeginJob" << endl;
116 
117 }
#define LogTrace(id)
void DTLocalTriggerBaseTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

To reset the MEs.

Reimplemented from edm::EDAnalyzer.

Definition at line 143 of file DTLocalTriggerBaseTask.cc.

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

143  {
144 
145  nEventsInLS=0;
146  nLumis++;
147  int resetCycle = theParams.getUntrackedParameter<int>("ResetCycle");
148 
149  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
150  << "[DTLocalTriggerBaseTask]: Begin of LS transition" << endl;
151 
152  if( nLumis%resetCycle == 0 ) {
153  map<uint32_t,map<string,MonitorElement*> >::const_iterator chambIt = chamberHistos.begin();
154  map<uint32_t,map<string,MonitorElement*> >::const_iterator chambEnd = chamberHistos.end();
155  for(;chambIt!=chambEnd;++chambIt) {
156  map<string,MonitorElement*>::const_iterator histoIt = chambIt->second.begin();
157  map<string,MonitorElement*>::const_iterator histoEnd = chambIt->second.end();
158  for(;histoIt!=histoEnd;++histoIt) {
159  histoIt->second->Reset();
160  }
161  }
162  }
163 
164 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
void DTLocalTriggerBaseTask::beginRun ( const edm::Run run,
const edm::EventSetup context 
)
protectedvirtual

Beginrun.

Reimplemented from edm::EDAnalyzer.

Definition at line 120 of file DTLocalTriggerBaseTask.cc.

References bookHistos(), DTChamberId, edm::EventSetup::get(), LogTrace, nEventMonitor, theDQMStore, and theTrigGeomUtils.

120  {
121 
122  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
123  << "[DTLocalTriggerBaseTask]: BeginRun" << endl;
124 
125  ESHandle<DTGeometry> theGeom;
126  context.get<MuonGeometryRecord>().get(theGeom);
127  theTrigGeomUtils = new DTTrigGeomUtils(theGeom);
128 
129  theDQMStore->setCurrentFolder("DT/EventInfo/Counters");
130  nEventMonitor = theDQMStore->bookFloat("nProcessedEventsTrigger");
131  for (int wh=-2;wh<3;++wh){
132  for (int stat=1;stat<5;++stat){
133  for (int sect=1;sect<13;++sect){
134  bookHistos(DTChamberId(wh,stat,sect));
135  }
136  }
137  bookHistos(wh);
138  }
139 
140 }
DTTrigGeomUtils * theTrigGeomUtils
void bookHistos(const DTChamberId &chamb)
Book the histograms.
#define LogTrace(id)
const T & get() const
Definition: EventSetup.h:55
void DTLocalTriggerBaseTask::bookHistos ( const DTChamberId chamb)
private

Book the histograms.

Definition at line 239 of file DTLocalTriggerBaseTask.cc.

References chamberHistos, detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, DTTrigGeomUtils::phiRange(), processDCC, processDDU, DetId::rawId(), DTChamberId::sector(), setQLabels(), DTChamberId::station(), relativeConstraints::station, theDQMStore, theParams, theTrigGeomUtils, theTypes, topFolder(), tpMode, trendHistos, and DTChamberId::wheel().

Referenced by beginRun().

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

Book the histograms.

Definition at line 348 of file DTLocalTriggerBaseTask.cc.

References LogTrace, MonitorElement::setAxisTitle(), theDQMStore, topFolder(), and wheelHistos.

348  {
349 
350  stringstream wheel; wheel << wh;
351  theDQMStore->setCurrentFolder(topFolder("DDU") + "Wheel" + wheel.str() + "/");
352  string whTag = "_W" + wheel.str();
353 
354  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
355  << "[DTLocalTriggerBaseTask]: booking wheel histos for "
356  << topFolder("DDU") << "Wheel" << wh << endl;
357 
358  string histoTag = "COM_BXDiff";
359  MonitorElement *me = theDQMStore->bookProfile2D(histoTag+whTag,
360  "DDU-DCC BX Difference",12,1,13,4,1,5,0.,20.);
361  me->setAxisTitle("Sector",1);
362  me->setAxisTitle("station",2);
363  wheelHistos[wh][histoTag] = me;
364 
365 }
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
#define LogTrace(id)
std::string & topFolder(std::string const &type)
Get the Top folder (different between Physics and TP and DCC/DDU)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void DTLocalTriggerBaseTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 180 of file DTLocalTriggerBaseTask.cc.

References nEvents, processDCC, processDDU, theDQMStore, and topFolder().

180  {
181 
182  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
183  << "[DTLocalTriggerBaseTask]: analyzed " << nEvents << " events" << endl;
184 
185  if (processDCC) theDQMStore->rmdir(topFolder("DCC"));
186  if (processDDU) theDQMStore->rmdir(topFolder("DDU"));
187 
188 }
std::string & topFolder(std::string const &type)
Get the Top folder (different between Physics and TP and DCC/DDU)
void DTLocalTriggerBaseTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Perform trend plot operations.

Reimplemented from edm::EDAnalyzer.

Definition at line 166 of file DTLocalTriggerBaseTask.cc.

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

166  {
167 
168  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
169  << "[DTLocalTriggerBaseTask]: End of LS transition" << endl;
170 
171  map<uint32_t,DTTimeEvolutionHisto* >::const_iterator chambIt = trendHistos.begin();
172  map<uint32_t,DTTimeEvolutionHisto* >::const_iterator chambEnd = trendHistos.end();
173  for(;chambIt!=chambEnd;++chambIt) {
174  chambIt->second->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
175  }
176 
177 }
LuminosityBlockNumber_t luminosityBlock() const
#define LogTrace(id)
std::map< uint32_t, DTTimeEvolutionHisto * > trendHistos
void DTLocalTriggerBaseTask::runDCCAnalysis ( std::vector< L1MuDTChambPhDigi > const *  phTrigs,
std::vector< L1MuDTChambThDigi > const *  thTrigs 
)
private

Run analysis on DCC data.

Definition at line 368 of file DTLocalTriggerBaseTask.cc.

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

Referenced by analyze().

370 {
371  vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
372  vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
373 
374  for(; iph !=iphe ; ++iph) {
375 
376  int wh = iph->whNum();
377  int sec = iph->scNum() + 1; // DTTF->DT Convention
378  int st = iph->stNum();
379  int qual = iph->code();
380  int is1st = iph->Ts2Tag() ? 1 : 0;
381  int bx = iph->bxNum() - is1st;
382 
383  if (qual <0 || qual>6) continue; // Check that quality is in a valid range
384 
385  DTChamberId dtChId(wh,st,sec);
386  uint32_t rawId = dtChId.rawId();
387 
388  float pos = theTrigGeomUtils->trigPos(&(*iph));
389  float dir = theTrigGeomUtils->trigDir(&(*iph));
390 
391  if (abs(bx-targetBXDCC)<= bestAccRange &&
392  theCompMap[rawId].qualDCC() <= qual)
393  theCompMap[rawId].setDCC(qual,bx);
394 
395  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
396  if (tpMode) {
397  innerME["DCC_BXvsQual"]->Fill(qual,bx); // SM BX vs Qual Phi view (1st tracks)
398  innerME["DCC_QualvsPhirad"]->Fill(pos,qual); // SM Qual vs radial angle Phi view
399  } else {
400  innerME["DCC_BXvsQual"]->Fill(qual,bx); // SM BX vs Qual Phi view (1st tracks)
401  innerME["DCC_Flag1stvsQual"]->Fill(qual,is1st); // SM Qual 1st/2nd track flag Phi view
402  if (!is1st) innerME["DCC_QualvsPhirad"]->Fill(pos,qual); // SM Qual vs radial angle Phi view ONLY for 1st tracks
403  if (detailedAnalysis) {
404  innerME["DCC_QualvsPhibend"]->Fill(dir,qual); // SM Qual vs bending Phi view
405  }
406  }
407 
408  }
409 
410  vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin();
411  vector<L1MuDTChambThDigi>::const_iterator ithe = thTrigs->end();
412 
413  for(; ith != ithe; ++ith) {
414  int wh = ith->whNum();
415  int sec = ith->scNum() + 1; // DTTF -> DT Convention
416  int st = ith->stNum();
417  int bx = ith->bxNum();
418 
419  int thcode[7];
420 
421  for (int pos=0; pos<7; pos++)
422  thcode[pos] = ith->code(pos);
423 
424  DTChamberId dtChId(wh,st,sec);
425  uint32_t rawId = dtChId.rawId();
426 
427  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
428 
429  for (int pos=0; pos<7; pos++)
430  if (thcode[pos])
431  innerME["DCC_PositionvsBX"]->Fill(bx,pos); // SM BX vs Position Theta view
432 
433  }
434 
435  // Fill Quality plots with best DCC triggers (phi view)
436  if (!tpMode) {
437  map<uint32_t,DTTPGCompareUnit>::const_iterator compIt = theCompMap.begin();
438  map<uint32_t,DTTPGCompareUnit>::const_iterator compEnd = theCompMap.end();
439  for (; compIt!=compEnd; ++compIt) {
440  int bestQual = compIt->second.qualDCC();
441  if (bestQual > -1)
442  chamberHistos[compIt->first]["DCC_BestQual"]->Fill(bestQual); // SM Best Qual Trigger Phi view
443  }
444  }
445 
446 }
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::runDDUAnalysis ( edm::Handle< DTLocalTriggerCollection > &  trigsDDU)
private

Run analysis on ROS data.

Definition at line 449 of file DTLocalTriggerBaseTask.cc.

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

Referenced by analyze().

449  {
450 
451  DTLocalTriggerCollection::DigiRangeIterator detUnitIt = trigsDDU->begin();
452  DTLocalTriggerCollection::DigiRangeIterator detUnitEnd = trigsDDU->end();
453 
454  for (; detUnitIt!=detUnitEnd; ++detUnitIt){
455 
456  const DTChamberId& chId = (*detUnitIt).first;
457  uint32_t rawId = chId.rawId();
458 
459  const DTLocalTriggerCollection::Range& range = (*detUnitIt).second;
460  DTLocalTriggerCollection::const_iterator trigIt = range.first;
461  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
462 
463  int bestQualTheta = -1;
464 
465  for (; trigIt!=range.second; ++trigIt){
466 
467  int qualPhi = trigIt->quality();
468  int qualTheta = trigIt->trTheta();
469  int flag1st = trigIt->secondTrack() ? 1 : 0;
470  int bx = trigIt->bx();
471  int bxPhi = bx - flag1st; // phi BX assign is different for 1st & 2nd tracks
472 
473  if( qualPhi>-1 && qualPhi<7 ) { // it is a phi trigger
474  if (abs(bx-targetBXDDU) <= bestAccRange &&
475  theCompMap[rawId].qualDDU()<= qualPhi)
476  theCompMap[rawId].setDDU(qualPhi,bxPhi);
477  if(tpMode) {
478  innerME["DDU_BXvsQual"]->Fill(qualPhi,bxPhi); // SM BX vs Qual Phi view
479  } else {
480  innerME["DDU_BXvsQual"]->Fill(qualPhi,bxPhi); // SM BX vs Qual Phi view
481  innerME["DDU_Flag1stvsQual"]->Fill(qualPhi,flag1st); // SM Quality vs 1st/2nd track flag Phi view
482  }
483  }
484 
485  if( qualTheta>0 && !tpMode ){// it is a theta trigger & is not TP
486  if (qualTheta > bestQualTheta){
487  bestQualTheta = qualTheta;
488  }
489  innerME["DDU_ThetaBXvsQual"]->Fill(qualTheta,bx); // SM BX vs Qual Theta view
490  }
491  }
492 
493  // Fill Quality plots with best ddu triggers
494  if (!tpMode && theCompMap.find(rawId)!= theCompMap.end()) {
495  int bestQualPhi = theCompMap[rawId].qualDDU();
496  if (bestQualPhi>-1)
497  innerME["DDU_BestQual"]->Fill(bestQualPhi); // SM Best Qual Trigger Phi view
498  if(bestQualTheta>0) {
499  innerME["DDU_ThetaBestQual"]->Fill(bestQualTheta); // SM Best Qual Trigger Theta view
500  }
501  }
502  }
503 
504 }
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::runDDUvsDCCAnalysis ( )
private

Run analysis on ROS data.

Definition at line 507 of file DTLocalTriggerBaseTask.cc.

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

Referenced by analyze().

507  {
508 
509  map<uint32_t,DTTPGCompareUnit>::const_iterator compIt = theCompMap.begin();
510  map<uint32_t,DTTPGCompareUnit>::const_iterator compEnd = theCompMap.end();
511 
512  for (; compIt!=compEnd; ++compIt) {
513 
514  uint32_t rawId = compIt->first;
515  DTChamberId chId(rawId);
516  map<string, MonitorElement*> &innerME = chamberHistos[rawId];
517 
518  const DTTPGCompareUnit & compUnit = compIt->second;
519  if ( compUnit.hasOne() ){
520  innerME["COM_QualDDUvsQualDCC"]->Fill(compUnit.qualDCC(),compUnit.qualDDU());
521  }
522  if ( compUnit.hasBoth() ){
523  wheelHistos[chId.wheel()]["COM_BXDiff"]->Fill(chId.sector(),chId.station(),compUnit.deltaBX());
524  if ( compUnit.hasSameQual() ) {
525  trendHistos[rawId]->accumulateValueTimeSlot(1);
526  }
527  }
528  }
529 
530 }
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::setQLabels ( MonitorElement me,
short int  iaxis 
)
private

Set Quality labels.

Definition at line 533 of file DTLocalTriggerBaseTask.cc.

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

Referenced by bookHistos().

533  {
534 
535  TH1* histo = me->getTH1();
536  if (!histo) return;
537 
538  TAxis* axis=0;
539  if (iaxis==1) {
540  axis=histo->GetXaxis();
541  }
542  else if(iaxis==2) {
543  axis=histo->GetYaxis();
544  }
545  if (!axis) return;
546 
547  string labels[7] = {"LI","LO","HI","HO","LL","HL","HH"};
548  int istart = axis->GetXmin()<-1 ? 2 : 1;
549  for (int i=0;i<7;i++) {
550  axis->SetBinLabel(i+istart,labels[i].c_str());
551  }
552 
553 }
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 DCC/DDU)

Definition at line 87 of file DTLocalTriggerBaseTask.h.

References baseFolder.

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

87 { return baseFolder[type == "DCC"]; }
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 102 of file DTLocalTriggerBaseTask.h.

Referenced by topFolder().

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

Definition at line 123 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

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

Definition at line 124 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and DTLocalTriggerBaseTask().

bool DTLocalTriggerBaseTask::detailedAnalysis
private

Definition at line 104 of file DTLocalTriggerBaseTask.h.

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

MonitorElement* DTLocalTriggerBaseTask::nEventMonitor
private

Definition at line 121 of file DTLocalTriggerBaseTask.h.

Referenced by analyze(), and beginRun().

int DTLocalTriggerBaseTask::nEvents
private
int DTLocalTriggerBaseTask::nEventsInLS
private

Definition at line 99 of file DTLocalTriggerBaseTask.h.

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

int DTLocalTriggerBaseTask::nLumis
private

Definition at line 100 of file DTLocalTriggerBaseTask.h.

Referenced by beginLuminosityBlock().

bool DTLocalTriggerBaseTask::processDCC
private

Definition at line 105 of file DTLocalTriggerBaseTask.h.

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

bool DTLocalTriggerBaseTask::processDDU
private

Definition at line 106 of file DTLocalTriggerBaseTask.h.

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

int DTLocalTriggerBaseTask::targetBXDCC
private

Definition at line 109 of file DTLocalTriggerBaseTask.h.

Referenced by DTLocalTriggerBaseTask(), and runDCCAnalysis().

int DTLocalTriggerBaseTask::targetBXDDU
private

Definition at line 108 of file DTLocalTriggerBaseTask.h.

Referenced by DTLocalTriggerBaseTask(), and runDDUAnalysis().

std::map<uint32_t,DTTPGCompareUnit> DTLocalTriggerBaseTask::theCompMap
private
DQMStore* DTLocalTriggerBaseTask::theDQMStore
private

Definition at line 112 of file DTLocalTriggerBaseTask.h.

Referenced by beginRun(), bookHistos(), DTLocalTriggerBaseTask(), and endJob().

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

Definition at line 115 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), and DTLocalTriggerBaseTask().

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

Definition at line 120 of file DTLocalTriggerBaseTask.h.

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

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

Referenced by bookHistos(), and runDDUvsDCCAnalysis().