99 std::map<unsigned int, ArmPlots>
armPlots;
116 events_per_bx = ibooker.
book1D(
"events per BX",
"rp;Event.BX", 4002, -1.5, 4000. + 0.5);
117 events_per_bx_short = ibooker.
book1D(
"events per BX (short)",
"rp;Event.BX", 102, -1.5, 100. + 0.5);
126 RPState = ibooker.
book2D(
"rpstate per LS",
127 "RP State per Lumisection;Luminosity Section;",
135 TH2F *
hist = RPState->getTH2F();
136 hist->SetCanExtend(TH1::kAllAxes);
137 TAxis *ya =
hist->GetYaxis();
138 ya->SetBinLabel(1,
"45, 210, FR-BT");
139 ya->SetBinLabel(2,
"45, 210, FR-HR");
140 ya->SetBinLabel(3,
"45, 210, FR-TP");
141 ya->SetBinLabel(4,
"45, 220, C1");
142 ya->SetBinLabel(5,
"45, 220, FR-BT");
143 ya->SetBinLabel(6,
"45, 220, FR-HR");
144 ya->SetBinLabel(7,
"45, 220, FR-TP");
145 ya->SetBinLabel(8,
"45, 220, NR-BP");
146 ya->SetBinLabel(9,
"45, 220, NR-TP");
147 ya->SetBinLabel(10,
"56, 210, FR-BT");
148 ya->SetBinLabel(11,
"56, 210, FR-HR");
149 ya->SetBinLabel(12,
"56, 210, FR-TP");
150 ya->SetBinLabel(13,
"56, 220, C1");
151 ya->SetBinLabel(14,
"56, 220, FR-BT");
152 ya->SetBinLabel(15,
"56, 220, FR-HR");
153 ya->SetBinLabel(16,
"56, 220, FR-TP");
154 ya->SetBinLabel(17,
"56, 220, NR-BP");
155 ya->SetBinLabel(18,
"56, 220, NR-TP");
158 h_trackCorr_hor = ibooker.
book2D(
"track correlation hor",
"ctpps_common_rp_hor", 6, -0.5, 5.5, 6, -0.5, 5.5);
160 TH2F *
hist = h_trackCorr_hor->getTH2F();
161 TAxis *xa =
hist->GetXaxis(), *ya =
hist->GetYaxis();
162 xa->SetBinLabel(1,
"45, 210, far");
163 ya->SetBinLabel(1,
"45, 210, far");
164 xa->SetBinLabel(2,
"45, 220, far");
165 ya->SetBinLabel(2,
"45, 220, far");
166 xa->SetBinLabel(3,
"45, 220, cyl");
167 ya->SetBinLabel(3,
"45, 220, cyl");
168 xa->SetBinLabel(4,
"56, 210, far");
169 ya->SetBinLabel(4,
"56, 210, far");
170 xa->SetBinLabel(5,
"56, 220, far");
171 ya->SetBinLabel(5,
"56, 220, far");
172 xa->SetBinLabel(6,
"56, 220, cyl");
173 ya->SetBinLabel(6,
"56, 220, cyl");
176 h_trackCorr_vert = ibooker.
book2D(
"track correlation vert",
"ctpps_common_rp_vert", 8, -0.5, 7.5, 8, -0.5, 7.5);
178 TH2F *
hist = h_trackCorr_vert->getTH2F();
179 TAxis *xa =
hist->GetXaxis(), *ya =
hist->GetYaxis();
180 xa->SetBinLabel(1,
"45, 210, far, top");
181 ya->SetBinLabel(1,
"45, 210, far, top");
182 xa->SetBinLabel(2,
"45, 210, far, bot");
183 ya->SetBinLabel(2,
"45, 210, far, bot");
184 xa->SetBinLabel(3,
"45, 220, far, top");
185 ya->SetBinLabel(3,
"45, 220, far, top");
186 xa->SetBinLabel(4,
"45, 220, far, bot");
187 ya->SetBinLabel(4,
"45, 220, far, bot");
188 xa->SetBinLabel(5,
"56, 210, far, top");
189 ya->SetBinLabel(5,
"56, 210, far, top");
190 xa->SetBinLabel(6,
"56, 210, far, bot");
191 ya->SetBinLabel(6,
"56, 210, far, bot");
192 xa->SetBinLabel(7,
"56, 220, far, top");
193 ya->SetBinLabel(7,
"56, 220, far, top");
194 xa->SetBinLabel(8,
"56, 220, far, bot");
195 ya->SetBinLabel(8,
"56, 220, far, bot");
207 string title =
"ctpps_common_sector_" +
name;
210 ibooker.
book1D(
"number of top RPs with tracks",
title +
";number of top RPs with tracks", 5, -0.5, 4.5);
212 ibooker.
book1D(
"number of hor RPs with tracks",
title +
";number of hor RPs with tracks", 5, -0.5, 4.5);
214 ibooker.
book1D(
"number of bot RPs with tracks",
title +
";number of bot RPs with tracks", 5, -0.5, 4.5);
218 TAxis *xa = h_trackCorr_h->GetXaxis(), *ya = h_trackCorr_h->GetYaxis();
219 xa->SetBinLabel(1,
"210, far, hor");
220 ya->SetBinLabel(1,
"210, far, hor");
221 xa->SetBinLabel(2,
"210, far, top");
222 ya->SetBinLabel(2,
"210, far, top");
223 xa->SetBinLabel(3,
"210, far, bot");
224 ya->SetBinLabel(3,
"210, far, bot");
225 xa->SetBinLabel(4,
"220, cyl");
226 ya->SetBinLabel(4,
"220, cyl");
227 xa->SetBinLabel(5,
"220, far, hor");
228 ya->SetBinLabel(5,
"220, far, hor");
229 xa->SetBinLabel(6,
"220, far, top");
230 ya->SetBinLabel(6,
"220, far, top");
231 xa->SetBinLabel(7,
"220, far, bot");
232 ya->SetBinLabel(7,
"220, far, bot");
236 xa = h_trackCorr_h->GetXaxis();
237 ya = h_trackCorr_h->GetYaxis();
238 xa->SetBinLabel(1,
"210, far, hor");
239 ya->SetBinLabel(1,
"210, far, hor");
240 xa->SetBinLabel(2,
"210, far, top");
241 ya->SetBinLabel(2,
"210, far, top");
242 xa->SetBinLabel(3,
"210, far, bot");
243 ya->SetBinLabel(3,
"210, far, bot");
244 xa->SetBinLabel(4,
"220, cyl");
245 ya->SetBinLabel(4,
"220, cyl");
246 xa->SetBinLabel(5,
"220, far, hor");
247 ya->SetBinLabel(5,
"220, far, hor");
248 xa->SetBinLabel(6,
"220, far, top");
249 ya->SetBinLabel(6,
"220, far, top");
250 xa->SetBinLabel(7,
"220, far, bot");
251 ya->SetBinLabel(7,
"220, far, bot");
255 h_proton_th_x = ibooker.
book1D(
"proton theta st x",
";#theta^{*}_{x} (rad)", 250, -500E-6, +500E-6);
256 h_proton_th_y = ibooker.
book1D(
"proton theta st y",
";#theta^{*}_{y} (rad)", 250, -500E-6, +500E-6);
261 for (
const unsigned int rpDecId : {2, 3, 16, 23}) {
262 unsigned int st = rpDecId / 10, rp = rpDecId % 10, rpFullDecId =
id * 100 + rpDecId;
264 string stName, rpName;
267 rpName = stName +
"_" + rpName;
271 ibooker.
book1D(rpName +
" - track x histogram",
title +
"/" + rpName +
";track x (mm)", 200, 0., 40.),
273 rpName +
" - track time histogram",
title +
"/" + rpName +
";track time (ns)", 100, -25., +50.)};
276 ibooker.
book1D(rpName +
" - track x histogram",
title +
"/" + rpName +
";track x (mm)", 200, 0., 40.),
277 ibooker.
book1D(rpName +
" - track y histogram",
title +
"/" + rpName +
";track y (mm)", 200, -20., +20.)};
286 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
307 for (
unsigned int arm = 0; arm < 2; arm++) {
330 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeCTPPSRecord > input not available.";
335 auto &
rpstate = *luminosityBlockCache(
event.getLuminosityBlock().index());
337 rpstate.reserve(CTPPSRecord::RomanPot::Last);
338 for (uint8_t
i = 0;
i < CTPPSRecord::RomanPot::Last; ++
i)
353 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeTracks > input not available.";
360 set<signed int> s_rp_idx_global_hor, s_rp_idx_global_vert;
361 map<unsigned int, set<signed int>> ms_rp_idx_arm;
363 for (
auto &tr : *hTracks) {
365 const unsigned int arm =
rpId.arm();
366 const unsigned int stNum =
rpId.station();
367 const unsigned int rpNum =
rpId.rp();
368 const unsigned int stRPNum = stNum * 10 + rpNum;
380 s_rp_idx_global_hor.insert(3 * arm +
idx);
395 s_rp_idx_global_vert.insert(4 * arm +
idx);
415 const signed int hor = ((rpNum == 2) || (rpNum == 3) || (rpNum == 6)) ? 1 : 0;
418 ms_rp_idx_arm[arm].insert(
idx * 10 + hor);
428 for (
const auto &idx1 : s_rp_idx_global_hor)
429 for (
const auto &idx2 : s_rp_idx_global_hor)
432 for (
const auto &idx1 : s_rp_idx_global_vert)
433 for (
const auto &idx2 : s_rp_idx_global_vert)
439 map<unsigned int, set<unsigned int>>
mTop, mHor, mBot;
441 for (
auto &tr : *hTracks) {
443 const unsigned int rpNum =
rpId.rp();
444 const unsigned int armIdx =
rpId.arm();
446 if (rpNum == 0 || rpNum == 4)
448 if (rpNum == 2 || rpNum == 3 || rpNum == 6)
449 mHor[armIdx].insert(
rpId);
450 if (rpNum == 1 || rpNum == 5)
451 mBot[armIdx].insert(
rpId);
454 unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
458 auto it = ap.trackingRPPlots.find(rpDecId);
459 if (it != ap.trackingRPPlots.end()) {
460 it->second.h_x->Fill(tr.x());
461 it->second.h_y->Fill(tr.y());
467 auto it = ap.timingRPPlots.find(rpDecId);
468 if (it != ap.timingRPPlots.end()) {
469 it->second.h_x->Fill(tr.x());
470 it->second.h_time->Fill(tr.time());
476 p.second.h_numRPWithTrack_top->Fill(
mTop[
p.first].size());
477 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first].size());
478 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first].size());
484 for (
const auto &ap : ms_rp_idx_arm) {
487 for (
const auto &idx1 : ap.second) {
488 for (
const auto &idx2 : ap.second) {
489 plots.h_trackCorr->Fill(idx1 / 10, idx2 / 10);
491 if ((idx1 % 10) != (idx2 % 10))
492 plots.h_trackCorr_overlap->Fill(idx1 / 10, idx2 / 10);
508 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeProtons > input not available.";
514 for (
auto &
p : *hRecoProtons) {
518 signed int armIndex = -1;
528 plots.h_proton_xi->Fill(
p.xi());
529 plots.h_proton_th_x->Fill(
p.thetaX());
530 plots.h_proton_th_y->Fill(
p.thetaY());
531 plots.h_proton_t->Fill(fabs(
p.t()));
532 plots.h_proton_time->Fill(
p.time());
540 return std::make_shared<std::vector<int>>();
546 auto const &
rpstate = *luminosityBlockCache(iLumi.
index());