CMS 3D CMS Logo

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) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
 Summary. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 BeginRun. More...
 
 DTSegmentAnalysisTask (const edm::ParameterSet &pset)
 Constructor. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
 
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
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- 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< DTRecSegment4DCollectionrecHits4DToken_
 
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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (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, 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 
)
override

Definition at line 149 of file DTSegmentAnalysisTask.cc.

References DTStatusFlag::cellStatus(), checkNoisyChannels, SoftLeptonByDistance_cfi::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(), and xdir.

149  {
150 
151  nevents++;
153 
154  nEventsInLS++;
155  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "[DTSegmentAnalysisTask] Analyze #Run: " << event.id().run()
156  << " #Event: " << event.id().event();
157  if(!(event.id().event()%1000))
158  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "[DTSegmentAnalysisTask] Analyze #Run: " << event.id().run()
159  << " #Event: " << event.id().event();
160 
161  ESHandle<DTStatusFlag> statusMap;
162  if(checkNoisyChannels) {
163  setup.get<DTStatusFlagRcd>().get(statusMap);
164  }
165 
166 
167  // -- 4D segment analysis -----------------------------------------------------
168 
169  // Get the 4D segment collection from the event
171  event.getByToken(recHits4DToken_, all4DSegments);
172 
173  if(!all4DSegments.isValid()) return;
174 
175  // Loop over all chambers containing a segment
176  DTRecSegment4DCollection::id_iterator chamberId;
177  for (chamberId = all4DSegments->id_begin();
178  chamberId != all4DSegments->id_end();
179  ++chamberId){
180  // Get the range for the corresponding ChamerId
181  DTRecSegment4DCollection::range range = all4DSegments->get(*chamberId);
182 
183  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << " Chamber: " << *chamberId << " has " << distance(range.first, range.second)
184  << " 4D segments";
185 
186  // Loop over the rechits of this ChamerId
187  for (DTRecSegment4DCollection::const_iterator segment4D = range.first;
188  segment4D!=range.second;
189  ++segment4D){
190 
191  //FOR NOISY CHANNELS////////////////////////////////
192  bool segmNoisy = false;
193  if(checkNoisyChannels) {
194 
195  if((*segment4D).hasPhi()){
196  const DTChamberRecSegment2D* phiSeg = (*segment4D).phiSegment();
197  vector<DTRecHit1D> phiHits = phiSeg->specificRecHits();
198  map<DTSuperLayerId,vector<DTRecHit1D> > hitsBySLMap;
199  for(vector<DTRecHit1D>::const_iterator hit = phiHits.begin();
200  hit != phiHits.end(); ++hit) {
201  DTWireId wireId = (*hit).wireId();
202 
203  // Check for noisy channels to skip them
204  bool isNoisy = false;
205  bool isFEMasked = false;
206  bool isTDCMasked = false;
207  bool isTrigMask = false;
208  bool isDead = false;
209  bool isNohv = false;
210  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
211  if(isNoisy) {
212  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "Wire: " << wireId << " is noisy, skipping!";
213  segmNoisy = true;
214  }
215  }
216  }
217 
218  if((*segment4D).hasZed()) {
219  const DTSLRecSegment2D* zSeg = (*segment4D).zSegment(); // zSeg lives in the SL RF
220  // Check for noisy channels to skip them
221  vector<DTRecHit1D> zHits = zSeg->specificRecHits();
222  for(vector<DTRecHit1D>::const_iterator hit = zHits.begin();
223  hit != zHits.end(); ++hit) {
224  DTWireId wireId = (*hit).wireId();
225  bool isNoisy = false;
226  bool isFEMasked = false;
227  bool isTDCMasked = false;
228  bool isTrigMask = false;
229  bool isDead = false;
230  bool isNohv = false;
231  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
232  if(isNoisy) {
233  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "Wire: " << wireId << " is noisy, skipping!";
234  segmNoisy = true;
235  }
236  }
237  }
238 
239  } // end of switch on noisy channels
240  if (segmNoisy) {
241  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask")<<"skipping the segment: it contains noisy cells";
242  continue;
243  }
244  //END FOR NOISY CHANNELS////////////////////////////////
245 
246  int nHits=0;
247  if((*segment4D).hasPhi())
248  nHits = (((*segment4D).phiSegment())->specificRecHits()).size();
249  if((*segment4D).hasZed())
250  nHits = nHits + ((((*segment4D).zSegment())->specificRecHits()).size());
251 
252  double anglePhiSegm(0.);
253  if( (*segment4D).hasPhi() ) {
254  double xdir = (*segment4D).phiSegment()->localDirection().x();
255  double zdir = (*segment4D).phiSegment()->localDirection().z();
256 
257  anglePhiSegm = atan(xdir/zdir)*180./TMath::Pi();
258  }
259  if( fabs(anglePhiSegm) > phiSegmCut ) continue;
260  // If the segment is in Wh+-2/SecX/MB1, get the DT chambers just above and check if there is a segment
261  // to validate the segment present in MB1
262  if( fabs((*chamberId).wheel()) == 2 && (*chamberId).station() == 1 ) {
263 
264  bool segmOk=false;
265  int mb(2);
266  while( mb < 4 ) {
267  DTChamberId checkMB((*chamberId).wheel(),mb,(*chamberId).sector());
268  DTRecSegment4DCollection::range ckrange = all4DSegments->get(checkMB);
269 
270  for (DTRecSegment4DCollection::const_iterator cksegment4D = ckrange.first;
271  cksegment4D!=ckrange.second;
272  ++cksegment4D){
273 
274  int nHits=0;
275  if((*cksegment4D).hasPhi())
276  nHits = (((*cksegment4D).phiSegment())->specificRecHits()).size();
277  if((*cksegment4D).hasZed())
278  nHits = nHits + ((((*cksegment4D).zSegment())->specificRecHits()).size());
279 
280  if( nHits >= nhitsCut ) segmOk=true;
281 
282  }
283  mb++;
284  }
285 
286  if( !segmOk ) continue;
287 
288  }
289  fillHistos(*chamberId,
290  nHits,
291  (*segment4D).chi2()/(*segment4D).degreesOfFreedom());
292  }
293  }
294 
295  // -----------------------------------------------------------------------------
296 }
size
Write out results.
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:74
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
const T & get() const
Definition: EventSetup.h:56
int cellStatus(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool &noiseFlag, bool &feMask, bool &tdcMask, bool &trigMask, bool &deadFlag, bool &nohvFlag) const
get content
Definition: DTStatusFlag.h:100
MonitorElement * nEventMonitor
edm::EventID id() const
Definition: EventBase.h:60
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
void DTSegmentAnalysisTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overridevirtual

