CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTSegmentsTask Class Reference

#include <DTSegmentsTask.h>

Inheritance diagram for DTSegmentsTask:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 book the histos More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 DTSegmentsTask (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~DTSegmentsTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
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::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 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)
 

Private Attributes

bool checkNoisyChannels
 
bool debug
 
edm::ParameterSet parameters
 
std::vector< MonitorElement * > phiHistos
 
edm::EDGetTokenT< DTRecSegment4DCollectiontheRecHits4DLabel_
 
std::vector< MonitorElement * > thetaHistos
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
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 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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

DQM Analysis of 4D DT segments

Author
G. Mila - INFN Torino

Definition at line 25 of file DTSegmentsTask.h.

Constructor & Destructor Documentation

DTSegmentsTask::DTSegmentsTask ( const edm::ParameterSet pset)

Constructor.

Definition at line 27 of file DTSegmentsTask.cc.

References dtDigiTask_cfi::checkNoisyChannels, debug, edm::ParameterSet::getUntrackedParameter(), muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

27  {
28  debug = pset.getUntrackedParameter<bool>("debug", false);
29  parameters = pset;
30 
31  // should be init from pset, but it was commented out...
32  // better false than undefined
33  checkNoisyChannels = false;
34 
35  // the name of the 4D rec hits collection
36  theRecHits4DLabel_ = consumes<DTRecSegment4DCollection>(parameters.getParameter<std::string>("recHits4DLabel"));
37 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTRecSegment4DCollection > theRecHits4DLabel_
DTSegmentsTask::~DTSegmentsTask ( )
override

Destructor.

Definition at line 39 of file DTSegmentsTask.cc.

39 {}

Member Function Documentation

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

book the histos

Definition at line 110 of file DTSegmentsTask.cc.

References DTStatusFlag::cellStatus(), dtDigiTask_cfi::checkNoisyChannels, gather_cfg::cout, debug, HLT_2018_cff::distance, edm::EventSetup::get(), FastTimerService_cff::range, findQualityFiles::size, and DTRecSegment2D::specificRecHits().

110  {
111  // Get the map of noisy channels
112  // bool checkNoisyChannels = parameters.getUntrackedParameter<bool>("checkNoisyChannels",false);
113  ESHandle<DTStatusFlag> statusMap;
114  if (checkNoisyChannels) {
115  setup.get<DTStatusFlagRcd>().get(statusMap);
116  }
117 
118  // Get the 4D segment collection from the event
120  event.getByToken(theRecHits4DLabel_, all4DSegments);
121 
122  // Loop over all chambers containing a segment
124  for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
125  // Get the range for the corresponding ChamerId
126  DTRecSegment4DCollection::range range = all4DSegments->get(*chamberId);
127  int nsegm = distance(range.first, range.second);
128  if (debug)
129  cout << " Chamber: " << *chamberId << " has " << nsegm << " 4D segments" << endl;
130 
131  // Loop over the rechits of this ChamerId
132  for (DTRecSegment4DCollection::const_iterator segment4D = range.first; segment4D != range.second; ++segment4D) {
133  //FOR NOISY CHANNELS////////////////////////////////
134  bool segmNoisy = false;
135  if ((*segment4D).hasPhi()) {
136  const DTChamberRecSegment2D* phiSeg = (*segment4D).phiSegment();
137  vector<DTRecHit1D> phiHits = phiSeg->specificRecHits();
138  map<DTSuperLayerId, vector<DTRecHit1D> > hitsBySLMap;
139  for (vector<DTRecHit1D>::const_iterator hit = phiHits.begin(); hit != phiHits.end(); ++hit) {
140  DTWireId wireId = (*hit).wireId();
141 
142  // Check for noisy channels to skip them
143  if (checkNoisyChannels) {
144  bool isNoisy = false;
145  bool isFEMasked = false;
146  bool isTDCMasked = false;
147  bool isTrigMask = false;
148  bool isDead = false;
149  bool isNohv = false;
150  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
151  if (isNoisy) {
152  if (debug)
153  cout << "Wire: " << wireId << " is noisy, skipping!" << endl;
154  segmNoisy = true;
155  }
156  }
157  }
158  }
159 
160  if ((*segment4D).hasZed()) {
161  const DTSLRecSegment2D* zSeg = (*segment4D).zSegment(); // zSeg lives in the SL RF
162  // Check for noisy channels to skip them
163  vector<DTRecHit1D> zHits = zSeg->specificRecHits();
164  for (vector<DTRecHit1D>::const_iterator hit = zHits.begin(); hit != zHits.end(); ++hit) {
165  DTWireId wireId = (*hit).wireId();
166  if (checkNoisyChannels) {
167  bool isNoisy = false;
168  bool isFEMasked = false;
169  bool isTDCMasked = false;
170  bool isTrigMask = false;
171  bool isDead = false;
172  bool isNohv = false;
173  //cout<<"wire id "<<wireId<<endl;
174  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
175  if (isNoisy) {
176  if (debug)
177  cout << "Wire: " << wireId << " is noisy, skipping!" << endl;
178  segmNoisy = true;
179  }
180  }
181  }
182  }
183 
184  if (segmNoisy) {
185  if (debug)
186  cout << "skipping the segment: it contains noisy cells" << endl;
187  continue;
188  }
189  //END FOR NOISY CHANNELS////////////////////////////////
190 
191  // Fill the histos
192  int nHits = 0;
193  if ((*segment4D).hasPhi()) {
194  nHits = (((*segment4D).phiSegment())->specificRecHits()).size();
195  if (debug)
196  cout << "Phi segment with number of hits: " << nHits << endl;
197  phiHistos[0]->Fill((*chamberId).wheel(), nHits);
198  phiHistos[1]->Fill((*chamberId).sector(), nHits);
199  phiHistos[2]->Fill((*chamberId).station(), nHits);
200  }
201  if ((*segment4D).hasZed()) {
202  nHits = (((*segment4D).zSegment())->specificRecHits()).size();
203  if (debug)
204  cout << "Zed segment with number of hits: " << nHits << endl;
205  thetaHistos[0]->Fill((*chamberId).wheel(), nHits);
206  thetaHistos[1]->Fill((*chamberId).sector(), nHits);
207  thetaHistos[2]->Fill((*chamberId).station(), nHits);
208  }
209 
210  } //loop over segments
211  } // loop over chambers
212 }
size
Write out results.
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
identifier iterator
Definition: RangeMap.h:130
edm::EDGetTokenT< DTRecSegment4DCollection > theRecHits4DLabel_
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
std::vector< MonitorElement * > thetaHistos
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
std::vector< MonitorElement * > phiHistos
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
T get() const
Definition: EventSetup.h:73
void DTSegmentsTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 41 of file DTSegmentsTask.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), dqm::dqmstoreimpl::DQMStore::IBooker::cd(), and dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

