CMS 3D CMS Logo

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

#include <DTNoiseAnalysisTest.h>

Inheritance diagram for DTNoiseAnalysisTest:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTNoiseAnalysisTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTNoiseAnalysisTest ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::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 ()
 
 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 & itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginRun (edm::Run const &run, edm::EventSetup const &context)
 BeginRun. More...
 
void bookHistos (DQMStore::IBooker &)
 book the summary histograms More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 DQM Client Diagnostic. More...
 
- 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

std::string getMEName (const DTChamberId &chID)
 Get the ME name. More...
 
std::string getSynchNoiseMEName (int wheelId) const
 

Private Attributes

bool bookingdone
 
bool detailedAnalysis
 
bool doSynchNoise
 
MonitorElementglbSummarySynchNoiseHisto
 
double maxSynchNoiseRate
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
int nMinEvts
 
std::map< int, MonitorElement * > noiseHistos
 
int noisyCellDef
 
std::map< int, MonitorElement * > noisyCellHistos
 
MonitorElementsummaryNoiseHisto
 
MonitorElementsummarySynchNoiseHisto
 
MonitorElementthreshChannelsHisto
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 37 of file DTNoiseAnalysisTest.h.

Constructor & Destructor Documentation

DTNoiseAnalysisTest::DTNoiseAnalysisTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 39 of file DTNoiseAnalysisTest.cc.

References edm::ParameterSet::getUntrackedParameter(), and LogTrace.

