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
DTSegmentAnalysisTask Class Reference

#include <DTSegmentAnalysisTask.h>

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

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
 Summary. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &)
 BeginRun. More...
 
 DTSegmentAnalysisTask (const edm::ParameterSet &pset)
 Constructor. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
 
virtual ~DTSegmentAnalysisTask ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 (DQMStore::IBooker &ibooker, DTChamberId chamberId)
 
void fillHistos (DTChamberId chamberId, int nHits, float chi2)
 

Private Attributes

bool checkNoisyChannels
 
bool detailedAnalysis
 
edm::ESHandle< DTGeometrydtGeom
 
std::map< DTChamberId,
std::vector< MonitorElement * > > 
histosPerCh
 
std::map< int, std::map< int,
DTTimeEvolutionHisto * > > 
histoTimeEvol
 
bool hltDQMMode
 
DTTimeEvolutionHistohNevtPerLS
 
MonitorElementnEventMonitor
 
int nevents
 
int nEventsInLS
 
int nhitsCut
 
int nLSTimeBin
 
int nTimeBins
 
edm::ParameterSet parameters
 
double phiSegmCut
 
edm::EDGetTokenT
< DTRecSegment4DCollection
recHits4DToken_
 
bool slideTimeBins
 
std::map< int, MonitorElement * > summaryHistos
 
std::string topHistoFolder
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

DQM Analysis of 4D DT segments, it produces plots about:

Author
G. Cerminara - INFN Torino

Definition at line 43 of file DTSegmentAnalysisTask.h.

Constructor & Destructor Documentation

DTSegmentAnalysisTask::DTSegmentAnalysisTask ( const edm::ParameterSet pset)

Constructor.

Definition at line 39 of file DTSegmentAnalysisTask.cc.

References checkNoisyChannels, detailedAnalysis, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltDQMMode, HLT_25ns14e33_v1_cff::InputTag, nhitsCut, nLSTimeBin, nTimeBins, phiSegmCut, recHits4DToken_, slideTimeBins, and topHistoFolder.

