325 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeTracks > input not available.";
332 set<signed int> s_rp_idx_global_hor, s_rp_idx_global_vert;
333 map<unsigned int, set<signed int>> ms_rp_idx_arm;
335 for (
auto &tr : *hTracks)
338 const unsigned int arm =
rpId.arm();
339 const unsigned int stNum =
rpId.station();
340 const unsigned int rpNum =
rpId.rp();
341 const unsigned int stRPNum = stNum * 10 + rpNum;
345 if (stRPNum == 3) idx = 0;
346 if (stRPNum == 23) idx = 1;
347 if (stRPNum == 16) idx = 2;
350 s_rp_idx_global_hor.insert(3*arm + idx);
355 if (stRPNum == 4) idx = 0;
356 if (stRPNum == 5) idx = 1;
357 if (stRPNum == 24) idx = 2;
358 if (stRPNum == 25) idx = 3;
361 s_rp_idx_global_vert.insert(4*arm + idx);
366 if (stRPNum == 3) idx = 0;
367 if (stRPNum == 4) idx = 1;
368 if (stRPNum == 5) idx = 2;
369 if (stRPNum == 16) idx = 3;
370 if (stRPNum == 23) idx = 4;
371 if (stRPNum == 24) idx = 5;
372 if (stRPNum == 25) idx = 6;
374 const signed int hor = ((rpNum == 2) || (rpNum == 3) || (rpNum == 6)) ? 1 : 0;
377 ms_rp_idx_arm[arm].insert(idx * 10 + hor);
387 for (
const auto &idx1 : s_rp_idx_global_hor)
388 for (
const auto &idx2 : s_rp_idx_global_hor)
391 for (
const auto &idx1 : s_rp_idx_global_vert)
392 for (
const auto &idx2 : s_rp_idx_global_vert)
398 map<unsigned int, set<unsigned int>>
mTop, mHor, mBot;
400 for (
auto &tr : *hTracks)
403 const unsigned int rpNum =
rpId.rp();
404 const unsigned int armIdx =
rpId.arm();
406 if (rpNum == 0 || rpNum == 4)
407 mTop[armIdx].insert(
rpId);
408 if (rpNum == 2 || rpNum == 3 || rpNum == 6)
409 mHor[armIdx].insert(
rpId);
410 if (rpNum == 1 || rpNum == 5)
411 mBot[armIdx].insert(
rpId);
414 unsigned int rpDecId =
rpId.arm()*100 +
rpId.station()*10 +
rpId.rp();
418 auto it = ap.trackingRPPlots.find(rpDecId);
419 if (it != ap.trackingRPPlots.end())
421 it->second.h_x->Fill(tr.getX());
422 it->second.h_y->Fill(tr.getY());
428 auto it = ap.timingRPPlots.find(rpDecId);
429 if (it != ap.timingRPPlots.end())
431 it->second.h_x->Fill(tr.getX());
432 it->second.h_time->Fill(tr.getTime());
439 p.second.h_numRPWithTrack_top->Fill(mTop[
p.first].size());
440 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first].size());
441 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first].size());
447 for (
const auto &ap : ms_rp_idx_arm)
449 auto &
plots = armPlots[ap.first];
451 for (
const auto &idx1 : ap.second)
453 for (
const auto &idx2 : ap.second)
455 plots.h_trackCorr->Fill(idx1/10, idx2/10);
457 if ((idx1 % 10) != (idx2 % 10))
458 plots.h_trackCorr_overlap->Fill(idx1/10, idx2/10);
const edm::EDGetTokenT< std::vector< CTPPSLocalTrackLite > > tokenLocalTrackLite
const unsigned int verbosity
MonitorElement * h_trackCorr_hor
std::map< unsigned int, ArmPlots > armPlots
MonitorElement * events_per_bx
MonitorElement * events_per_bx_short
MonitorElement * h_trackCorr_vert
Base class for CTPPS detector IDs.