100 std::map<unsigned int, ArmPlots>
armPlots;
117 events_per_bx = ibooker.
book1D(
"events per BX",
"rp;Event.BX", 4002, -1.5, 4000. + 0.5);
118 events_per_bx_short = ibooker.
book1D(
"events per BX (short)",
"rp;Event.BX", 102, -1.5, 100. + 0.5);
127 RPState = ibooker.
book2D(
"rpstate per LS",
128 "RP State per Lumisection;Luminosity Section;",
136 TH2F *
hist = RPState->getTH2F();
137 hist->SetCanExtend(TH1::kAllAxes);
138 TAxis *ya =
hist->GetYaxis();
139 ya->SetBinLabel(1,
"45, 210, FR-BT");
140 ya->SetBinLabel(2,
"45, 210, FR-HR");
141 ya->SetBinLabel(3,
"45, 210, FR-TP");
142 ya->SetBinLabel(4,
"45, 220, C1");
143 ya->SetBinLabel(5,
"45, 220, FR-BT");
144 ya->SetBinLabel(6,
"45, 220, FR-HR");
145 ya->SetBinLabel(7,
"45, 220, FR-TP");
146 ya->SetBinLabel(8,
"45, 220, NR-BP");
147 ya->SetBinLabel(9,
"45, 220, NR-TP");
148 ya->SetBinLabel(10,
"56, 210, FR-BT");
149 ya->SetBinLabel(11,
"56, 210, FR-HR");
150 ya->SetBinLabel(12,
"56, 210, FR-TP");
151 ya->SetBinLabel(13,
"56, 220, C1");
152 ya->SetBinLabel(14,
"56, 220, FR-BT");
153 ya->SetBinLabel(15,
"56, 220, FR-HR");
154 ya->SetBinLabel(16,
"56, 220, FR-TP");
155 ya->SetBinLabel(17,
"56, 220, NR-BP");
156 ya->SetBinLabel(18,
"56, 220, NR-TP");
159 h_trackCorr_hor = ibooker.
book2D(
"track correlation hor",
"ctpps_common_rp_hor", 6, -0.5, 5.5, 6, -0.5, 5.5);
161 TH2F *
hist = h_trackCorr_hor->getTH2F();
162 TAxis *xa =
hist->GetXaxis(), *ya =
hist->GetYaxis();
163 xa->SetBinLabel(1,
"45, 210, far");
164 ya->SetBinLabel(1,
"45, 210, far");
165 xa->SetBinLabel(2,
"45, 220, far");
166 ya->SetBinLabel(2,
"45, 220, far");
167 xa->SetBinLabel(3,
"45, 220, cyl");
168 ya->SetBinLabel(3,
"45, 220, cyl");
169 xa->SetBinLabel(4,
"56, 210, far");
170 ya->SetBinLabel(4,
"56, 210, far");
171 xa->SetBinLabel(5,
"56, 220, far");
172 ya->SetBinLabel(5,
"56, 220, far");
173 xa->SetBinLabel(6,
"56, 220, cyl");
174 ya->SetBinLabel(6,
"56, 220, cyl");
177 h_trackCorr_vert = ibooker.
book2D(
"track correlation vert",
"ctpps_common_rp_vert", 8, -0.5, 7.5, 8, -0.5, 7.5);
179 TH2F *
hist = h_trackCorr_vert->getTH2F();
180 TAxis *xa =
hist->GetXaxis(), *ya =
hist->GetYaxis();
181 xa->SetBinLabel(1,
"45, 210, far, top");
182 ya->SetBinLabel(1,
"45, 210, far, top");
183 xa->SetBinLabel(2,
"45, 210, far, bot");
184 ya->SetBinLabel(2,
"45, 210, far, bot");
185 xa->SetBinLabel(3,
"45, 220, far, top");
186 ya->SetBinLabel(3,
"45, 220, far, top");
187 xa->SetBinLabel(4,
"45, 220, far, bot");
188 ya->SetBinLabel(4,
"45, 220, far, bot");
189 xa->SetBinLabel(5,
"56, 210, far, top");
190 ya->SetBinLabel(5,
"56, 210, far, top");
191 xa->SetBinLabel(6,
"56, 210, far, bot");
192 ya->SetBinLabel(6,
"56, 210, far, bot");
193 xa->SetBinLabel(7,
"56, 220, far, top");
194 ya->SetBinLabel(7,
"56, 220, far, top");
195 xa->SetBinLabel(8,
"56, 220, far, bot");
196 ya->SetBinLabel(8,
"56, 220, far, bot");
208 string title =
"ctpps_common_sector_" +
name;
211 ibooker.
book1D(
"number of top RPs with tracks",
title +
";number of top RPs with tracks", 5, -0.5, 4.5);
213 ibooker.
book1D(
"number of hor RPs with tracks",
title +
";number of hor RPs with tracks", 5, -0.5, 4.5);
215 ibooker.
book1D(
"number of bot RPs with tracks",
title +
";number of bot RPs with tracks", 5, -0.5, 4.5);
219 TAxis *xa = h_trackCorr_h->GetXaxis(), *ya = h_trackCorr_h->GetYaxis();
220 xa->SetBinLabel(1,
"210, far, hor");
221 ya->SetBinLabel(1,
"210, far, hor");
222 xa->SetBinLabel(2,
"210, far, top");
223 ya->SetBinLabel(2,
"210, far, top");
224 xa->SetBinLabel(3,
"210, far, bot");
225 ya->SetBinLabel(3,
"210, far, bot");
226 xa->SetBinLabel(4,
"220, cyl");
227 ya->SetBinLabel(4,
"220, cyl");
228 xa->SetBinLabel(5,
"220, far, hor");
229 ya->SetBinLabel(5,
"220, far, hor");
230 xa->SetBinLabel(6,
"220, far, top");
231 ya->SetBinLabel(6,
"220, far, top");
232 xa->SetBinLabel(7,
"220, far, bot");
233 ya->SetBinLabel(7,
"220, far, bot");
237 xa = h_trackCorr_h->GetXaxis();
238 ya = h_trackCorr_h->GetYaxis();
239 xa->SetBinLabel(1,
"210, far, hor");
240 ya->SetBinLabel(1,
"210, far, hor");
241 xa->SetBinLabel(2,
"210, far, top");
242 ya->SetBinLabel(2,
"210, far, top");
243 xa->SetBinLabel(3,
"210, far, bot");
244 ya->SetBinLabel(3,
"210, far, bot");
245 xa->SetBinLabel(4,
"220, cyl");
246 ya->SetBinLabel(4,
"220, cyl");
247 xa->SetBinLabel(5,
"220, far, hor");
248 ya->SetBinLabel(5,
"220, far, hor");
249 xa->SetBinLabel(6,
"220, far, top");
250 ya->SetBinLabel(6,
"220, far, top");
251 xa->SetBinLabel(7,
"220, far, bot");
252 ya->SetBinLabel(7,
"220, far, bot");
256 h_proton_th_x = ibooker.
book1D(
"proton theta st x",
";#theta^{*}_{x} (rad)", 250, -500E-6, +500E-6);
257 h_proton_th_y = ibooker.
book1D(
"proton theta st y",
";#theta^{*}_{y} (rad)", 250, -500E-6, +500E-6);
262 for (
const unsigned int rpDecId : {2, 3, 16, 23}) {
263 unsigned int st = rpDecId / 10, rp = rpDecId % 10, rpFullDecId =
id * 100 + rpDecId;
265 string stName, rpName;
268 rpName = stName +
"_" + rpName;
272 ibooker.
book1D(rpName +
" - track x histogram",
title +
"/" + rpName +
";track x (mm)", 200, 0., 40.),
274 rpName +
" - track time histogram",
title +
"/" + rpName +
";track time (ns)", 100, -25., +50.)};
277 ibooker.
book1D(rpName +
" - track x histogram",
title +
"/" + rpName +
";track x (mm)", 200, 0., 40.),
278 ibooker.
book1D(rpName +
" - track y histogram",
title +
"/" + rpName +
";track y (mm)", 200, -20., +20.)};
287 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
309 for (
unsigned int arm = 0;
arm < 2;
arm++) {
332 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeCTPPSRecord > input not available.";
337 auto &
rpstate = *luminosityBlockCache(
event.getLuminosityBlock().index());
339 rpstate.reserve(CTPPSRecord::RomanPot::Last);
340 for (uint8_t
i = 0;
i < CTPPSRecord::RomanPot::Last; ++
i)
355 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeTracks > input not available.";
362 set<signed int> s_rp_idx_global_hor, s_rp_idx_global_vert;
363 map<unsigned int, set<signed int>> ms_rp_idx_arm;
365 for (
auto &tr : *hTracks) {
367 const unsigned int arm =
rpId.arm();
368 const unsigned int stNum =
rpId.station();
369 const unsigned int rpNum =
rpId.rp();
370 const unsigned int stRPNum = stNum * 10 + rpNum;
382 s_rp_idx_global_hor.insert(3 *
arm +
idx);
397 s_rp_idx_global_vert.insert(4 *
arm +
idx);
417 const signed int hor = ((rpNum == 2) || (rpNum == 3) || (rpNum == 6)) ? 1 : 0;
420 ms_rp_idx_arm[
arm].insert(
idx * 10 + hor);
430 for (
const auto &idx1 : s_rp_idx_global_hor)
431 for (
const auto &idx2 : s_rp_idx_global_hor)
434 for (
const auto &idx1 : s_rp_idx_global_vert)
435 for (
const auto &idx2 : s_rp_idx_global_vert)
441 map<unsigned int, set<unsigned int>>
mTop, mHor, mBot;
443 for (
auto &tr : *hTracks) {
445 const unsigned int rpNum =
rpId.rp();
446 const unsigned int armIdx =
rpId.arm();
448 if (rpNum == 0 || rpNum == 4)
450 if (rpNum == 2 || rpNum == 3 || rpNum == 6)
451 mHor[armIdx].insert(
rpId);
452 if (rpNum == 1 || rpNum == 5)
453 mBot[armIdx].insert(
rpId);
456 unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
460 auto it = ap.trackingRPPlots.find(rpDecId);
461 if (it != ap.trackingRPPlots.end()) {
462 it->second.h_x->Fill(tr.x());
463 it->second.h_y->Fill(tr.y());
469 auto it = ap.timingRPPlots.find(rpDecId);
470 if (it != ap.timingRPPlots.end()) {
471 it->second.h_x->Fill(tr.x());
472 it->second.h_time->Fill(tr.time());
478 p.second.h_numRPWithTrack_top->Fill(
mTop[
p.first].size());
479 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first].size());
480 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first].size());
486 for (
const auto &ap : ms_rp_idx_arm) {
489 for (
const auto &idx1 : ap.second) {
490 for (
const auto &idx2 : ap.second) {
491 plots.h_trackCorr->Fill(idx1 / 10, idx2 / 10);
493 if ((idx1 % 10) != (idx2 % 10))
494 plots.h_trackCorr_overlap->Fill(idx1 / 10, idx2 / 10);
510 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeProtons > input not available.";
516 for (
auto &
p : *hRecoProtons) {
520 signed int armIndex = -1;
530 plots.h_proton_xi->Fill(
p.xi());
531 plots.h_proton_th_x->Fill(
p.thetaX());
532 plots.h_proton_th_y->Fill(
p.thetaY());
533 plots.h_proton_t->Fill(fabs(
p.t()));
534 plots.h_proton_time->Fill(
p.time());
542 return std::make_shared<std::vector<int>>();
548 auto const &
rpstate = *luminosityBlockCache(iLumi.
index());