test
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 Member Functions | Private Attributes
DTNoiseTask Class Reference

#include <DTNoiseTask.h>

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

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 DTNoiseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTNoiseTask ()
 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
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
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 To reset the MEs. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &)
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &setup)
 
- 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
< DTDigiCollection
dtDigiToken_
 
edm::ESHandle< DTGeometrydtGeom
 
int evtNumber
 
std::map< DTChamberId, int > mapEvt
 
MonitorElementnEventMonitor
 
std::map< DTChamberId,
MonitorElement * > 
noiseHistos
 
edm::EDGetTokenT
< DTRecSegment4DCollection
recHits4DToken_
 
double safeMargin
 
std::map< DTSuperLayerId,
MonitorElement * > 
tbHistos
 
edm::ESHandle< DTTtrigtTrigMap
 
std::map< DTChamberId, double > tTrigStMap
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

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(), HLT_25ns10e33_v2_cff::InputTag, 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:78
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
Definition: DTNoiseTask.h:76
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
Definition: DTNoiseTask.h:70
double safeMargin
Definition: DTNoiseTask.h:98
bool doTimeBoxHistos
Definition: DTNoiseTask.h:74
DTNoiseTask::~DTNoiseTask ( )
virtual

Destructor.

Definition at line 67 of file DTNoiseTask.cc.

67 {}

Member Function Documentation

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

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 80 of file DTNoiseTask.cc.

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

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

To reset the MEs.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 70 of file DTNoiseTask.cc.

71  {
72 
73  LogVerbatim("DTNoiseTask") <<"[DTNoiseTask]: Begin of LS transition"<<endl;
74 
75 }
void DTNoiseTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  setup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 256 of file DTNoiseTask.cc.

References DQMStore::IBooker::bookFloat(), bookHistos(), doTimeBoxHistos, dtGeom, nEventMonitor, DTTimeUnits::ns, DQMStore::IBooker::setCurrentFolder(), tTrigMap, and tTrigStMap.

258  {
259 
260  ibooker.setCurrentFolder("DT/EventInfo/Counters");
261  nEventMonitor = ibooker.bookFloat("nProcessedEventsNoise");
262 
263 
264 
265  // Loop over all the chambers
266  vector<const DTChamber*>::const_iterator ch_it = dtGeom->chambers().begin();
267  vector<const DTChamber*>::const_iterator ch_end = dtGeom->chambers().end();
268  for (; ch_it != ch_end; ++ch_it) {
269  DTChamberId chId = (*ch_it)->id();
270  // histo booking
271  bookHistos(ibooker,chId);
272  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
273  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
274  // Loop over the SLs
275  for(; sl_it != sl_end; ++sl_it) {
276  DTSuperLayerId slId = (*sl_it)->id();
277  if(doTimeBoxHistos)
278  bookHistos(ibooker,slId);
279  float tTrig, tTrigRMS, kFactor;
280  tTrigMap->get(slId, tTrig, tTrigRMS,kFactor,DTTimeUnits::ns);
281  // tTrig mapping per station
282  // check that the ttrig is the lowest of the 3 SLs
283  if(tTrigStMap.find(chId)==tTrigStMap.end() ||
284  (tTrigStMap.find(chId)!=tTrigStMap.end() && tTrig < tTrigStMap[chId]))
285  tTrigStMap[chId] = tTrig;
286  }
287  }
288 
289 
290 }
MonitorElement * nEventMonitor
Definition: DTNoiseTask.h:95
edm::ESHandle< DTGeometry > dtGeom
Definition: DTNoiseTask.h:80
edm::ESHandle< DTTtrig > tTrigMap
Definition: DTNoiseTask.h:81
void bookHistos(DQMStore::IBooker &, DTChamberId chId)
Definition: DTNoiseTask.cc:157
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
std::map< DTChamberId, double > tTrigStMap
Definition: DTNoiseTask.h:84
bool doTimeBoxHistos
Definition: DTNoiseTask.h:74
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
void DTNoiseTask::bookHistos ( DQMStore::IBooker ibooker,
DTChamberId  chId 
)
private

Definition at line 157 of file DTNoiseTask.cc.

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

Referenced by bookHistograms().

