38 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: Constructor";
55 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"DTNoiseAnalysisTest: analyzed " <<
nevents <<
" events";
60 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: BeginJob";
79 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: Begin of LS transition";
86 if(
nevents%1000 == 0)
LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
87 <<
"[DTNoiseAnalysisTest]: "<<
nevents<<
" events";
92 LogVerbatim (
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
93 <<
"[DTNoiseAnalysisTest]: End of LS transition, performing the DQM client operation";
96 for(map<int, MonitorElement* >::iterator
plot = noiseHistos.begin();
98 (*plot).second->Reset();
101 for(map<int, MonitorElement* >::iterator
plot = noisyCellHistos.begin();
102 plot != noisyCellHistos.end(); ++
plot) {
103 (*plot).second->Reset();
106 summaryNoiseHisto->Reset();
110 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
111 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
113 LogTrace (
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
114 <<
"[DTNoiseAnalysisTest]: Fill the summary histos";
116 for (; ch_it != ch_end; ++ch_it) {
123 TH2F * histo_root = histo->
getTH2F();
125 for(
int sl = 1; sl != 4; ++sl) {
127 if(chID.
station() == 4 && sl == 2)
continue;
129 int binYlow = ((sl-1)*4)+1;
131 for(
int layer = 1; layer <= 4; ++layer) {
136 int nWires = muonGeom->layer(layID)->specificTopology().channels();
137 int firstWire = muonGeom->layer(layID)->specificTopology().firstChannel();
139 int binY = binYlow+(layer-1);
141 for(
int wire = firstWire; wire != (nWires+firstWire); wire++){
143 double noise = histo_root->GetBinContent(wire, binY);
145 noiseHistos[chID.
wheel()]->Fill(noise);
146 noiseHistos[3]->Fill(noise);
147 int sector = chID.
sector();
148 if(noise>noisyCellDef) {
151 }
else if(sector == 14) {
154 noisyCellHistos[chID.
wheel()]->Fill(sector,chID.
station());
155 summaryNoiseHisto->Fill(sector,chID.
wheel());
163 if(detailedAnalysis) {
164 threshChannelsHisto->Reset();
165 TH1F *
histo = noiseHistos[3]->getTH1F();
167 int threshBin =
step + 1;
168 int minBin = 26 +
step*5;
169 int nNoisyCh = histo->Integral(minBin,101);
170 threshChannelsHisto->setBinContent(threshBin,nNoisyCh);
178 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
179 <<
"[DTNoiseAnalysisTest]: fill summaries for synch noise" << endl;
180 summarySynchNoiseHisto->Reset();
181 glbSummarySynchNoiseHisto->Reset();
182 for(
int wheel = -2; wheel != 3; ++wheel) {
184 MonitorElement * histoNoiseSynch = dbe->get(getSynchNoiseMEName(wheel));
185 if(histoNoiseSynch != 0) {
186 for(
int sect = 1; sect != 13; ++sect) {
188 float maxSectRate = 0;
189 for(
int sta = 1; sta != 5; ++sta) {
190 float chRate = histo->GetBinContent(sect, sta)/(float)
nevents;
191 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
192 <<
" Wheel: " << wheel <<
" sect: " << sect
193 <<
" station: " << sta
194 <<
" rate is: " << chRate << endl;
195 if (chRate > maxSectRate)
196 maxSectRate = chRate;
198 summarySynchNoiseHisto->Fill(sect,wheel,
199 maxSectRate > maxSynchNoiseRate ? 1 : 0);
200 float glbBinValue = 1 - 0.15*maxSectRate/maxSynchNoiseRate;
201 glbSummarySynchNoiseHisto->Fill(sect,wheel,glbBinValue>0 ? glbBinValue : 0);
205 LogWarning(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
206 <<
" Histo: " << getSynchNoiseMEName(wheel) <<
" not found!" << endl;
212 string nEvtsName =
"DT/EventInfo/Counters/nProcessedEventsNoise";
217 glbSummarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
218 summarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
220 glbSummarySynchNoiseHisto->setEntries(nMinEvts +1);
221 summarySynchNoiseHisto->setEntries(nMinEvts + 1);
222 LogVerbatim (
"DTDQM|DTMonitorClient|DTnoiseAnalysisTest") <<
"[DTNoiseAnalysisTest] ME: "
223 << nEvtsName <<
" not found!" << endl;
232 stringstream wheel; wheel << chID.
wheel();
234 stringstream sector; sector << chID.
sector();
237 "DT/05-Noise/Wheel" + wheel.str() +
239 "/Sector" + sector.str() +
"/";
241 string histoname = folderName +
string(
"NoiseRate")
243 +
"_St" + station.str()
244 +
"_Sec" + sector.str();
253 dbe->setCurrentFolder(
"DT/05-Noise");
256 for(
int wh=-2; wh<=2; wh++){
257 stringstream wheel; wheel << wh;
258 histoName =
"NoiseRateSummary_W" + wheel.str();
259 noiseHistos[wh] = dbe->book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
260 noiseHistos[wh]->setAxisTitle(
"rate (Hz)",1);
261 noiseHistos[wh]->setAxisTitle(
"entries",2);
263 histoName =
"NoiseRateSummary";
264 noiseHistos[3] = dbe->book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
265 noiseHistos[3]->setAxisTitle(
"rate (Hz)",1);
266 noiseHistos[3]->setAxisTitle(
"entries",2);
269 for(
int wh=-2; wh<=2; wh++){
270 stringstream wheel; wheel << wh;
271 histoName =
"NoiseSummary_W" + wheel.str();
272 noisyCellHistos[wh] = dbe->book2D(histoName.c_str(),
"# of noisy channels",12,1,13,4,1,5);
273 noisyCellHistos[wh]->setBinLabel(1,
"MB1",2);
274 noisyCellHistos[wh]->setBinLabel(2,
"MB2",2);
275 noisyCellHistos[wh]->setBinLabel(3,
"MB3",2);
276 noisyCellHistos[wh]->setBinLabel(4,
"MB4",2);
277 noisyCellHistos[wh]->setAxisTitle(
"Sector",1);
280 histoName =
"NoiseSummary";
281 summaryNoiseHisto = dbe->book2D(histoName.c_str(),
"# of noisy channels",12,1,13,5,-2,3);
282 summaryNoiseHisto->setAxisTitle(
"Sector",1);
283 summaryNoiseHisto->setAxisTitle(
"Wheel",2);
285 if(detailedAnalysis) {
286 histoName =
"NoisyChannels";
287 threshChannelsHisto = dbe->book1D(histoName.c_str(),
"# of noisy channels vs threshold",15,500,2000);
288 threshChannelsHisto->setAxisTitle(
"threshold",1);
289 threshChannelsHisto->setAxisTitle(
"# noisy channels",2);
293 dbe->setCurrentFolder(
"DT/05-Noise/SynchNoise/");
294 histoName =
"SynchNoiseSummary";
295 summarySynchNoiseHisto = dbe->book2D(histoName.c_str(),
"Summary Synch. Noise",12,1,13,5,-2,3);
296 summarySynchNoiseHisto->setAxisTitle(
"Sector",1);
297 summarySynchNoiseHisto->setAxisTitle(
"Wheel",2);
298 histoName =
"SynchNoiseGlbSummary";
299 glbSummarySynchNoiseHisto = dbe->book2D(histoName.c_str(),
"Summary Synch. Noise",12,1,13,5,-2,3);
300 glbSummarySynchNoiseHisto->setAxisTitle(
"Sector",1);
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
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.