77 MonitorElement *h_numRPWithTrack_top=
nullptr, *h_numRPWithTrack_hor=
nullptr, *h_numRPWithTrack_bot=
nullptr;
80 MonitorElement *h_proton_xi=
nullptr, *h_proton_t=
nullptr, *h_proton_time=
nullptr;
132 hist->SetCanExtend(TH1::kAllAxes);
133 TAxis* ya = hist->GetYaxis();
134 ya->SetBinLabel(1,
"45, 210, FR-BT");
135 ya->SetBinLabel(2,
"45, 210, FR-HR");
136 ya->SetBinLabel(3,
"45, 210, FR-TP");
137 ya->SetBinLabel(4,
"45, 220, C1");
138 ya->SetBinLabel(5,
"45, 220, FR-BT");
139 ya->SetBinLabel(6,
"45, 220, FR-HR");
140 ya->SetBinLabel(7,
"45, 220, FR-TP");
141 ya->SetBinLabel(8,
"45, 220, NR-BP");
142 ya->SetBinLabel(9,
"45, 220, NR-TP");
143 ya->SetBinLabel(10,
"56, 210, FR-BT");
144 ya->SetBinLabel(11,
"56, 210, FR-HR");
145 ya->SetBinLabel(12,
"56, 210, FR-TP");
146 ya->SetBinLabel(13,
"56, 220, C1");
147 ya->SetBinLabel(14,
"56, 220, FR-BT");
148 ya->SetBinLabel(15,
"56, 220, FR-HR");
149 ya->SetBinLabel(16,
"56, 220, FR-TP");
150 ya->SetBinLabel(17,
"56, 220, NR-BP");
151 ya->SetBinLabel(18,
"56, 220, NR-TP");
154 h_trackCorr_hor = ibooker.
book2D(
"track correlation hor",
"ctpps_common_rp_hor", 6, -0.5, 5.5, 6, -0.5, 5.5);
157 TAxis* xa = hist->GetXaxis(), *ya = hist->GetYaxis();
158 xa->SetBinLabel(1,
"45, 210, far"); ya->SetBinLabel(1,
"45, 210, far");
159 xa->SetBinLabel(2,
"45, 220, far"); ya->SetBinLabel(2,
"45, 220, far");
160 xa->SetBinLabel(3,
"45, 220, cyl"); ya->SetBinLabel(3,
"45, 220, cyl");
161 xa->SetBinLabel(4,
"56, 210, far"); ya->SetBinLabel(4,
"56, 210, far");
162 xa->SetBinLabel(5,
"56, 220, far"); ya->SetBinLabel(5,
"56, 220, far");
163 xa->SetBinLabel(6,
"56, 220, cyl"); ya->SetBinLabel(6,
"56, 220, cyl");
166 h_trackCorr_vert = ibooker.
book2D(
"track correlation vert",
"ctpps_common_rp_vert", 8, -0.5, 7.5, 8, -0.5, 7.5);
169 TAxis* xa = hist->GetXaxis(), *ya = hist->GetYaxis();
170 xa->SetBinLabel(1,
"45, 210, far, top"); ya->SetBinLabel(1,
"45, 210, far, top");
171 xa->SetBinLabel(2,
"45, 210, far, bot"); ya->SetBinLabel(2,
"45, 210, far, bot");
172 xa->SetBinLabel(3,
"45, 220, far, top"); ya->SetBinLabel(3,
"45, 220, far, top");
173 xa->SetBinLabel(4,
"45, 220, far, bot"); ya->SetBinLabel(4,
"45, 220, far, bot");
174 xa->SetBinLabel(5,
"56, 210, far, top"); ya->SetBinLabel(5,
"56, 210, far, top");
175 xa->SetBinLabel(6,
"56, 210, far, bot"); ya->SetBinLabel(6,
"56, 210, far, bot");
176 xa->SetBinLabel(7,
"56, 220, far, top"); ya->SetBinLabel(7,
"56, 220, far, top");
177 xa->SetBinLabel(8,
"56, 220, far, bot"); ya->SetBinLabel(8,
"56, 220, far, bot");
190 string title =
"ctpps_common_sector_" +
name;
196 h_trackCorr = ibooker.
book2D(
"track correlation", title, 7, -0.5, 6.5, 7, -0.5, 6.5);
198 TAxis *xa = h_trackCorr_h->GetXaxis(), *ya = h_trackCorr_h->GetYaxis();
199 xa->SetBinLabel( 1,
"210, far, hor"); ya->SetBinLabel( 1,
"210, far, hor");
200 xa->SetBinLabel( 2,
"210, far, top"); ya->SetBinLabel( 2,
"210, far, top");
201 xa->SetBinLabel( 3,
"210, far, bot"); ya->SetBinLabel( 3,
"210, far, bot");
202 xa->SetBinLabel( 4,
"220, cyl" ); ya->SetBinLabel( 4,
"220, cyl" );
203 xa->SetBinLabel( 5,
"220, far, hor"); ya->SetBinLabel( 5,
"220, far, hor");
204 xa->SetBinLabel( 6,
"220, far, top"); ya->SetBinLabel( 6,
"220, far, top");
205 xa->SetBinLabel( 7,
"220, far, bot"); ya->SetBinLabel( 7,
"220, far, bot");
209 xa = h_trackCorr_h->GetXaxis(); ya = h_trackCorr_h->GetYaxis();
210 xa->SetBinLabel( 1,
"210, far, hor"); ya->SetBinLabel( 1,
"210, far, hor");
211 xa->SetBinLabel( 2,
"210, far, top"); ya->SetBinLabel( 2,
"210, far, top");
212 xa->SetBinLabel( 3,
"210, far, bot"); ya->SetBinLabel( 3,
"210, far, bot");
213 xa->SetBinLabel( 4,
"220, cyl" ); ya->SetBinLabel( 4,
"220, cyl" );
214 xa->SetBinLabel( 5,
"220, far, hor"); ya->SetBinLabel( 5,
"220, far, hor");
215 xa->SetBinLabel( 6,
"220, far, top"); ya->SetBinLabel( 6,
"220, far, top");
216 xa->SetBinLabel( 7,
"220, far, bot"); ya->SetBinLabel( 7,
"220, far, bot");
222 for (
const unsigned int &rpDecId : { 2, 3, 16, 23 })
224 unsigned int st = rpDecId / 10, rp = rpDecId % 10, rpFullDecId =
id * 100 + rpDecId;
226 string stName, rpName;
229 rpName = stName +
"_" + rpName;
234 ibooker.
book1D(rpName +
" - track x histogram", title+
"/"+rpName+
";track x (mm)", 200, 0., 40.),
235 ibooker.
book1D(rpName +
" - track time histogram", title+
"/"+rpName+
";track time (ns)", 100, -25., +50.)
239 ibooker.
book1D(rpName +
" - track x histogram", title+
"/"+rpName+
";track x (mm)", 200, 0., 40.),
240 ibooker.
book1D(rpName +
" - track y histogram", title+
"/"+rpName+
";track y (mm)", 200, -20., +20.)
250 verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
274 for (
unsigned int arm = 0; arm < 2; arm++)
299 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeCTPPSRecord > input not available.";
307 rpstate.reserve(CTPPSRecord::RomanPot::Last);
308 for (uint8_t
i = 0;
i < CTPPSRecord::RomanPot::Last; ++
i)
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);
476 LogProblem(
"CTPPSCommonDQMSource") <<
"ERROR in CTPPSCommonDQMSource::analyzeProtons > input not available.";
482 for (
auto &
p : *hRecoProtons)
487 signed int armIndex = -1;
497 plots.h_proton_xi->Fill(
p.xi());
498 plots.h_proton_t->Fill(fabs(
p.t()));
499 plots.h_proton_time->Fill(
p.time());
507 return std::make_shared<std::vector<int>>();
514 auto const&
rpstate = *luminosityBlockCache(iLumi.
index());
LuminosityBlockID id() const
MonitorElement * h_proton_time
const edm::EDGetTokenT< std::vector< CTPPSLocalTrackLite > > tokenLocalTrackLite
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * h_proton_xi
LuminosityBlockIndex index() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::map< unsigned int, TimingRPPlots > timingRPPlots
Local (=single RP) track with essential information only.
MonitorElement * h_proton_t
~CTPPSCommonDQMSource() override
int bunchCrossing() const
const unsigned int verbosity
MonitorElement * h_trackCorr_hor
void globalEndLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &c) override
MonitorElement * h_trackCorr_overlap
CTPPSCommonDQMSource(const edm::ParameterSet &ps)
std::vector< int > rpstate
std::map< unsigned int, ArmPlots > armPlots
MonitorElement * h_numRPWithTrack_bot
void Init(DQMStore::IBooker &ibooker)
const edm::EDGetTokenT< std::vector< reco::ForwardProton > > tokenRecoProtons
#define DEFINE_FWK_MODULE(type)
MonitorElement * h_numRPWithTrack_top
MonitorElement * events_per_bx
void setCurrentFolder(std::string const &fullpath)
MonitorElement * events_per_bx_short
MonitorElement * book1D(Args &&...args)
void analyzeTracks(edm::Event const &event, edm::EventSetup const &eventSetup)
void rpName(std::string &name, NameFlag flag=nFull) const
MonitorElement * h_trackCorr_vert
LuminosityBlock const & getLuminosityBlock() const
void armName(std::string &name, NameFlag flag=nFull) const
std::shared_ptr< std::vector< int > > globalBeginLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &c) const override
plots related to the whole system
MonitorElement * h_trackCorr
std::map< unsigned int, TrackingRPPlots > trackingRPPlots
Status status(const uint8_t rp) const
Return the status of the given roman pot.
MonitorElement * book2D(Args &&...args)
LuminosityBlockNumber_t luminosityBlock() const
Base class for CTPPS detector IDs.
void analyzeProtons(edm::Event const &event, edm::EventSetup const &eventSetup)
Class to contain CTPPS information from soft FED 1022.
void analyzeCTPPSRecord(edm::Event const &event, edm::EventSetup const &eventSetup)
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
void stationName(std::string &name, NameFlag flag=nFull) const
const edm::EDGetTokenT< CTPPSRecord > ctppsRecordToken
MonitorElement * h_numRPWithTrack_hor