39  : nevents(0) , nEventsInLS(0), hNevtPerLS(0) {
40 
41  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "[DTSegmentAnalysisTask] Constructor called!";
42 
43  // switch for detailed analysis
44  detailedAnalysis = pset.getUntrackedParameter<bool>("detailedAnalysis",false);
45  // the name of the 4D rec hits collection
46  recHits4DToken_ = consumes<DTRecSegment4DCollection>(
47  edm::InputTag(pset.getParameter<string>("recHits4DLabel")));
48  // Get the map of noisy channels
49  checkNoisyChannels = pset.getUntrackedParameter<bool>("checkNoisyChannels",false);
50  // # of bins in the time histos
51  nTimeBins = pset.getUntrackedParameter<int>("nTimeBins",100);
52  // # of LS per bin in the time histos
53  nLSTimeBin = pset.getUntrackedParameter<int>("nLSTimeBin",2);
54  // switch on/off sliding bins in time histos
55  slideTimeBins = pset.getUntrackedParameter<bool>("slideTimeBins",true);
56  phiSegmCut = pset.getUntrackedParameter<double>("phiSegmCut",30.);
57  nhitsCut = pset.getUntrackedParameter<int>("nhitsCut",12);
58 
59  // top folder for the histograms in DQMStore
60  topHistoFolder = pset.getUntrackedParameter<string>("topHistoFolder","DT/02-Segments");
61  // hlt DQM mode
62  hltDQMMode = pset.getUntrackedParameter<bool>("hltDQMMode",false);
63 
64 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTTimeEvolutionHisto * hNevtPerLS
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
DTSegmentAnalysisTask::~DTSegmentAnalysisTask ( )
virtual

Destructor.

Definition at line 67 of file DTSegmentAnalysisTask.cc.

References hNevtPerLS.

67  {
68  //FR moved fron endjob
69  delete hNevtPerLS;
70  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "[DTSegmentAnalysisTask] Destructor called!";
71 }
DTTimeEvolutionHisto * hNevtPerLS

Member Function Documentation

void DTSegmentAnalysisTask::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 124 of file DTSegmentAnalysisTask.cc.

References checkNoisyChannels, HLT_25ns14e33_v1_cff::distance, edm::EventID::event(), MonitorElement::Fill(), fillHistos(), edm::EventSetup::get(), edm::EventBase::id(), edm::HandleBase::isValid(), nEventMonitor, nevents, nEventsInLS, nhitsCut, phiSegmCut, Pi, recHits4DToken_, findQualityFiles::size, DTRecSegment2D::specificRecHits(), crabStatusFromReport::statusMap, and xdir.

124  {
125 
126  nevents++;
128 
129  nEventsInLS++;
130  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "[DTSegmentAnalysisTask] Analyze #Run: " << event.id().run()
131  << " #Event: " << event.id().event();
132  if(!(event.id().event()%1000))
133  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "[DTSegmentAnalysisTask] Analyze #Run: " << event.id().run()
134  << " #Event: " << event.id().event();
135 
137  if(checkNoisyChannels) {
138  setup.get<DTStatusFlagRcd>().get(statusMap);
139  }
140 
141 
142  // -- 4D segment analysis -----------------------------------------------------
143 
144  // Get the 4D segment collection from the event
146  event.getByToken(recHits4DToken_, all4DSegments);
147 
148  if(!all4DSegments.isValid()) return;
149 
150  // Loop over all chambers containing a segment
151  DTRecSegment4DCollection::id_iterator chamberId;
152  for (chamberId = all4DSegments->id_begin();
153  chamberId != all4DSegments->id_end();
154  ++chamberId){
155  // Get the range for the corresponding ChamerId
156  DTRecSegment4DCollection::range range = all4DSegments->get(*chamberId);
157 
158  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << " Chamber: " << *chamberId << " has " << distance(range.first, range.second)
159  << " 4D segments";
160 
161  // Loop over the rechits of this ChamerId
162  for (DTRecSegment4DCollection::const_iterator segment4D = range.first;
163  segment4D!=range.second;
164  ++segment4D){
165 
166  //FOR NOISY CHANNELS////////////////////////////////
167  bool segmNoisy = false;
168  if(checkNoisyChannels) {
169 
170  if((*segment4D).hasPhi()){
171  const DTChamberRecSegment2D* phiSeg = (*segment4D).phiSegment();
172  vector<DTRecHit1D> phiHits = phiSeg->specificRecHits();
173  map<DTSuperLayerId,vector<DTRecHit1D> > hitsBySLMap;
174  for(vector<DTRecHit1D>::const_iterator hit = phiHits.begin();
175  hit != phiHits.end(); ++hit) {
176  DTWireId wireId = (*hit).wireId();
177 
178  // Check for noisy channels to skip them
179  bool isNoisy = false;
180  bool isFEMasked = false;
181  bool isTDCMasked = false;
182  bool isTrigMask = false;
183  bool isDead = false;
184  bool isNohv = false;
185  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
186  if(isNoisy) {
187  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "Wire: " << wireId << " is noisy, skipping!";
188  segmNoisy = true;
189  }
190  }
191  }
192 
193  if((*segment4D).hasZed()) {
194  const DTSLRecSegment2D* zSeg = (*segment4D).zSegment(); // zSeg lives in the SL RF
195  // Check for noisy channels to skip them
196  vector<DTRecHit1D> zHits = zSeg->specificRecHits();
197  for(vector<DTRecHit1D>::const_iterator hit = zHits.begin();
198  hit != zHits.end(); ++hit) {
199  DTWireId wireId = (*hit).wireId();
200  bool isNoisy = false;
201  bool isFEMasked = false;
202  bool isTDCMasked = false;
203  bool isTrigMask = false;
204  bool isDead = false;
205  bool isNohv = false;
206  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
207  if(isNoisy) {
208  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "Wire: " << wireId << " is noisy, skipping!";
209  segmNoisy = true;
210  }
211  }
212  }
213 
214  } // end of switch on noisy channels
215  if (segmNoisy) {
216  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask")<<"skipping the segment: it contains noisy cells";
217  continue;
218  }
219  //END FOR NOISY CHANNELS////////////////////////////////
220 
221  int nHits=0;
222  if((*segment4D).hasPhi())
223  nHits = (((*segment4D).phiSegment())->specificRecHits()).size();
224  if((*segment4D).hasZed())
225  nHits = nHits + ((((*segment4D).zSegment())->specificRecHits()).size());
226 
227  double anglePhiSegm(0.);
228  if( (*segment4D).hasPhi() ) {
229  double xdir = (*segment4D).phiSegment()->localDirection().x();
230  double zdir = (*segment4D).phiSegment()->localDirection().z();
231 
232  anglePhiSegm = atan(xdir/zdir)*180./TMath::Pi();
233  }
234  if( fabs(anglePhiSegm) > phiSegmCut ) continue;
235  // If the segment is in Wh+-2/SecX/MB1, get the DT chambers just above and check if there is a segment
236  // to validate the segment present in MB1
237  if( fabs((*chamberId).wheel()) == 2 && (*chamberId).station() == 1 ) {
238 
239  bool segmOk=false;
240  int mb(2);
241  while( mb < 4 ) {
242  DTChamberId checkMB((*chamberId).wheel(),mb,(*chamberId).sector());
243  DTRecSegment4DCollection::range ckrange = all4DSegments->get(checkMB);
244 
245  for (DTRecSegment4DCollection::const_iterator cksegment4D = ckrange.first;
246  cksegment4D!=ckrange.second;
247  ++cksegment4D){
248 
249  int nHits=0;
250  if((*cksegment4D).hasPhi())
251  nHits = (((*cksegment4D).phiSegment())->specificRecHits()).size();
252  if((*cksegment4D).hasZed())
253  nHits = nHits + ((((*cksegment4D).zSegment())->specificRecHits()).size());
254 
255  if( nHits >= nhitsCut ) segmOk=true;
256 
257  }
258  mb++;
259  }
260 
261  if( !segmOk ) continue;
262 
263  }
264  fillHistos(*chamberId,
265  nHits,
266  (*segment4D).chi2()/(*segment4D).degreesOfFreedom());
267  }
268  }
269 
270  // -----------------------------------------------------------------------------
271 }
const double Pi
EventNumber_t event() const
Definition: EventID.h:41
void fillHistos(DTChamberId chamberId, int nHits, float chi2)
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
void Fill(long long x)
bool isValid() const
Definition: HandleBase.h:75
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
const T & get() const
Definition: EventSetup.h:55
MonitorElement * nEventMonitor
edm::EventID id() const
Definition: EventBase.h:60
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
tuple size
Write out results.
void DTSegmentAnalysisTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
virtual

Summary.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 370 of file DTSegmentAnalysisTask.cc.

References nEventsInLS.

370  {
371  nEventsInLS = 0;
372 }
void DTSegmentAnalysisTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 81 of file DTSegmentAnalysisTask.cc.

References DQMStore::IBooker::bookFloat(), bookHistos(), chambers, dtGeom, histoTimeEvol, hltDQMMode, hNevtPerLS, nEventMonitor, nLSTimeBin, nTimeBins, DQMStore::IBooker::setCurrentFolder(), slideTimeBins, and topHistoFolder.

81  {
82 
83  if (!hltDQMMode) {
84  ibooker.setCurrentFolder("DT/EventInfo/Counters");
85  nEventMonitor = ibooker.bookFloat("nProcessedEventsSegment");
86  }
87 
88  // loop over all the DT chambers & book the histos
89  const vector<const DTChamber*>& chambers = dtGeom->chambers();
90  vector<const DTChamber*>::const_iterator ch_it = chambers.begin();
91  vector<const DTChamber*>::const_iterator ch_end = chambers.end();
92  for (; ch_it != ch_end; ++ch_it) {
93  bookHistos(ibooker,(*ch_it)->id());
94  }
95 
96  // book sector time-evolution histos
97  int modeTimeHisto = 0;
98  if(!slideTimeBins) modeTimeHisto = 1;
99  for(int wheel = -2; wheel != 3; ++wheel) { // loop over wheels
100  for(int sector = 1; sector <= 12; ++sector) { // loop over sectors
101 
102  stringstream wheelstr; wheelstr << wheel;
103  stringstream sectorstr; sectorstr << sector;
104  string sectorHistoName = "NSegmPerEvent_W" + wheelstr.str()
105  + "_Sec" + sectorstr.str();
106  string sectorHistoTitle = "# segm. W" + wheelstr.str() + " Sect." + sectorstr.str();
107 
108  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheelstr.str() +
109  "/Sector" + sectorstr.str());
110 
111  histoTimeEvol[wheel][sector] = new DTTimeEvolutionHisto(ibooker,sectorHistoName,sectorHistoTitle,
112  nTimeBins,nLSTimeBin,slideTimeBins,modeTimeHisto);
113 
114  }
115  }
116 
118  else ibooker.setCurrentFolder("DT/EventInfo/");
119 
120  hNevtPerLS = new DTTimeEvolutionHisto(ibooker,"NevtPerLS","# evt.",nTimeBins,nLSTimeBin,slideTimeBins,2);
121 
122 }
DTTimeEvolutionHisto * hNevtPerLS
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chamberId)
edm::ESHandle< DTGeometry > dtGeom
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * nEventMonitor
std::map< int, std::map< int, DTTimeEvolutionHisto * > > histoTimeEvol
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
void DTSegmentAnalysisTask::bookHistos ( DQMStore::IBooker ibooker,
DTChamberId  chamberId 
)
private

