40 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: Constructor";
59 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"DTNoiseAnalysisTest: analyzed " << nevents <<
" events";
83 LogVerbatim (
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
84 <<
"[DTNoiseAnalysisTest]: End of LS transition, performing the DQM client operation";
87 for(map<int, MonitorElement* >::iterator
plot = noiseHistos.begin();
89 (*plot).second->Reset();
92 for(map<int, MonitorElement* >::iterator
plot = noisyCellHistos.begin();
93 plot != noisyCellHistos.end(); ++
plot) {
94 (*plot).second->Reset();
97 summaryNoiseHisto->Reset();
101 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
102 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
104 LogTrace (
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
105 <<
"[DTNoiseAnalysisTest]: Fill the summary histos";
107 for (; ch_it != ch_end; ++ch_it) {
114 TH2F * histo_root = histo->
getTH2F();
116 for(
int sl = 1; sl != 4; ++sl) {
118 if(chID.
station() == 4 && sl == 2)
continue;
120 int binYlow = ((sl-1)*4)+1;
122 for(
int layer = 1; layer <= 4; ++layer) {
127 int nWires = muonGeom->layer(layID)->specificTopology().channels();
128 int firstWire = muonGeom->layer(layID)->specificTopology().firstChannel();
130 int binY = binYlow+(layer-1);
132 for(
int wire = firstWire; wire != (nWires+firstWire); wire++){
134 double noise = histo_root->GetBinContent(wire, binY);
136 noiseHistos[chID.
wheel()]->Fill(noise);
137 noiseHistos[3]->Fill(noise);
138 int sector = chID.
sector();
139 if(noise>noisyCellDef) {
142 }
else if(sector == 14) {
145 noisyCellHistos[chID.
wheel()]->Fill(sector,chID.
station());
146 summaryNoiseHisto->Fill(sector,chID.
wheel());
154 if(detailedAnalysis) {
155 threshChannelsHisto->Reset();
156 TH1F *
histo = noiseHistos[3]->getTH1F();
158 int threshBin =
step + 1;
159 int minBin = 26 +
step*5;
160 int nNoisyCh = histo->Integral(minBin,101);
161 threshChannelsHisto->setBinContent(threshBin,nNoisyCh);
169 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
170 <<
"[DTNoiseAnalysisTest]: fill summaries for synch noise" << endl;
171 summarySynchNoiseHisto->Reset();
172 glbSummarySynchNoiseHisto->Reset();
177 if(histoNoiseSynch != 0) {
178 for(
int sect = 1; sect != 13; ++sect) {
180 float maxSectRate = 0;
181 for(
int sta = 1; sta != 5; ++sta) {
182 if (nevents>0) chRate = histo->GetBinContent(sect, sta)/(
float)nevents;
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;
192 summarySynchNoiseHisto->Fill(sect,
wheel,
193 maxSectRate > maxSynchNoiseRate ? 1 : 0);
194 float glbBinValue = 1 - 0.15*maxSectRate/maxSynchNoiseRate;
195 glbSummarySynchNoiseHisto->Fill(sect,
wheel,glbBinValue>0 ? glbBinValue : 0);
199 LogWarning(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
200 <<
" Histo: " << getSynchNoiseMEName(
wheel) <<
" not found!" << endl;
206 string nEvtsName =
"DT/EventInfo/Counters/nProcessedEventsNoise";
212 glbSummarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
213 summarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
215 glbSummarySynchNoiseHisto->setEntries(nMinEvts +1);
216 summarySynchNoiseHisto->setEntries(nMinEvts + 1);
217 LogVerbatim (
"DTDQM|DTMonitorClient|DTnoiseAnalysisTest") <<
"[DTNoiseAnalysisTest] ME: " 218 << nEvtsName <<
" not found!" << endl;
229 stringstream sector; sector << chID.
sector();
232 "DT/05-Noise/Wheel" + wheel.str() +
233 "/Sector" + sector.str() +
"/";
235 string histoname = folderName +
string(
"NoiseRate")
237 +
"_St" + station.str()
238 +
"_Sec" + sector.str();
249 for(
int wh=-2; wh<=2; wh++){
250 stringstream
wheel; wheel << wh;
251 histoName =
"NoiseRateSummary_W" + wheel.str();
253 noiseHistos[wh] = ibooker.
book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
255 noiseHistos[wh]->setAxisTitle(
"entries",2);
257 histoName =
"NoiseRateSummary";
259 noiseHistos[3] = ibooker.
book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
261 noiseHistos[3]->setAxisTitle(
"entries",2);
264 for(
int wh=-2; wh<=2; wh++){
265 stringstream
wheel; wheel << wh;
266 histoName =
"NoiseSummary_W" + wheel.str();
268 noisyCellHistos[wh] = ibooker.
book2D(histoName.c_str(),
"# of noisy channels",12,1,13,4,1,5);
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);
276 histoName =
"NoiseSummary";
278 summaryNoiseHisto = ibooker.
book2D(histoName.c_str(),
"# of noisy channels",12,1,13,5,-2,3);
280 summaryNoiseHisto->setAxisTitle(
"Wheel",2);
282 if(detailedAnalysis) {
283 histoName =
"NoisyChannels";
285 threshChannelsHisto = ibooker.
book1D(histoName.c_str(),
"# of noisy channels vs threshold",15,500,2000);
287 threshChannelsHisto->setAxisTitle(
"# noisy channels",2);
292 histoName =
"SynchNoiseSummary";
294 summarySynchNoiseHisto = ibooker.
book2D(histoName.c_str(),
"Summary Synch. Noise",12,1,13,5,-2,3);
296 summarySynchNoiseHisto->setAxisTitle(
"Wheel",2);
297 histoName =
"SynchNoiseGlbSummary";
299 glbSummarySynchNoiseHisto = ibooker.
book2D(histoName.c_str(),
"Summary Synch. Noise",12,1,13,5,-2,3);
301 glbSummarySynchNoiseHisto->setAxisTitle(
"Wheel",2);
310 stringstream
wheel; wheel << wheelId;
312 "DT/05-Noise/SynchNoise/";
313 string histoname = folderName +
string(
"SyncNoiseEvents")
314 +
"_W" + wheel.str();
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * get(const std::string &path)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void bookHistos(DQMStore::IBooker &)
book the summary histograms
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
DQM Client Diagnostic.
double getFloatValue(void) const
MonitorElement * book1D(Args &&...args)
std::string getMEName(const DTChamberId &chID)
Get the ME name.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
std::string getSynchNoiseMEName(int wheelId) const
int station() const
Return the station number.
TH2F * getTH2F(void) const
int wheel() const
Return the wheel number.
DTNoiseAnalysisTest(const edm::ParameterSet &ps)
Constructor.
void beginRun(edm::Run const &run, edm::EventSetup const &context)
BeginRun.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
virtual ~DTNoiseAnalysisTest()
Destructor.
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)