157  {
158 
159  // set the folder
160  stringstream wheel; wheel << chId.wheel();
161  stringstream station; station << chId.station();
162  stringstream sector; sector << chId.sector();
163 
164  ibooker.setCurrentFolder("DT/05-Noise/Wheel" + wheel.str() +
165 // "/Station" + station.str() +
166  "/Sector" + sector.str());
167 
168  // Build the histo name
169  string histoName = string("NoiseRate")
170  + "_W" + wheel.str()
171  + "_St" + station.str()
172  + "_Sec" + sector.str() ;
173 
174  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: booking chamber histo:"<<endl;
175  LogVerbatim("DTNoiseTask") << " folder "<< "DT/05-Noise/Wheel" + wheel.str() +
176 // "/Station" + station.str() +
177  "/Sector" + sector.str() + "/"<<endl;
178  LogVerbatim("DTNoiseTask") << " histoName "<<histoName<<endl;
179 
180  // Get the chamber from the geometry
181  int nWires_max = 0;
182  const DTChamber* dtchamber = dtGeom->chamber(chId);
183  const vector<const DTSuperLayer*> superlayers = dtchamber->superLayers();
184 
185  // Loop over layers and find the max # of wires
186  for(vector<const DTSuperLayer*>::const_iterator sl = superlayers.begin();
187  sl != superlayers.end(); ++sl) { // loop over SLs
188  vector<const DTLayer*> layers = (*sl)->layers();
189  for(vector<const DTLayer*>::const_iterator lay = layers.begin();
190  lay != layers.end(); ++lay) { // loop over layers
191  int nWires = (*lay)->specificTopology().channels();
192  if(nWires > nWires_max) nWires_max = nWires;
193  }
194  }
195 
196  noiseHistos[chId] = ibooker.book2D(histoName,"Noise rate (Hz) per channel", nWires_max,1, nWires_max+1,12,1,13);
197  noiseHistos[chId]->setAxisTitle("wire number",1);
198  noiseHistos[chId]->setBinLabel(1,"SL1-L1",2);
199  noiseHistos[chId]->setBinLabel(2,"SL1-L2",2);
200  noiseHistos[chId]->setBinLabel(3,"SL1-L3",2);
201  noiseHistos[chId]->setBinLabel(4,"SL1-L4",2);
202  noiseHistos[chId]->setBinLabel(5,"SL2-L1",2);
203  noiseHistos[chId]->setBinLabel(6,"SL2-L2",2);
204  noiseHistos[chId]->setBinLabel(7,"SL2-L3",2);
205  noiseHistos[chId]->setBinLabel(8,"SL2-L4",2);
206  noiseHistos[chId]->setBinLabel(9,"SL3-L1",2);
207  noiseHistos[chId]->setBinLabel(10,"SL3-L2",2);
208  noiseHistos[chId]->setBinLabel(11,"SL3-L3",2);
209  noiseHistos[chId]->setBinLabel(12,"SL3-L4",2);
210 
211 }
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
edm::ESHandle< DTGeometry > dtGeom
Definition: DTNoiseTask.h:80
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:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
int sector() const
Definition: DTChamberId.h:61
std::map< DTChamberId, MonitorElement * > noiseHistos
Definition: DTNoiseTask.h:87
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 214 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, and DTChamberId::wheel().

214  {
215 
216  // set the folder
217  stringstream wheel; wheel << slId.chamberId().wheel();
218  stringstream station; station << slId.chamberId().station();
219  stringstream sector; sector << slId.chamberId().sector();
220  stringstream superlayer; superlayer << slId.superlayer();
221 
222  ibooker.setCurrentFolder("DT/05-Noise/Wheel" + wheel.str() +
223  "/Station" + station.str() +
224  "/Sector" + sector.str());
225 
226  // Build the histo name
227  string histoName = string("TimeBox")
228  + "_W" + wheel.str()
229  + "_St" + station.str()
230  + "_Sec" + sector.str()
231  + "_SL" + superlayer.str();
232 
233  LogVerbatim("DTNoiseTask") <<"[DTNoiseTask]: booking SL histo:"<<endl;
234  LogVerbatim("DTNoiseTask") <<" folder "<< "DT/05-Noise/Wheel" + wheel.str() +
235  "/Station" + station.str() +
236  "/Sector" + sector.str() + "/" << endl;
237  LogVerbatim("DTNoiseTask") <<" histoName "<<histoName<<endl;
238 
239  tbHistos[slId] = ibooker.book1D(histoName,"Time Box (TDC counts)", 1000, 0, 6000);
240 
241 }
DTChamberId chamberId() const
Return the corresponding ChamberId.
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::map< DTSuperLayerId, MonitorElement * > tbHistos
Definition: DTNoiseTask.h:93
int superlayer() const
Return the superlayer number (deprecated method name)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
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 
)
protectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 243 of file DTNoiseTask.cc.

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

243  {
244 
245  LogVerbatim("DTNoiseTask") <<"[DTNoiseTask]: Begin of run"<<endl;
246 
247  // tTrig Map
248  setup.get<DTTtrigRcd>().get(tTrigMap);
249 
250  // get the geometry
251  setup.get<MuonGeometryRecord>().get(dtGeom);
252 
253 
254 }
edm::ESHandle< DTGeometry > dtGeom
Definition: DTNoiseTask.h:80
edm::ESHandle< DTTtrig > tTrigMap
Definition: DTNoiseTask.h:81
const T & get() const
Definition: EventSetup.h:56
void DTNoiseTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup setup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 292 of file DTNoiseTask.cc.

References alignCSCRings::e, evtNumber, mapEvt, noiseHistos, safeMargin, and tTrigStMap.

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

Member Data Documentation

bool DTNoiseTask::doSegmentVeto
private

Definition at line 78 of file DTNoiseTask.h.

Referenced by analyze(), and DTNoiseTask().

bool DTNoiseTask::doTimeBoxHistos
private

Definition at line 74 of file DTNoiseTask.h.

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

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

Definition at line 70 of file DTNoiseTask.h.

Referenced by analyze(), and DTNoiseTask().

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

Definition at line 80 of file DTNoiseTask.h.

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

int DTNoiseTask::evtNumber
private

Definition at line 72 of file DTNoiseTask.h.

Referenced by analyze(), and endLuminosityBlock().

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

Definition at line 90 of file DTNoiseTask.h.

Referenced by analyze(), and endLuminosityBlock().

MonitorElement* DTNoiseTask::nEventMonitor
private

Definition at line 95 of file DTNoiseTask.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 87 of file DTNoiseTask.h.

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

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

Definition at line 76 of file DTNoiseTask.h.

Referenced by analyze(), and DTNoiseTask().

double DTNoiseTask::safeMargin
private

Definition at line 98 of file DTNoiseTask.h.

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

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

Definition at line 93 of file DTNoiseTask.h.

Referenced by analyze(), and bookHistos().

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

Definition at line 81 of file DTNoiseTask.h.

Referenced by bookHistograms(), and dqmBeginRun().

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

Definition at line 84 of file DTNoiseTask.h.

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