Definition at line 275 of file DTSegmentAnalysisTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), detailedAnalysis, hltbtagharvestinganalyzer_cfi::histoName, mergeVDriftHistosByStation::histos, histosPerCh, DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, summaryHistos, topHistoFolder, and DTChamberId::wheel().

Referenced by bookHistograms().

275  {
276 
277  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << " Booking histos for chamber: " << chamberId;
278 
279 
280  // Compose the chamber name
281  stringstream wheel; wheel << chamberId.wheel();
282  stringstream station; station << chamberId.station();
283  stringstream sector; sector << chamberId.sector();
284 
285  string chamberHistoName =
286  "_W" + wheel.str() +
287  "_St" + station.str() +
288  "_Sec" + sector.str();
289 
290 
291  for(int wh=-2; wh<=2; wh++){
292  stringstream wheel; wheel << wh;
293  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheel.str());
294  string histoName = "numberOfSegments_W" + wheel.str();
295 
296  summaryHistos[wh] = ibooker.book2D(histoName.c_str(),histoName.c_str(),12,1,13,4,1,5);
297  summaryHistos[wh]->setAxisTitle("Sector",1);
298  summaryHistos[wh]->setBinLabel(1,"1",1);
299  summaryHistos[wh]->setBinLabel(2,"2",1);
300  summaryHistos[wh]->setBinLabel(3,"3",1);
301  summaryHistos[wh]->setBinLabel(4,"4",1);
302  summaryHistos[wh]->setBinLabel(5,"5",1);
303  summaryHistos[wh]->setBinLabel(6,"6",1);
304  summaryHistos[wh]->setBinLabel(7,"7",1);
305  summaryHistos[wh]->setBinLabel(8,"8",1);
306  summaryHistos[wh]->setBinLabel(9,"9",1);
307  summaryHistos[wh]->setBinLabel(10,"10",1);
308  summaryHistos[wh]->setBinLabel(11,"11",1);
309  summaryHistos[wh]->setBinLabel(12,"12",1);
310  summaryHistos[wh]->setBinLabel(1,"MB1",2);
311  summaryHistos[wh]->setBinLabel(2,"MB2",2);
312  summaryHistos[wh]->setBinLabel(3,"MB3",2);
313  summaryHistos[wh]->setBinLabel(4,"MB4",2);
314  }
315 
316 
317  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheel.str() +
318  "/Sector" + sector.str() +
319  "/Station" + station.str());
320 
321  // Create the monitor elements
322  vector<MonitorElement *> histos;
323  histos.push_back(ibooker.book1D("h4DSegmNHits"+chamberHistoName,
324  "# of hits per segment",
325  16, 0.5, 16.5));
326  if(detailedAnalysis){
327  histos.push_back(ibooker.book1D("h4DChi2"+chamberHistoName,
328  "4D Segment reduced Chi2",
329  20, 0, 20));
330  }
331  histosPerCh[chamberId] = histos;
332 }
std::map< int, MonitorElement * > summaryHistos
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
void DTSegmentAnalysisTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
virtual