43  {
44  ibooker.cd();
45  ibooker.setCurrentFolder("Muons/DTSegmentsMonitor");
46 
47  // histos for phi segments
48  phiHistos.push_back(
49  ibooker.book2D("phiSegments_numHitsVsWheel", "phiSegments_numHitsVsWheel", 5, -2.5, 2.5, 20, 0, 20));
50  phiHistos[0]->setBinLabel(1, "W-2", 1);
51  phiHistos[0]->setBinLabel(2, "W-1", 1);
52  phiHistos[0]->setBinLabel(3, "W0", 1);
53  phiHistos[0]->setBinLabel(4, "W1", 1);
54  phiHistos[0]->setBinLabel(5, "W2", 1);
55  phiHistos.push_back(
56  ibooker.book2D("phiSegments_numHitsVsSector", "phiSegments_numHitsVsSector", 14, 0.5, 14.5, 20, 0, 20));
57  phiHistos[1]->setBinLabel(1, "Sec1", 1);
58  phiHistos[1]->setBinLabel(2, "Sec2", 1);
59  phiHistos[1]->setBinLabel(3, "Sec3", 1);
60  phiHistos[1]->setBinLabel(4, "Sec4", 1);
61  phiHistos[1]->setBinLabel(5, "Sec5", 1);
62  phiHistos[1]->setBinLabel(6, "Sec6", 1);
63  phiHistos[1]->setBinLabel(7, "Sec7", 1);
64  phiHistos[1]->setBinLabel(8, "Sec8", 1);
65  phiHistos[1]->setBinLabel(9, "Sec9", 1);
66  phiHistos[1]->setBinLabel(10, "Sec10", 1);
67  phiHistos[1]->setBinLabel(11, "Sec11", 1);
68  phiHistos[1]->setBinLabel(12, "Sec12", 1);
69  phiHistos[1]->setBinLabel(13, "Sec13", 1);
70  phiHistos[1]->setBinLabel(14, "Sec14", 1);
71  phiHistos.push_back(
72  ibooker.book2D("phiSegments_numHitsVsStation", "phiSegments_numHitsVsStation", 4, 0.5, 4.5, 20, 0, 20));
73  phiHistos[2]->setBinLabel(1, "St1", 1);
74  phiHistos[2]->setBinLabel(2, "St2", 1);
75  phiHistos[2]->setBinLabel(3, "St3", 1);
76  phiHistos[2]->setBinLabel(4, "St4", 1);
77 
78  // histos for theta segments
79  thetaHistos.push_back(
80  ibooker.book2D("thetaSegments_numHitsVsWheel", "thetaSegments_numHitsVsWheel", 5, -2.5, 2.5, 20, 0, 20));
81  thetaHistos[0]->setBinLabel(1, "W-2", 1);
82  thetaHistos[0]->setBinLabel(2, "W-1", 1);
83  thetaHistos[0]->setBinLabel(3, "W0", 1);
84  thetaHistos[0]->setBinLabel(4, "W1", 1);
85  thetaHistos[0]->setBinLabel(5, "W2", 1);
86  thetaHistos.push_back(
87  ibooker.book2D("thetaSegments_numHitsVsSector", "thetaSegments_numHitsVsSector", 14, 0.5, 14.5, 20, 0, 20));
88  thetaHistos[1]->setBinLabel(1, "Sec1", 1);
89  thetaHistos[1]->setBinLabel(2, "Sec2", 1);
90  thetaHistos[1]->setBinLabel(3, "Sec3", 1);
91  thetaHistos[1]->setBinLabel(4, "Sec4", 1);
92  thetaHistos[1]->setBinLabel(5, "Sec5", 1);
93  thetaHistos[1]->setBinLabel(6, "Sec6", 1);
94  thetaHistos[1]->setBinLabel(7, "Sec7", 1);
95  thetaHistos[1]->setBinLabel(8, "Sec8", 1);
96  thetaHistos[1]->setBinLabel(9, "Sec9", 1);
97  thetaHistos[1]->setBinLabel(10, "Sec10", 1);
98  thetaHistos[1]->setBinLabel(11, "Sec11", 1);
99  thetaHistos[1]->setBinLabel(12, "Sec12", 1);
100  thetaHistos[1]->setBinLabel(13, "Sec13", 1);
101  thetaHistos[1]->setBinLabel(14, "Sec14", 1);
102  thetaHistos.push_back(
103  ibooker.book2D("thetaSegments_numHitsVsStation", "thetaSegments_numHitsVsStation", 4, 0.5, 4.5, 20, 0, 20));
104  thetaHistos[2]->setBinLabel(1, "St1", 1);
105  thetaHistos[2]->setBinLabel(2, "St2", 1);
106  thetaHistos[2]->setBinLabel(3, "St3", 1);
107  thetaHistos[2]->setBinLabel(4, "St4", 1);
108 }
std::vector< MonitorElement * > thetaHistos
std::vector< MonitorElement * > phiHistos

Member Data Documentation

bool DTSegmentsTask::checkNoisyChannels
private

Definition at line 41 of file DTSegmentsTask.h.

bool DTSegmentsTask::debug
private
edm::ParameterSet DTSegmentsTask::parameters
private
std::vector<MonitorElement *> DTSegmentsTask::phiHistos
private

Definition at line 45 of file DTSegmentsTask.h.

edm::EDGetTokenT<DTRecSegment4DCollection> DTSegmentsTask::theRecHits4DLabel_
private

Definition at line 49 of file DTSegmentsTask.h.

std::vector<MonitorElement *> DTSegmentsTask::thetaHistos
private

Definition at line 46 of file DTSegmentsTask.h.