Summary.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 368 of file DTSegmentAnalysisTask.cc.

References nEventsInLS.

368  {
369  nEventsInLS = 0;
370 }
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::book2D(), DQMStore::IBooker::bookFloat(), bookHistos(), DTGeometry::chambers(), chambers, dtGeom, histoTimeEvol, hltDQMMode, hNevtPerLS, nEventMonitor, nLSTimeBin, nTimeBins, DQMStore::IBooker::setCurrentFolder(), slideTimeBins, summaryHistos, topHistoFolder, and makeMuonMisalignmentScenario::wheel.

81  {
82 
83  if (!hltDQMMode) {
84  ibooker.setCurrentFolder("DT/EventInfo/Counters");
85  nEventMonitor = ibooker.bookFloat("nProcessedEventsSegment");
86  }
87 
88  for(int wh=-2; wh<=2; wh++){
89  stringstream wheel; wheel << wh;
90  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheel.str());
91  string histoName = "numberOfSegments_W" + wheel.str();
92 
93  summaryHistos[wh] = ibooker.book2D(histoName.c_str(),histoName.c_str(),12,1,13,4,1,5);
94  summaryHistos[wh]->setAxisTitle("Sector",1);
95  summaryHistos[wh]->setBinLabel(1,"1",1);
96  summaryHistos[wh]->setBinLabel(2,"2",1);
97  summaryHistos[wh]->setBinLabel(3,"3",1);
98  summaryHistos[wh]->setBinLabel(4,"4",1);
99  summaryHistos[wh]->setBinLabel(5,"5",1);
100  summaryHistos[wh]->setBinLabel(6,"6",1);
101  summaryHistos[wh]->setBinLabel(7,"7",1);
102  summaryHistos[wh]->setBinLabel(8,"8",1);
103  summaryHistos[wh]->setBinLabel(9,"9",1);
104  summaryHistos[wh]->setBinLabel(10,"10",1);
105  summaryHistos[wh]->setBinLabel(11,"11",1);
106  summaryHistos[wh]->setBinLabel(12,"12",1);
107  summaryHistos[wh]->setBinLabel(1,"MB1",2);
108  summaryHistos[wh]->setBinLabel(2,"MB2",2);
109  summaryHistos[wh]->setBinLabel(3,"MB3",2);
110  summaryHistos[wh]->setBinLabel(4,"MB4",2);
111  }
112 
113  // loop over all the DT chambers & book the histos
114  const vector<const DTChamber*>& chambers = dtGeom->chambers();
115  vector<const DTChamber*>::const_iterator ch_it = chambers.begin();
116  vector<const DTChamber*>::const_iterator ch_end = chambers.end();
117  for (; ch_it != ch_end; ++ch_it) {
118  bookHistos(ibooker,(*ch_it)->id());
119  }
120 
121  // book sector time-evolution histos
122  int modeTimeHisto = 0;
123  if(!slideTimeBins) modeTimeHisto = 1;
124  for(int wheel = -2; wheel != 3; ++wheel) { // loop over wheels
125  for(int sector = 1; sector <= 12; ++sector) { // loop over sectors
126 
127  stringstream wheelstr; wheelstr << wheel;
128  stringstream sectorstr; sectorstr << sector;
129  string sectorHistoName = "NSegmPerEvent_W" + wheelstr.str()
130  + "_Sec" + sectorstr.str();
131  string sectorHistoTitle = "# segm. W" + wheelstr.str() + " Sect." + sectorstr.str();
132 
133  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheelstr.str() +
134  "/Sector" + sectorstr.str());
135 
136  histoTimeEvol[wheel][sector] = new DTTimeEvolutionHisto(ibooker,sectorHistoName,sectorHistoTitle,
137  nTimeBins,nLSTimeBin,slideTimeBins,modeTimeHisto);
138 
139  }
140  }
141 
143  else ibooker.setCurrentFolder("DT/EventInfo/");
144 
145  hNevtPerLS = new DTTimeEvolutionHisto(ibooker,"NevtPerLS","# evt.",nTimeBins,nLSTimeBin,slideTimeBins,2);
146 
147 }
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:85
DTTimeEvolutionHisto * hNevtPerLS
std::map< int, MonitorElement * > summaryHistos
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chamberId)
edm::ESHandle< DTGeometry > dtGeom
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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 300 of file DTSegmentAnalysisTask.cc.

