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

Public Member Functions

 DTLocalTriggerBaseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTLocalTriggerBaseTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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 > *phTrigs, std::vector< L1MuDTChambThDigi > *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 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
 
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
 
std::map< int, std::map
< std::string, MonitorElement * > > 
wheelHistos
 

Friends

class DTMonitorModule
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 67 of file DTLocalTriggerBaseTask.cc.

References bestAccRange, detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, cppFunctionSkipper::operator, processDCC, processDDU, targetBXDCC, targetBXDDU, theDQMStore, theParams, theTypes, topFolder(), and tpMode.

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

Destructor.

Definition at line 100 of file DTLocalTriggerBaseTask.cc.

References LogTrace, nEvents, and theTrigGeomUtils.

100  {
101 
102  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
103  << "[DTLocalTriggerBaseTask]: analyzed " << nEvents << " events" << endl;
104  if (theTrigGeomUtils) { delete theTrigGeomUtils; }
105 
106 }
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 188 of file DTLocalTriggerBaseTask.cc.

References MonitorElement::Fill(), edm::Event::getByLabel(), edm::ParameterSet::getUntrackedParameter(), edm::HandleBase::isValid(), nEventMonitor, nEvents, nEventsInLS, processDCC, processDDU, runDCCAnalysis(), runDDUAnalysis(), runDDUvsDCCAnalysis(), theCompMap, and theParams.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file DTLocalTriggerBaseTask.cc.

References LogTrace.

109  {
110 
111  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
112  << "[DTLocalTriggerBaseTask]: BeginJob" << endl;
113 
114 }
#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 140 of file DTLocalTriggerBaseTask.cc.

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

140  {
141 
142  nEventsInLS=0;
143  nLumis++;
144  int resetCycle = theParams.getUntrackedParameter<int>("ResetCycle");
145 
146  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
147  << "[DTLocalTriggerBaseTask]: Begin of LS transition" << endl;
148 
149  if( nLumis%resetCycle == 0 ) {
150  map<uint32_t,map<string,MonitorElement*> >::const_iterator chambIt = chamberHistos.begin();
151  map<uint32_t,map<string,MonitorElement*> >::const_iterator chambEnd = chamberHistos.end();
152  for(;chambIt!=chambEnd;++chambIt) {
153  map<string,MonitorElement*>::const_iterator histoIt = chambIt->second.begin();
154  map<string,MonitorElement*>::const_iterator histoEnd = chambIt->second.end();
155  for(;histoIt!=histoEnd;++histoIt) {
156  histoIt->second->Reset();
157  }
158  }
159  }
160 
161 }
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 117 of file DTLocalTriggerBaseTask.cc.

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

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

Book the histograms.

Definition at line 236 of file DTLocalTriggerBaseTask.cc.

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

Referenced by beginRun().

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

Book the histograms.

Definition at line 345 of file DTLocalTriggerBaseTask.cc.

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

345  {
346 
347  stringstream wheel; wheel << wh;
348  theDQMStore->setCurrentFolder(topFolder("DDU") + "Wheel" + wheel.str() + "/");
349  string whTag = "_W" + wheel.str();
350 
351  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
352  << "[DTLocalTriggerBaseTask]: booking wheel histos for "
353  << topFolder("DDU") << "Wheel" << wh << endl;
354 
355  string histoTag = "COM_BXDiff";
356  MonitorElement *me = theDQMStore->bookProfile2D(histoTag+whTag,
357  "DDU-DCC BX Difference",12,1,13,4,1,5,0.,20.);
358  me->setAxisTitle("Sector",1);
359  me->setAxisTitle("station",2);
360  wheelHistos[wh][histoTag] = me;
361 
362 }
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
#define LogTrace(id)
std::string & topFolder(std::string 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 setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1175
void DTLocalTriggerBaseTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 177 of file DTLocalTriggerBaseTask.cc.

References nEvents, processDCC, processDDU, DQMStore::rmdir(), theDQMStore, and topFolder().

177  {
178 
179  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
180  << "[DTLocalTriggerBaseTask]: analyzed " << nEvents << " events" << endl;
181 
182  if (processDCC) theDQMStore->rmdir(topFolder("DCC"));
183  if (processDDU) theDQMStore->rmdir(topFolder("DDU"));
184 
185 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2530
std::string & topFolder(std::string 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 163 of file DTLocalTriggerBaseTask.cc.

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

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

Run analysis on DCC data.

Definition at line 365 of file DTLocalTriggerBaseTask.cc.

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

Referenced by analyze().

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

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

Referenced by analyze().

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

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

References MonitorElement::getTH1(), interpolateCardsSimple::histo, i, and reco_calib_source_client_cfg::labels.

Referenced by bookHistos().

530  {
531 
532  TH1* histo = me->getTH1();
533  if (!histo) return;
534 
535  TAxis* axis=0;
536  if (iaxis==1) {
537  axis=histo->GetXaxis();
538  }
539  else if(iaxis==2) {
540  axis=histo->GetYaxis();
541  }
542  if (!axis) return;
543 
544  string labels[7] = {"LI","LO","HI","HO","LL","HL","HH"};
545  int istart = axis->GetXmin()<-1 ? 2 : 1;
546  for (int i=0;i<7;i++) {
547  axis->SetBinLabel(i+istart,labels[i].c_str());
548  }
549 
550 }
int i
Definition: DBlmapReader.cc:9
TH1 * getTH1(void) const
std::string& DTLocalTriggerBaseTask::topFolder ( std::string  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:22

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

Definition at line 98 of file DTLocalTriggerBaseTask.h.

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

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

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

Definition at line 118 of file DTLocalTriggerBaseTask.h.

Referenced by bookHistos(), and runDDUvsDCCAnalysis().