39 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: Constructor";
49 percentual =
parameters.getUntrackedParameter<
int>(
"BadSLpercentual", 10);
65 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: BeginJob";
74 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: BeginRun";
83 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: Begin of LS transition";
110 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: End of LS transition, performing the DQM client operation";
118 for(map<int, MonitorElement*> ::const_iterator
histo = wheelHistos.begin();
119 histo != wheelHistos.end();
121 (*histo).second->Reset();
124 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: "<<nLumiSegs<<
" updates";
127 float tTrig, tTrigRMS,kFactor;
129 map <pair<int,int>,
int> cmsHistos;
131 map <pair<int,int>,
bool> filled;
132 for(
int i=-2;
i<3;
i++){
133 for(
int j=1;
j<15;
j++){
134 filled[make_pair(
i,
j)]=
false;
138 vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
139 vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
140 for (; ch_it != ch_end; ++ch_it) {
142 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
143 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
144 for(; sl_it != sl_end; ++sl_it) {
151 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest]: I've got the histo!!";
153 TH1F * tb_histo_root = tb_histo->
getTH1F();
155 pair<double, double> meanAndSigma = theFitter->fitTimeBox(tb_histo_root);
166 if (
histos.find((*ch_it)->id().rawId()) !=
histos.end()) {
167 string criterionName =
parameters.getUntrackedParameter<
string>(
"tTrigTestName",
"tTrigOffSet");
168 const QReport * theQReport =
histos.find((*ch_it)->id().rawId())->
second->getQReport(criterionName);
170 vector<dqm::me_util::Channel> badChannels = theQReport->getBadChannels();
171 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
172 channel != badChannels.end(); channel++) {
173 edm::LogError (
"tTrigCalibration") <<
"Chamber ID : "<<(*ch_it)->id()<<
" Bad channels: "<<(*channel).getBin()<<
" "<<(*channel).getContents();
174 if(wheelHistos.find((*ch_it)->id().wheel()) == wheelHistos.end())
bookHistos((*ch_it)->id(), (*ch_it)->id().wheel());
176 if(!((*ch_it)->id().station() == 4 && (*channel).getBin() == 3))
177 wheelHistos[(*ch_it)->id().wheel()]->Fill((*ch_it)->id().sector()-1,((*channel).getBin()-1)+3*((*ch_it)->id().station()-1));
179 wheelHistos[(*ch_it)->id().wheel()]->Fill((*ch_it)->id().sector()-1,10);
182 cmsHistos[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())]++;
183 if(((*ch_it)->id().sector()<13 &&
184 double(cmsHistos[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())])/11>double(percentual)/100 &&
185 filled[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())]==
false) ||
186 ((*ch_it)->id().sector()>=13 &&
187 double(cmsHistos[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())])/2>double(percentual)/100 &&
188 filled[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())]==
false)){
189 filled[make_pair((*ch_it)->id().wheel(),(*ch_it)->id().sector())]=
true;
190 wheelHistos[3]->Fill((*ch_it)->id().sector()-1,(*ch_it)->id().wheel());
205 edm::LogVerbatim (
"tTrigCalibration") <<
"[DTtTrigCalibrationTest] endjob called!";
207 dbe->rmdir(
"DT/Tests/DTtTrigCalibration");
215 stringstream wheel; wheel << slID.
wheel();
217 stringstream sector; sector << slID.
sector();
218 stringstream superLayer; superLayer << slID.
superlayer();
220 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
221 string folderTag =
parameters.getUntrackedParameter<
string>(
"folderTag",
"TimeBoxes");
223 folderRoot +
"DT/DTDigiTask/Wheel" + wheel.str() +
224 "/Station" + station.str() +
225 "/Sector" + sector.str() +
"/" + folderTag +
"/";
227 string histoTag =
parameters.getUntrackedParameter<
string>(
"histoTag",
"TimeBox");
228 string histoname = folderName + histoTag
230 +
"_St" + station.str()
231 +
"_Sec" + sector.str()
232 +
"_SL" + superLayer.str();
242 stringstream wheel; wheel << ch.
wheel();
244 stringstream sector; sector << ch.
sector();
246 string histoName =
"tTrigTest_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
248 dbe->setCurrentFolder(
"DT/Tests/DTtTrigCalibration");
250 histos[ch.
rawId()] = dbe->book1D(histoName.c_str(),histoName.c_str(),3,0,2);
256 dbe->setCurrentFolder(
"DT/Tests/DTtTrigCalibration/SummaryPlot");
258 if(wheelHistos.find(3) == wheelHistos.end()){
259 string histoName =
"t_TrigSummary_testFailedByAtLeastBadSL";
260 wheelHistos[3] = dbe->book2D(histoName.c_str(),histoName.c_str(),14,0,14,5,-2,2);
261 wheelHistos[3]->setBinLabel(1,
"Sector1",1);
262 wheelHistos[3]->setBinLabel(1,
"Sector1",1);
263 wheelHistos[3]->setBinLabel(2,
"Sector2",1);
264 wheelHistos[3]->setBinLabel(3,
"Sector3",1);
265 wheelHistos[3]->setBinLabel(4,
"Sector4",1);
266 wheelHistos[3]->setBinLabel(5,
"Sector5",1);
267 wheelHistos[3]->setBinLabel(6,
"Sector6",1);
268 wheelHistos[3]->setBinLabel(7,
"Sector7",1);
269 wheelHistos[3]->setBinLabel(8,
"Sector8",1);
270 wheelHistos[3]->setBinLabel(9,
"Sector9",1);
271 wheelHistos[3]->setBinLabel(10,
"Sector10",1);
272 wheelHistos[3]->setBinLabel(11,
"Sector11",1);
273 wheelHistos[3]->setBinLabel(12,
"Sector12",1);
274 wheelHistos[3]->setBinLabel(13,
"Sector13",1);
275 wheelHistos[3]->setBinLabel(14,
"Sector14",1);
276 wheelHistos[3]->setBinLabel(1,
"Wheel-2",2);
277 wheelHistos[3]->setBinLabel(2,
"Wheel-1",2);
278 wheelHistos[3]->setBinLabel(3,
"Wheel0",2);
279 wheelHistos[3]->setBinLabel(4,
"Wheel+1",2);
280 wheelHistos[3]->setBinLabel(5,
"Wheel+2",2);
283 stringstream wheel; wheel <<wh;
284 string histoName =
"t_TrigSummary_testFailed_W" + wheel.str();
285 wheelHistos[wh] = dbe->book2D(histoName.c_str(),histoName.c_str(),14,0,14,11,0,11);
286 wheelHistos[wh]->setBinLabel(1,
"Sector1",1);
287 wheelHistos[wh]->setBinLabel(2,
"Sector2",1);
288 wheelHistos[wh]->setBinLabel(3,
"Sector3",1);
289 wheelHistos[wh]->setBinLabel(4,
"Sector4",1);
290 wheelHistos[wh]->setBinLabel(5,
"Sector5",1);
291 wheelHistos[wh]->setBinLabel(6,
"Sector6",1);
292 wheelHistos[wh]->setBinLabel(7,
"Sector7",1);
293 wheelHistos[wh]->setBinLabel(8,
"Sector8",1);
294 wheelHistos[wh]->setBinLabel(9,
"Sector9",1);
295 wheelHistos[wh]->setBinLabel(10,
"Sector10",1);
296 wheelHistos[wh]->setBinLabel(11,
"Sector11",1);
297 wheelHistos[wh]->setBinLabel(12,
"Sector12",1);
298 wheelHistos[wh]->setBinLabel(13,
"Sector13",1);
299 wheelHistos[wh]->setBinLabel(14,
"Sector14",1);
300 wheelHistos[wh]->setBinLabel(1,
"MB1_SL1",2);
301 wheelHistos[wh]->setBinLabel(2,
"MB1_SL2",2);
302 wheelHistos[wh]->setBinLabel(3,
"MB1_SL3",2);
303 wheelHistos[wh]->setBinLabel(4,
"MB2_SL1",2);
304 wheelHistos[wh]->setBinLabel(5,
"MB2_SL2",2);
305 wheelHistos[wh]->setBinLabel(6,
"MB2_SL3",2);
306 wheelHistos[wh]->setBinLabel(7,
"MB3_SL1",2);
307 wheelHistos[wh]->setBinLabel(8,
"MB3_SL2",2);
308 wheelHistos[wh]->setBinLabel(9,
"MB3_SL3",2);
309 wheelHistos[wh]->setBinLabel(10,
"MB4_SL1",2);
310 wheelHistos[wh]->setBinLabel(11,
"MB4_SL3",2);
LuminosityBlockID id() const
std::string getMEName(const DTSuperLayerId &slID)
Get the ME name.
void bookHistos(const DTChamberId &ch)
book the new ME
uint32_t rawId() const
get the raw id
U second(std::pair< T, U > const &p)
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.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
int superlayer() const
Return the superlayer number (deprecated method name)
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
DQM Client Diagnostic.
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
int station() const
Return the station number.
int wheel() const
Return the wheel number.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.