42 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: Constructor";
50 percentual =
parameters.getUntrackedParameter<
int>(
"BadSLpercentual", 10);
66 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: BeginRun";
79 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: End of LS transition, performing the DQM client operation";
87 for(map<int, MonitorElement*> ::const_iterator
histo = wheelHistos.begin();
88 histo != wheelHistos.end();
90 (*histo).second->Reset();
93 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: "<<nLumiSegs<<
" updates";
96 float tTrig, tTrigRMS,kFactor;
98 map <pair<int,int>,
int> cmsHistos;
100 map <pair<int,int>,
bool> filled;
101 for(
int i=-2;
i<3;
i++){
102 for(
int j=1;
j<15;
j++){
103 filled[make_pair(
i,
j)]=
false;
107 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
108 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
109 for (; ch_it != ch_end; ++ch_it) {
111 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
112 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
113 for(; sl_it != sl_end; ++sl_it) {
120 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: I've got the histo!!";
122 TH1F * tb_histo_root = tb_histo->
getTH1F();
124 pair<double, double> meanAndSigma = theFitter->fitTimeBox(tb_histo_root);
135 if (
histos.find((*ch_it)->id().rawId()) !=
histos.end()) {
136 string criterionName =
parameters.getUntrackedParameter<
string>(
"tTrigTestName",
"tTrigOffSet");
137 const QReport * theQReport =
histos.find((*ch_it)->id().rawId())->
second->getQReport(criterionName);
139 vector<dqm::me_util::Channel> badChannels = theQReport->getBadChannels();
140 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
141 channel != badChannels.end(); channel++) {
142 edm::LogError (
"tTrigCalibration") <<
"Chamber ID : "<<(*ch_it)->id()<<
" Bad channels: "<<(*channel).getBin()<<
" "<<(*channel).getContents();
144 if(wheelHistos.find((*ch_it)->id().wheel()) == wheelHistos.end())
bookHistos(ibooker,(*ch_it)->id(), (*ch_it)->id().wheel());
146 if(!((*ch_it)->id().station() == 4 && (*channel).getBin() == 3))
147 wheelHistos[(*ch_it)->id().wheel()]->Fill((*ch_it)->id().sector()-1,((*channel).getBin()-1)+3*((*ch_it)->id().station()-1));
149 wheelHistos[(*ch_it)->id().wheel()]->Fill((*ch_it)->id().sector()-1,10);
152 cmsHistos[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())]++;
153 if(((*ch_it)->id().sector()<13 &&
154 double(cmsHistos[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())])/11>double(percentual)/100 &&
155 filled[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())]==
false) ||
156 ((*ch_it)->id().sector()>=13 &&
157 double(cmsHistos[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())])/2>double(percentual)/100 &&
158 filled[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())]==
false)){
159 filled[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())]=
true;
160 wheelHistos[3]->Fill((*ch_it)->id().sector()-1,(*ch_it)->id().wheel());
172 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest] endjob called!";
181 stringstream wheel; wheel << slID.
wheel();
183 stringstream sector; sector << slID.
sector();
184 stringstream superLayer; superLayer << slID.
superlayer();
186 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
187 string folderTag =
parameters.getUntrackedParameter<
string>(
"folderTag",
"TimeBoxes");
189 folderRoot +
"DT/DTDigiTask/Wheel" + wheel.str() +
190 "/Station" + station.str() +
191 "/Sector" + sector.str() +
"/" + folderTag +
"/";
193 string histoTag =
parameters.getUntrackedParameter<
string>(
"histoTag",
"TimeBox");
194 string histoname = folderName + histoTag
196 +
"_St" + station.str()
197 +
"_Sec" + sector.str()
198 +
"_SL" + superLayer.str();
206 stringstream wheel; wheel << ch.
wheel();
208 stringstream sector; sector << ch.
sector();
210 string histoName =
"tTrigTest_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
221 if(wheelHistos.find(3) == wheelHistos.end()){
222 string histoName =
"t_TrigSummary_testFailedByAtLeastBadSL";
223 wheelHistos[3] = ibooker.
book2D(histoName.c_str(),histoName.c_str(),14,0,14,5,-2,2);
225 wheelHistos[3]->setBinLabel(1,
"Sector1",1);
226 wheelHistos[3]->setBinLabel(2,
"Sector2",1);
227 wheelHistos[3]->setBinLabel(3,
"Sector3",1);
228 wheelHistos[3]->setBinLabel(4,
"Sector4",1);
229 wheelHistos[3]->setBinLabel(5,
"Sector5",1);
230 wheelHistos[3]->setBinLabel(6,
"Sector6",1);
231 wheelHistos[3]->setBinLabel(7,
"Sector7",1);
232 wheelHistos[3]->setBinLabel(8,
"Sector8",1);
233 wheelHistos[3]->setBinLabel(9,
"Sector9",1);
234 wheelHistos[3]->setBinLabel(10,
"Sector10",1);
235 wheelHistos[3]->setBinLabel(11,
"Sector11",1);
236 wheelHistos[3]->setBinLabel(12,
"Sector12",1);
237 wheelHistos[3]->setBinLabel(13,
"Sector13",1);
238 wheelHistos[3]->setBinLabel(14,
"Sector14",1);
239 wheelHistos[3]->setBinLabel(1,
"Wheel-2",2);
240 wheelHistos[3]->setBinLabel(2,
"Wheel-1",2);
241 wheelHistos[3]->setBinLabel(3,
"Wheel0",2);
242 wheelHistos[3]->setBinLabel(4,
"Wheel+1",2);
243 wheelHistos[3]->setBinLabel(5,
"Wheel+2",2);
246 stringstream wheel; wheel <<wh;
247 string histoName =
"t_TrigSummary_testFailed_W" + wheel.str();
249 wheelHistos[wh] = ibooker.
book2D(histoName.c_str(),histoName.c_str(),14,0,14,11,0,11);
251 wheelHistos[wh]->setBinLabel(2,
"Sector2",1);
252 wheelHistos[wh]->setBinLabel(3,
"Sector3",1);
253 wheelHistos[wh]->setBinLabel(4,
"Sector4",1);
254 wheelHistos[wh]->setBinLabel(5,
"Sector5",1);
255 wheelHistos[wh]->setBinLabel(6,
"Sector6",1);
256 wheelHistos[wh]->setBinLabel(7,
"Sector7",1);
257 wheelHistos[wh]->setBinLabel(8,
"Sector8",1);
258 wheelHistos[wh]->setBinLabel(9,
"Sector9",1);
259 wheelHistos[wh]->setBinLabel(10,
"Sector10",1);
260 wheelHistos[wh]->setBinLabel(11,
"Sector11",1);
261 wheelHistos[wh]->setBinLabel(12,
"Sector12",1);
262 wheelHistos[wh]->setBinLabel(13,
"Sector13",1);
263 wheelHistos[wh]->setBinLabel(14,
"Sector14",1);
264 wheelHistos[wh]->setBinLabel(1,
"MB1_SL1",2);
265 wheelHistos[wh]->setBinLabel(2,
"MB1_SL2",2);
266 wheelHistos[wh]->setBinLabel(3,
"MB1_SL3",2);
267 wheelHistos[wh]->setBinLabel(4,
"MB2_SL1",2);
268 wheelHistos[wh]->setBinLabel(5,
"MB2_SL2",2);
269 wheelHistos[wh]->setBinLabel(6,
"MB2_SL3",2);
270 wheelHistos[wh]->setBinLabel(7,
"MB3_SL1",2);
271 wheelHistos[wh]->setBinLabel(8,
"MB3_SL2",2);
272 wheelHistos[wh]->setBinLabel(9,
"MB3_SL3",2);
273 wheelHistos[wh]->setBinLabel(10,
"MB4_SL1",2);
274 wheelHistos[wh]->setBinLabel(11,
"MB4_SL3",2);
LuminosityBlockID id() const
std::string getMEName(const DTSuperLayerId &slID)
Get the ME name.
MonitorElement * get(const std::string &path)
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)
void bookHistos(DQMStore::IBooker &, const DTChamberId &ch)
book the new ME
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.
DTtTrigCalibrationTest(const edm::ParameterSet &ps)
Constructor.
virtual ~DTtTrigCalibrationTest()
Destructor.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
int superlayer() const
Return the superlayer number (deprecated method name)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
DQM Client Diagnostic.
int station() const
Return the station number.
int wheel() const
Return the wheel number.