BeginRun.

Reimplemented from DQMEDAnalyzer.

Definition at line 74 of file DTSegmentAnalysisTask.cc.

References dtGeom, and edm::EventSetup::get().

74  {
75 
76  // Get the DT Geometry
77  context.get<MuonGeometryRecord>().get(dtGeom);
78 
79 }
edm::ESHandle< DTGeometry > dtGeom
const T & get() const
Definition: EventSetup.h:55
void DTSegmentAnalysisTask::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
virtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 358 of file DTSegmentAnalysisTask.cc.

References histoTimeEvol, hNevtPerLS, edm::LuminosityBlockBase::luminosityBlock(), nEventsInLS, and DTTimeEvolutionHisto::updateTimeSlot().

358  {
359 
360  hNevtPerLS->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
361  // book sector time-evolution histos
362  for(int wheel = -2; wheel != 3; ++wheel) {
363  for(int sector = 1; sector <= 12; ++sector) {
364  histoTimeEvol[wheel][sector]->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
365  }
366  }
367 }
DTTimeEvolutionHisto * hNevtPerLS
void updateTimeSlot(int ls, int nEventsInLS)
std::map< int, std::map< int, DTTimeEvolutionHisto * > > histoTimeEvol
void DTSegmentAnalysisTask::fillHistos ( DTChamberId  chamberId,
int  nHits,
float  chi2 
)
private

