CMS 3D CMS Logo

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

#include <DTNoiseTask.h>

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

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 DTNoiseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTNoiseTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &setup) 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 &, DTChamberId chId)
 
void bookHistos (DQMStore::IBooker &, DTSuperLayerId slId)
 

Private Attributes

bool doSegmentVeto
 
bool doTimeBoxHistos
 
edm::EDGetTokenT< DTDigiCollectiondtDigiToken_
 
edm::ESHandle< DTGeometrydtGeom
 
int evtNumber
 
std::map< DTChamberId, int > mapEvt
 
MonitorElementnEventMonitor
 
std::map< DTChamberId, MonitorElement * > noiseHistos
 
edm::EDGetTokenT< DTRecSegment4DCollectionrecHits4DToken_
 
double safeMargin
 
std::map< DTSuperLayerId, MonitorElement * > tbHistos
 
edm::ESHandle< DTTtrigtTrigMap
 
std::map< DTChamberId, double > tTrigStMap
 

Additional Inherited Members

- 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 DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

No description available.

Authors
G. Mila , G. Cerminara - INFN Torino

Definition at line 41 of file DTNoiseTask.h.

Constructor & Destructor Documentation

DTNoiseTask::DTNoiseTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 41 of file DTNoiseTask.cc.

References doSegmentVeto, doTimeBoxHistos, dtDigiToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), recHits4DToken_, and safeMargin.

