98 std::map<unsigned int, ArmPlots>
armPlots;
113 ibooker.setCurrentFolder(
"CTPPS/common");
115 events_per_bx = ibooker.book1D(
"events per BX",
"rp;Event.BX", 4002, -1.5, 4000. + 0.5);
116 events_per_bx_short = ibooker.book1D(
"events per BX (short)",
"rp;Event.BX", 102, -1.5, 100. + 0.5);
125 RPState = ibooker.book2D(
"rpstate per LS",
126 "RP State per Lumisection;Luminosity Section;",
134 TH2F *
hist = RPState->getTH2F();
135 hist->SetCanExtend(TH1::kAllAxes);
136 TAxis *ya =
hist->GetYaxis();
137 ya->SetBinLabel(1,
"45, 210, FR-BT");
138 ya->SetBinLabel(2,
"45, 210, FR-HR");
139 ya->SetBinLabel(3,
"45, 210, FR-TP");
140 ya->SetBinLabel(4,
"45, 220, C1");
141 ya->SetBinLabel(5,
"45, 220, FR-BT");
142 ya->SetBinLabel(6,
"45, 220, FR-HR");
143 ya->SetBinLabel(7,
"45, 220, FR-TP");
144 ya->SetBinLabel(8,
"45, 220, NR-BP");
145 ya->SetBinLabel(9,
"45, 220, NR-TP");
146 ya->SetBinLabel(10,
"56, 210, FR-BT");
147 ya->SetBinLabel(11,
"56, 210, FR-HR");
148 ya->SetBinLabel(12,
"56, 210, FR-TP");
149 ya->SetBinLabel(13,
"56, 220, C1");
150 ya->SetBinLabel(14,
"56, 220, FR-BT");
151 ya->SetBinLabel(15,
"56, 220, FR-HR");
152 ya->SetBinLabel(16,
"56, 220, FR-TP");
153 ya->SetBinLabel(17,
"56, 220, NR-BP");
154 ya->SetBinLabel(18,
"56, 220, NR-TP");
157 h_trackCorr_hor = ibooker.book2D(
"track correlation hor",
"ctpps_common_rp_hor", 6, -0.5, 5.5, 6, -0.5, 5.5);
159 TH2F *
hist = h_trackCorr_hor->getTH2F();
160 TAxis *xa =
hist->GetXaxis(), *ya =
hist->GetYaxis();
161 xa->SetBinLabel(1,
"45, 210, far");
162 ya->SetBinLabel(1,
"45, 210, far");
163 xa->SetBinLabel(2,
"45, 220, far");
164 ya->SetBinLabel(2,
"45, 220, far");
165 xa->SetBinLabel(3,
"45, 220, cyl");
166 ya->SetBinLabel(3,
"45, 220, cyl");
167 xa->SetBinLabel(4,
"56, 210, far");
168 ya->SetBinLabel(4,
"56, 210, far");
169 xa->SetBinLabel(5,
"56, 220, far");
170 ya->SetBinLabel(5,
"56, 220, far");
171 xa->SetBinLabel(6,
"56, 220, cyl");
172 ya->SetBinLabel(6,
"56, 220, cyl");
175 h_trackCorr_vert = ibooker.book2D(
"track correlation vert",
"ctpps_common_rp_vert", 8, -0.5, 7.5, 8, -0.5, 7.5);
177 TH2F *
hist = h_trackCorr_vert->getTH2F();
178 TAxis *xa =
hist->GetXaxis(), *ya =
hist->GetYaxis();
179 xa->SetBinLabel(1,
"45, 210, far, top");
180 ya->SetBinLabel(1,
"45, 210, far, top");
181 xa->SetBinLabel(2,
"45, 210, far, bot");
182 ya->SetBinLabel(2,
"45, 210, far, bot");
183 xa->SetBinLabel(3,
"45, 220, far, top");
184 ya->SetBinLabel(3,
"45, 220, far, top");
185 xa->SetBinLabel(4,
"45, 220, far, bot");
186 ya->SetBinLabel(4,
"45, 220, far, bot");
187 xa->SetBinLabel(5,
"56, 210, far, top");
188 ya->SetBinLabel(5,
"56, 210, far, top");
189 xa->SetBinLabel(6,
"56, 210, far, bot");
190 ya->SetBinLabel(6,
"56, 210, far, bot");
191 xa->SetBinLabel(7,
"56, 220, far, top");
192 ya->SetBinLabel(7,
"56, 220, far, top");
193 xa->SetBinLabel(8,
"56, 220, far, bot");
194 ya->SetBinLabel(8,
"56, 220, far, bot");
204 ibooker.setCurrentFolder(
"CTPPS/common/sector " +
name);
206 string title =
"ctpps_common_sector_" +
name;
209 ibooker.book1D(
"number of top RPs with tracks",
title +
";number of top RPs with tracks", 5, -0.5, 4.5);
211 ibooker.book1D(
"number of hor RPs with tracks",
title +
";number of hor RPs with tracks", 5, -0.5, 4.5);
213 ibooker.book1D(
"number of bot RPs with tracks",
title +
";number of bot RPs with tracks", 5, -0.5, 4.5);
215 h_trackCorr = ibooker.book2D(
"track correlation",
title, 7, -0.5, 6.5, 7, -0.5, 6.5);
217 TAxis *xa = h_trackCorr_h->GetXaxis(), *ya = h_trackCorr_h->GetYaxis();
218 xa->SetBinLabel(1,
"210, far, hor");
219 ya->SetBinLabel(1,
"210, far, hor");
220 xa->SetBinLabel(2,
"210, far, top");
221 ya->SetBinLabel(2,
"210, far, top");
222 xa->SetBinLabel(3,
"210, far, bot");
223 ya->SetBinLabel(3,
"210, far, bot");
224 xa->SetBinLabel(4,
"220, cyl");
225 ya->SetBinLabel(4,
"220, cyl");
226 xa->SetBinLabel(5,
"220, far, hor");
227 ya->SetBinLabel(5,
"220, far, hor");
228 xa->SetBinLabel(6,
"220, far, top");
229 ya->SetBinLabel(6,
"220, far, top");
230 xa->SetBinLabel(7,
"220, far, bot");
231 ya->SetBinLabel(7,
"220, far, bot");
235 xa = h_trackCorr_h->GetXaxis();
236 ya = h_trackCorr_h->GetYaxis();
237 xa->SetBinLabel(1,
"210, far, hor");
238 ya->SetBinLabel(1,
"210, far, hor");
239 xa->SetBinLabel(2,
"210, far, top");
240 ya->SetBinLabel(2,
"210, far, top");
241 xa->SetBinLabel(3,
"210, far, bot");
242 ya->SetBinLabel(3,
"210, far, bot");
243 xa->SetBinLabel(4,
"220, cyl");
244 ya->SetBinLabel(4,
"220, cyl");
245 xa->SetBinLabel(5,
"220, far, hor");
246 ya->SetBinLabel(5,
"220, far, hor");
247 xa->SetBinLabel(6,
"220, far, top");
248 ya->SetBinLabel(6,
"220, far, top");
249 xa->SetBinLabel(7,
"220, far, bot");
250 ya->SetBinLabel(7,
"220, far, bot");
254 h_proton_t = ibooker.book1D(
"proton t",
title +
";|t| GeV^{2}", 100, 0., 5.);
258 for (
const unsigned int rpDecId : {2, 3, 16, 23}) {
259 unsigned int st = rpDecId / 10, rp = rpDecId % 10, rpFullDecId =
id * 100 + rpDecId;
261 string stName, rpName;
264 rpName = stName +
"_" + rpName;
268 ibooker.book1D(rpName +
" - track x histogram",
title +
"/" + rpName +
";track x (mm)", 200, 0., 40.),
270 rpName +
" - track time histogram",
title +
"/" + rpName +
";track time (ns)", 100, -25., +50.)};
273 ibooker.book1D(rpName +
" - track x histogram",
title +
"/" + rpName +
";track x (mm)", 200, 0., 40.),
274 ibooker.book1D(rpName +
" - track y histogram",
title +
"/" + rpName +
";track y (mm)", 200, -20., +20.)};
283 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
304 for (
unsigned int arm = 0; arm < 2; arm++) {
327 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeCTPPSRecord > input not available.";
332 auto &
rpstate = *luminosityBlockCache(
event.getLuminosityBlock().index());
334 rpstate.reserve(CTPPSRecord::RomanPot::Last);
335 for (uint8_t
i = 0;
i < CTPPSRecord::RomanPot::Last; ++
i)
350 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeTracks > input not available.";
357 set<signed int> s_rp_idx_global_hor, s_rp_idx_global_vert;
358 map<unsigned int, set<signed int>> ms_rp_idx_arm;
360 for (
auto &tr : *hTracks) {
362 const unsigned int arm =
rpId.arm();
363 const unsigned int stNum =
rpId.station();
364 const unsigned int rpNum =
rpId.rp();
365 const unsigned int stRPNum = stNum * 10 + rpNum;
377 s_rp_idx_global_hor.insert(3 * arm +
idx);
392 s_rp_idx_global_vert.insert(4 * arm +
idx);
412 const signed int hor = ((rpNum == 2) || (rpNum == 3) || (rpNum == 6)) ? 1 : 0;
415 ms_rp_idx_arm[arm].insert(
idx * 10 + hor);
425 for (
const auto &idx1 : s_rp_idx_global_hor)
426 for (
const auto &idx2 : s_rp_idx_global_hor)
429 for (
const auto &idx1 : s_rp_idx_global_vert)
430 for (
const auto &idx2 : s_rp_idx_global_vert)
436 map<unsigned int, set<unsigned int>>
mTop, mHor, mBot;
438 for (
auto &tr : *hTracks) {
440 const unsigned int rpNum =
rpId.rp();
441 const unsigned int armIdx =
rpId.arm();
443 if (rpNum == 0 || rpNum == 4)
445 if (rpNum == 2 || rpNum == 3 || rpNum == 6)
446 mHor[armIdx].insert(
rpId);
447 if (rpNum == 1 || rpNum == 5)
448 mBot[armIdx].insert(
rpId);
451 unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
455 auto it = ap.trackingRPPlots.find(rpDecId);
456 if (it != ap.trackingRPPlots.end()) {
457 it->second.h_x->Fill(tr.x());
458 it->second.h_y->Fill(tr.y());
464 auto it = ap.timingRPPlots.find(rpDecId);
465 if (it != ap.timingRPPlots.end()) {
466 it->second.h_x->Fill(tr.x());
467 it->second.h_time->Fill(tr.time());
473 p.second.h_numRPWithTrack_top->Fill(
mTop[
p.first].size());
474 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first].size());
475 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first].size());
481 for (
const auto &ap : ms_rp_idx_arm) {
484 for (
const auto &idx1 : ap.second) {
485 for (
const auto &idx2 : ap.second) {
486 plots.h_trackCorr->Fill(idx1 / 10, idx2 / 10);
488 if ((idx1 % 10) != (idx2 % 10))
489 plots.h_trackCorr_overlap->Fill(idx1 / 10, idx2 / 10);
505 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeProtons > input not available.";
511 for (
auto &
p : *hRecoProtons) {
515 signed int armIndex = -1;
525 plots.h_proton_xi->Fill(
p.xi());
526 plots.h_proton_t->Fill(fabs(
p.t()));
527 plots.h_proton_time->Fill(
p.time());
535 return std::make_shared<std::vector<int>>();
541 auto const &
rpstate = *luminosityBlockCache(iLumi.
index());