53 std::array<unsigned int, 4>
rpIds;
59 std::array<std::array<MonitorElement *, 4>, 4>
v_h_y;
107 bool diag = (top45 != top56);
109 string name =
string((diag) ?
"diagonal" :
"antidiagonal") +
" 45" + ((top45) ?
"top" :
"bot") +
" - 56" +
110 ((top56) ?
"top" :
"bot");
123 h2_track_corr_vert = ibooker.
book2D(
"track correlation in verticals",
title +
";;", 4, -0.5, 3.5, 4, -0.5, 3.5);
124 TH2F *h2 = h2_track_corr_vert->
getTH2F();
125 TAxis *xa = h2->GetXaxis(), *ya = h2->GetYaxis();
126 for (
unsigned int i = 0;
i < 4;
i++) {
129 rpName = rpName.substr(15);
131 xa->SetBinLabel(
i + 1, rpName.c_str());
132 ya->SetBinLabel(
i + 1, rpName.c_str());
135 h_rate_vs_time_dgn_4rp =
136 ibooker.
book1D(
"rate - 4 RPs",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
137 h_rate_vs_time_dgn_2rp = ibooker.
book1D(
138 "rate - 2 RPs (220-fr)",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
140 for (
unsigned int i = 0;
i < 4;
i++) {
143 rpName = rpName.substr(15);
147 v_h2_y_vs_x_dgn_4rp[
i] = ibooker.
book2D(
148 "xy hist - " + rpName +
" - 4 RPs cond",
title +
";x (mm);y (mm)", 100, -18., +18., 100, -18., +18.);
149 v_h2_y_vs_x_dgn_2rp[
i] = ibooker.
book2D(
150 "xy hist - " + rpName +
" - 2 RPs cond",
title +
";x (mm);y (mm)", 100, -18., +18., 100, -18., +18.);
154 for (
unsigned int j = 0;
j < 4;
j++) {
157 rpCoincName = rpCoincName.substr(15);
160 ibooker.
book1D(
"y hist - " + rpName +
" - coinc " + rpCoincName,
title +
";y (mm)", 180, -18., +18.);
175 h_rate_vs_time_suff =
176 ibooker.
book1D(
"rate - suff",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
177 h_rate_vs_time_track =
178 ibooker.
book1D(
"rate - track",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
179 h_rate_vs_time_unresolved =
180 ibooker.
book1D(
"rate - unresolved",
title +
";lumi section", ls_max - ls_min + 1, -0.5 + ls_min, +0.5 + ls_max);
187 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)) {
210 for (
unsigned int arm = 0;
arm < 2;
arm++) {
212 for (
unsigned int st : {0, 2}) {
214 for (
unsigned int rp : {4, 5}) {
243 LogProblem(
"ElasticPlotDQMSource") <<
"ERROR in ElasticPlotDQMSource::analyze > some of the required inputs are " 244 "not valid. Skipping this event.\n" 245 <<
" hits.isValid = " <<
hits.isValid() <<
"\n" 246 <<
" patterns.isValid = " << patterns.
isValid() <<
"\n" 247 <<
" tracks.isValid = " <<
tracks.isValid();
255 map<unsigned int, unsigned int> rp_planes_u_too_full, rp_planes_v_too_full;
256 map<unsigned int, bool> rp_pat_suff;
257 map<unsigned int, const TotemRPLocalTrack *> rp_track;
259 for (
const auto &ds : *
hits) {
264 if (
detId.isStripsCoordinateUDirection())
265 rp_planes_u_too_full[
rpId]++;
267 rp_planes_v_too_full[
rpId]++;
271 for (
auto &ds : *patterns) {
275 unsigned int n_pat_u = 0, n_pat_v = 0;
287 (n_pat_u > 0 || rp_planes_u_too_full[
rpId] >= 3) && (n_pat_v > 0 || rp_planes_v_too_full[
rpId] >= 3);
290 for (
auto &ds : *
tracks) {
294 for (
auto &ft : ds) {
308 auto &
dp = dpp.second;
311 bool cond_4rp =
true, cond_2rp =
true;
312 for (
unsigned int i = 0;
i < 4;
i++) {
313 if (rp_track[
dp.rpIds[
i]] ==
nullptr)
316 if ((
i == 0 ||
i == 3) && rp_track[
dp.rpIds[
i]] ==
nullptr)
326 for (
unsigned int i = 0;
i < 4;
i++) {
333 dp.v_h2_y_vs_x_dgn_4rp[
i]->Fill(tr_i->
x0(), tr_i->
y0());
336 dp.v_h2_y_vs_x_dgn_2rp[
i]->Fill(tr_i->
x0(), tr_i->
y0());
338 for (
unsigned int j = 0;
j < 4;
j++) {
339 if (rp_track[
dp.rpIds[
j]] ==
nullptr)
342 dp.h2_track_corr_vert->Fill(
i,
j);
344 dp.v_h_y[
i][
j]->Fill(tr_i->
y0());
352 for (
const auto &
p : rp_pat_suff) {
353 const auto &
rpId =
p.first;
357 auto &
pp = pp_it->second;
359 const auto &pat_suff = rp_pat_suff[
rpId];
360 const auto &has_track = (rp_track[
rpId] !=
nullptr);
366 if (pat_suff && !has_track)
Detector ID class for TOTEM Si strip detectors.
edm::EDGetTokenT< edm::DetSetVector< TotemRPRecHit > > tokenRecHit
ElasticPlotDQMSource(const edm::ParameterSet &ps)
MonitorElement * h_rate_vs_time_suff
MonitorElement * h_rate_vs_time_unresolved
virtual void setCurrentFolder(std::string const &fullpath)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
static constexpr double ls_duration_inverse
MonitorElement * h_rate_vs_time_dgn_2rp
A track fit through a single RP.
T getUntrackedParameter(std::string const &, T const &) const
std::array< unsigned int, 4 > rpIds
virtual TH2F * getTH2F() const
MonitorElement * h_rate_vs_time_track
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
void rpName(std::string &name, NameFlag flag=nFull) const
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPattern
std::array< std::array< MonitorElement *, 4 >, 4 > v_h_y
std::map< unsigned int, PotPlots > potPlots
#define DEFINE_FWK_MODULE(type)
~ElasticPlotDQMSource() override
std::map< unsigned int, DiagonalPlots > diagonalPlots
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
static constexpr unsigned int ls_min
std::array< MonitorElement *, 4 > v_h2_y_vs_x_dgn_4rp
Base class for CTPPS detector IDs.
static constexpr unsigned int ls_max
std::array< MonitorElement *, 4 > v_h2_y_vs_x_dgn_2rp
MonitorElement * h_rate_vs_time_dgn_4rp
plots related to one (anti)diagonal
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * h2_track_corr_vert
Log< level::Error, true > LogProblem