40 metname_ =
"InterChannelSynchDBValidation";
41 LogVerbatim(metname_) <<
"[DTt0DBValidation] Constructor called!";
51 t0TestName_ =
"t0DifferenceInRange";
54 outputMEsInRootFile_ =
false;
55 if( pset.
exists(
"OutputFileName") ){
56 outputMEsInRootFile_ =
true;
67 metname_ =
"InterChannelSynchDBValidation";
68 LogVerbatim(metname_) <<
"[DTt0DBValidation] Parameters initialization";
72 tZeroRefMap_ = &*t0_Ref;
73 LogVerbatim(metname_) <<
"[DTt0DBValidation] reference T0 version: " << t0_Ref->version();
78 LogVerbatim(metname_) <<
"[DTt0DBValidation] T0 to validate version: " << t0->version();
81 for(
int wheel=-2; wheel<=2; wheel++){
83 wheelSummary_[wheel]->Reset();
100 int channelId =
tzero->channelId;
101 if ( channelId == 0 )
continue;
107 LogTrace(metname_)<<
"Ref Wire: " << wireId <<endl
108 <<
" T0 mean (TDC counts): " << t0mean
109 <<
" T0_rms (TDC counts): " << t0rms;
111 t0RefMap_[wireId].push_back(t0mean);
112 t0RefMap_[wireId].push_back(t0rms);
126 int channelId =
tzero->channelId;
127 if ( channelId == 0 )
continue;
133 LogTrace(metname_)<<
"Wire: " << wireId <<endl
134 <<
" T0 mean (TDC counts): " << t0mean
135 <<
" T0_rms (TDC counts): " << t0rms;
137 t0Map_[wireId].push_back(t0mean);
138 t0Map_[wireId].push_back(t0rms);
141 double difference = 0;
142 for(
map<
DTWireId, vector<float> >::const_iterator theMap = t0RefMap_.begin();
143 theMap != t0RefMap_.end();
145 if(t0Map_.find((*theMap).first) != t0Map_.end()) {
148 difference = t0Map_[(*theMap).first][0]-(*theMap).second[0];
151 DTLayerId layerId = (*theMap).first.layerId();
152 if(t0DiffHistos_.find(layerId) == t0DiffHistos_.end()) {
153 const DTTopology& dtTopo = dtGeom_->layer(layerId)->specificTopology();
159 LogTrace(metname_)<<
"Filling the histo for wire: "<<(*theMap).first
160 <<
" difference: "<<difference;
161 t0DiffHistos_[layerId]->Fill((*theMap).first.wire(),difference);
171 string testCriterionName = t0TestName_;
172 for(map<DTLayerId, MonitorElement*>::const_iterator hDiff = t0DiffHistos_.begin();
173 hDiff != t0DiffHistos_.end();
176 const QReport * theDiffQReport = (*hDiff).second->getQReport(testCriterionName);
178 int xBin = ((*hDiff).first.station()-1)*12+(*hDiff).first.layer()+4*((*hDiff).first.superlayer()-1);
179 if( (*hDiff).first.station()==4 && (*hDiff).first.superlayer()==3 )
180 xBin = ((*hDiff).first.station()-1)*12+(*hDiff).first.layer()+4*((*hDiff).first.superlayer()-2);
182 int qReportStatus = theDiffQReport->
getStatus()/100;
183 wheelSummary_[(*hDiff).first.wheel()]->setBinContent(xBin,(*hDiff).first.sector(),qReportStatus);
186 <<
" ------- " << theDiffQReport->
getStatus()
187 <<
" ------- " << setprecision(3) << theDiffQReport->
getQTresult();
188 vector<dqm::me_util::Channel> badChannels = theDiffQReport->
getBadChannels();
189 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
190 channel != badChannels.end(); channel++) {
191 LogVerbatim(metname_) <<
"layer: " << (*hDiff).first <<
" Bad channel: "
192 << (*channel).getBin() <<
" Contents : "
193 << (*channel).getContents();
205 if(outputMEsInRootFile_)
dbe_->
save(outputFileName_);
211 LogTrace(metname_)<<
" Booking histos for L: " << lId;
218 stringstream layer; layer << lId.
layer();
222 "_St" + station.str() +
223 "_Sec" + sector.str() +
224 "_SL" + superLayer.str()+
228 "/Station" + station.str() +
229 "/Sector" + sector.str() +
230 "/SuperLayer" +superLayer.str());
233 hDifference =
dbe_->
book1D(
"T0Difference"+lHistoName,
"difference between the two t0 values",lastWire-firstWire+1, firstWire-0.5, lastWire+0.5);
235 t0DiffHistos_[lId] = hDifference;
241 stringstream wh; wh << wheel;
242 wheelSummary_[wheel]=
dbe_->
book2D(
"SummaryWrongT0_W"+wh.str(),
"W"+wh.str()+
": summary of wrong t0 differences",44,1,45,14,1,15);
244 wheelSummary_[wheel]->setBinLabel(2,
"M1L2",1);
245 wheelSummary_[wheel]->setBinLabel(3,
"M1L3",1);
246 wheelSummary_[wheel]->setBinLabel(4,
"M1L4",1);
247 wheelSummary_[wheel]->setBinLabel(5,
"M1L5",1);
248 wheelSummary_[wheel]->setBinLabel(6,
"M1L6",1);
249 wheelSummary_[wheel]->setBinLabel(7,
"M1L7",1);
250 wheelSummary_[wheel]->setBinLabel(8,
"M1L8",1);
251 wheelSummary_[wheel]->setBinLabel(9,
"M1L9",1);
252 wheelSummary_[wheel]->setBinLabel(10,
"M1L10",1);
253 wheelSummary_[wheel]->setBinLabel(11,
"M1L11",1);
254 wheelSummary_[wheel]->setBinLabel(12,
"M1L12",1);
255 wheelSummary_[wheel]->setBinLabel(13,
"M2L1",1);
256 wheelSummary_[wheel]->setBinLabel(14,
"M2L2",1);
257 wheelSummary_[wheel]->setBinLabel(15,
"M2L3",1);
258 wheelSummary_[wheel]->setBinLabel(16,
"M2L4",1);
259 wheelSummary_[wheel]->setBinLabel(17,
"M2L5",1);
260 wheelSummary_[wheel]->setBinLabel(18,
"M2L6",1);
261 wheelSummary_[wheel]->setBinLabel(19,
"M2L7",1);
262 wheelSummary_[wheel]->setBinLabel(20,
"M2L8",1);
263 wheelSummary_[wheel]->setBinLabel(21,
"M2L9",1);
264 wheelSummary_[wheel]->setBinLabel(22,
"M2L10",1);
265 wheelSummary_[wheel]->setBinLabel(23,
"M2L11",1);
266 wheelSummary_[wheel]->setBinLabel(24,
"M2L12",1);
267 wheelSummary_[wheel]->setBinLabel(25,
"M3L1",1);
268 wheelSummary_[wheel]->setBinLabel(26,
"M3L2",1);
269 wheelSummary_[wheel]->setBinLabel(27,
"M3L3",1);
270 wheelSummary_[wheel]->setBinLabel(28,
"M3L4",1);
271 wheelSummary_[wheel]->setBinLabel(29,
"M3L5",1);
272 wheelSummary_[wheel]->setBinLabel(30,
"M3L6",1);
273 wheelSummary_[wheel]->setBinLabel(31,
"M3L7",1);
274 wheelSummary_[wheel]->setBinLabel(32,
"M3L8",1);
275 wheelSummary_[wheel]->setBinLabel(33,
"M3L9",1);
276 wheelSummary_[wheel]->setBinLabel(34,
"M3L10",1);
277 wheelSummary_[wheel]->setBinLabel(35,
"M3L11",1);
278 wheelSummary_[wheel]->setBinLabel(36,
"M3L12",1);
279 wheelSummary_[wheel]->setBinLabel(37,
"M4L1",1);
280 wheelSummary_[wheel]->setBinLabel(38,
"M4L2",1);
281 wheelSummary_[wheel]->setBinLabel(39,
"M4L3",1);
282 wheelSummary_[wheel]->setBinLabel(40,
"M4L4",1);
283 wheelSummary_[wheel]->setBinLabel(41,
"M4L5",1);
284 wheelSummary_[wheel]->setBinLabel(42,
"M4L6",1);
285 wheelSummary_[wheel]->setBinLabel(43,
"M4L7",1);
286 wheelSummary_[wheel]->setBinLabel(44,
"M4L8",1);
T getParameter(std::string const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
DTChamberId chamberId() const
Return the corresponding ChamberId.
virtual ~DTt0DBValidation()
Destructor.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int layer() const
Return the layer number.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
std::vector< DTT0Data >::const_iterator const_iterator
Access methods to data.
const std::string & getMessage(void) const
get message attached to test
void beginRun(const edm::Run &run, const edm::EventSetup &setup)
Operations.
int firstChannel() const
Returns the wire number of the first wire.
int lastChannel() const
Returns the wire number of the last wire.
DTt0DBValidation(const edm::ParameterSet &pset)
Constructor.
int getStatus(void) const
get test status (see Core/interface/QTestStatus.h)
const std::vector< DQMChannel > & getBadChannels(void) const
int superlayer() const
Return the superlayer number (deprecated method name)
float getQTresult(void) const
get test result i.e. prob value
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
void bookHistos(DTLayerId lId, int firstWire, int lastWire)
static const double tzero[3]
void endRun(edm::Run const &, edm::EventSetup const &)
int station() const
Return the station number.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
int wheel() const
Return the wheel number.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void setCurrentFolder(const std::string &fullpath)