40 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: Constructor";
57 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"DTNoiseAnalysisTest: analyzed " <<
nevents <<
" events";
62 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: BeginJob";
81 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: Begin of LS transition";
88 if(
nevents%1000 == 0)
LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
89 <<
"[DTNoiseAnalysisTest]: "<<
nevents<<
" events";
94 LogVerbatim (
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
95 <<
"[DTNoiseAnalysisTest]: End of LS transition, performing the DQM client operation";
98 for(map<int, MonitorElement* >::iterator
plot = noiseHistos.begin();
100 (*plot).second->Reset();
103 for(map<int, MonitorElement* >::iterator
plot = noisyCellHistos.begin();
104 plot != noisyCellHistos.end(); ++
plot) {
105 (*plot).second->Reset();
108 summaryNoiseHisto->Reset();
112 vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
113 vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
115 LogTrace (
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
116 <<
"[DTNoiseAnalysisTest]: Fill the summary histos";
118 for (; ch_it != ch_end; ++ch_it) {
125 TH2F * histo_root = histo->
getTH2F();
127 for(
int sl = 1; sl != 4; ++sl) {
129 if(chID.
station() == 4 && sl == 2)
continue;
131 int binYlow = ((sl-1)*4)+1;
133 for(
int layer = 1; layer <= 4; ++layer) {
138 int nWires = muonGeom->layer(layID)->specificTopology().channels();
139 int firstWire = muonGeom->layer(layID)->specificTopology().firstChannel();
141 int binY = binYlow+(layer-1);
143 for(
int wire = firstWire; wire != (nWires+firstWire); wire++){
145 double noise = histo_root->GetBinContent(wire, binY);
147 noiseHistos[chID.
wheel()]->Fill(noise);
148 noiseHistos[3]->Fill(noise);
149 int sector = chID.
sector();
150 if(noise>noisyCellDef) {
153 }
else if(sector == 14) {
156 noisyCellHistos[chID.
wheel()]->Fill(sector,chID.
station());
157 summaryNoiseHisto->Fill(sector,chID.
wheel());
165 if(detailedAnalysis) {
166 threshChannelsHisto->Reset();
167 TH1F *
histo = noiseHistos[3]->getTH1F();
169 int threshBin =
step + 1;
170 int minBin = 26 +
step*5;
171 int nNoisyCh = histo->Integral(minBin,101);
172 threshChannelsHisto->setBinContent(threshBin,nNoisyCh);
180 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
181 <<
"[DTNoiseAnalysisTest]: fill summaries for synch noise" << endl;
182 summarySynchNoiseHisto->Reset();
183 glbSummarySynchNoiseHisto->Reset();
184 for(
int wheel = -2; wheel != 3; ++wheel) {
186 MonitorElement * histoNoiseSynch = dbe->get(getSynchNoiseMEName(wheel));
187 if(histoNoiseSynch != 0) {
188 for(
int sect = 1; sect != 13; ++sect) {
190 float maxSectRate = 0;
191 for(
int sta = 1; sta != 5; ++sta) {
192 float chRate = histo->GetBinContent(sect, sta)/(float)
nevents;
193 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
194 <<
" Wheel: " << wheel <<
" sect: " << sect
195 <<
" station: " << sta
196 <<
" rate is: " << chRate << endl;
197 if (chRate > maxSectRate)
198 maxSectRate = chRate;
200 summarySynchNoiseHisto->Fill(sect,wheel,
201 maxSectRate > maxSynchNoiseRate ? 1 : 0);
202 float glbBinValue = 1 - 0.15*maxSectRate/maxSynchNoiseRate;
203 glbSummarySynchNoiseHisto->Fill(sect,wheel,glbBinValue>0 ? glbBinValue : 0);
207 LogWarning(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
208 <<
" Histo: " << getSynchNoiseMEName(wheel) <<
" not found!" << endl;
214 string nEvtsName =
"DT/EventInfo/Counters/nProcessedEventsNoise";
219 glbSummarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
220 summarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
222 glbSummarySynchNoiseHisto->setEntries(nMinEvts +1);
223 summarySynchNoiseHisto->setEntries(nMinEvts + 1);
224 LogVerbatim (
"DTDQM|DTMonitorClient|DTnoiseAnalysisTest") <<
"[DTNoiseAnalysisTest] ME: "
225 << nEvtsName <<
" not found!" << endl;
234 stringstream wheel; wheel << chID.
wheel();
236 stringstream sector; sector << chID.
sector();
239 "DT/05-Noise/Wheel" + wheel.str() +
241 "/Sector" + sector.str() +
"/";
243 string histoname = folderName +
string(
"NoiseRate")
245 +
"_St" + station.str()
246 +
"_Sec" + sector.str();
255 dbe->setCurrentFolder(
"DT/05-Noise");
258 for(
int wh=-2; wh<=2; wh++){
259 stringstream wheel; wheel << wh;
260 histoName =
"NoiseRateSummary_W" + wheel.str();
261 noiseHistos[wh] = dbe->book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
262 noiseHistos[wh]->setAxisTitle(
"rate (Hz)",1);
263 noiseHistos[wh]->setAxisTitle(
"entries",2);
265 histoName =
"NoiseRateSummary";
266 noiseHistos[3] = dbe->book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
267 noiseHistos[3]->setAxisTitle(
"rate (Hz)",1);
268 noiseHistos[3]->setAxisTitle(
"entries",2);
271 for(
int wh=-2; wh<=2; wh++){
272 stringstream wheel; wheel << wh;
273 histoName =
"NoiseSummary_W" + wheel.str();
274 noisyCellHistos[wh] = dbe->book2D(histoName.c_str(),
"# of noisy channels",12,1,13,4,1,5);
275 noisyCellHistos[wh]->setBinLabel(1,
"MB1",2);
276 noisyCellHistos[wh]->setBinLabel(2,
"MB2",2);
277 noisyCellHistos[wh]->setBinLabel(3,
"MB3",2);
278 noisyCellHistos[wh]->setBinLabel(4,
"MB4",2);
279 noisyCellHistos[wh]->setAxisTitle(
"Sector",1);
282 histoName =
"NoiseSummary";
283 summaryNoiseHisto = dbe->book2D(histoName.c_str(),
"# of noisy channels",12,1,13,5,-2,3);
284 summaryNoiseHisto->setAxisTitle(
"Sector",1);
285 summaryNoiseHisto->setAxisTitle(
"Wheel",2);
287 if(detailedAnalysis) {
288 histoName =
"NoisyChannels";
289 threshChannelsHisto = dbe->book1D(histoName.c_str(),
"# of noisy channels vs threshold",15,500,2000);
290 threshChannelsHisto->setAxisTitle(
"threshold",1);
291 threshChannelsHisto->setAxisTitle(
"# noisy channels",2);
295 dbe->setCurrentFolder(
"DT/05-Noise/SynchNoise/");
296 histoName =
"SynchNoiseSummary";
297 summarySynchNoiseHisto = dbe->book2D(histoName.c_str(),
"Summary Synch. Noise",12,1,13,5,-2,3);
298 summarySynchNoiseHisto->setAxisTitle(
"Sector",1);
299 summarySynchNoiseHisto->setAxisTitle(
"Wheel",2);
300 histoName =
"SynchNoiseGlbSummary";
301 glbSummarySynchNoiseHisto = dbe->book2D(histoName.c_str(),
"Summary Synch. Noise",12,1,13,5,-2,3);
302 glbSummarySynchNoiseHisto->setAxisTitle(
"Sector",1);
303 glbSummarySynchNoiseHisto->setAxisTitle(
"Wheel",2);
312 stringstream wheel; wheel << wheelId;
314 "DT/05-Noise/SynchNoise/";
315 string histoname = folderName +
string(
"SyncNoiseEvents")
316 +
"_W" + wheel.str();
T getUntrackedParameter(std::string const &, T const &) const
void bookHistos()
book the summary histograms
double getFloatValue(void) const
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
DQM Client Diagnostic.
std::string getMEName(const DTChamberId &chID)
Get the ME name.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
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.
virtual ~DTNoiseAnalysisTest()
Destructor.