41 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: Constructor";
56 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"DTNoiseAnalysisTest: analyzed " <<
nevents <<
" events";
61 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: BeginJob";
80 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<
"[DTNoiseAnalysisTest]: Begin of LS transition";
87 if(
nevents%1000 == 0)
LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
88 <<
"[DTNoiseAnalysisTest]: "<<
nevents<<
" events";
93 LogVerbatim (
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
94 <<
"[DTNoiseAnalysisTest]: End of LS transition, performing the DQM client operation";
97 for(map<int, MonitorElement* >::iterator
plot = noiseHistos.begin();
99 (*plot).second->Reset();
102 for(map<int, MonitorElement* >::iterator
plot = noisyCellHistos.begin();
103 plot != noisyCellHistos.end(); ++
plot) {
104 (*plot).second->Reset();
107 summaryNoiseHisto->Reset();
111 vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
112 vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
114 LogTrace (
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
115 <<
"[DTNoiseAnalysisTest]: Fill the summary histos";
117 for (; ch_it != ch_end; ++ch_it) {
124 TH2F * histo_root = histo->
getTH2F();
126 for(
int sl = 1; sl != 4; ++sl) {
128 if(chID.
station() == 4 && sl == 2)
continue;
130 int binYlow = ((sl-1)*4)+1;
132 for(
int layer = 1; layer <= 4; ++layer) {
137 int nWires = muonGeom->layer(layID)->specificTopology().channels();
138 int firstWire = muonGeom->layer(layID)->specificTopology().firstChannel();
140 int binY = binYlow+(layer-1);
142 for(
int wire = firstWire; wire != (nWires+firstWire); wire++){
144 double noise = histo_root->GetBinContent(wire, binY);
146 noiseHistos[chID.
wheel()]->Fill(noise);
147 noiseHistos[3]->Fill(noise);
148 int sector = chID.
sector();
149 if(noise>noisyCellDef) {
152 }
else if(sector == 14) {
155 noisyCellHistos[chID.
wheel()]->Fill(sector,chID.
station());
156 summaryNoiseHisto->Fill(sector,chID.
wheel());
169 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
170 <<
"[DTNoiseAnalysisTest]: fill summaries for synch noise" << endl;
171 summarySynchNoiseHisto->Reset();
172 for(
int wheel = -2; wheel != 3; ++wheel) {
174 MonitorElement * histoNoiseSynch = dbe->get(getSynchNoiseMEName(wheel));
175 if(histoNoiseSynch != 0) {
176 for(
int sect = 1; sect != 13; ++sect) {
178 for(
int sta = 1; sta != 5; ++sta) {
179 LogTrace(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
180 <<
" Wheel: " << wheel <<
" sect: " << sect
181 <<
" station: " << sta
182 <<
" rate is: " << histo->GetBinContent(sect, sta)/(float)
nevents << endl;
183 if(histo->GetBinContent(sect, sta)/(float)
nevents > maxSynchNoiseRate) {
184 summarySynchNoiseHisto->Fill(sect,wheel,1);
186 summarySynchNoiseHisto->Fill(sect,wheel,0);
191 LogWarning(
"DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
192 <<
" Histo: " << getSynchNoiseMEName(wheel) <<
" not found!" << endl;
203 stringstream wheel; wheel << chID.
wheel();
205 stringstream sector; sector << chID.
sector();
208 "DT/05-Noise/Wheel" + wheel.str() +
210 "/Sector" + sector.str() +
"/";
212 string histoname = folderName + string(
"NoiseRate")
214 +
"_St" + station.str()
215 +
"_Sec" + sector.str();
224 dbe->setCurrentFolder(
"DT/05-Noise");
227 for(
int wh=-2; wh<=2; wh++){
228 stringstream wheel; wheel << wh;
229 histoName =
"NoiseRateSummary_W" + wheel.str();
230 noiseHistos[wh] = dbe->book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
231 noiseHistos[wh]->setAxisTitle(
"rate (Hz)",1);
232 noiseHistos[wh]->setAxisTitle(
"entries",2);
234 histoName =
"NoiseRateSummary";
235 noiseHistos[3] = dbe->book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
236 noiseHistos[3]->setAxisTitle(
"rate (Hz)",1);
237 noiseHistos[3]->setAxisTitle(
"entries",2);
240 for(
int wh=-2; wh<=2; wh++){
241 stringstream wheel; wheel << wh;
242 histoName =
"NoiseSummary_W" + wheel.str();
243 noisyCellHistos[wh] = dbe->book2D(histoName.c_str(),
"# of noisy channels",12,1,13,4,1,5);
244 noisyCellHistos[wh]->setBinLabel(1,
"MB1",2);
245 noisyCellHistos[wh]->setBinLabel(2,
"MB2",2);
246 noisyCellHistos[wh]->setBinLabel(3,
"MB3",2);
247 noisyCellHistos[wh]->setBinLabel(4,
"MB4",2);
248 noisyCellHistos[wh]->setAxisTitle(
"Sector",1);
251 histoName =
"NoiseSummary";
252 summaryNoiseHisto = dbe->book2D(histoName.c_str(),
"# of noisy channels",12,1,13,5,-2,3);
253 summaryNoiseHisto->setAxisTitle(
"Sector",1);
254 summaryNoiseHisto->setAxisTitle(
"Wheel",2);
258 dbe->setCurrentFolder(
"DT/05-Noise/SynchNoise/");
259 histoName =
"SynchNoiseSummary";
260 summarySynchNoiseHisto = dbe->book2D(histoName.c_str(),
"Summary Synch. Noise",12,1,13,5,-2,3);
261 summarySynchNoiseHisto->setAxisTitle(
"Sector",1);
262 summarySynchNoiseHisto->setAxisTitle(
"Wheel",2);
271 stringstream wheel; wheel << wheelId;
273 "DT/05-Noise/SynchNoise/";
274 string histoname = folderName + string(
"SyncNoiseEvents")
275 +
"_W" + wheel.str();
T getUntrackedParameter(std::string const &, T const &) const
void bookHistos()
book the summary histograms
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.