111 vfat_problem = ibooker.
book2D(
"vfats with any problem",
title +
";plane;vfat index", 10, -0.5, 9.5, 4, -0.5, 3.5);
112 vfat_missing = ibooker.
book2D(
"vfats missing",
title +
";plane;vfat index", 10, -0.5, 9.5, 4, -0.5, 3.5);
114 ibooker.
book2D(
"vfats with EC or BC error",
title +
";plane;vfat index", 10, -0.5, 9.5, 4, -0.5, 3.5);
116 ibooker.
book2D(
"vfats with data corruption",
title +
";plane;vfat index", 10, -0.5, 9.5, 4, -0.5, 3.5);
118 activity = ibooker.
book1D(
"active planes",
title +
";number of active planes", 11, -0.5, 10.5);
119 activity_u = ibooker.
book1D(
"active planes U",
title +
";number of active U planes", 11, -0.5, 10.5);
120 activity_v = ibooker.
book1D(
"active planes V",
title +
";number of active V planes", 11, -0.5, 10.5);
122 activity_per_bx = ibooker.
book1D(
"activity per BX",
title +
";Event.BX", 4002, -1.5, 4000. + 0.5);
123 activity_per_bx_short = ibooker.
book1D(
"activity per BX (short)",
title +
";Event.BX", 102, -1.5, 100. + 0.5);
126 ibooker.
book2D(
"activity in planes (2D)",
title +
";plane number;strip number", 10, -0.5, 9.5, 32, -0.5, 511.5);
128 patterns_u = ibooker.
book1D(
"recognized patterns U",
title +
";number of recognized U patterns", 11, -0.5, 10.5);
129 patterns_v = ibooker.
book1D(
"recognized patterns V",
title +
";number of recognized V patterns", 11, -0.5, 10.5);
132 ibooker.
book1D(
"planes contributing to fit U",
title +
";number of planes contributing to U fit", 6, -0.5, 5.5);
134 ibooker.
book1D(
"planes contributing to fit V",
title +
";number of planes contributing to V fit", 6, -0.5, 5.5);
136 event_category = ibooker.
book1D(
"event category",
title +
";event category", 5, -0.5, 4.5);
137 TH1F *event_category_h = event_category->
getTH1F();
138 event_category_h->GetXaxis()->SetBinLabel(1,
"empty");
139 event_category_h->GetXaxis()->SetBinLabel(2,
"insufficient");
140 event_category_h->GetXaxis()->SetBinLabel(3,
"single-track");
141 event_category_h->GetXaxis()->SetBinLabel(4,
"multi-track");
142 event_category_h->GetXaxis()->SetBinLabel(5,
"shower");
144 trackHitsCumulativeHist =
145 ibooker.
book2D(
"track XY profile",
title +
";x (mm);y (mm)", 100, -18., +18., 100, -18., +18.);
147 track_u_profile = ibooker.
book1D(
"track profile U",
title +
"; U (mm)", 512, -256 * 66E-3, +256 * 66E-3);
148 track_v_profile = ibooker.
book1D(
"track profile V",
title +
"; V (mm)", 512, -256 * 66E-3, +256 * 66E-3);
150 triggerSectorUVCorrelation_all = ibooker.
book2D(
151 "trigger sector UV correlation (no cond)",
title +
";V sector;U sector", 16, -0.5, 15.5, 16, -0.5, 15.5);
152 triggerSectorUVCorrelation_mult2 = ibooker.
book2D(
153 "trigger sector UV correlation (max mult 2)",
title +
";V sector;U sector", 16, -0.5, 15.5, 16, -0.5, 15.5);
154 triggerSectorUVCorrelation_track = ibooker.
book2D(
155 "trigger sector UV correlation (track)",
title +
";V sector;U sector", 16, -0.5, 15.5, 16, -0.5, 15.5);
168 digi_profile_cumulative = ibooker.
book1D(
"digi profile",
title +
";strip number", 512, -0.5, 511.5);
169 cluster_profile_cumulative = ibooker.
book1D(
"cluster profile",
title +
";cluster center", 1024, -0.25, 511.75);
170 hit_multiplicity = ibooker.
book1D(
"hit multiplicity",
title +
";hits/detector/event", 6, -0.5, 5.5);
171 cluster_size = ibooker.
book1D(
"cluster size",
title +
";hits per cluster", 5, 0.5, 5.5);
173 efficiency_num = ibooker.
book1D(
"efficiency num",
title +
";track position (mm)", 30, -15., 0.);
174 efficiency_den = ibooker.
book1D(
"efficiency den",
title +
";track position (mm)", 30, -15., 0.);
181 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
205 for (
unsigned int arm : {0, 1}) {
207 for (
unsigned int st_rp : {2, 3, 4, 5, 24, 25}) {
208 const unsigned int st = st_rp / 10;
209 const unsigned int rp = st_rp % 10;
215 for (
unsigned int pl = 0; pl < 10; ++pl) {
260 <<
"ERROR in TotemDQMModuleRP::analyze > some of the required inputs are not valid. Skipping this event.\n" 261 <<
" status.isValid = " <<
status.isValid() <<
"\n" 262 <<
" digi.isValid = " << digi.
isValid() <<
"\n" 263 <<
" digCluster.isValid = " << digCluster.
isValid() <<
"\n" 264 <<
" hits.isValid = " <<
hits.isValid() <<
"\n" 265 <<
" patterns.isValid = " << patterns.
isValid() <<
"\n" 266 <<
" tracks.isValid = " <<
tracks.isValid();
275 for (
auto &ds : *
status) {
277 unsigned int plNum = detId.
plane();
283 auto &
plots = it->second;
287 plots.vfat_problem->Fill(plNum,
s.chipPosition());
288 plots.vfat_missing->Fill(plNum,
s.chipPosition());
291 if (
s.isECProgressError() ||
s.isBCProgressError()) {
292 plots.vfat_problem->Fill(plNum,
s.chipPosition());
293 plots.vfat_ec_bc_error->Fill(plNum,
s.chipPosition());
296 if (
s.isIDMismatch() ||
s.isFootprintError() ||
s.isCRCError()) {
297 plots.vfat_problem->Fill(plNum,
s.chipPosition());
298 plots.vfat_corruption->Fill(plNum,
s.chipPosition());
313 auto &
plots = plIt->second;
316 plots.digi_profile_cumulative->Fill(dit->stripNumber());
326 auto &
plots = plIt->second;
329 plots.hit_multiplicity->Fill(it->size());
333 plots.cluster_profile_cumulative->Fill(dit->centerStripPosition());
336 plots.cluster_size->Fill(dit->numberOfStrips());
341 for (
auto &ds : *
tracks) {
344 for (
auto &ft : ds) {
348 double rp_z =
geometry.rpTranslation(rpId).z();
350 for (
unsigned int plNum = 0; plNum < 10; ++plNum) {
357 auto &
plots = plIt->second;
359 double ft_z = ft.z0();
360 double ft_x = ft.x0() + ft.tx() * (ft_z - rp_z);
361 double ft_y = ft.y0() + ft.ty() * (ft_z - rp_z);
365 bool hasMatchingHit =
false;
366 const auto &hit_ds_it =
hits->find(plId);
367 if (hit_ds_it !=
hits->end()) {
368 for (
const auto &
h : *hit_ds_it) {
369 bool match = (fabs(ft_v -
h.position()) < 2. * 0.066);
371 hasMatchingHit =
true;
377 plots.efficiency_den->Fill(ft_v);
379 plots.efficiency_num->Fill(ft_v);
388 map<unsigned int, set<unsigned int>> planes;
389 map<unsigned int, set<unsigned int>> planes_u;
390 map<unsigned int, set<unsigned int>> planes_v;
391 for (
const auto &ds : *
hits) {
396 unsigned int planeNum = detId.
plane();
399 planes[rpId].insert(planeNum);
400 if (detId.isStripsCoordinateUDirection())
401 planes_u[rpId].
insert(planeNum);
403 planes_v[rpId].insert(planeNum);
406 for (
const auto &ds : *
status) {
407 bool activity =
false;
408 for (
const auto &
s : ds) {
409 if (
s.isNumberOfClustersSpecified() &&
s.numberOfClusters() > 0) {
419 unsigned int planeNum = detId.
plane();
422 planes[rpId].insert(planeNum);
423 if (detId.isStripsCoordinateUDirection())
424 planes_u[rpId].
insert(planeNum);
426 planes_v[rpId].insert(planeNum);
430 for (std::map<unsigned int, PotPlots>::iterator it =
potPlots.begin(); it !=
potPlots.end(); it++) {
431 it->second.activity->Fill(planes[it->first].size());
432 it->second.activity_u->Fill(planes_u[it->first].size());
433 it->second.activity_v->Fill(planes_v[it->first].size());
435 if (planes[it->first].size() >= 6) {
436 it->second.activity_per_bx->Fill(
event.bunchCrossing());
437 it->second.activity_per_bx_short->Fill(
event.bunchCrossing());
443 unsigned int planeNum = detId.
plane();
449 auto &
plots = plIt->second;
452 plots.hit_plane_hist->Fill(planeNum, dit->centerStripPosition());
456 for (
auto &ds : *patterns) {
462 auto &
plots = plIt->second;
465 unsigned int u = 0,
v = 0;
477 plots.patterns_u->Fill(u);
478 plots.patterns_v->Fill(
v);
484 auto &
pp = it.second;
487 unsigned int pl_u = planes_u[rpId].size();
488 unsigned int pl_v = planes_v[rpId].size();
491 const auto &rp_pat_it = patterns->find(rpId);
493 unsigned int pat_u = 0, pat_v = 0;
494 if (rp_pat_it != patterns->end()) {
495 for (
auto &
p : *rp_pat_it) {
510 if (pl_u == 0 && pl_v == 0)
513 if (
category == -1 && pat_u + pat_v <= 1) {
520 if (pat_u == 1 && pat_v == 1)
530 set<unsigned int> rps_with_tracks;
532 for (
auto &ds : *
tracks) {
535 rps_with_tracks.insert(rpId);
540 auto &
plots = plIt->second;
542 for (
auto &ft : ds) {
547 unsigned int n_pl_in_fit_u = 0, n_pl_in_fit_v = 0;
548 for (
auto &hds : ft.hits()) {
552 for (
auto &
h : hds) {
561 plots.h_planes_fit_u->Fill(n_pl_in_fit_u);
562 plots.h_planes_fit_v->Fill(n_pl_in_fit_v);
570 double rp_x = (
geometry.sensor(plId_V)->translation().x() +
geometry.sensor(plId_U)->translation().x()) / 2.;
571 double rp_y = (
geometry.sensor(plId_V)->translation().y() +
geometry.sensor(plId_U)->translation().y()) / 2.;
577 double x = ft.x0() - rp_x;
578 double y = ft.y0() - rp_y;
580 plots.trackHitsCumulativeHist->Fill(
x,
y);
582 double U =
x * rod_U.x() +
y * rod_U.y();
583 double V =
x * rod_V.x() +
y * rod_V.y();
585 plots.track_u_profile->Fill(
U);
586 plots.track_v_profile->Fill(
V);
591 map<unsigned int, map<unsigned int, map<unsigned int, unsigned int>>>
593 for (
const auto &
dp : *digi) {
596 unsigned int uvFlag = (plId.isStripsCoordinateUDirection()) ? 0 : 1;
599 for (
const auto &
d :
dp) {
600 unsigned int sector =
d.stripNumber() / 32;
605 triggerSectorMap[rpId][uvFlag][
sector]++;
608 for (
auto &rpp : triggerSectorMap) {
609 const unsigned int rpId = rpp.first;
613 set<unsigned int> triggerSectorsU;
614 for (
const auto sp : rpp.second[0]) {
616 triggerSectorsU.insert(sp.first);
619 set<unsigned int> triggerSectorsV;
620 for (
const auto sp : rpp.second[1]) {
622 triggerSectorsV.insert(sp.first);
628 auto &
plots = plIt->second;
630 const bool high_mult = (triggerSectorsU.size() > 2 && triggerSectorsV.size() > 2);
632 const bool has_track = (rps_with_tracks.find(rpId) != rps_with_tracks.end());
634 for (
const auto &secU : triggerSectorsU) {
635 for (
const auto &secV : triggerSectorsV) {
636 plots.triggerSectorUVCorrelation_all->Fill(secV, secU);
639 plots.triggerSectorUVCorrelation_mult2->Fill(secV, secU);
642 plots.triggerSectorUVCorrelation_track->Fill(secV, secU);
Detector ID class for TOTEM Si strip detectors.
MonitorElement * event_category
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * triggerSectorUVCorrelation_all
MonitorElement * cluster_profile_cumulative
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geometryToken_
MonitorElement * activity
MonitorElement * vfat_corruption
MonitorElement * cluster_size
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * h_planes_fit_u
MonitorElement * activity_per_bx
MonitorElement * triggerSectorUVCorrelation_track
MonitorElement * track_u_profile
DetGeomDesc::Translation Vector
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus
plots related to one RP plane
std::map< unsigned int, PlanePlots > planePlots
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * activity_v
MonitorElement * efficiency_den
MonitorElement * patterns_v
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
void rpName(std::string &name, NameFlag flag=nFull) const
~TotemRPDQMSource() override
MonitorElement * efficiency_num
#define DEFINE_FWK_MODULE(type)
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
MonitorElement * vfat_missing
MonitorElement * track_v_profile
MonitorElement * hit_multiplicity
MonitorElement * hit_plane_hist
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPattern
void planeName(std::string &name, NameFlag flag=nFull) const
virtual TH1F * getTH1F() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void setPlane(uint32_t det)
MonitorElement * patterns_u
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster
MonitorElement * activity_u
Base class for CTPPS detector IDs.
TotemRPDQMSource(const edm::ParameterSet &ps)
MonitorElement * vfat_ec_bc_error
edm::EDGetTokenT< edm::DetSetVector< TotemRPRecHit > > tokenRecHit
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack
MonitorElement * triggerSectorUVCorrelation_mult2
MonitorElement * vfat_problem
std::map< unsigned int, PotPlots > potPlots
bool isStripsCoordinateUDirection() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
MonitorElement * h_planes_fit_v
MonitorElement * digi_profile_cumulative
MonitorElement * activity_per_bx_short
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tokenDigi
Log< level::Error, true > LogProblem
MonitorElement * trackHitsCumulativeHist