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 Attributes
DTDigiForNoiseTask Class Reference

#include <DTDigiForNoiseTask.h>

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

Public Member Functions

 DTDigiForNoiseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTDigiForNoiseTask ()
 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 analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 To reset the MEs. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 bookHistograms More...
 
void bookHistos (DQMStore::IBooker &, const DTLayerId &dtSL)
 Book the ME. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &)
 begin run More...
 
- 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 Attributes

bool debug
 
std::map< DTLayerId,
MonitorElement * > 
digiHistos
 
edm::EDGetTokenT
< DTDigiCollection
dtDigisToken_
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
edm::ParameterSet parameters
 

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

Definition at line 42 of file DTDigiForNoiseTask.h.

Constructor & Destructor Documentation

DTDigiForNoiseTask::DTDigiForNoiseTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 34 of file DTDigiForNoiseTask.cc.

References gather_cfg::cout, debug, edm::ParameterSet::getUntrackedParameter(), HLT_25ns14e33_v1_cff::InputTag, cmsHarvester::nevents, Parameters::parameters, and AlCaHLTBitMon_QueryRunRegistry::string.

34  {
35 
36  debug = ps.getUntrackedParameter<bool>("debug", false);
37  dtDigisToken_ = consumes<DTDigiCollection>(
38  edm::InputTag(ps.getUntrackedParameter<std::string>("diDigisLabel", "dtunpacker")));
39 
40  if(debug)
41  cout<<"[DTDigiForNoiseTask]: Constructor"<<endl;
42 
43  parameters = ps;
44 
45  nevents = 0;
46 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTDigiCollection > dtDigisToken_
edm::ParameterSet parameters
tuple cout
Definition: gather_cfg.py:121
DTDigiForNoiseTask::~DTDigiForNoiseTask ( )
virtual

Destructor.

Definition at line 49 of file DTDigiForNoiseTask.cc.

References gather_cfg::cout, debug, and cmsHarvester::nevents.

49  {
50 
51  if(debug)
52  cout << "DTDigiForNoiseTask: analyzed " << nevents << " events" << endl;
53 
54 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void DTDigiForNoiseTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 150 of file DTDigiForNoiseTask.cc.

References debug, DTTopology::firstChannel(), edm::Event::getByToken(), DTTopology::lastChannel(), and cmsHarvester::nevents.

150  {
151 
152  nevents++;
153  if (nevents%1000 == 0 && debug) {}
154 
156  e.getByToken(dtDigisToken_, dtdigis);
157 
158  std::map< int,int > DigiPerWirePerEvent;
159 
160  // Loop over all the chambers
161  auto ch_it = muonGeom->chambers().begin();
162  auto ch_end = muonGeom->chambers().end();
163  // Loop over the SLs
164  for (; ch_it != ch_end; ++ch_it) {
165  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
166  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
167  // Loop over the SLs
168  for(; sl_it != sl_end; ++sl_it) {
169  vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
170  vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
171  // Loop over the Ls
172  for(; l_it != l_end; ++l_it) {
173  DTLayerId layerId = (*l_it)->id();
174 
175  DTDigiCollection::Range layerDigi= dtdigis->get(layerId);
176  if(layerDigi.first != layerDigi.second){
177 
178  const DTTopology& dtTopo = muonGeom->layer(layerId)->specificTopology();
179  const int firstWire = dtTopo.firstChannel();
180  const int lastWire = dtTopo.lastChannel();
181 
182  if (digiHistos.find(layerId) != digiHistos.end()){
183  for (int wire=firstWire; wire-lastWire <= 0; wire++) {
184  DigiPerWirePerEvent[wire]= 0;
185  }
186 
187  for (DTDigiCollection::const_iterator digi = layerDigi.first;
188  digi!=layerDigi.second;
189  ++digi){
190  DigiPerWirePerEvent[(*digi).wire()]+=1;
191  }
192 
193  for (int wire=firstWire; wire-lastWire<=0; wire++) {
194  digiHistos.find(layerId)->second->Fill(wire,DigiPerWirePerEvent[wire]);
195  }
196  }
197  }
198 
199  } //Loop Ls
200  } //Loop SLs
201  } //Loop over chambers
202 
203 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
edm::EDGetTokenT< DTDigiCollection > dtDigisToken_
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:80
std::map< DTLayerId, MonitorElement * > digiHistos
std::vector< DTDigi >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
edm::ESHandle< DTGeometry > muonGeom
void DTDigiForNoiseTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
protectedvirtual

To reset the MEs.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 73 of file DTDigiForNoiseTask.cc.

References gather_cfg::cout, debug, timingPdfMaker::histo, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), and Parameters::parameters.

73  {
74 
75  if(debug)
76  cout<<"[DTDigiForNoiseTask]: Begin of LS transition"<<endl;
77 
78  if(lumiSeg.id().luminosityBlock()%parameters.getUntrackedParameter<int>("ResetCycle", 3) == 0) {
79  for(map< DTLayerId, MonitorElement* > ::const_iterator histo = digiHistos.begin();
80  histo != digiHistos.end();
81  histo++) {
82  (*histo).second->Reset();
83  }
84  }
85 
86 }
T getUntrackedParameter(std::string const &, T const &) const
std::map< DTLayerId, MonitorElement * > digiHistos
edm::ParameterSet parameters
tuple cout
Definition: gather_cfg.py:121
void DTDigiForNoiseTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

bookHistograms

Implements DQMEDAnalyzer.

Definition at line 64 of file DTDigiForNoiseTask.cc.

References gather_cfg::cout, and debug.

66  {
67 
68  if(debug)
69  cout<<"[DTDigiForNoiseTask]: boojHistograms"<<endl;
70 
71 }
tuple cout
Definition: gather_cfg.py:121
void DTDigiForNoiseTask::bookHistos ( DQMStore::IBooker ibooker,
const DTLayerId dtSL 
)
protected

Book the ME.

Definition at line 88 of file DTDigiForNoiseTask.cc.

References DQMStore::IBooker::book2D(), bookHistos(), DTSuperLayerId::chamberId(), gather_cfg::cout, debug, DTTopology::firstChannel(), hltbtagharvestinganalyzer_cfi::histoName, DTTopology::lastChannel(), DTLayerId::layer(), DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), and DTChamberId::wheel().

88  {
89 
90  if (debug) cout<<"[DTDigiForNoiseTask]: booking"<<endl;
91 
92  const DTSuperLayerId dtSLId = lId.superlayerId();
93  const DTChamberId dtChId = dtSLId.chamberId();
94  stringstream layer; layer << lId.layer();
95  stringstream superLayer; superLayer << dtSLId.superlayer();
96  stringstream wheel; wheel << dtChId.wheel();
97  stringstream station; station << dtChId.station();
98  stringstream sector; sector << dtChId.sector();
99 
100  ibooker.setCurrentFolder("DT/DTDigiForNoiseTask/Wheel" + wheel.str() +
101  "/Station" + station.str() +
102  "/Sector" + sector.str() + "/DigiPerEvent");
103 
104  if (debug){
105  cout<<"[DTDigiForNoiseTask]: folder "<< "DT/DTDigiTask/Wheel" + wheel.str() +
106  "/Station" + station.str() +
107  "/Sector" + sector.str() + "/DigiPerEvent"<<endl;
108  }
109 
110  string histoName =
111  "DigiPerEvent_W" + wheel.str()
112  + "_St" + station.str()
113  + "_Sec" + sector.str()
114  + "_SL" + superLayer.str()
115  + "_L" + layer.str();
116 
117  if (debug) cout<<"[DTDigiTask]: histoName "<<histoName<<endl;
118 
119  const DTTopology& dtTopo = muonGeom->layer(lId)->specificTopology();
120  const int firstWire = dtTopo.firstChannel();
121  const int lastWire = dtTopo.lastChannel();
122  int nWires = lastWire-firstWire+1;
123 
124  digiHistos[lId] = ibooker.book2D(histoName,histoName,nWires,firstWire,lastWire,10,-0.5,9.5);
125 
126 // dynamic bookings staticized
127  // Loop over all the chambers
128  auto ch_it = muonGeom->chambers().begin();
129  auto ch_end = muonGeom->chambers().end();
130  // Loop over the SLs
131  for (; ch_it != ch_end; ++ch_it) {
132  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
133  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
134  // Loop over the SLs
135  for(; sl_it != sl_end; ++sl_it) {
136  vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
137  vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
138  // Loop over the Ls
139  for(; l_it != l_end; ++l_it) {
140  DTLayerId layerId = (*l_it)->id();
141 
142  bookHistos(ibooker,layerId);
143  }
144  }
145  }
146 
147 }
DTChamberId chamberId() const
Return the corresponding ChamberId.
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:80
std::map< DTLayerId, MonitorElement * > digiHistos
int superlayer() const
Return the superlayer number (deprecated method name)
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
tuple cout
Definition: gather_cfg.py:121
void bookHistos(DQMStore::IBooker &, const DTLayerId &dtSL)
Book the ME.
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
edm::ESHandle< DTGeometry > muonGeom
void DTDigiForNoiseTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup setup 
)
protectedvirtual

begin run

Reimplemented from DQMEDAnalyzer.

Definition at line 56 of file DTDigiForNoiseTask.cc.

References edm::EventSetup::get().

57 {
58 
59  // Get the geometry
60  setup.get<MuonGeometryRecord>().get(muonGeom);
61  return;
62 }
const T & get() const
Definition: EventSetup.h:55
edm::ESHandle< DTGeometry > muonGeom

Member Data Documentation

bool DTDigiForNoiseTask::debug
private
std::map< DTLayerId, MonitorElement* > DTDigiForNoiseTask::digiHistos
private

Definition at line 80 of file DTDigiForNoiseTask.h.

edm::EDGetTokenT<DTDigiCollection> DTDigiForNoiseTask::dtDigisToken_
private

Definition at line 78 of file DTDigiForNoiseTask.h.

edm::ESHandle<DTGeometry> DTDigiForNoiseTask::muonGeom
private

Definition at line 77 of file DTDigiForNoiseTask.h.

int DTDigiForNoiseTask::nevents
private

Definition at line 73 of file DTDigiForNoiseTask.h.

edm::ParameterSet DTDigiForNoiseTask::parameters
private