63 MonitorElement *h_numRPWithTrack_top=
nullptr, *h_numRPWithTrack_hor=
nullptr, *h_numRPWithTrack_bot=
nullptr;
89 h_trackCorr_hor = ibooker.
book2D(
"track correlation hor",
"ctpps_common_rp_hor", 6, -0.5, 5.5, 6, -0.5, 5.5);
92 TAxis* xa = hist->GetXaxis(), *ya = hist->GetYaxis();
93 xa->SetBinLabel(1,
"45, 210, far"); ya->SetBinLabel(1,
"45, 210, far");
94 xa->SetBinLabel(2,
"45, 220, far"); ya->SetBinLabel(2,
"45, 220, far");
95 xa->SetBinLabel(3,
"45, 220, cyl"); ya->SetBinLabel(3,
"45, 220, cyl");
96 xa->SetBinLabel(4,
"56, 210, far"); ya->SetBinLabel(4,
"56, 210, far");
97 xa->SetBinLabel(5,
"56, 220, far"); ya->SetBinLabel(5,
"56, 220, far");
98 xa->SetBinLabel(6,
"56, 220, cyl"); ya->SetBinLabel(6,
"56, 220, cyl");
101 h_trackCorr_vert = ibooker.
book2D(
"track correlation vert",
"ctpps_common_rp_vert", 8, -0.5, 7.5, 8, -0.5, 7.5);
104 TAxis* xa = hist->GetXaxis(), *ya = hist->GetYaxis();
105 xa->SetBinLabel(1,
"45, 210, far, top"); ya->SetBinLabel(1,
"45, 210, far, top");
106 xa->SetBinLabel(2,
"45, 210, far, bot"); ya->SetBinLabel(2,
"45, 210, far, bot");
107 xa->SetBinLabel(3,
"45, 220, far, top"); ya->SetBinLabel(3,
"45, 220, far, top");
108 xa->SetBinLabel(4,
"45, 220, far, bot"); ya->SetBinLabel(4,
"45, 220, far, bot");
109 xa->SetBinLabel(5,
"56, 210, far, top"); ya->SetBinLabel(5,
"56, 210, far, top");
110 xa->SetBinLabel(6,
"56, 210, far, bot"); ya->SetBinLabel(6,
"56, 210, far, bot");
111 xa->SetBinLabel(7,
"56, 220, far, top"); ya->SetBinLabel(7,
"56, 220, far, top");
112 xa->SetBinLabel(8,
"56, 220, far, bot"); ya->SetBinLabel(8,
"56, 220, far, bot");
125 string title =
"ctpps_common_sector_" +
name;
131 h_trackCorr = ibooker.
book2D(
"track correlation", title, 7, -0.5, 6.5, 7, -0.5, 6.5);
133 TAxis *xa = h_trackCorr_h->GetXaxis(), *ya = h_trackCorr_h->GetYaxis();
134 xa->SetBinLabel( 1,
"210, far, hor"); ya->SetBinLabel( 1,
"210, far, hor");
135 xa->SetBinLabel( 2,
"210, far, top"); ya->SetBinLabel( 2,
"210, far, top");
136 xa->SetBinLabel( 3,
"210, far, bot"); ya->SetBinLabel( 3,
"210, far, bot");
137 xa->SetBinLabel( 4,
"220, cyl" ); ya->SetBinLabel( 4,
"220, cyl" );
138 xa->SetBinLabel( 5,
"220, far, hor"); ya->SetBinLabel( 5,
"220, far, hor");
139 xa->SetBinLabel( 6,
"220, far, top"); ya->SetBinLabel( 6,
"220, far, top");
140 xa->SetBinLabel( 7,
"220, far, bot"); ya->SetBinLabel( 7,
"220, far, bot");
144 xa = h_trackCorr_h->GetXaxis(); ya = h_trackCorr_h->GetYaxis();
145 xa->SetBinLabel( 1,
"210, far, hor"); ya->SetBinLabel( 1,
"210, far, hor");
146 xa->SetBinLabel( 2,
"210, far, top"); ya->SetBinLabel( 2,
"210, far, top");
147 xa->SetBinLabel( 3,
"210, far, bot"); ya->SetBinLabel( 3,
"210, far, bot");
148 xa->SetBinLabel( 4,
"220, cyl" ); ya->SetBinLabel( 4,
"220, cyl" );
149 xa->SetBinLabel( 5,
"220, far, hor"); ya->SetBinLabel( 5,
"220, far, hor");
150 xa->SetBinLabel( 6,
"220, far, top"); ya->SetBinLabel( 6,
"220, far, top");
151 xa->SetBinLabel( 7,
"220, far, bot"); ya->SetBinLabel( 7,
"220, far, bot");
158 verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0))
177 for (
unsigned int arm = 0; arm < 2; arm++)
200 <<
" trackLites.isValid = " << tracks.
isValid();
208 set<signed int> s_rp_idx_global_hor, s_rp_idx_global_vert;
209 map<unsigned int, set<signed int>> ms_rp_idx_arm;
211 for (
auto &tr : *tracks)
214 const unsigned int arm = rpId.
arm();
215 const unsigned int stNum = rpId.station();
216 const unsigned int rpNum = rpId.rp();
217 const unsigned int stRPNum = stNum * 10 + rpNum;
221 if (stRPNum == 3) idx = 0;
222 if (stRPNum == 23) idx = 1;
223 if (stRPNum == 16) idx = 2;
226 s_rp_idx_global_hor.insert(3*arm + idx);
231 if (stRPNum == 4) idx = 0;
232 if (stRPNum == 5) idx = 1;
233 if (stRPNum == 24) idx = 2;
234 if (stRPNum == 25) idx = 3;
237 s_rp_idx_global_vert.insert(4*arm + idx);
242 if (stRPNum == 3) idx = 0;
243 if (stRPNum == 4) idx = 1;
244 if (stRPNum == 5) idx = 2;
245 if (stRPNum == 16) idx = 3;
246 if (stRPNum == 23) idx = 4;
247 if (stRPNum == 24) idx = 5;
248 if (stRPNum == 25) idx = 6;
250 const signed int hor = ((rpNum == 2) || (rpNum == 3) || (rpNum == 6)) ? 1 : 0;
253 ms_rp_idx_arm[arm].insert(idx * 10 + hor);
263 for (
const auto &idx1 : s_rp_idx_global_hor)
264 for (
const auto &idx2 : s_rp_idx_global_hor)
267 for (
const auto &idx1 : s_rp_idx_global_vert)
268 for (
const auto &idx2 : s_rp_idx_global_vert)
274 map<unsigned int, set<unsigned int>>
mTop, mHor, mBot;
276 for (
auto &tr : *tracks)
279 const unsigned int rpNum = rpId.
rp();
280 const unsigned int armIdx = rpId.arm();
282 if (rpNum == 0 || rpNum == 4)
283 mTop[armIdx].insert(rpId);
284 if (rpNum == 2 || rpNum == 3 || rpNum == 6)
285 mHor[armIdx].insert(rpId);
286 if (rpNum == 1 || rpNum == 5)
287 mBot[armIdx].insert(rpId);
292 p.second.h_numRPWithTrack_top->Fill(mTop[
p.first].size());
293 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first].size());
294 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first].size());
298 for (
const auto &ap : ms_rp_idx_arm)
300 auto &
plots = armPlots[ap.first];
302 for (
const auto &idx1 : ap.second)
304 for (
const auto &idx2 : ap.second)
306 plots.h_trackCorr->Fill(idx1/10, idx2/10);
308 if ((idx1 % 10) != (idx2 % 10))
309 plots.h_trackCorr_overlap->Fill(idx1/10, idx2/10);
T getParameter(std::string const &) const
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
MonitorElement * h_trackCorr_hor
MonitorElement * h_trackCorr_overlap
CTPPSCommonDQMSource(const edm::ParameterSet &ps)
std::map< unsigned int, ArmPlots > armPlots
MonitorElement * h_numRPWithTrack_bot
void Init(DQMStore::IBooker &ibooker)
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)
MonitorElement * book2D(Args &&...args)
Base class for CTPPS detector IDs.
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
MonitorElement * h_numRPWithTrack_hor