43 dbe->setCurrentFolder(
"DT/Tests/Noise");
53 edm::LogVerbatim (
"noise") <<
"DTNoiseTest: analyzed " << updates <<
" events";
108 edm::LogVerbatim (
"noise") <<
"[DTNoiseTest]: End of LS transition, performing the DQM client operation";
122 float tTrig, tTrigRMS, kFactor;
126 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
127 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
129 for (; ch_it != ch_end; ++ch_it) {
131 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
132 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
136 TH2F * noiseHisto = noiseME->
getTH2F();
139 double nevents = (int) noiseHisto->GetEntries();
141 double normalization =0;
145 float noiseStatistics=0;
146 int newNoiseChannels=0;
148 for(; sl_it != sl_end; ++sl_it) {
153 if (tTrig==0) tTrig=1;
154 const double ns_s = 1e9*(32/25);
155 normalization = ns_s/float(tTrig*nevents);
157 noiseHisto->Scale(normalization);
170 for (
int binX=1; binX <= noiseHisto->GetNbinsX(); binX++) {
172 if (noiseHisto->GetBinContent(binX,binY) >
parameters.getUntrackedParameter<
int>(
"HzThreshold", 300))
173 theNoisyChannels.push_back(
DTWireId(theLayer, binX));
177 average += noiseHisto->GetBinContent(binX,binY);
183 if (nOfChannels) noiseStatistics = average/nOfChannels;
184 histoTag =
"NoiseAverage";
189 for ( vector<DTWireId>::const_iterator nb_it = theNoisyChannels.begin();
190 nb_it != theNoisyChannels.end(); ++nb_it) {
192 bool isNoisy =
false;
193 bool isFEMasked =
false;
194 bool isTDCMasked =
false;
195 bool isTrigMask =
false;
198 statusMap->cellStatus((*nb_it), isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
200 if (!isNoisy) newNoiseChannels++;
202 theNoisyChannels.clear();
203 histoTag =
"NewNoisyChannels";
205 histos[histoTag].find((*ch_it)->id().rawId())->
second->setBinContent(slID.
superLayer(), newNoiseChannels);
209 vector<const DTSuperLayer*>::const_iterator sl2_it = (*ch_it)->superLayers().begin();
210 vector<const DTSuperLayer*>::const_iterator sl2_end = (*ch_it)->superLayers().end();
211 for(; sl2_it != sl2_end; ++sl2_it) {
212 vector<const DTLayer*>::const_iterator l_it = (*sl2_it)->layers().begin();
213 vector<const DTLayer*>::const_iterator l_end = (*sl2_it)->layers().end();
214 for(; l_it != l_end; ++l_it) {
219 if (noisePerEventME) {
220 TH2F * noiseHistoPerEvent = noisePerEventME->
getTH2F();
221 int nWires = muonGeom->layer(lID)->specificTopology().channels();
222 double MeanNumerator=0, MeanDenominator=0;
223 histoTag =
"MeanDigiPerEvent";
224 for (
int w=1;
w<=nWires;
w++){
225 for(
int numDigi=1; numDigi<=10; numDigi++){
226 MeanNumerator+=(noiseHistoPerEvent->GetBinContent(
w,numDigi)*(numDigi-1));
227 MeanDenominator+=noiseHistoPerEvent->GetBinContent(
w,numDigi);
229 double Mean=MeanNumerator/MeanDenominator;
231 histos[histoTag].find((*l_it)->id().rawId())->
second->setBinContent(
w, Mean);
239 histoTag =
"MeanDigiPerEvent";
240 string MeanCriterionName =
parameters.getUntrackedParameter<
string>(
"meanTestName",
"NoiseMeanInRange");
241 for(map<uint32_t, MonitorElement*>::const_iterator hMean =
histos[histoTag].
begin();
242 hMean !=
histos[histoTag].end();
244 const QReport * theMeanQReport = (*hMean).second->getQReport(MeanCriterionName);
246 vector<dqm::me_util::Channel> badChannels = theMeanQReport->
getBadChannels();
247 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
248 channel != badChannels.end(); channel++) {
249 LogVerbatim (
"tTrigCalibration")<<
"LayerId : "<<(*hMean).first<<
" Bad mean channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
267 dbe->rmdir(
"DT/Tests/Noise");
273 stringstream wheel; wheel << ch.
wheel();
275 stringstream sector; sector << ch.
sector();
277 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
278 string folderTag =
parameters.getUntrackedParameter<
string>(
"folderTag",
"Occupancies");
280 folderRoot +
"DT/DTDigiTask/Wheel" + wheel.str() +
281 "/Station" + station.str() +
282 "/Sector" + sector.str() +
"/" + folderTag +
"/";
284 string histoTag =
parameters.getUntrackedParameter<
string>(
"histoTag",
"OccupancyNoise_perCh");
285 string histoname = folderName + histoTag
287 +
"_St" + station.str()
288 +
"_Sec" + sector.str();
297 stringstream wheel; wheel << ly.
wheel();
299 stringstream sector; sector << ly.
sector();
300 stringstream superLayer; superLayer << ly.
superlayer();
301 stringstream layer; layer << ly.
layer();
303 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
304 string folderTag =
parameters.getUntrackedParameter<
string>(
"folderTagForDigiPerEventTest",
"DigiPerEvent");
306 folderRoot +
"DT/DTDigiForNoiseTask/Wheel" + wheel.str() +
307 "/Station" + station.str() +
308 "/Sector" + sector.str() +
"/" + folderTag +
"/";
310 string histoTag =
parameters.getUntrackedParameter<
string>(
"histoTagForDigiPerEventTest",
"DigiPerEvent");
311 string histoname = folderName + histoTag
313 +
"_St" + station.str()
314 +
"_Sec" + sector.str()
315 +
"_SL" + superLayer.str()
316 +
"_L" + layer.str();
326 stringstream wheel; wheel << ch.
wheel();
328 stringstream sector; sector << ch.
sector();
330 dbe->setCurrentFolder(
"DT/Tests/Noise/" + folder);
332 string histoName = histoTag +
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
334 if (folder ==
"NoiseAverage")
335 (
histos[histoTag])[ch.
rawId()] = dbe->book1D(histoName.c_str(),histoName.c_str(),3,0,3);
337 if ( folder ==
"NewNoisyChannels")
338 (
histos[histoTag])[ch.
rawId()] = dbe->book1D(histoName.c_str(),histoName.c_str(),3,0,3);
349 stringstream layer; layer << lId.
layer();
351 string histoName = histoTag +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str() +
"_L" + layer.str();
353 dbe->setCurrentFolder(
"DT/Tests/Noise/" + folder +
354 "/Wheel" + wheel.str() +
355 "/Station" + station.str() +
356 "/Sector" + sector.str());
358 (
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.