41  : evtNumber(0) {
42 
43  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: Constructor"<<endl;
44 
45  //switch for timeBox booking
46  doTimeBoxHistos = ps.getUntrackedParameter<bool>("doTbHistos", false);
47 
48  // The label to retrieve the digis
49  dtDigiToken_ = consumes<DTDigiCollection>(
50  ps.getParameter<InputTag>("dtDigiLabel"));
51 
52  // the name of the 4D rec hits collection
53  recHits4DToken_ = consumes<DTRecSegment4DCollection>(
54  edm::InputTag(ps.getParameter<string>("recHits4DLabel")));
55 
56  // switch for segment veto
57  doSegmentVeto = ps.getUntrackedParameter<bool>("doSegmentVeto", false);
58 
59  // safe margin (ns) between ttrig and beginning of counting area
60  safeMargin = ps.getUntrackedParameter<double>("safeMargin", 200.);
61 
62 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool doSegmentVeto
Definition: DTNoiseTask.h:77
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
Definition: DTNoiseTask.h:75
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
Definition: DTNoiseTask.h:69
double safeMargin
Definition: DTNoiseTask.h:97
bool doTimeBoxHistos
Definition: DTNoiseTask.h:73
DTNoiseTask::~DTNoiseTask ( )
override

Destructor.

Definition at line 67 of file DTNoiseTask.cc.

67 {}

Member Function Documentation

void DTNoiseTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotected

Analyze.

Definition at line 70 of file DTNoiseTask.cc.

References doSegmentVeto, doTimeBoxHistos, dtDigiToken_, evtNumber, MonitorElement::Fill(), edm::Event::getByToken(), mapEvt, nEventMonitor, noiseHistos, PostProcessor_cff::normalization, recHits4DToken_, safeMargin, edm::second(), tbHistos, tTrigStMap, and cuy::yBin.

70  {
71 
72  evtNumber++;
74 
75  if(evtNumber%1000==0)
76  LogVerbatim("DTNoiseTask") <<"[DTNoiseTask]: Analyzing evt number :"<<evtNumber<<endl;
77 
78  // map of the chambers with at least 1 segment
79  std::map<DTChamberId, int> segmentsChId;
80 
81  // Get the 4D segment collection from the event
83  if(doSegmentVeto) {
84  e.getByToken(recHits4DToken_, all4DSegments);
85 
86  // Loop over all chambers containing a segment and look for the number of segments
87  DTRecSegment4DCollection::id_iterator chamberId;
88  for (chamberId = all4DSegments->id_begin();
89  chamberId != all4DSegments->id_end();
90  ++chamberId){
91  segmentsChId[*chamberId]=1;
92  }
93  }
94 
95  // Get the digis from the event
97  e.getByToken(dtDigiToken_, dtdigis);
98 
99  // LOOP OVER ALL THE DIGIS OF THE EVENT
101  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It){
102  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
103  digiIt!=((*dtLayerId_It).second).second; ++digiIt){
104 
105  //Check the TDC trigger width
106  int tdcTime = (*digiIt).countsTDC();
107  double upperLimit = tTrigStMap[(*dtLayerId_It).first.superlayerId().chamberId()]-safeMargin;
108  if(doTimeBoxHistos)
109  tbHistos[(*dtLayerId_It).first.superlayerId()]->Fill(tdcTime);
110  if(tdcTime>upperLimit)
111  continue;
112 
113  //Check the chamber has no 4D segments (optional)
114  if(doSegmentVeto &&
115  segmentsChId.find((*dtLayerId_It).first.superlayerId().chamberId())!=segmentsChId.end())
116  continue;
117 
118  // fill the occupancy histo
119  // FIXME: needs to be optimized: no need to rescale the histo for each digi
120  TH2F* noise_root = noiseHistos[(*dtLayerId_It).first.superlayerId().chamberId()]->getTH2F();
121  double normalization=0;
122  if(mapEvt.find((*dtLayerId_It).first.superlayerId().chamberId())!=mapEvt.end()) {
123  LogVerbatim("DTNoiseTask") << " Last fill: # of events: "
124  << mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()]
125  << endl;
126  normalization = 1e-9*upperLimit*mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()];
127  // revert back to # of entries
128  noise_root->Scale(normalization);
129  }
130  int yBin=(*dtLayerId_It).first.layer()+(4*((*dtLayerId_It).first.superlayerId().superlayer()-1));
131  noise_root->Fill((*digiIt).wire(),yBin);
132  // normalize the occupancy histo
133  mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()] = evtNumber;
134  LogVerbatim("DTNoiseTask") << (*dtLayerId_It).first << " wire: " << (*digiIt).wire()
135  << " # counts: " << noise_root->GetBinContent((*digiIt).wire(),yBin)
136  << " Time interval: " << upperLimit
137  << " # of events: " << evtNumber << endl;;
138  normalization = double( 1e-9*upperLimit*mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()]);
139  // update the rate
140  noise_root->Scale(1./normalization);
141  LogVerbatim("DTNoiseTask") << " noise rate: "
142  << noise_root->GetBinContent((*digiIt).wire(),yBin) << endl;
143  }
144  }
145 }
std::map< DTChamberId, int > mapEvt
Definition: DTNoiseTask.h:89
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
MonitorElement * nEventMonitor
Definition: DTNoiseTask.h:94
bool doSegmentVeto
Definition: DTNoiseTask.h:77
void Fill(long long x)
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
Definition: DTNoiseTask.h:75
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
Definition: DTNoiseTask.h:69
double safeMargin
Definition: DTNoiseTask.h:97
std::map< DTSuperLayerId, MonitorElement * > tbHistos
Definition: DTNoiseTask.h:92
std::map< DTChamberId, double > tTrigStMap
Definition: DTNoiseTask.h:83
std::vector< DTDigi >::const_iterator const_iterator
bool doTimeBoxHistos
Definition: DTNoiseTask.h:73
std::map< DTChamberId, MonitorElement * > noiseHistos
Definition: DTNoiseTask.h:86
yBin
Definition: cuy.py:892
void DTNoiseTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  setup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 246 of file DTNoiseTask.cc.

References DQMStore::IBooker::bookFloat(), bookHistos(), DTGeometry::chambers(), doTimeBoxHistos, dtGeom, DTTtrig::get(), DTAnalyzerDetailed_cfi::kFactor, nEventMonitor, DTTimeUnits::ns, DQMStore::IBooker::setCurrentFolder(), tTrigMap, and tTrigStMap.