39  {
40  LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest") << "[DTNoiseAnalysisTest]: Constructor";
41 
42  // get the cfi parameters
43  noisyCellDef = ps.getUntrackedParameter<int>("noisyCellDef",500);
44 
45  // switch on/off the summaries for the Synchronous noise
46  doSynchNoise = ps.getUntrackedParameter<bool>("doSynchNoise", false);
47  detailedAnalysis = ps.getUntrackedParameter<bool>("detailedAnalysis",false);
48  maxSynchNoiseRate = ps.getUntrackedParameter<double>("maxSynchNoiseRate", 0.001);
49  nMinEvts = ps.getUntrackedParameter<int>("nEventsCert", 5000);
50 
51  nevents = 0;
52 
53  bookingdone = 0;
54 
55 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
DTNoiseAnalysisTest::~DTNoiseAnalysisTest ( )
virtual

Destructor.

Definition at line 58 of file DTNoiseAnalysisTest.cc.

References LogTrace.

58  {
59  LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest") << "DTNoiseAnalysisTest: analyzed " << nevents << " events";
60 }
#define LogTrace(id)

Member Function Documentation

void DTNoiseAnalysisTest::beginRun ( edm::Run const &  run,
edm::EventSetup const &  context 
)
protectedvirtual

BeginRun.

Reimplemented from DQMEDHarvester.

Definition at line 63 of file DTNoiseAnalysisTest.cc.

References edm::EventSetup::get().

63  {
64 
65  // Get the geometry
66  context.get<MuonGeometryRecord>().get(muonGeom);
67 
68 }
edm::ESHandle< DTGeometry > muonGeom
void DTNoiseAnalysisTest::bookHistos ( DQMStore::IBooker ibooker)
protected

book the summary histograms

Definition at line 244 of file DTNoiseAnalysisTest.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and makeMuonMisalignmentScenario::wheel.

244  {
245 
246  ibooker.setCurrentFolder("DT/05-Noise");
247  string histoName;
248 
249  for(int wh=-2; wh<=2; wh++){
250  stringstream wheel; wheel << wh;
251  histoName = "NoiseRateSummary_W" + wheel.str();
252 
253  noiseHistos[wh] = ibooker.book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
254  noiseHistos[wh]->setAxisTitle("rate (Hz)",1);
255  noiseHistos[wh]->setAxisTitle("entries",2);
256  }
257  histoName = "NoiseRateSummary";
258 
259  noiseHistos[3] = ibooker.book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
260  noiseHistos[3]->setAxisTitle("rate (Hz)",1);
261  noiseHistos[3]->setAxisTitle("entries",2);
262 
263 
264  for(int wh=-2; wh<=2; wh++){
265  stringstream wheel; wheel << wh;
266  histoName = "NoiseSummary_W" + wheel.str();
267 
268  noisyCellHistos[wh] = ibooker.book2D(histoName.c_str(),"# of noisy channels",12,1,13,4,1,5);
269  noisyCellHistos[wh]->setBinLabel(1,"MB1",2);
270  noisyCellHistos[wh]->setBinLabel(2,"MB2",2);
271  noisyCellHistos[wh]->setBinLabel(3,"MB3",2);
272  noisyCellHistos[wh]->setBinLabel(4,"MB4",2);
273  noisyCellHistos[wh]->setAxisTitle("Sector",1);
274  }
275 
276  histoName = "NoiseSummary";
277 
278  summaryNoiseHisto = ibooker.book2D(histoName.c_str(),"# of noisy channels",12,1,13,5,-2,3);
279  summaryNoiseHisto->setAxisTitle("Sector",1);
280  summaryNoiseHisto->setAxisTitle("Wheel",2);
281 
282  if(detailedAnalysis) {
283  histoName = "NoisyChannels";
284 
285  threshChannelsHisto = ibooker.book1D(histoName.c_str(),"# of noisy channels vs threshold",15,500,2000);
286  threshChannelsHisto->setAxisTitle("threshold",1);
287  threshChannelsHisto->setAxisTitle("# noisy channels",2);
288  }
289 
290  if(doSynchNoise) {
291  ibooker.setCurrentFolder("DT/05-Noise/SynchNoise/");
292  histoName = "SynchNoiseSummary";
293 
294  summarySynchNoiseHisto = ibooker.book2D(histoName.c_str(),"Summary Synch. Noise",12,1,13,5,-2,3);
297  histoName = "SynchNoiseGlbSummary";
298 
299  glbSummarySynchNoiseHisto = ibooker.book2D(histoName.c_str(),"Summary Synch. Noise",12,1,13,5,-2,3);
302  }
303 
304 }
MonitorElement * threshChannelsHisto
std::map< int, MonitorElement * > noisyCellHistos
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * summarySynchNoiseHisto
MonitorElement * glbSummarySynchNoiseHisto
std::map< int, MonitorElement * > noiseHistos
MonitorElement * summaryNoiseHisto
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void DTNoiseAnalysisTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protectedvirtual

Implements DQMEDHarvester.

Definition at line 321 of file DTNoiseAnalysisTest.cc.

321 {}
void DTNoiseAnalysisTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
protectedvirtual

DQM Client Diagnostic.

Reimplemented from DQMEDHarvester.

Definition at line 71 of file DTNoiseAnalysisTest.cc.

References bookHistos(), objects.autophobj::float, DQMStore::IGetter::get(), MonitorElement::getFloatValue(), MonitorElement::getTH2F(), trackerHits::histo, LogTrace, plotFactory::plot, DTChamberId::sector(), DTChamberId::station(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

72  {
73 
74  float chRate;
75 
76  if (!bookingdone) {
77  // book the histos
78  bookHistos(ibooker);
79  }
80  bookingdone = 1;
81 
82 
83  LogVerbatim ("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
84  <<"[DTNoiseAnalysisTest]: End of LS transition, performing the DQM client operation";
85 
86  // Reset the summary plots
87  for(map<int, MonitorElement* >::iterator plot = noiseHistos.begin();
88  plot != noiseHistos.end(); ++plot) {
89  (*plot).second->Reset();
90  }
91 
92  for(map<int, MonitorElement* >::iterator plot = noisyCellHistos.begin();
93  plot != noisyCellHistos.end(); ++plot) {
94  (*plot).second->Reset();
95  }
96 
98 
99 
100 
101  vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
102  vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
103 
104  LogTrace ("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
105  <<"[DTNoiseAnalysisTest]: Fill the summary histos";
106 
107  for (; ch_it != ch_end; ++ch_it) { // loop over chambers
108  DTChamberId chID = (*ch_it)->id();
109 
110  MonitorElement * histo = igetter.get(getMEName(chID));
111 
112  if(histo) { // check the pointer
113 
114  TH2F * histo_root = histo->getTH2F();
115 
116  for(int sl = 1; sl != 4; ++sl) { // loop over SLs
117  // skip theta SL in MB4 chambers
118  if(chID.station() == 4 && sl == 2) continue;
119 
120  int binYlow = ((sl-1)*4)+1;
121 
122  for(int layer = 1; layer <= 4; ++layer) { // loop over layers
123 
124  // Get the layer ID
125  DTLayerId layID(chID,sl,layer);
126 
127  int nWires = muonGeom->layer(layID)->specificTopology().channels();
128  int firstWire = muonGeom->layer(layID)->specificTopology().firstChannel();
129 
130  int binY = binYlow+(layer-1);
131 
132  for(int wire = firstWire; wire != (nWires+firstWire); wire++){ // loop over wires
133 
134  double noise = histo_root->GetBinContent(wire, binY);
135  // fill the histos
136  noiseHistos[chID.wheel()]->Fill(noise);
137  noiseHistos[3]->Fill(noise);
138  int sector = chID.sector();
139  if(noise>noisyCellDef) {
140  if(sector == 13) {
141  sector = 4;
142  } else if(sector == 14) {
143  sector = 10;
144  }
145  noisyCellHistos[chID.wheel()]->Fill(sector,chID.station());
146  summaryNoiseHisto->Fill(sector,chID.wheel());
147  }
148  }
149  }
150  }
151  }
152  }
153 
154  if(detailedAnalysis) {
156  TH1F * histo = noiseHistos[3]->getTH1F();
157  for(int step = 0; step != 15; step++) {
158  int threshBin = step + 1;
159  int minBin = 26 + step*5;
160  int nNoisyCh = histo->Integral(minBin,101);
161  threshChannelsHisto->setBinContent(threshBin,nNoisyCh);
162  }
163  }
164 
165  // build the summary of synch noise
166 
167 
168  if(doSynchNoise) {
169  LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
170  << "[DTNoiseAnalysisTest]: fill summaries for synch noise" << endl;
173  for(int wheel = -2; wheel != 3; ++wheel) {
174  // Get the histo produced by DTDigiTask
175 
176  MonitorElement * histoNoiseSynch = igetter.get(getSynchNoiseMEName(wheel));
177  if(histoNoiseSynch != 0) {
178  for(int sect = 1; sect != 13; ++sect) { // loop over sectors
179  TH2F * histo = histoNoiseSynch->getTH2F();
180  float maxSectRate = 0;
181  for(int sta = 1; sta != 5; ++sta) {
182  if (nevents>0) chRate = histo->GetBinContent(sect, sta)/(float)nevents;
183  else chRate = -1.0;
184  // in case nevents 0 e.g. counting not done
185  LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
186  << " Wheel: " << wheel << " sect: " << sect
187  << " station: " << sta
188  << " rate is: " << chRate << endl;
189  if (chRate > maxSectRate)
190  maxSectRate = chRate;
191  }
193  maxSectRate > maxSynchNoiseRate ? 1 : 0);
194  float glbBinValue = 1 - 0.15*maxSectRate/maxSynchNoiseRate;
195  glbSummarySynchNoiseHisto->Fill(sect,wheel,glbBinValue>0 ? glbBinValue : 0);
196 
197  }
198  } else {
199  LogWarning("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
200  << " Histo: " << getSynchNoiseMEName(wheel) << " not found!" << endl;
201  }
202  }
203 
204  }
205 
206  string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsNoise";
207 
208  MonitorElement * meProcEvts = igetter.get(nEvtsName);
209 
210  if (meProcEvts) {
211  int nProcEvts = meProcEvts->getFloatValue();
212  glbSummarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
213  summarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
214  } else {
217  LogVerbatim ("DTDQM|DTMonitorClient|DTnoiseAnalysisTest") << "[DTNoiseAnalysisTest] ME: "
218  << nEvtsName << " not found!" << endl;
219  }
220 
221 
222 }
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:85
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * threshChannelsHisto
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
std::map< int, MonitorElement * > noisyCellHistos
edm::ESHandle< DTGeometry > muonGeom
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
void Fill(long long x)
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
Definition: DTGeometry.cc:110
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
void bookHistos(DQMStore::IBooker &)
book the summary histograms
double getFloatValue(void) const
std::string getMEName(const DTChamberId &chID)
Get the ME name.
void setEntries(double nentries)
set # of entries
#define LogTrace(id)
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:75
MonitorElement * summarySynchNoiseHisto
MonitorElement * glbSummarySynchNoiseHisto
std::map< int, MonitorElement * > noiseHistos
int sector() const
Definition: DTChamberId.h:61
std::string getSynchNoiseMEName(int wheelId) const
step
MonitorElement * summaryNoiseHisto
int station() const
Return the station number.
Definition: DTChamberId.h:51
TH2F * getTH2F(void) const
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
void Reset(void)
reset ME (ie. contents, errors, etc)
string DTNoiseAnalysisTest::getMEName ( const DTChamberId chID)
private

Get the ME name.

Definition at line 225 of file DTNoiseAnalysisTest.cc.

References DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

225  {
226 
227  stringstream wheel; wheel << chID.wheel();
228  stringstream station; station << chID.station();
229  stringstream sector; sector << chID.sector();
230 
231  string folderName =
232  "DT/05-Noise/Wheel" + wheel.str() +
233  "/Sector" + sector.str() + "/";
234 
235  string histoname = folderName + string("NoiseRate")
236  + "_W" + wheel.str()
237  + "_St" + station.str()
238  + "_Sec" + sector.str();
239 
240  return histoname;
241 
242 }
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
string DTNoiseAnalysisTest::getSynchNoiseMEName ( int  wheelId) const
private

Definition at line 308 of file DTNoiseAnalysisTest.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and makeMuonMisalignmentScenario::wheel.

308  {
309 
310  stringstream wheel; wheel << wheelId;
311  string folderName =
312  "DT/05-Noise/SynchNoise/";
313  string histoname = folderName + string("SyncNoiseEvents")
314  + "_W" + wheel.str();
315 
316  return histoname;
317 
318 }

Member Data Documentation

bool DTNoiseAnalysisTest::bookingdone
private

Definition at line 71 of file DTNoiseAnalysisTest.h.

bool DTNoiseAnalysisTest::detailedAnalysis
private

Definition at line 88 of file DTNoiseAnalysisTest.h.

bool DTNoiseAnalysisTest::doSynchNoise
private

Definition at line 87 of file DTNoiseAnalysisTest.h.

MonitorElement* DTNoiseAnalysisTest::glbSummarySynchNoiseHisto
private

Definition at line 85 of file DTNoiseAnalysisTest.h.

double DTNoiseAnalysisTest::maxSynchNoiseRate
private

Definition at line 89 of file DTNoiseAnalysisTest.h.

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

Definition at line 74 of file DTNoiseAnalysisTest.h.

int DTNoiseAnalysisTest::nevents
private

Definition at line 68 of file DTNoiseAnalysisTest.h.

int DTNoiseAnalysisTest::nMinEvts
private

Definition at line 69 of file DTNoiseAnalysisTest.h.

std::map< int, MonitorElement* > DTNoiseAnalysisTest::noiseHistos
private

Definition at line 80 of file DTNoiseAnalysisTest.h.

int DTNoiseAnalysisTest::noisyCellDef
private

Definition at line 77 of file DTNoiseAnalysisTest.h.

std::map< int, MonitorElement* > DTNoiseAnalysisTest::noisyCellHistos
private

Definition at line 81 of file DTNoiseAnalysisTest.h.

MonitorElement* DTNoiseAnalysisTest::summaryNoiseHisto
private

Definition at line 82 of file DTNoiseAnalysisTest.h.

MonitorElement* DTNoiseAnalysisTest::summarySynchNoiseHisto
private

Definition at line 84 of file DTNoiseAnalysisTest.h.

MonitorElement* DTNoiseAnalysisTest::threshChannelsHisto
private

Definition at line 83 of file DTNoiseAnalysisTest.h.