45 dbe->setCurrentFolder(
"DT/Tests/Noise");
55 edm::LogVerbatim (
"noise") <<
"DTNoiseTest: analyzed " << updates <<
" events";
110 edm::LogVerbatim (
"noise") <<
"[DTNoiseTest]: End of LS transition, performing the DQM client operation";
124 float tTrig, tTrigRMS, kFactor;
128 vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
129 vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
131 for (; ch_it != ch_end; ++ch_it) {
133 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
134 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
138 TH2F * noiseHisto = noiseME->
getTH2F();
141 double nevents = (int) noiseHisto->GetEntries();
143 double normalization =0;
147 float noiseStatistics=0;
148 int newNoiseChannels=0;
150 for(; sl_it != sl_end; ++sl_it) {
155 if (tTrig==0) tTrig=1;
156 const double ns_s = 1e9*(32/25);
157 normalization = ns_s/float(tTrig*nevents);
159 noiseHisto->Scale(normalization);
172 for (
int binX=1; binX <= noiseHisto->GetNbinsX(); binX++) {
174 if (noiseHisto->GetBinContent(binX,binY) >
parameters.getUntrackedParameter<
int>(
"HzThreshold", 300))
175 theNoisyChannels.push_back(
DTWireId(theLayer, binX));
179 average += noiseHisto->GetBinContent(binX,binY);
185 if (nOfChannels) noiseStatistics = average/nOfChannels;
186 histoTag =
"NoiseAverage";
191 for ( vector<DTWireId>::const_iterator nb_it = theNoisyChannels.begin();
192 nb_it != theNoisyChannels.end(); ++nb_it) {
194 bool isNoisy =
false;
195 bool isFEMasked =
false;
196 bool isTDCMasked =
false;
197 bool isTrigMask =
false;
200 statusMap->cellStatus((*nb_it), isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
202 if (!isNoisy) newNoiseChannels++;
204 theNoisyChannels.clear();
205 histoTag =
"NewNoisyChannels";
206 if (
histos[histoTag].
find((*ch_it)->id().rawId()) ==
histos[histoTag].
end())
bookHistos((*ch_it)->id(),string(
"NewNoisyChannels"), histoTag );
207 histos[histoTag].find((*ch_it)->id().rawId())->
second->setBinContent(slID.
superLayer(), newNoiseChannels);
211 vector<const DTSuperLayer*>::const_iterator sl2_it = (*ch_it)->superLayers().begin();
212 vector<const DTSuperLayer*>::const_iterator sl2_end = (*ch_it)->superLayers().end();
213 for(; sl2_it != sl2_end; ++sl2_it) {
214 vector<const DTLayer*>::const_iterator l_it = (*sl2_it)->layers().begin();
215 vector<const DTLayer*>::const_iterator l_end = (*sl2_it)->layers().end();
216 for(; l_it != l_end; ++l_it) {
221 if (noisePerEventME) {
222 TH2F * noiseHistoPerEvent = noisePerEventME->
getTH2F();
223 int nWires = muonGeom->layer(lID)->specificTopology().channels();
224 double MeanNumerator=0, MeanDenominator=0;
225 histoTag =
"MeanDigiPerEvent";
226 for (
int w=1;
w<=nWires;
w++){
227 for(
int numDigi=1; numDigi<=10; numDigi++){
228 MeanNumerator+=(noiseHistoPerEvent->GetBinContent(
w,numDigi)*(numDigi-1));
229 MeanDenominator+=noiseHistoPerEvent->GetBinContent(
w,numDigi);
231 double Mean=MeanNumerator/MeanDenominator;
232 if (
histos[histoTag].
find((*l_it)->id().rawId()) ==
histos[histoTag].
end())
bookHistos((*l_it)->id(),nWires, string(
"MeanDigiPerEvent"), histoTag );
233 histos[histoTag].find((*l_it)->id().rawId())->
second->setBinContent(
w, Mean);
241 histoTag =
"MeanDigiPerEvent";
242 string MeanCriterionName =
parameters.getUntrackedParameter<
string>(
"meanTestName",
"NoiseMeanInRange");
243 for(map<uint32_t, MonitorElement*>::const_iterator hMean =
histos[histoTag].
begin();
244 hMean !=
histos[histoTag].end();
246 const QReport * theMeanQReport = (*hMean).second->getQReport(MeanCriterionName);
248 vector<dqm::me_util::Channel> badChannels = theMeanQReport->
getBadChannels();
249 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
250 channel != badChannels.end(); channel++) {
251 LogVerbatim (
"tTrigCalibration")<<
"LayerId : "<<(*hMean).first<<
" Bad mean channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
269 dbe->rmdir(
"DT/Tests/Noise");
275 stringstream wheel; wheel << ch.
wheel();
277 stringstream sector; sector << ch.
sector();
279 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
280 string folderTag =
parameters.getUntrackedParameter<
string>(
"folderTag",
"Occupancies");
282 folderRoot +
"DT/DTDigiTask/Wheel" + wheel.str() +
283 "/Station" + station.str() +
284 "/Sector" + sector.str() +
"/" + folderTag +
"/";
286 string histoTag =
parameters.getUntrackedParameter<
string>(
"histoTag",
"OccupancyNoise_perCh");
287 string histoname = folderName + histoTag
289 +
"_St" + station.str()
290 +
"_Sec" + sector.str();
299 stringstream wheel; wheel << ly.
wheel();
301 stringstream sector; sector << ly.
sector();
302 stringstream superLayer; superLayer << ly.
superlayer();
303 stringstream layer; layer << ly.
layer();
305 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
306 string folderTag =
parameters.getUntrackedParameter<
string>(
"folderTagForDigiPerEventTest",
"DigiPerEvent");
308 folderRoot +
"DT/DTDigiForNoiseTask/Wheel" + wheel.str() +
309 "/Station" + station.str() +
310 "/Sector" + sector.str() +
"/" + folderTag +
"/";
312 string histoTag =
parameters.getUntrackedParameter<
string>(
"histoTagForDigiPerEventTest",
"DigiPerEvent");
313 string histoname = folderName + histoTag
315 +
"_St" + station.str()
316 +
"_Sec" + sector.str()
317 +
"_SL" + superLayer.str()
318 +
"_L" + layer.str();
328 stringstream wheel; wheel << ch.
wheel();
330 stringstream sector; sector << ch.
sector();
332 dbe->setCurrentFolder(
"DT/Tests/Noise/" + folder);
334 string histoName = histoTag +
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
336 if (folder ==
"NoiseAverage")
337 (
histos[histoTag])[ch.
rawId()] = dbe->book1D(histoName.c_str(),histoName.c_str(),3,0,3);
339 if ( folder ==
"NewNoisyChannels")
340 (
histos[histoTag])[ch.
rawId()] = dbe->book1D(histoName.c_str(),histoName.c_str(),3,0,3);
351 stringstream layer; layer << lId.
layer();
353 string histoName = histoTag +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str() +
"_L" + layer.str();
355 dbe->setCurrentFolder(
"DT/Tests/Noise/" + folder +
356 "/Wheel" + wheel.str() +
357 "/Station" + station.str() +
358 "/Sector" + sector.str());
360 (
histos[histoTag])[lId.
rawId()] = dbe->book1D(histoName.c_str(),histoName.c_str(),nWires,0,nWires);
LuminosityBlockID id() const
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
DTNoiseTest(const edm::ParameterSet &ps)
Constructor.
int layer() const
Return the layer number.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
uint32_t rawId() const
get the raw id
U second(std::pair< T, U > const &p)
int superLayer() const
Return the superlayer number.
const std::vector< DQMChannel > & getBadChannels(void) const
int superlayer() const
Return the superlayer number (deprecated method name)
void bookHistos(const DTChamberId &ch, std::string folder, std::string histoTag)
book the new ME
virtual ~DTNoiseTest()
Destructor.
LuminosityBlockNumber_t luminosityBlock() const
std::string getMEName(const DTChamberId &ch)
Get the ME name.
int station() const
Return the station number.
TH2F * getTH2F(void) const
int wheel() const
Return the wheel number.
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
DQM Client Diagnostic.