42 LogVerbatim(
"NoiseDBValidation") <<
"[DTnoiseDBValidation] Constructor called!";
46 dbe_->setCurrentFolder(
"DT/DtCalib/NoiseDBValidation");
52 diffTestName_ =
"noiseDifferenceInRange";
53 if( pset.
exists(
"diffTestName") ) diffTestName_ = pset.
getParameter<
string>(
"diffTestName");
55 wheelTestName_ =
"noiseWheelOccInRange";
56 if( pset.
exists(
"wheelTestName") ) wheelTestName_ = pset.
getParameter<
string>(
"wheelTestName");
58 stationTestName_ =
"noiseStationOccInRange";
59 if( pset.
exists(
"stationTestName") ) stationTestName_ = pset.
getParameter<
string>(
"stationTestName");
61 sectorTestName_ =
"noiseSectorOccInRange";
62 if( pset.
exists(
"sectorTestName") ) sectorTestName_ = pset.
getParameter<
string>(
"sectorTestName");
64 layerTestName_ =
"noiseLayerOccInRange";
65 if( pset.
exists(
"layerTestName") ) layerTestName_ = pset.
getParameter<
string>(
"layerTestName");
67 outputMEsInRootFile_ =
false;
68 if( pset.
exists(
"OutputFileName") ){
69 outputMEsInRootFile_ =
true;
80 noiseRefMap_ = &*noiseRef;
84 noiseMap_ = &*noiseValid;
89 LogVerbatim(
"NoiseDBValidation")<<
"[DTnoiseDBValidation] Parameters initialization";
95 diffHisto_ =
dbe_->book1D(
"noisyCellDiff",
"percentual (wrt the previous db) total number of noisy cells",1, 0.5, 1.5);
96 diffHisto_->setBinLabel(1,
"Diff");
97 wheelHisto_ =
dbe_->book1D(
"wheelOccupancy",
"percentual noisy cells occupancy per wheel",5, -2.5, 2.5);
98 wheelHisto_->setBinLabel(1,
"Wh-2");
99 wheelHisto_->setBinLabel(2,
"Wh-1");
100 wheelHisto_->setBinLabel(3,
"Wh0");
101 wheelHisto_->setBinLabel(4,
"Wh1");
102 wheelHisto_->setBinLabel(5,
"Wh2");
103 stationHisto_ =
dbe_->book1D(
"stationOccupancy",
"percentual noisy cells occupancy per station",4, 0.5, 4.5);
104 stationHisto_->setBinLabel(1,
"St1");
105 stationHisto_->setBinLabel(2,
"St2");
106 stationHisto_->setBinLabel(3,
"St3");
107 stationHisto_->setBinLabel(4,
"St4");
108 sectorHisto_ =
dbe_->book1D(
"sectorOccupancy",
"percentual noisy cells occupancy per sector",12, 0.5, 12.5);
109 sectorHisto_->setBinLabel(1,
"Sect1");
110 sectorHisto_->setBinLabel(2,
"Sect2");
111 sectorHisto_->setBinLabel(3,
"Sect3");
112 sectorHisto_->setBinLabel(4,
"Sect4");
113 sectorHisto_->setBinLabel(5,
"Sect5");
114 sectorHisto_->setBinLabel(6,
"Sect6");
115 sectorHisto_->setBinLabel(7,
"Sect7");
116 sectorHisto_->setBinLabel(8,
"Sect8");
117 sectorHisto_->setBinLabel(9,
"Sect9");
118 sectorHisto_->setBinLabel(10,
"Sect10");
119 sectorHisto_->setBinLabel(11,
"Sect11");
120 sectorHisto_->setBinLabel(12,
"Sect12");
121 layerHisto_ =
dbe_->book1D(
"layerOccupancy",
"percentual noisy cells occupancy per layer",3, 0.5, 3.5);
122 layerHisto_->setBinLabel(1,
"First 10 bins");
123 layerHisto_->setBinLabel(2,
"Middle bins");
124 layerHisto_->setBinLabel(3,
"Last 10 bins");
131 map<int, int> sectMap;
133 map<int, int> layerMap;
139 DTWireId wireId((*noise).first.wheelId,
140 (*noise).first.stationId,
141 (*noise).first.sectorId,
143 (*noise).first.layerId,
144 (*noise).first.cellId);
145 LogVerbatim(
"NoiseDBValidation") <<
"Ref. noisy wire: " << wireId;
152 DTWireId wireId((*noise).first.wheelId,
153 (*noise).first.stationId,
154 (*noise).first.sectorId,
156 (*noise).first.layerId,
157 (*noise).first.cellId);
158 LogVerbatim(
"NoiseDBValidation") <<
"Valid. noisy wire: " << wireId;
161 whMap[(*noise).first.wheelId]++;
162 stMap[(*noise).first.stationId]++;
163 sectMap[(*noise).first.sectorId]++;
167 if((*noise).first.cellId<=10)
169 if((*noise).first.cellId>10 && (*noise).first.cellId<(lastWire-10))
171 if((*noise).first.cellId>=(lastWire-10))
175 if( noiseHistoMap_.find(chId) == noiseHistoMap_.end() ) bookHisto(chId);
181 double scale = 1/double(noisyCellsRef_);
182 diffHisto_->Fill(1,
abs(noisyCellsRef_ - noisyCellsValid_)*scale);
184 scale = 1/double(noisyCellsValid_);
185 for(map<int, int >::const_iterator wheel = whMap.begin();
186 wheel != whMap.end();
188 wheelHisto_->Fill((*wheel).first, ((*wheel).second)*scale);
190 for(map<int, int >::const_iterator
station = stMap.begin();
193 stationHisto_->Fill((*station).first, ((*station).second)*scale);
195 for(map<int, int >::const_iterator sector = sectMap.begin();
196 sector != sectMap.end();
198 sectorHisto_->Fill((*sector).first, ((*sector).second)*scale);
200 for(map<int, int >::const_iterator layer = layerMap.begin();
201 layer != layerMap.end();
203 layerHisto_->Fill((*layer).first, ((*layer).second)*scale);
213 const QReport * theDiffQReport = diffHisto_->getQReport(diffTestName_);
215 vector<dqm::me_util::Channel> badChannels = theDiffQReport->
getBadChannels();
216 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
217 channel != badChannels.end(); channel++) {
218 LogWarning(
"NoiseDBValidation") <<
" Bad partial difference of noisy channels! Contents : " << (*channel).getContents();
222 const QReport * theDiffQReport2 = wheelHisto_->getQReport(wheelTestName_);
223 if(theDiffQReport2) {
224 vector<dqm::me_util::Channel> badChannels = theDiffQReport2->
getBadChannels();
225 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
226 channel != badChannels.end(); channel++) {
227 int wheel = (*channel).getBin()-3;
228 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for wheel : " << wheel <<
" Contents : " << (*channel).getContents();
232 const QReport * theDiffQReport3 = stationHisto_->getQReport(stationTestName_);
233 if(theDiffQReport3) {
234 vector<dqm::me_util::Channel> badChannels = theDiffQReport3->
getBadChannels();
235 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
236 channel != badChannels.end(); channel++) {
237 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for station : " << (*channel).getBin() <<
" Contents : " << (*channel).getContents();
241 const QReport * theDiffQReport4 = sectorHisto_->getQReport(sectorTestName_);
242 if(theDiffQReport4) {
243 vector<dqm::me_util::Channel> badChannels = theDiffQReport4->
getBadChannels();
244 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
245 channel != badChannels.end(); channel++) {
246 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for sector : " << (*channel).getBin() <<
" Contents : " << (*channel).getContents();
250 const QReport * theDiffQReport5 = layerHisto_->getQReport(layerTestName_);
251 if(theDiffQReport5) {
252 vector<dqm::me_util::Channel> badChannels = theDiffQReport5->
getBadChannels();
253 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
254 channel != badChannels.end(); channel++) {
255 if((*channel).getBin()==1)
256 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for the first 10 wires! Contents : " << (*channel).getContents();
257 if((*channel).getBin()==2)
258 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for the middle wires! Contents : " << (*channel).getContents();
259 if((*channel).getBin()==3)
260 LogWarning(
"NoiseDBValidation") <<
" Bad percentual occupancy for the last 10 wires! Contents : "<<(*channel).getContents();
268 if(outputMEsInRootFile_)
dbe_->save(outputFileName_);
272 stringstream histoName;
273 histoName <<
"NoiseOccupancy"
274 <<
"_W" << chId.
wheel()
276 <<
"_Sec" << chId.
sector();
278 if( noiseHistoMap_.find(chId) == noiseHistoMap_.end() ){
281 const DTChamber* dtchamber = dtGeom_->chamber(chId);
282 const vector<const DTSuperLayer*> superlayers = dtchamber->
superLayers();
285 for(vector<const DTSuperLayer*>::const_iterator sl = superlayers.begin();
286 sl != superlayers.end(); ++sl) {
287 vector<const DTLayer*>
layers = (*sl)->layers();
288 for(vector<const DTLayer*>::const_iterator lay = layers.begin();
289 lay != layers.end(); ++lay) {
290 int nWires = (*lay)->specificTopology().channels();
291 if(nWires > nWiresMax) nWiresMax = nWires;
295 noiseHistoMap_[chId] =
dbe_->book2D(histoName.str(),
"Noise occupancy",nWiresMax,1,(nWiresMax + 1),12,1,13);
296 for(
int i_sl = 1; i_sl <= 3; ++i_sl) {
297 for(
int i_lay = 1; i_lay <= 4; ++i_lay) {
300 label <<
"SL" << i_sl <<
": L" << i_lay;
301 noiseHistoMap_[chId]->setBinLabel(binNumber,label.str(),2);
T getParameter(std::string const &) const
void beginRun(const edm::Run &run, const edm::EventSetup &setup)
Operations.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
DTChamberId chamberId() const
Return the corresponding ChamberId.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void bookHisto(const DTChamberId &)
int layer() const
Return the layer number.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
int lastChannel() const
Returns the wire number of the last wire.
DTnoiseDBValidation(const edm::ParameterSet &pset)
Constructor.
const std::vector< const DTSuperLayer * > & superLayers() const
Return the superlayers in the chamber.
Abs< T >::type abs(const T &t)
int superLayer() const
Return the superlayer number.
std::vector< std::pair< DTStatusFlagId, DTStatusFlagData > >::const_iterator const_iterator
Access methods to data.
const std::vector< DQMChannel > & getBadChannels(void) const
int wire() const
Return the wire number.
void endRun(edm::Run const &, edm::EventSetup const &)
DTLayerId layerId() const
Return the corresponding LayerId.
virtual ~DTnoiseDBValidation()
Destructor.
int station() const
Return the station number.
int wheel() const
Return the wheel number.