248  {
249 
250  ibooker.setCurrentFolder("DT/EventInfo/Counters");
251  nEventMonitor = ibooker.bookFloat("nProcessedEventsNoise");
252 
253 
254 
255  // Loop over all the chambers
256  vector<const DTChamber*>::const_iterator ch_it = dtGeom->chambers().begin();
257  vector<const DTChamber*>::const_iterator ch_end = dtGeom->chambers().end();
258  for (; ch_it != ch_end; ++ch_it) {
259  DTChamberId chId = (*ch_it)->id();
260  // histo booking
261  bookHistos(ibooker,chId);
262  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
263  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
264  // Loop over the SLs
265  for(; sl_it != sl_end; ++sl_it) {
266  DTSuperLayerId slId = (*sl_it)->id();
267  if(doTimeBoxHistos)
268  bookHistos(ibooker,slId);
269  float tTrig, tTrigRMS, kFactor;
270  tTrigMap->get(slId, tTrig, tTrigRMS,kFactor,DTTimeUnits::ns);
271  // tTrig mapping per station
272  // check that the ttrig is the lowest of the 3 SLs
273  if(tTrigStMap.find(chId)==tTrigStMap.end() ||
274  (tTrigStMap.find(chId)!=tTrigStMap.end() && tTrig < tTrigStMap[chId]))
275  tTrigStMap[chId] = tTrig;
276  }
277  }
278 
279 
280 }
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
MonitorElement * nEventMonitor
Definition: DTNoiseTask.h:94
edm::ESHandle< DTGeometry > dtGeom
Definition: DTNoiseTask.h:79
edm::ESHandle< DTTtrig > tTrigMap
Definition: DTNoiseTask.h:80
void bookHistos(DQMStore::IBooker &, DTChamberId chId)
Definition: DTNoiseTask.cc:147
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
Definition: DTTtrig.cc:85
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::map< DTChamberId, double > tTrigStMap
Definition: DTNoiseTask.h:83
bool doTimeBoxHistos
Definition: DTNoiseTask.h:73
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112
void DTNoiseTask::bookHistos ( DQMStore::IBooker ibooker,
DTChamberId  chId 
)
private

Definition at line 147 of file DTNoiseTask.cc.