References DQMStore::IBooker::book1D(), detailedAnalysis, plotFactory::histos, histosPerCh, DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, topHistoFolder, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

300  {
301 
302  edm::LogVerbatim ("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << " Booking histos for chamber: " << chamberId;
303 
304 
305  // Compose the chamber name
306  stringstream wheel; wheel << chamberId.wheel();
307  stringstream station; station << chamberId.station();
308  stringstream sector; sector << chamberId.sector();
309 
310  string chamberHistoName =
311  "_W" + wheel.str() +
312  "_St" + station.str() +
313  "_Sec" + sector.str();
314 
315  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheel.str() +
316  "/Sector" + sector.str() +
317  "/Station" + station.str());
318 
319  // Create the monitor elements
320  vector<MonitorElement *> histos;
321  histos.push_back(ibooker.book1D("h4DSegmNHits"+chamberHistoName,
322  "# of hits per segment",
323  16, 0.5, 16.5));
324  if(detailedAnalysis){
325  histos.push_back(ibooker.book1D("h4DChi2"+chamberHistoName,
326  "4D Segment reduced Chi2",
327  20, 0, 20));
328  }
329  histosPerCh[chamberId] = histos;
330 }
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
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 
)
override

BeginRun.

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:56
void DTSegmentAnalysisTask::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overridevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 356 of file DTSegmentAnalysisTask.cc.

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

356  {
357 
358  hNevtPerLS->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
359  // book sector time-evolution histos
360  for(int wheel = -2; wheel != 3; ++wheel) {
361  for(int sector = 1; sector <= 12; ++sector) {
362  histoTimeEvol[wheel][sector]->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
363  }
364  }
365 }
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 334 of file DTSegmentAnalysisTask.cc.

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

Referenced by analyze().

336  {
337  int sector = chamberId.sector();
338  if(chamberId.sector()==13) {
339  sector = 4;
340  } else if(chamberId.sector()==14) {
341  sector = 10;
342  }
343 
344  summaryHistos[chamberId.wheel()]->Fill(sector,chamberId.station());
345  histoTimeEvol[chamberId.wheel()][sector]->accumulateValueTimeSlot(1);
346 
347  vector<MonitorElement *> histos = histosPerCh[chamberId];
348  histos[0]->Fill(nHits);
349  if(detailedAnalysis){
350  histos[1]->Fill(chi2);
351  }
352 
353 }
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 bookHistograms(), and fillHistos().

std::string DTSegmentAnalysisTask::topHistoFolder
private

Definition at line 108 of file DTSegmentAnalysisTask.h.

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