74 MonitorElement *h_numRPWithTrack_top=
nullptr, *h_numRPWithTrack_hor=
nullptr, *h_numRPWithTrack_bot=
nullptr;
106 hist->SetCanExtend(TH1::kAllAxes);
107 TAxis* ya = hist->GetYaxis();
108 ya->SetBinLabel(1,
"45, 210, FR-BT");
109 ya->SetBinLabel(2,
"45, 210, FR-HR");
110 ya->SetBinLabel(3,
"45, 210, FR-TP");
111 ya->SetBinLabel(4,
"45, 220, C1");
112 ya->SetBinLabel(5,
"45, 220, FR-BT");
113 ya->SetBinLabel(6,
"45, 220, FR-HR");
114 ya->SetBinLabel(7,
"45, 220, FR-TP");
115 ya->SetBinLabel(8,
"45, 220, NR-BP");
116 ya->SetBinLabel(9,
"45, 220, NR-TP");
117 ya->SetBinLabel(10,
"56, 210, FR-BT");
118 ya->SetBinLabel(11,
"56, 210, FR-HR");
119 ya->SetBinLabel(12,
"56, 210, FR-TP");
120 ya->SetBinLabel(13,
"56, 220, C1");
121 ya->SetBinLabel(14,
"56, 220, FR-BT");
122 ya->SetBinLabel(15,
"56, 220, FR-HR");
123 ya->SetBinLabel(16,
"56, 220, FR-TP");
124 ya->SetBinLabel(17,
"56, 220, NR-BP");
125 ya->SetBinLabel(18,
"56, 220, NR-TP");
128 h_trackCorr_hor = ibooker.
book2D(
"track correlation hor",
"ctpps_common_rp_hor", 6, -0.5, 5.5, 6, -0.5, 5.5);
131 TAxis* xa = hist->GetXaxis(), *ya = hist->GetYaxis();
132 xa->SetBinLabel(1,
"45, 210, far"); ya->SetBinLabel(1,
"45, 210, far");
133 xa->SetBinLabel(2,
"45, 220, far"); ya->SetBinLabel(2,
"45, 220, far");
134 xa->SetBinLabel(3,
"45, 220, cyl"); ya->SetBinLabel(3,
"45, 220, cyl");
135 xa->SetBinLabel(4,
"56, 210, far"); ya->SetBinLabel(4,
"56, 210, far");
136 xa->SetBinLabel(5,
"56, 220, far"); ya->SetBinLabel(5,
"56, 220, far");
137 xa->SetBinLabel(6,
"56, 220, cyl"); ya->SetBinLabel(6,
"56, 220, cyl");
140 h_trackCorr_vert = ibooker.
book2D(
"track correlation vert",
"ctpps_common_rp_vert", 8, -0.5, 7.5, 8, -0.5, 7.5);
143 TAxis* xa = hist->GetXaxis(), *ya = hist->GetYaxis();
144 xa->SetBinLabel(1,
"45, 210, far, top"); ya->SetBinLabel(1,
"45, 210, far, top");
145 xa->SetBinLabel(2,
"45, 210, far, bot"); ya->SetBinLabel(2,
"45, 210, far, bot");
146 xa->SetBinLabel(3,
"45, 220, far, top"); ya->SetBinLabel(3,
"45, 220, far, top");
147 xa->SetBinLabel(4,
"45, 220, far, bot"); ya->SetBinLabel(4,
"45, 220, far, bot");
148 xa->SetBinLabel(5,
"56, 210, far, top"); ya->SetBinLabel(5,
"56, 210, far, top");
149 xa->SetBinLabel(6,
"56, 210, far, bot"); ya->SetBinLabel(6,
"56, 210, far, bot");
150 xa->SetBinLabel(7,
"56, 220, far, top"); ya->SetBinLabel(7,
"56, 220, far, top");
151 xa->SetBinLabel(8,
"56, 220, far, bot"); ya->SetBinLabel(8,
"56, 220, far, bot");
164 string title =
"ctpps_common_sector_" +
name;
170 h_trackCorr = ibooker.
book2D(
"track correlation", title, 7, -0.5, 6.5, 7, -0.5, 6.5);
172 TAxis *xa = h_trackCorr_h->GetXaxis(), *ya = h_trackCorr_h->GetYaxis();
173 xa->SetBinLabel( 1,
"210, far, hor"); ya->SetBinLabel( 1,
"210, far, hor");
174 xa->SetBinLabel( 2,
"210, far, top"); ya->SetBinLabel( 2,
"210, far, top");
175 xa->SetBinLabel( 3,
"210, far, bot"); ya->SetBinLabel( 3,
"210, far, bot");
176 xa->SetBinLabel( 4,
"220, cyl" ); ya->SetBinLabel( 4,
"220, cyl" );
177 xa->SetBinLabel( 5,
"220, far, hor"); ya->SetBinLabel( 5,
"220, far, hor");
178 xa->SetBinLabel( 6,
"220, far, top"); ya->SetBinLabel( 6,
"220, far, top");
179 xa->SetBinLabel( 7,
"220, far, bot"); ya->SetBinLabel( 7,
"220, far, bot");
183 xa = h_trackCorr_h->GetXaxis(); ya = h_trackCorr_h->GetYaxis();
184 xa->SetBinLabel( 1,
"210, far, hor"); ya->SetBinLabel( 1,
"210, far, hor");
185 xa->SetBinLabel( 2,
"210, far, top"); ya->SetBinLabel( 2,
"210, far, top");
186 xa->SetBinLabel( 3,
"210, far, bot"); ya->SetBinLabel( 3,
"210, far, bot");
187 xa->SetBinLabel( 4,
"220, cyl" ); ya->SetBinLabel( 4,
"220, cyl" );
188 xa->SetBinLabel( 5,
"220, far, hor"); ya->SetBinLabel( 5,
"220, far, hor");
189 xa->SetBinLabel( 6,
"220, far, top"); ya->SetBinLabel( 6,
"220, far, top");
190 xa->SetBinLabel( 7,
"220, far, bot"); ya->SetBinLabel( 7,
"220, far, bot");
197 verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0))
222 for (
unsigned int arm = 0; arm < 2; arm++)
267 for (uint8_t
i = 0;
i < CTPPSRecord::RomanPot::Last; ++
i) {
286 <<
" trackLites.isValid = " << tracks.
isValid();
294 set<signed int> s_rp_idx_global_hor, s_rp_idx_global_vert;
295 map<unsigned int, set<signed int>> ms_rp_idx_arm;
297 for (
auto &tr : *tracks)
300 const unsigned int arm = rpId.
arm();
301 const unsigned int stNum = rpId.station();
302 const unsigned int rpNum = rpId.rp();
303 const unsigned int stRPNum = stNum * 10 + rpNum;
307 if (stRPNum == 3) idx = 0;
308 if (stRPNum == 23) idx = 1;
309 if (stRPNum == 16) idx = 2;
312 s_rp_idx_global_hor.insert(3*arm + idx);
317 if (stRPNum == 4) idx = 0;
318 if (stRPNum == 5) idx = 1;
319 if (stRPNum == 24) idx = 2;
320 if (stRPNum == 25) idx = 3;
323 s_rp_idx_global_vert.insert(4*arm + idx);
328 if (stRPNum == 3) idx = 0;
329 if (stRPNum == 4) idx = 1;
330 if (stRPNum == 5) idx = 2;
331 if (stRPNum == 16) idx = 3;
332 if (stRPNum == 23) idx = 4;
333 if (stRPNum == 24) idx = 5;
334 if (stRPNum == 25) idx = 6;
336 const signed int hor = ((rpNum == 2) || (rpNum == 3) || (rpNum == 6)) ? 1 : 0;
339 ms_rp_idx_arm[arm].insert(idx * 10 + hor);
349 for (
const auto &idx1 : s_rp_idx_global_hor)
350 for (
const auto &idx2 : s_rp_idx_global_hor)
353 for (
const auto &idx1 : s_rp_idx_global_vert)
354 for (
const auto &idx2 : s_rp_idx_global_vert)
360 map<unsigned int, set<unsigned int>>
mTop, mHor, mBot;
362 for (
auto &tr : *tracks)
365 const unsigned int rpNum = rpId.
rp();
366 const unsigned int armIdx = rpId.arm();
368 if (rpNum == 0 || rpNum == 4)
369 mTop[armIdx].insert(rpId);
370 if (rpNum == 2 || rpNum == 3 || rpNum == 6)
371 mHor[armIdx].insert(rpId);
372 if (rpNum == 1 || rpNum == 5)
373 mBot[armIdx].insert(rpId);
378 p.second.h_numRPWithTrack_top->Fill(mTop[
p.first].size());
379 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first].size());
380 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first].size());
384 for (
const auto &ap : ms_rp_idx_arm)
386 auto &
plots = armPlots[ap.first];
388 for (
const auto &idx1 : ap.second)
390 for (
const auto &idx2 : ap.second)
392 plots.h_trackCorr->Fill(idx1/10, idx2/10);
394 if ((idx1 % 10) != (idx2 % 10))
395 plots.h_trackCorr_overlap->Fill(idx1/10, idx2/10);
LuminosityBlockID id() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< std::vector< CTPPSLocalTrackLite > > tokenLocalTrackLite
~CTPPSCommonDQMSource() override
int bunchCrossing() const
void beginLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &c) override
MonitorElement * h_trackCorr_hor
MonitorElement * h_trackCorr_overlap
CTPPSCommonDQMSource(const edm::ParameterSet &ps)
std::vector< int > rpstate
std::map< unsigned int, ArmPlots > armPlots
MonitorElement * h_numRPWithTrack_bot
LuminosityBlockNumber_t luminosityBlock() const
void Init(DQMStore::IBooker &ibooker)
static const int MAX_VBINS
edm::EDGetTokenT< CTPPSRecord > ctppsRecordToken
MonitorElement * h_numRPWithTrack_top
MonitorElement * events_per_bx
MonitorElement * events_per_bx_short
MonitorElement * book1D(Args &&...args)
MonitorElement * h_trackCorr_vert
void armName(std::string &name, NameFlag flag=nFull) const
plots related to the whole system
MonitorElement * h_trackCorr
void setCurrentFolder(const std::string &fullpath)
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 analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
void endLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &c) override
MonitorElement * h_numRPWithTrack_hor
static const int MAX_LUMIS