55 edm::LogVerbatim (
"noise") <<
"DTNoiseTest: analyzed " << updates <<
" events";
70 edm::LogVerbatim (
"noise") <<
"[DTNoiseTest]: End of LS transition, performing the DQM client operation";
84 float tTrig, tTrigRMS, kFactor;
88 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
89 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
91 for (; ch_it != ch_end; ++ch_it) {
93 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
94 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
98 TH2F * noiseHisto = noiseME->
getTH2F();
101 double nevents = (int) noiseHisto->GetEntries();
103 double normalization =0;
107 float noiseStatistics=0;
108 int newNoiseChannels=0;
110 for(; sl_it != sl_end; ++sl_it) {
115 if (tTrig==0) tTrig=1;
116 const double ns_s = 1e9*(32/25);
117 normalization = ns_s/float(tTrig*nevents);
119 noiseHisto->Scale(normalization);
132 for (
int binX=1; binX <= noiseHisto->GetNbinsX(); binX++) {
134 if (noiseHisto->GetBinContent(binX,binY) >
parameters.getUntrackedParameter<
int>(
"HzThreshold", 300))
135 theNoisyChannels.push_back(
DTWireId(theLayer, binX));
139 average += noiseHisto->GetBinContent(binX,binY);
145 if (nOfChannels) noiseStatistics = average/nOfChannels;
146 histoTag =
"NoiseAverage";
151 for ( vector<DTWireId>::const_iterator nb_it = theNoisyChannels.begin();
152 nb_it != theNoisyChannels.end(); ++nb_it) {
154 bool isNoisy =
false;
155 bool isFEMasked =
false;
156 bool isTDCMasked =
false;
157 bool isTrigMask =
false;
160 statusMap->cellStatus((*nb_it), isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
162 if (!isNoisy) newNoiseChannels++;
164 theNoisyChannels.clear();
165 histoTag =
"NewNoisyChannels";
169 histos[histoTag].find((*ch_it)->id().rawId())->
second->setBinContent(slID.
superLayer(), newNoiseChannels);
173 vector<const DTSuperLayer*>::const_iterator sl2_it = (*ch_it)->superLayers().begin();
174 vector<const DTSuperLayer*>::const_iterator sl2_end = (*ch_it)->superLayers().end();
175 for(; sl2_it != sl2_end; ++sl2_it) {
176 vector<const DTLayer*>::const_iterator l_it = (*sl2_it)->layers().begin();
177 vector<const DTLayer*>::const_iterator l_end = (*sl2_it)->layers().end();
178 for(; l_it != l_end; ++l_it) {
183 if (noisePerEventME) {
184 TH2F * noiseHistoPerEvent = noisePerEventME->
getTH2F();
185 int nWires = muonGeom->layer(lID)->specificTopology().channels();
186 double MeanNumerator=0, MeanDenominator=0;
187 histoTag =
"MeanDigiPerEvent";
188 for (
int w=1;
w<=nWires;
w++){
189 for(
int numDigi=1; numDigi<=10; numDigi++){
190 MeanNumerator+=(noiseHistoPerEvent->GetBinContent(
w,numDigi)*(numDigi-1));
191 MeanDenominator+=noiseHistoPerEvent->GetBinContent(
w,numDigi);
193 double Mean=MeanNumerator/MeanDenominator;
195 histos[histoTag].find((*l_it)->id().rawId())->
second->setBinContent(
w, Mean);
203 histoTag =
"MeanDigiPerEvent";
204 string MeanCriterionName =
parameters.getUntrackedParameter<
string>(
"meanTestName",
"NoiseMeanInRange");
205 for(map<uint32_t, MonitorElement*>::const_iterator hMean =
histos[histoTag].
begin();
206 hMean !=
histos[histoTag].end();
208 const QReport * theMeanQReport = (*hMean).second->getQReport(MeanCriterionName);
210 vector<dqm::me_util::Channel> badChannels = theMeanQReport->
getBadChannels();
211 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
212 channel != badChannels.end(); channel++) {
213 LogVerbatim (
"tTrigCalibration")<<
"LayerId : "<<(*hMean).first<<
" Bad mean channels: "
214 <<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
229 stringstream wheel; wheel << ch.
wheel();
231 stringstream sector; sector << ch.
sector();
233 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
234 string folderTag =
parameters.getUntrackedParameter<
string>(
"folderTag",
"Occupancies");
236 folderRoot +
"DT/DTDigiTask/Wheel" + wheel.str() +
237 "/Station" + station.str() +
238 "/Sector" + sector.str() +
"/" + folderTag +
"/";
240 string histoTag =
parameters.getUntrackedParameter<
string>(
"histoTag",
"OccupancyNoise_perCh");
241 string histoname = folderName + histoTag
243 +
"_St" + station.str()
244 +
"_Sec" + sector.str();
253 stringstream wheel; wheel << ly.
wheel();
255 stringstream sector; sector << ly.
sector();
256 stringstream superLayer; superLayer << ly.
superlayer();
257 stringstream layer; layer << ly.
layer();
259 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
260 string folderTag =
parameters.getUntrackedParameter<
string>(
"folderTagForDigiPerEventTest",
"DigiPerEvent");
262 folderRoot +
"DT/DTDigiForNoiseTask/Wheel" + wheel.str() +
263 "/Station" + station.str() +
264 "/Sector" + sector.str() +
"/" + folderTag +
"/";
266 string histoTag =
parameters.getUntrackedParameter<
string>(
"histoTagForDigiPerEventTest",
"DigiPerEvent");
267 string histoname = folderName + histoTag
269 +
"_St" + station.str()
270 +
"_Sec" + sector.str()
271 +
"_SL" + superLayer.str()
272 +
"_L" + layer.str();
281 stringstream wheel; wheel << ch.
wheel();
283 stringstream sector; sector << ch.
sector();
287 string histoName = histoTag +
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
289 if (folder ==
"NoiseAverage")
290 (
histos[histoTag])[ch.
rawId()] = ibooker.
book1D(histoName.c_str(),histoName.c_str(),3,0,3);
292 if ( folder ==
"NewNoisyChannels")
293 (
histos[histoTag])[ch.
rawId()] = ibooker.
book1D(histoName.c_str(),histoName.c_str(),3,0,3);
303 stringstream layer; layer << lId.
layer();
305 string histoName = histoTag +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str()
306 +
"_SL" + superLayer.str() +
"_L" + layer.str();
309 "/Wheel" + wheel.str() +
310 "/Station" + station.str() +
311 "/Sector" + sector.str());
313 (
histos[histoTag])[lId.
rawId()] = ibooker.
book1D(histoName.c_str(),histoName.c_str(),nWires,0,nWires);
void bookHistos(DQMStore::IBooker &, const DTChamberId &ch, std::string folder, std::string histoTag)
book the new ME
LuminosityBlockID id() const
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
DQM Client Diagnostic.
MonitorElement * get(const std::string &path)
DTNoiseTest(const edm::ParameterSet &ps)
Constructor.
int layer() const
Return the layer number.
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)
MonitorElement * book1D(Args &&...args)
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 setCurrentFolder(const std::string &fullpath)
virtual ~DTNoiseTest()
Destructor.
LuminosityBlockNumber_t luminosityBlock() const
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
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.