Definition at line 336 of file DTSegmentAnalysisTask.cc.

References detailedAnalysis, mergeVDriftHistosByStation::histos, histosPerCh, histoTimeEvol, DTChamberId::sector(), DTChamberId::station(), summaryHistos, and DTChamberId::wheel().

Referenced by analyze().

338  {
339  int sector = chamberId.sector();
340  if(chamberId.sector()==13) {
341  sector = 4;
342  } else if(chamberId.sector()==14) {
343  sector = 10;
344  }
345 
346  summaryHistos[chamberId.wheel()]->Fill(sector,chamberId.station());
347  histoTimeEvol[chamberId.wheel()][sector]->accumulateValueTimeSlot(1);
348 
349  vector<MonitorElement *> histos = histosPerCh[chamberId];
350  histos[0]->Fill(nHits);
351  if(detailedAnalysis){
352  histos[1]->Fill(chi2);
353  }
354 
355 }
std::map< int, MonitorElement * > summaryHistos
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
std::map< int, std::map< int, DTTimeEvolutionHisto * > > histoTimeEvol
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45

Member Data Documentation

bool DTSegmentAnalysisTask::checkNoisyChannels
private

Definition at line 81 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and DTSegmentAnalysisTask().

bool DTSegmentAnalysisTask::detailedAnalysis
private

Definition at line 72 of file DTSegmentAnalysisTask.h.

Referenced by bookHistos(), DTSegmentAnalysisTask(), and fillHistos().

edm::ESHandle<DTGeometry> DTSegmentAnalysisTask::dtGeom
private

Definition at line 75 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and dqmBeginRun().

std::map<DTChamberId, std::vector<MonitorElement*> > DTSegmentAnalysisTask::histosPerCh
private

Definition at line 93 of file DTSegmentAnalysisTask.h.

Referenced by bookHistos(), and fillHistos().

std::map<int, std::map<int, DTTimeEvolutionHisto*> > DTSegmentAnalysisTask::histoTimeEvol
private

Definition at line 95 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), endLuminosityBlock(), and fillHistos().

bool DTSegmentAnalysisTask::hltDQMMode
private

Definition at line 110 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and DTSegmentAnalysisTask().

DTTimeEvolutionHisto* DTSegmentAnalysisTask::hNevtPerLS
private
MonitorElement* DTSegmentAnalysisTask::nEventMonitor
private

Definition at line 116 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and bookHistograms().

int DTSegmentAnalysisTask::nevents
private

Definition at line 97 of file DTSegmentAnalysisTask.h.

Referenced by analyze().

int DTSegmentAnalysisTask::nEventsInLS
private

Definition at line 98 of file DTSegmentAnalysisTask.h.

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

int DTSegmentAnalysisTask::nhitsCut
private

Definition at line 114 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and DTSegmentAnalysisTask().

int DTSegmentAnalysisTask::nLSTimeBin
private

Definition at line 104 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and DTSegmentAnalysisTask().

int DTSegmentAnalysisTask::nTimeBins
private

Definition at line 102 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and DTSegmentAnalysisTask().

edm::ParameterSet DTSegmentAnalysisTask::parameters
private
double DTSegmentAnalysisTask::phiSegmCut
private

Definition at line 112 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and DTSegmentAnalysisTask().

edm::EDGetTokenT<DTRecSegment4DCollection> DTSegmentAnalysisTask::recHits4DToken_
private

Definition at line 78 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and DTSegmentAnalysisTask().

bool DTSegmentAnalysisTask::slideTimeBins
private

Definition at line 106 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and DTSegmentAnalysisTask().

std::map< int, MonitorElement* > DTSegmentAnalysisTask::summaryHistos
private

Definition at line 94 of file DTSegmentAnalysisTask.h.

Referenced by bookHistos(), and fillHistos().

std::string DTSegmentAnalysisTask::topHistoFolder
private

Definition at line 108 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), bookHistos(), and DTSegmentAnalysisTask().