41 static constexpr
unsigned int ls_min = 0;
42 static constexpr
unsigned int ls_max = 2000;
53 std::array<unsigned int, 4>
rpIds;
59 std::array<std::array<MonitorElement *, 4>, 4>
v_h_y;
92 std::map<unsigned int, PotPlots>
potPlots;
107 bool diag = (top45 != top56);
109 string name =
string((diag) ?
"diagonal" :
"antidiagonal") +
" 45" + ((top45) ?
"top" :
"bot") +
" - 56" +
110 ((top56) ?
"top" :
"bot");
123 h2_track_corr_vert = ibooker.
book2D(
"track correlation in verticals",
title +
";;", 4, -0.5, 3.5, 4, -0.5, 3.5);
124 TH2F *h2 = h2_track_corr_vert->
getTH2F();
125 TAxis *xa = h2->GetXaxis(), *ya = h2->GetYaxis();
126 for (
unsigned int i = 0;
i < 4;
i++) {
129 rpName = rpName.substr(15);
131 xa->SetBinLabel(
i + 1, rpName.c_str());
132 ya->SetBinLabel(
i + 1, rpName.c_str());
135 h_rate_vs_time_dgn_4rp =
136 ibooker.
book1D(
"rate - 4 RPs",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
137 h_rate_vs_time_dgn_2rp = ibooker.
book1D(
138 "rate - 2 RPs (220-fr)",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
140 for (
unsigned int i = 0;
i < 4;
i++) {
143 rpName = rpName.substr(15);
147 v_h2_y_vs_x_dgn_4rp[
i] = ibooker.
book2D(
148 "xy hist - " + rpName +
" - 4 RPs cond",
title +
";x (mm);y (mm)", 100, -18., +18., 100, -18., +18.);
149 v_h2_y_vs_x_dgn_2rp[
i] = ibooker.
book2D(
150 "xy hist - " + rpName +
" - 2 RPs cond",
title +
";x (mm);y (mm)", 100, -18., +18., 100, -18., +18.);
154 for (
unsigned int j = 0;
j < 4;
j++) {
157 rpCoincName = rpCoincName.substr(15);
160 ibooker.
book1D(
"y hist - " + rpName +
" - coinc " + rpCoincName,
title +
";y (mm)", 180, -18., +18.);
175 h_rate_vs_time_suff =
176 ibooker.
book1D(
"rate - suff",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
177 h_rate_vs_time_track =
178 ibooker.
book1D(
"rate - track",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
179 h_rate_vs_time_unresolved =
180 ibooker.
book1D(
"rate - unresolved",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
187 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)) {
210 for (
unsigned int arm = 0;
arm < 2;
arm++) {
212 for (
unsigned int st : {0, 2}) {
214 for (
unsigned int rp : {4, 5}) {
243 LogProblem(
"ElasticPlotDQMSource") <<
"ERROR in ElasticPlotDQMSource::analyze > some of the required inputs are "
244 "not valid. Skipping this event.\n"
245 <<
" hits.isValid = " <<
hits.isValid() <<
"\n"
246 <<
" patterns.isValid = " << patterns.
isValid() <<
"\n"
247 <<
" tracks.isValid = " <<
tracks.isValid();
255 map<unsigned int, unsigned int> rp_planes_u_too_full, rp_planes_v_too_full;
256 map<unsigned int, bool> rp_pat_suff;
257 map<unsigned int, const TotemRPLocalTrack *> rp_track;
259 for (
const auto &ds : *
hits) {
264 if (detId.isStripsCoordinateUDirection())
265 rp_planes_u_too_full[
rpId]++;
267 rp_planes_v_too_full[
rpId]++;
271 for (
auto &ds : *patterns) {
275 unsigned int n_pat_u = 0, n_pat_v = 0;
287 (n_pat_u > 0 || rp_planes_u_too_full[
rpId] >= 3) && (n_pat_v > 0 || rp_planes_v_too_full[
rpId] >= 3);
290 for (
auto &ds : *
tracks) {
294 for (
auto &ft : ds) {
308 auto &
dp = dpp.second;
311 bool cond_4rp =
true, cond_2rp =
true;
312 for (
unsigned int i = 0;
i < 4;
i++) {
313 if (rp_track[
dp.rpIds[
i]] ==
nullptr)
316 if ((
i == 0 ||
i == 3) && rp_track[
dp.rpIds[
i]] ==
nullptr)
326 for (
unsigned int i = 0;
i < 4;
i++) {
333 dp.v_h2_y_vs_x_dgn_4rp[
i]->Fill(tr_i->
x0(), tr_i->
y0());
336 dp.v_h2_y_vs_x_dgn_2rp[
i]->Fill(tr_i->
x0(), tr_i->
y0());
338 for (
unsigned int j = 0;
j < 4;
j++) {
339 if (rp_track[
dp.rpIds[
j]] ==
nullptr)
342 dp.h2_track_corr_vert->Fill(
i,
j);
344 dp.v_h_y[
i][
j]->Fill(tr_i->
y0());
352 for (
const auto &
p : rp_pat_suff) {
353 const auto &
rpId =
p.first;
357 auto &
pp = pp_it->second;
359 const auto &pat_suff = rp_pat_suff[
rpId];
360 const auto &has_track = (rp_track[
rpId] !=
nullptr);
366 if (pat_suff && !has_track)