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:
DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
 ~DTSegmentAnalysisTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

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

Author
G. Cerminara - INFN Torino

Definition at line 39 of file DTSegmentAnalysisTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 38 of file DTSegmentAnalysisTask.cc.

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

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

Destructor.

Definition at line 63 of file DTSegmentAnalysisTask.cc.

References hNevtPerLS.

63  {
64  //FR moved fron endjob
65  delete hNevtPerLS;
66  edm::LogVerbatim("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << "[DTSegmentAnalysisTask] Destructor called!";
67 }
DTTimeEvolutionHisto * hNevtPerLS

Member Function Documentation

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

Definition at line 145 of file DTSegmentAnalysisTask.cc.

References DTStatusFlag::cellStatus(), checkNoisyChannels, HLT_2018_cff::distance, edm::EventID::event(), dqm::impl::MonitorElement::Fill(), fillHistos(), edm::EventSetup::get(), edm::EventBase::id(), edm::HandleBase::isValid(), nEventMonitor, nevents, nEventsInLS, nhitsCut, phiSegmCut, Pi, FastTimerService_cff::range, recHits4DToken_, findQualityFiles::size, DTRecSegment2D::specificRecHits(), and xdir.

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

Summary.

Definition at line 339 of file DTSegmentAnalysisTask.cc.

References nEventsInLS.

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

Implements DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 74 of file DTSegmentAnalysisTask.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), dqm::dqmstoreimpl::DQMStore::IBooker::bookFloat(), bookHistos(), DTGeometry::chambers(), chambers, dtGeom, HltBtagPostValidation_cff::histoName, histoTimeEvol, hltDQMMode, hNevtPerLS, nEventMonitor, nLSTimeBin, nTimeBins, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), slideTimeBins, summaryHistos, topHistoFolder, and makeMuonMisalignmentScenario::wheel.

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

Definition at line 285 of file DTSegmentAnalysisTask.cc.

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

Referenced by bookHistograms().

285  {
286  edm::LogVerbatim("DTDQM|DTMonitorModule|DTSegmentAnalysisTask") << " Booking histos for chamber: " << chamberId;
287 
288  // Compose the chamber name
289  stringstream wheel;
290  wheel << chamberId.wheel();
291  stringstream station;
292  station << chamberId.station();
293  stringstream sector;
294  sector << chamberId.sector();
295 
296  string chamberHistoName = "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str();
297 
298  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" +
299  station.str());
300 
301  // Create the monitor elements
302  vector<MonitorElement*> histos;
303  histos.push_back(ibooker.book1D("h4DSegmNHits" + chamberHistoName, "# of hits per segment", 16, 0.5, 16.5));
304  if (detailedAnalysis) {
305  histos.push_back(ibooker.book1D("h4DChi2" + chamberHistoName, "4D Segment reduced Chi2", 20, 0, 20));
306  }
307  histosPerCh[chamberId] = histos;
308 }
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
histos
Definition: combine.py:4
int sector() const
Definition: DTChamberId.h:49
int station() const
Return the station number.
Definition: DTChamberId.h:42
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
void DTSegmentAnalysisTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
override

BeginRun.

Definition at line 69 of file DTSegmentAnalysisTask.cc.

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

69  {
70  // Get the DT Geometry
71  context.get<MuonGeometryRecord>().get(dtGeom);
72 }
edm::ESHandle< DTGeometry > dtGeom
T get() const
Definition: EventSetup.h:73
void DTSegmentAnalysisTask::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
override

Definition at line 329 of file DTSegmentAnalysisTask.cc.

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

329  {
330  hNevtPerLS->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
331  // book sector time-evolution histos
332  for (int wheel = -2; wheel != 3; ++wheel) {
333  for (int sector = 1; sector <= 12; ++sector) {
334  histoTimeEvol[wheel][sector]->updateTimeSlot(lumiSeg.luminosityBlock(), nEventsInLS);
335  }
336  }
337 }
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 311 of file DTSegmentAnalysisTask.cc.

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

Referenced by analyze().

311  {
312  int sector = chamberId.sector();
313  if (chamberId.sector() == 13) {
314  sector = 4;
315  } else if (chamberId.sector() == 14) {
316  sector = 10;
317  }
318 
319  summaryHistos[chamberId.wheel()]->Fill(sector, chamberId.station());
320  histoTimeEvol[chamberId.wheel()][sector]->accumulateValueTimeSlot(1);
321 
322  vector<MonitorElement*> histos = histosPerCh[chamberId];
323  histos[0]->Fill(nHits);
324  if (detailedAnalysis) {
325  histos[1]->Fill(chi2);
326  }
327 }
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
histos
Definition: combine.py:4
std::map< int, std::map< int, DTTimeEvolutionHisto * > > histoTimeEvol
int sector() const
Definition: DTChamberId.h:49
std::map< int, MonitorElement * > summaryHistos
int station() const
Return the station number.
Definition: DTChamberId.h:42
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39

Member Data Documentation

bool DTSegmentAnalysisTask::checkNoisyChannels
private

Definition at line 72 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and DTSegmentAnalysisTask().

bool DTSegmentAnalysisTask::detailedAnalysis
private

Definition at line 63 of file DTSegmentAnalysisTask.h.

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

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

Definition at line 66 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and dqmBeginRun().

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

Definition at line 82 of file DTSegmentAnalysisTask.h.

Referenced by bookHistos(), and fillHistos().

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

Definition at line 84 of file DTSegmentAnalysisTask.h.

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

bool DTSegmentAnalysisTask::hltDQMMode
private

Definition at line 99 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and DTSegmentAnalysisTask().

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

Definition at line 105 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and bookHistograms().

int DTSegmentAnalysisTask::nevents
private

Definition at line 86 of file DTSegmentAnalysisTask.h.

Referenced by analyze().

int DTSegmentAnalysisTask::nEventsInLS
private

Definition at line 87 of file DTSegmentAnalysisTask.h.

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

int DTSegmentAnalysisTask::nhitsCut
private

Definition at line 103 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and DTSegmentAnalysisTask().

int DTSegmentAnalysisTask::nLSTimeBin
private

Definition at line 93 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and DTSegmentAnalysisTask().

int DTSegmentAnalysisTask::nTimeBins
private

Definition at line 91 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and DTSegmentAnalysisTask().

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

Definition at line 101 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and DTSegmentAnalysisTask().

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

Definition at line 69 of file DTSegmentAnalysisTask.h.

Referenced by analyze(), and DTSegmentAnalysisTask().

bool DTSegmentAnalysisTask::slideTimeBins
private

Definition at line 95 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and DTSegmentAnalysisTask().

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

Definition at line 83 of file DTSegmentAnalysisTask.h.

Referenced by bookHistograms(), and fillHistos().

std::string DTSegmentAnalysisTask::topHistoFolder
private

Definition at line 97 of file DTSegmentAnalysisTask.h.

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