40 LogVerbatim(
"NoiseDBValidation") <<
"[DTnoiseDBValidation] Constructor called!";
47 labelDBRef_ =
pset.getParameter<
string>(
"labelDBRef");
48 labelDB_ =
pset.getParameter<
string>(
"labelDB");
50 diffTestName_ =
"noiseDifferenceInRange";
51 if (
pset.exists(
"diffTestName"))
52 diffTestName_ =
pset.getParameter<
string>(
"diffTestName");
54 wheelTestName_ =
"noiseWheelOccInRange";
55 if (
pset.exists(
"wheelTestName"))
56 wheelTestName_ =
pset.getParameter<
string>(
"wheelTestName");
58 stationTestName_ =
"noiseStationOccInRange";
59 if (
pset.exists(
"stationTestName"))
60 stationTestName_ =
pset.getParameter<
string>(
"stationTestName");
62 sectorTestName_ =
"noiseSectorOccInRange";
63 if (
pset.exists(
"sectorTestName"))
64 sectorTestName_ =
pset.getParameter<
string>(
"sectorTestName");
66 layerTestName_ =
"noiseLayerOccInRange";
67 if (
pset.exists(
"layerTestName"))
68 layerTestName_ =
pset.getParameter<
string>(
"layerTestName");
70 outputMEsInRootFile_ =
false;
71 if (
pset.exists(
"OutputFileName")) {
72 outputMEsInRootFile_ =
true;
86 noiseMap_ = &*noiseValid;
91 LogVerbatim(
"NoiseDBValidation") <<
"[DTnoiseDBValidation] Parameters initialization";
98 dbe_->
book1D(
"noisyCellDiff",
"percentual (wrt the previous db) total number of noisy cells", 1, 0.5, 1.5);
100 wheelHisto_ =
dbe_->
book1D(
"wheelOccupancy",
"percentual noisy cells occupancy per wheel", 5, -2.5, 2.5);
102 wheelHisto_->setBinLabel(2,
"Wh-1");
103 wheelHisto_->setBinLabel(3,
"Wh0");
104 wheelHisto_->setBinLabel(4,
"Wh1");
105 wheelHisto_->setBinLabel(5,
"Wh2");
106 stationHisto_ =
dbe_->
book1D(
"stationOccupancy",
"percentual noisy cells occupancy per station", 4, 0.5, 4.5);
108 stationHisto_->setBinLabel(2,
"St2");
109 stationHisto_->setBinLabel(3,
"St3");
110 stationHisto_->setBinLabel(4,
"St4");
111 sectorHisto_ =
dbe_->
book1D(
"sectorOccupancy",
"percentual noisy cells occupancy per sector", 12, 0.5, 12.5);
113 sectorHisto_->setBinLabel(2,
"Sect2");
114 sectorHisto_->setBinLabel(3,
"Sect3");
115 sectorHisto_->setBinLabel(4,
"Sect4");
116 sectorHisto_->setBinLabel(5,
"Sect5");
117 sectorHisto_->setBinLabel(6,
"Sect6");
118 sectorHisto_->setBinLabel(7,
"Sect7");
119 sectorHisto_->setBinLabel(8,
"Sect8");
120 sectorHisto_->setBinLabel(9,
"Sect9");
121 sectorHisto_->setBinLabel(10,
"Sect10");
122 sectorHisto_->setBinLabel(11,
"Sect11");
123 sectorHisto_->setBinLabel(12,
"Sect12");
124 layerHisto_ =
dbe_->
book1D(
"layerOccupancy",
"percentual noisy cells occupancy per layer", 3, 0.5, 3.5);
126 layerHisto_->setBinLabel(2,
"Middle bins");
127 layerHisto_->setBinLabel(3,
"Last 10 bins");
134 map<int, int> sectMap;
136 map<int, int> layerMap;
141 DTWireId wireId((*noise).first.wheelId,
142 (*noise).first.stationId,
143 (*noise).first.sectorId,
145 (*noise).first.layerId,
146 (*noise).first.cellId);
147 LogVerbatim(
"NoiseDBValidation") <<
"Ref. noisy wire: " << wireId;
153 DTWireId wireId((*noise).first.wheelId,
154 (*noise).first.stationId,
155 (*noise).first.sectorId,
157 (*noise).first.layerId,
158 (*noise).first.cellId);
159 LogVerbatim(
"NoiseDBValidation") <<
"Valid. noisy wire: " << wireId;
162 whMap[(*noise).first.wheelId]++;
163 stMap[(*noise).first.stationId]++;
164 sectMap[(*noise).first.sectorId]++;
168 if ((*noise).first.cellId <= 10)
170 if ((*noise).first.cellId > 10 && (*noise).first.cellId < (lastWire - 10))
172 if ((*noise).first.cellId >= (lastWire - 10))
176 if (noiseHistoMap_.find(chId) == noiseHistoMap_.end())
183 double scale = 1 / double(noisyCellsRef_);
184 diffHisto_->Fill(1,
abs(noisyCellsRef_ - noisyCellsValid_) *
scale);
186 scale = 1 / double(noisyCellsValid_);
187 for (map<int, int>::const_iterator
wheel = whMap.begin();
wheel != whMap.end();
wheel++) {
188 wheelHisto_->Fill((*wheel).first, ((*wheel).second) *
scale);
191 stationHisto_->Fill((*station).first, ((*station).second) *
scale);
193 for (map<int, int>::const_iterator sector = sectMap.begin(); sector != sectMap.end(); sector++) {
194 sectorHisto_->Fill((*sector).first, ((*sector).second) *
scale);
196 for (map<int, int>::const_iterator layer = layerMap.begin(); layer != layerMap.end(); layer++) {
197 layerHisto_->Fill((*layer).first, ((*layer).second) *
scale);
206 const QReport *theDiffQReport = diffHisto_->getQReport(diffTestName_);
207 if (theDiffQReport) {
208 vector<dqm::me_util::Channel> badChannels = theDiffQReport->
getBadChannels();
209 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
211 LogWarning(
"NoiseDBValidation") <<
" Bad partial difference of noisy channels! Contents : "
212 << (*channel).getContents();
217 const QReport *theDiffQReport2 = wheelHisto_->getQReport(wheelTestName_);
218 if (theDiffQReport2) {
219 vector<dqm::me_util::Channel> badChannels = theDiffQReport2->
getBadChannels();
220 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
222 int wheel = (*channel).getBin() - 3;
223 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for wheel : " <<
wheel
224 <<
" Contents : " << (*channel).getContents();
229 const QReport *theDiffQReport3 = stationHisto_->getQReport(stationTestName_);
230 if (theDiffQReport3) {
231 vector<dqm::me_util::Channel> badChannels = theDiffQReport3->
getBadChannels();
232 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
234 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for station : " << (*channel).getBin()
235 <<
" Contents : " << (*channel).getContents();
240 const QReport *theDiffQReport4 = sectorHisto_->getQReport(sectorTestName_);
241 if (theDiffQReport4) {
242 vector<dqm::me_util::Channel> badChannels = theDiffQReport4->
getBadChannels();
243 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
245 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for sector : " << (*channel).getBin()
246 <<
" Contents : " << (*channel).getContents();
251 const QReport *theDiffQReport5 = layerHisto_->getQReport(layerTestName_);
252 if (theDiffQReport5) {
253 vector<dqm::me_util::Channel> badChannels = theDiffQReport5->
getBadChannels();
254 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
256 if ((*channel).getBin() == 1)
257 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for the first 10 wires! Contents : "
258 << (*channel).getContents();
259 if ((*channel).getBin() == 2)
260 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for the middle wires! Contents : "
261 << (*channel).getContents();
262 if ((*channel).getBin() == 3)
263 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for the last 10 wires! Contents : "
264 << (*channel).getContents();
271 if (outputMEsInRootFile_)
280 if (noiseHistoMap_.find(chId) == noiseHistoMap_.end()) {
283 const DTChamber *dtchamber = dtGeom_->chamber(chId);
284 const vector<const DTSuperLayer *> &superlayers = dtchamber->
superLayers();
287 for (vector<const DTSuperLayer *>::const_iterator sl = superlayers.begin(); sl != superlayers.end();
289 vector<const DTLayer *>
layers = (*sl)->layers();
290 for (vector<const DTLayer *>::const_iterator lay =
layers.begin(); lay !=
layers.end();
292 int nWires = (*lay)->specificTopology().channels();
293 if (nWires > nWiresMax)
298 noiseHistoMap_[chId] =
dbe_->
book2D(
histoName.str(),
"Noise occupancy", nWiresMax, 1, (nWiresMax + 1), 12, 1, 13);
299 for (
int i_sl = 1; i_sl <= 3; ++i_sl) {
300 for (
int i_lay = 1; i_lay <= 4; ++i_lay) {
303 label <<
"SL" << i_sl <<
": L" << i_lay;