47 cout <<
"[DTnoiseDBValidation] Constructor called!" << endl;
51 dbe->setCurrentFolder(
"DT/noiseDBValidation");
66 noiseRefMap = &*noise_Ref;
70 noiseMap = &*noise_toTest;
88 diffHisto = dbe->book1D(
"noisyCellDiff",
"percentual (wrt the previous db) total number of noisy cells",1, 0.5, 1.5);
89 diffHisto->setBinLabel(1,
"diff");
90 wheelHisto = dbe->book1D(
"wheelOccupancy",
"percentual noisy cells occupancy per wheel",5, -2.5, 2.5);
91 wheelHisto->setBinLabel(1,
"wh-2");
92 wheelHisto->setBinLabel(2,
"wh-1");
93 wheelHisto->setBinLabel(3,
"wh0");
94 wheelHisto->setBinLabel(4,
"wh1");
95 wheelHisto->setBinLabel(5,
"wh2");
96 stationHisto = dbe->book1D(
"stationOccupancy",
"percentual noisy cells occupancy per station",4, 0.5, 4.5);
97 stationHisto->setBinLabel(1,
"st1");
98 stationHisto->setBinLabel(2,
"st2");
99 stationHisto->setBinLabel(3,
"st3");
100 stationHisto->setBinLabel(4,
"st4");
101 sectorHisto = dbe->book1D(
"sectorOccupancy",
"percentual noisy cells occupancy per sector",12, 0.5, 12.5);
102 sectorHisto->setBinLabel(1,
"sect1");
103 sectorHisto->setBinLabel(2,
"sect2");
104 sectorHisto->setBinLabel(3,
"sect3");
105 sectorHisto->setBinLabel(4,
"sect4");
106 sectorHisto->setBinLabel(5,
"sect5");
107 sectorHisto->setBinLabel(6,
"sect6");
108 sectorHisto->setBinLabel(7,
"sect7");
109 sectorHisto->setBinLabel(8,
"sect8");
110 sectorHisto->setBinLabel(9,
"sect9");
111 sectorHisto->setBinLabel(10,
"sect10");
112 sectorHisto->setBinLabel(11,
"sect11");
113 sectorHisto->setBinLabel(12,
"sect12");
114 layerHisto = dbe->book1D(
"layerOccupancy",
"percentual noisy cells occupancy per layer",3, 0.5, 3.5);
115 layerHisto->setBinLabel(1,
"first 10 bins");
116 layerHisto->setBinLabel(2,
"middle bins");
117 layerHisto->setBinLabel(3,
"last 10 bins");
124 map<int, int> sectMap;
126 map<int, int> layerMap;
131 noise != noiseRefMap->end(); noise++) {
132 DTWireId wireId((*noise).first.wheelId,
133 (*noise).first.stationId,
134 (*noise).first.sectorId,
136 (*noise).first.layerId,
137 (*noise).first.cellId);
138 cout<<
"Ref Wire: " << wireId<<endl;
144 noise != noiseMap->end(); noise++) {
145 DTWireId wireId((*noise).first.wheelId,
146 (*noise).first.stationId,
147 (*noise).first.sectorId,
149 (*noise).first.layerId,
150 (*noise).first.cellId);
151 cout<<
"toTest Wire: " << wireId<<endl;
154 whMap[(*noise).first.wheelId]++;
155 stMap[(*noise).first.stationId]++;
156 sectMap[(*noise).first.sectorId]++;
160 if((*noise).first.cellId<=10)
162 if((*noise).first.cellId>10 && (*noise).first.cellId<(lastWire-10))
164 if((*noise).first.cellId>=(lastWire-10))
170 double scale = 1/double(noisyCells_Ref);
171 diffHisto->Fill(1,
abs(noisyCells_Ref-noisyCells_toTest)*scale);
173 scale = 1/double(noisyCells_toTest);
174 for(map<int, int >::const_iterator wheel = whMap.begin();
175 wheel != whMap.end();
177 wheelHisto->Fill((*wheel).first, ((*wheel).second)*scale);
179 for(map<int, int >::const_iterator
station = stMap.begin();
182 stationHisto->Fill((*station).first, ((*station).second)*scale);
184 for(map<int, int >::const_iterator sector = sectMap.begin();
185 sector != sectMap.end();
187 sectorHisto->Fill((*sector).first, ((*sector).second)*scale);
189 for(map<int, int >::const_iterator layer = layerMap.begin();
190 layer != layerMap.end();
192 layerHisto->Fill((*layer).first, ((*layer).second)*scale);
200 string testCriterionName =
parameters.getUntrackedParameter<
string>(
"diffTestName",
"noiseDifferenceInRange");
201 const QReport * theDiffQReport = diffHisto->getQReport(testCriterionName);
203 vector<dqm::me_util::Channel> badChannels = theDiffQReport->
getBadChannels();
204 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
205 channel != badChannels.end(); channel++) {
206 cout <<
" Bad partial difference of noisy channels! Contents : "<<(*channel).getContents()<<endl;
209 testCriterionName =
parameters.getUntrackedParameter<
string>(
"wheelTestName",
"noiseWheelOccInRange");
210 const QReport * theDiffQReport2 = wheelHisto->getQReport(testCriterionName);
211 if(theDiffQReport2) {
212 vector<dqm::me_util::Channel> badChannels = theDiffQReport2->
getBadChannels();
213 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
214 channel != badChannels.end(); channel++) {
215 int wheel = (*channel).getBin()-3;
216 cout <<
" Bad percentual occupancy for wheel : "<<wheel<<
" Contents : "<<(*channel).getContents()<<endl;
219 testCriterionName =
parameters.getUntrackedParameter<
string>(
"stationTestName",
"noiseStationOccInRange");
220 const QReport * theDiffQReport3 = stationHisto->getQReport(testCriterionName);
221 if(theDiffQReport3) {
222 vector<dqm::me_util::Channel> badChannels = theDiffQReport3->
getBadChannels();
223 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
224 channel != badChannels.end(); channel++) {
225 cout <<
" Bad percentual occupancy for station : "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents()<<endl;
228 testCriterionName =
parameters.getUntrackedParameter<
string>(
"sectorTestName",
"noiseSectorOccInRange");
229 const QReport * theDiffQReport4 = sectorHisto->getQReport(testCriterionName);
230 if(theDiffQReport4) {
231 vector<dqm::me_util::Channel> badChannels = theDiffQReport4->
getBadChannels();
232 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
233 channel != badChannels.end(); channel++) {
234 cout <<
" Bad percentual occupancy for sector : "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents()<<endl;
237 testCriterionName =
parameters.getUntrackedParameter<
string>(
"layerTestName",
"noiseLayerOccInRange");
238 const QReport * theDiffQReport5 = layerHisto->getQReport(testCriterionName);
239 if(theDiffQReport5) {
240 vector<dqm::me_util::Channel> badChannels = theDiffQReport5->
getBadChannels();
241 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
242 channel != badChannels.end(); channel++) {
243 if((*channel).getBin()==1)
244 cout <<
" Bad percentual occupancy for the first 10 wires! Contents : "<<(*channel).getContents()<<endl;
245 if((*channel).getBin()==2)
246 cout <<
" Bad percentual occupancy for the middle wires! Contents : "<<(*channel).getContents()<<endl;
247 if((*channel).getBin()==3)
248 cout <<
" Bad percentual occupancy for the last 10 wires! Contents : "<<(*channel).getContents()<<endl;
const int lastChannel() const
Returns the wire number of the last wire.
T getUntrackedParameter(std::string const &, T const &) const
void beginRun(const edm::Run &run, const edm::EventSetup &setup)
const std::string metname
DTnoiseDBValidation(const edm::ParameterSet &pset)
Constructor.
std::vector< std::pair< DTStatusFlagId, DTStatusFlagData > >::const_iterator const_iterator
Access methods to data.
const std::vector< DQMChannel > & getBadChannels(void) const
void beginJob()
Operations.
DTLayerId layerId() const
Return the corresponding LayerId.
virtual ~DTnoiseDBValidation()
Destructor.