47 int qualTM()
const {
return theQual; }
55 :
nEvents(0), nLumis(0), theTrigGeomUtils(nullptr) {
56 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerBaseTask") <<
"[DTLocalTriggerBaseTask]: Constructor" << endl;
74 topFolder(
"TM") =
"DT/11-LocalTriggerTP-TM/";
76 topFolder(
"TM") =
"DT/03-LocalTrigger-TM/";
83 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
84 <<
"[DTLocalTriggerBaseTask]: analyzed " <<
nEvents <<
" events" << endl;
93 ibooker.setCurrentFolder(
"DT/EventInfo/Counters");
95 for (
int wh = -2; wh < 3; ++wh) {
97 for (
int sect = 1; sect < 13; ++sect) {
109 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
110 <<
"[DTLocalTriggerBaseTask]: Begin of LS transition" << endl;
112 if (
nLumis % resetCycle == 0) {
113 map<uint32_t, map<string, MonitorElement*> >::const_iterator chambIt =
chamberHistos.begin();
114 map<uint32_t, map<string, MonitorElement*> >::const_iterator chambEnd =
chamberHistos.end();
115 for (; chambIt != chambEnd; ++chambIt) {
116 map<string, MonitorElement*>::const_iterator histoIt = chambIt->second.begin();
117 map<string, MonitorElement*>::const_iterator histoEnd = chambIt->second.end();
118 for (; histoIt != histoEnd; ++histoIt) {
119 histoIt->second->Reset();
126 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerBaseTask") <<
"[DTLocalTriggerBaseTask]: End of LS transition" << endl;
128 map<uint32_t, DTTimeEvolutionHisto*>::const_iterator chambIt =
trendHistos.begin();
129 map<uint32_t, DTTimeEvolutionHisto*>::const_iterator chambEnd =
trendHistos.end();
130 for (; chambIt != chambEnd; ++chambIt) {
131 cout <<
"updating time slot in DTLocalTriggerBaseTask" << endl;
133 cout <<
"updated time slot in DTLocalTriggerBaseTask" << endl;
138 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerBaseTask") <<
"[DTLocalTriggerBaseTask]: BeginRun" << endl;
167 LogVerbatim(
"DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
168 <<
"[DTLocalTriggerBaseTask]: one or more TM handles for Input Tag " <<
inputTagTM <<
" not found!" << endl;
175 uint32_t rawId = dtCh.
rawId();
184 map<string, int>
minBX;
185 map<string, int>
maxBX;
190 string chTag =
"_W" +
wheel.str() +
"_Sec" + sector.str() +
"_St" +
station.str();
191 string labelInOut =
"";
193 vector<string>::const_iterator typeIt =
theTypes.begin();
194 vector<string>::const_iterator typeEnd =
theTypes.end();
196 for (; typeIt != typeEnd; ++typeIt) {
197 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerBaseTask")
198 <<
"[DTLocalTriggerBaseTask]: booking histos for " <<
topFolder((*typeIt)) <<
"Wheel" <<
wheel.str()
199 <<
"/Sector" << sector.str() <<
"/Station" <<
station.str() << endl;
201 for (
int InOut = 0; InOut < 2; InOut++) {
205 ibooker.setCurrentFolder(
topFolder(*typeIt) +
"Wheel" +
wheel.str() +
"/Sector" + sector.str() +
"/Station" +
206 station.str() +
"/LocalTriggerPhiIn");
208 }
else if (InOut == 1) {
209 ibooker.setCurrentFolder(
topFolder(*typeIt) +
"Wheel" +
wheel.str() +
"/Sector" + sector.str() +
"/Station" +
210 station.str() +
"/LocalTriggerPhiOut");
214 string histoTag = (*typeIt) +
"_BXvsQual" + labelInOut;
216 "BX vs trigger quality",
222 maxBX[*typeIt] + .5);
226 histoTag = (*typeIt) +
"_BestQual" + labelInOut;
228 ibooker.book1D(
histoTag + chTag,
"Trigger quality of best primitives", 7, -0.5, 6.5);
231 histoTag = (*typeIt) +
"_Flag1stvsQual" + labelInOut;
233 ibooker.book2D(
histoTag + chTag,
"1st/2nd trig flag vs quality", 7, -0.5, 6.5, 2, -0.5, 1.5);
236 histoTag = (*typeIt) +
"_FlagUpDownvsQual" + labelInOut;
238 ibooker.book2D(
histoTag + chTag,
"Up/Down trig flag vs quality", 7, -0.5, 6.5, 2, -0.5, 1.5);
242 if (*typeIt ==
"TM") {
247 histoTag = (*typeIt) +
"_QualvsPhirad" + labelInOut;
249 ibooker.book2D(
histoTag + chTag,
"Trigger quality vs local position", nBinsPh, minPh, maxPh, 7, -0.5, 6.5);
253 histoTag = (*typeIt) +
"_QualvsPhibend" + labelInOut;
255 ibooker.book2D(
histoTag + chTag,
"Trigger quality vs local direction", 200, -40., 40., 7, -0.5, 6.5);
262 ibooker.setCurrentFolder(
topFolder(*typeIt) +
"Wheel" +
wheel.str() +
"/Sector" + sector.str() +
"/Station" +
263 station.str() +
"/LocalTriggerTheta");
266 if ((*typeIt) ==
"TM" && dtCh.
station() != 4) {
267 histoTag = (*typeIt) +
"_PositionvsBX";
269 "Theta trigger position vs BX",
276 histoTag = (*typeIt) +
"_PositionvsQual";
278 ibooker.book2D(
histoTag + chTag,
"Theta trigger position vs quality", 2, 0.5, 2.5, 7, -0.5, 6.5);
280 histoTag = (*typeIt) +
"_ThetaBXvsQual";
282 "BX vs trigger quality",
288 maxBX[*typeIt] + .5);
296 histoTag = (*typeIt) +
"_ThetaBXvsQual";
298 "BX vs trigger quality",
304 maxBX[*typeIt] + .5);
307 histoTag = (*typeIt) +
"_ThetaBestQual";
309 ibooker.book1D(
histoTag + chTag,
"Trigger quality of best primitives (theta)", 7, -0.5, 6.5);
317 std::vector<L1MuDTChambPhDigi>
const* phOutTrigs,
318 std::vector<L1MuDTChambThDigi>
const* thTrigs) {
319 vector<L1MuDTChambPhDigi>::const_iterator iph = phInTrigs->begin();
320 vector<L1MuDTChambPhDigi>::const_iterator iphe = phInTrigs->end();
322 for (; iph != iphe; ++iph) {
323 int wh = iph->whNum();
324 int sec = iph->scNum() + 1;
325 int st = iph->stNum();
326 int qual = iph->code();
327 int is1st = iph->Ts2Tag() ? 1 : 0;
328 int bx = iph->bxNum() - is1st;
329 int updown = iph->UpDownTag();
331 if (qual < 0 || qual > 6)
335 uint32_t rawId = dtChId.
rawId();
343 map<string, MonitorElement*>& innerME =
chamberHistos[rawId];
345 innerME[
"TM_BXvsQual_In"]->Fill(qual,
bx);
346 innerME[
"TM_QualvsPhirad_In"]->Fill(
pos, qual);
348 innerME[
"TM_BXvsQual_In"]->Fill(qual,
bx);
349 innerME[
"TM_Flag1stvsQual_In"]->Fill(qual, is1st);
350 innerME[
"TM_FlagUpDownvsQual_In"]->Fill(qual, updown);
352 innerME[
"TM_QualvsPhirad_In"]->Fill(
pos, qual);
354 innerME[
"TM_QualvsPhibend_In"]->Fill(
dir, qual);
359 iph = phOutTrigs->begin();
360 iphe = phOutTrigs->end();
362 for (; iph != iphe; ++iph) {
363 int wh = iph->whNum();
364 int sec = iph->scNum() + 1;
365 int st = iph->stNum();
366 int qual = iph->code();
367 int is1st = iph->Ts2Tag() ? 1 : 0;
368 int bx = iph->bxNum() - is1st;
369 int updown = iph->UpDownTag();
370 if (qual < 0 || qual > 6)
374 uint32_t rawId = dtChId.
rawId();
382 map<string, MonitorElement*>& innerME =
chamberHistos[rawId];
384 innerME[
"TM_BXvsQual_Out"]->Fill(qual,
bx);
385 innerME[
"TM_QualvsPhirad_Out"]->Fill(
pos, qual);
387 innerME[
"TM_BXvsQual_Out"]->Fill(qual,
bx);
388 innerME[
"TM_Flag1stvsQual_Out"]->Fill(qual, is1st);
389 innerME[
"TM_FlagUpDownvsQual_Out"]->Fill(qual, updown);
392 innerME[
"TM_QualvsPhirad_Out"]->Fill(
pos, qual);
394 innerME[
"TM_QualvsPhibend_Out"]->Fill(
dir, qual);
399 vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin();
400 vector<L1MuDTChambThDigi>::const_iterator ithe = thTrigs->end();
402 for (; ith != ithe; ++ith) {
403 int wh = ith->whNum();
404 int sec = ith->scNum() + 1;
405 int st = ith->stNum();
406 int bx = ith->bxNum();
411 thcode[
pos] = ith->code(
pos);
414 uint32_t rawId = dtChId.
rawId();
416 map<string, MonitorElement*>& innerME =
chamberHistos[rawId];
419 if (thcode[
pos] > 0) {
420 innerME[
"TM_PositionvsBX"]->Fill(
bx,
pos);
421 innerME[
"TM_PositionvsQual"]->Fill(thcode[
pos],
pos);
422 innerME[
"TM_ThetaBXvsQual"]->Fill(thcode[
pos],
bx);
427 map<uint32_t, DTTPGCompareUnit>::const_iterator compIt =
theCompMapIn.begin();
428 map<uint32_t, DTTPGCompareUnit>::const_iterator compEnd =
theCompMapIn.end();
429 for (; compIt != compEnd; ++compIt) {
430 int bestQual = compIt->second.qualTM();
432 chamberHistos[compIt->first][
"TM_BestQual_In"]->Fill(bestQual);
438 map<uint32_t, DTTPGCompareUnit>::const_iterator compIt =
theCompMapOut.begin();
439 map<uint32_t, DTTPGCompareUnit>::const_iterator compEnd =
theCompMapOut.end();
440 for (; compIt != compEnd; ++compIt) {
441 int bestQual = compIt->second.qualTM();
443 chamberHistos[compIt->first][
"TM_BestQual_Out"]->Fill(bestQual);
453 TAxis* axis =
nullptr;
455 axis =
histo->GetXaxis();
456 }
else if (iaxis == 2) {
457 axis =
histo->GetYaxis();
462 string labels[7] = {
"LI",
"LO",
"HI",
"HO",
"LL",
"HL",
"HH"};
463 int istart = axis->GetXmin() < -1 ? 2 : 1;
464 for (
int i = 0;
i < 7;
i++) {
465 axis->SetBinLabel(
i + istart,
labels[
i].c_str());
474 TAxis* axis =
nullptr;
476 axis =
histo->GetXaxis();
477 }
else if (iaxis == 2) {
478 axis =
histo->GetYaxis();
483 string labels[2] = {
"L",
"H"};
484 int istart = axis->GetXmin() < -1 ? 2 : 1;
485 for (
int i = 0;
i < 2;
i++) {
486 axis->SetBinLabel(
i + istart,
labels[
i].c_str());