References DQMStore::IBooker::book2D(), DTGeometry::chamber(), dtGeom, LayerTriplets::layers(), noiseHistos, DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, DTChamber::superLayers(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

147  {
148 
149  // set the folder
150  stringstream wheel; wheel << chId.wheel();
151  stringstream station; station << chId.station();
152  stringstream sector; sector << chId.sector();
153 
154  ibooker.setCurrentFolder("DT/05-Noise/Wheel" + wheel.str() +
155 // "/Station" + station.str() +
156  "/Sector" + sector.str());
157 
158  // Build the histo name
159  string histoName = string("NoiseRate")
160  + "_W" + wheel.str()
161  + "_St" + station.str()
162  + "_Sec" + sector.str() ;
163 
164  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: booking chamber histo:"<<endl;
165  LogVerbatim("DTNoiseTask") << " folder "<< "DT/05-Noise/Wheel" + wheel.str() +
166 // "/Station" + station.str() +
167  "/Sector" + sector.str() + "/"<<endl;
168  LogVerbatim("DTNoiseTask") << " histoName "<<histoName<<endl;
169 
170  // Get the chamber from the geometry
171  int nWires_max = 0;
172  const DTChamber* dtchamber = dtGeom->chamber(chId);
173  const vector<const DTSuperLayer*>& superlayers = dtchamber->superLayers();
174 
175  // Loop over layers and find the max # of wires
176  for(vector<const DTSuperLayer*>::const_iterator sl = superlayers.begin();
177  sl != superlayers.end(); ++sl) { // loop over SLs
178  vector<const DTLayer*> layers = (*sl)->layers();
179  for(vector<const DTLayer*>::const_iterator lay = layers.begin();
180  lay != layers.end(); ++lay) { // loop over layers
181  int nWires = (*lay)->specificTopology().channels();
182  if(nWires > nWires_max) nWires_max = nWires;
183  }
184  }
185 
186  noiseHistos[chId] = ibooker.book2D(histoName,"Noise rate (Hz) per channel", nWires_max,1, nWires_max+1,12,1,13);
187  noiseHistos[chId]->setAxisTitle("wire number",1);
188  noiseHistos[chId]->setBinLabel(1,"SL1-L1",2);
189  noiseHistos[chId]->setBinLabel(2,"SL1-L2",2);
190  noiseHistos[chId]->setBinLabel(3,"SL1-L3",2);
191  noiseHistos[chId]->setBinLabel(4,"SL1-L4",2);
192  noiseHistos[chId]->setBinLabel(5,"SL2-L1",2);
193  noiseHistos[chId]->setBinLabel(6,"SL2-L2",2);
194  noiseHistos[chId]->setBinLabel(7,"SL2-L3",2);
195  noiseHistos[chId]->setBinLabel(8,"SL2-L4",2);
196  noiseHistos[chId]->setBinLabel(9,"SL3-L1",2);
197  noiseHistos[chId]->setBinLabel(10,"SL3-L2",2);
198  noiseHistos[chId]->setBinLabel(11,"SL3-L3",2);
199  noiseHistos[chId]->setBinLabel(12,"SL3-L4",2);
200 
201 }
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:99
edm::ESHandle< DTGeometry > dtGeom
Definition: DTNoiseTask.h:79
const std::vector< const DTSuperLayer * > & superLayers() const
Return the superlayers in the chamber.
Definition: DTChamber.cc:60
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
int sector() const
Definition: DTChamberId.h:61
std::map< DTChamberId, MonitorElement * > noiseHistos
Definition: DTNoiseTask.h:86
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
void DTNoiseTask::bookHistos ( DQMStore::IBooker ibooker,
DTSuperLayerId  slId 
)
private

Definition at line 204 of file DTNoiseTask.cc.

References DQMStore::IBooker::book1D(), DTSuperLayerId::chamberId(), DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, DTSuperLayerId::superlayer(), tbHistos, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

204  {
205 
206  // set the folder
207  stringstream wheel; wheel << slId.chamberId().wheel();
208  stringstream station; station << slId.chamberId().station();
209  stringstream sector; sector << slId.chamberId().sector();
210  stringstream superlayer; superlayer << slId.superlayer();
211 
212  ibooker.setCurrentFolder("DT/05-Noise/Wheel" + wheel.str() +
213  "/Station" + station.str() +
214  "/Sector" + sector.str());
215 
216  // Build the histo name
217  string histoName = string("TimeBox")
218  + "_W" + wheel.str()
219  + "_St" + station.str()
220  + "_Sec" + sector.str()
221  + "_SL" + superlayer.str();
222 
223  LogVerbatim("DTNoiseTask") <<"[DTNoiseTask]: booking SL histo:"<<endl;
224  LogVerbatim("DTNoiseTask") <<" folder "<< "DT/05-Noise/Wheel" + wheel.str() +
225  "/Station" + station.str() +
226  "/Sector" + sector.str() + "/" << endl;
227  LogVerbatim("DTNoiseTask") <<" histoName "<<histoName<<endl;
228 
229  tbHistos[slId] = ibooker.book1D(histoName,"Time Box (TDC counts)", 1000, 0, 6000);
230 
231 }
DTChamberId chamberId() const
Return the corresponding ChamberId.
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::map< DTSuperLayerId, MonitorElement * > tbHistos
Definition: DTNoiseTask.h:92
int superlayer() const
Return the superlayer number (deprecated method name)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
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 DTNoiseTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup setup 
)
overrideprotected

Definition at line 233 of file DTNoiseTask.cc.

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

233  {
234 
235  LogVerbatim("DTNoiseTask") <<"[DTNoiseTask]: Begin of run"<<endl;
236 
237  // tTrig Map
238  setup.get<DTTtrigRcd>().get(tTrigMap);
239 
240  // get the geometry
241  setup.get<MuonGeometryRecord>().get(dtGeom);
242 
243 
244 }
edm::ESHandle< DTGeometry > dtGeom
Definition: DTNoiseTask.h:79
edm::ESHandle< DTTtrig > tTrigMap
Definition: DTNoiseTask.h:80
T get() const
Definition: EventSetup.h:63
void DTNoiseTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup setup 
)
overrideprotected

Definition at line 282 of file DTNoiseTask.cc.

References MillePedeFileConverter_cfg::e, evtNumber, mapEvt, noiseHistos, PostProcessor_cff::normalization, safeMargin, and tTrigStMap.

282  {
283  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: End LS, update rates in all histos" << endl;
284 
285  // update the rate of all histos (usefull for histos with few entries: they are not updated very often
286  for(map<DTChamberId, MonitorElement*>::const_iterator meAndChamber = noiseHistos.begin();
287  meAndChamber != noiseHistos.end(); ++meAndChamber) {
288  DTChamberId chId = (*meAndChamber).first;
289  TH2F* noise_root = (*meAndChamber).second->getTH2F();
290  double upperLimit = tTrigStMap[chId]-safeMargin;
291 
292  double normalization=0;
293  if(mapEvt.find(chId) != mapEvt.end()) {
294  LogVerbatim("DTNoiseTask") << " Ch: " << chId << " Last fill: # of events: " << mapEvt[chId] << endl;
295  normalization = 1e-9*upperLimit*mapEvt[chId];
296  // revert back to # of entries
297  noise_root->Scale(normalization);
298  }
299  //check that event analyzed != 0 might happen oline
300  if (evtNumber) {
301  // set the # of events analyzed until this update
302  LogVerbatim("DTNoiseTask") << " Update for events: " << evtNumber << endl;
303  mapEvt[chId] = evtNumber;
304  // update the rate
305  normalization = double( 1e-9*upperLimit*evtNumber);
306  noise_root->Scale(1./normalization);
307  }
308  }
309 }
std::map< DTChamberId, int > mapEvt
Definition: DTNoiseTask.h:89
double safeMargin
Definition: DTNoiseTask.h:97
std::map< DTChamberId, double > tTrigStMap
Definition: DTNoiseTask.h:83
std::map< DTChamberId, MonitorElement * > noiseHistos
Definition: DTNoiseTask.h:86

Member Data Documentation

bool DTNoiseTask::doSegmentVeto
private

Definition at line 77 of file DTNoiseTask.h.

Referenced by analyze(), and DTNoiseTask().

bool DTNoiseTask::doTimeBoxHistos
private

Definition at line 73 of file DTNoiseTask.h.

Referenced by analyze(), bookHistograms(), and DTNoiseTask().

edm::EDGetTokenT<DTDigiCollection> DTNoiseTask::dtDigiToken_
private

Definition at line 69 of file DTNoiseTask.h.

Referenced by analyze(), and DTNoiseTask().

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

Definition at line 79 of file DTNoiseTask.h.

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

int DTNoiseTask::evtNumber
private

Definition at line 71 of file DTNoiseTask.h.

Referenced by analyze(), and endLuminosityBlock().

std::map<DTChamberId, int> DTNoiseTask::mapEvt
private

Definition at line 89 of file DTNoiseTask.h.

Referenced by analyze(), and endLuminosityBlock().

MonitorElement* DTNoiseTask::nEventMonitor
private

Definition at line 94 of file DTNoiseTask.h.

Referenced by analyze(), and bookHistograms().

std::map<DTChamberId, MonitorElement*> DTNoiseTask::noiseHistos
private

Definition at line 86 of file DTNoiseTask.h.

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

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

Definition at line 75 of file DTNoiseTask.h.

Referenced by analyze(), and DTNoiseTask().

double DTNoiseTask::safeMargin
private

Definition at line 97 of file DTNoiseTask.h.

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

std::map<DTSuperLayerId, MonitorElement*> DTNoiseTask::tbHistos
private

Definition at line 92 of file DTNoiseTask.h.

Referenced by analyze(), and bookHistos().

edm::ESHandle<DTTtrig> DTNoiseTask::tTrigMap
private

Definition at line 80 of file DTNoiseTask.h.

Referenced by bookHistograms(), and dqmBeginRun().

std::map<DTChamberId, double> DTNoiseTask::tTrigStMap
private

Definition at line 83 of file DTNoiseTask.h.

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