262 "ERROR in TotemDQMModuleRP::analyze > some of the required inputs are not valid. Skipping this event.\n" 263 <<
" status.isValid = " << status.
isValid() <<
"\n" 264 <<
" digi.isValid = " << digi.
isValid() <<
"\n" 265 <<
" digCluster.isValid = " << digCluster.
isValid() <<
"\n" 266 <<
" hits.isValid = " << hits.
isValid() <<
"\n" 267 <<
" patterns.isValid = " << patterns.
isValid() <<
"\n" 268 <<
" tracks.isValid = " << tracks.
isValid();
277 for (
auto &ds : *status)
280 unsigned int plNum = detId.
plane();
286 auto &
plots = it->second;
292 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
293 plots.vfat_missing->Fill(plNum,
s.getChipPosition());
296 if (
s.isECProgressError() ||
s.isBCProgressError())
298 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
299 plots.vfat_ec_bc_error->Fill(plNum,
s.getChipPosition());
302 if (
s.isIDMismatch() ||
s.isFootprintError() ||
s.isCRCError())
304 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
305 plots.vfat_corruption->Fill(plNum,
s.getChipPosition());
321 auto &
plots = plIt->second;
324 plots.digi_profile_cumulative->Fill(dit->getStripNumber());
335 auto &
plots = plIt->second;
338 plots.hit_multiplicity->Fill(it->size());
343 plots.cluster_profile_cumulative->Fill(dit->getCenterStripPosition());
346 plots.cluster_size->Fill(dit->getNumberOfStrips());
351 for (
auto &ds : *tracks)
362 for (
unsigned int plNum = 0; plNum < 10; ++plNum)
370 auto &
plots = plIt->second;
372 double ft_z = ft.getZ0();
373 double ft_x = ft.getX0() + ft.getTx() * (ft_z - rp_z);
374 double ft_y = ft.getY0() + ft.getTy() * (ft_z - rp_z);
376 double ft_v = geometry->
globalToLocal(plId, CLHEP::Hep3Vector(ft_x, ft_y, ft_z)).y();
378 bool hasMatchingHit =
false;
379 const auto &hit_ds_it = hits->find(plId);
380 if (hit_ds_it != hits->end())
382 for (
const auto &
h : *hit_ds_it)
384 bool match = (fabs(ft_v -
h.getPosition()) < 2.*0.066);
387 hasMatchingHit =
true;
393 plots.efficiency_den->Fill(ft_v);
395 plots.efficiency_num->Fill(ft_v);
405 map<unsigned int, set<unsigned int> > planes;
406 map<unsigned int, set<unsigned int> > planes_u;
407 map<unsigned int, set<unsigned int> > planes_v;
408 for (
const auto &ds : *hits)
414 unsigned int planeNum = detId.
plane();
417 planes[rpId].insert(planeNum);
418 if (detId.isStripsCoordinateUDirection())
419 planes_u[rpId].
insert(planeNum);
421 planes_v[rpId].insert(planeNum);
424 for (
const auto &ds : *status)
426 bool activity =
false;
427 for (
const auto &
s : ds)
429 if (
s.isNumberOfClustersSpecified() &&
s.getNumberOfClusters() > 0)
440 unsigned int planeNum = detId.
plane();
443 planes[rpId].insert(planeNum);
444 if (detId.isStripsCoordinateUDirection())
445 planes_u[rpId].
insert(planeNum);
447 planes_v[rpId].insert(planeNum);
451 for (std::map<unsigned int, PotPlots>::iterator it =
potPlots.begin(); it !=
potPlots.end(); it++)
453 it->second.activity->Fill(planes[it->first].size());
454 it->second.activity_u->Fill(planes_u[it->first].size());
455 it->second.activity_v->Fill(planes_v[it->first].size());
457 if (planes[it->first].size() >= 6)
459 it->second.activity_per_bx->Fill(
event.bunchCrossing());
460 it->second.activity_per_bx_short->Fill(
event.bunchCrossing());
467 unsigned int planeNum = detId.
plane();
473 auto &
plots = plIt->second;
476 plots.hit_plane_hist->Fill(planeNum, dit->getCenterStripPosition());
480 for (
auto &ds : *patterns)
487 auto &
plots = plIt->second;
490 unsigned int u = 0,
v = 0;
493 if (!
p.getFittable())
503 plots.patterns_u->Fill(u);
504 plots.patterns_v->Fill(
v);
511 auto &
pp = it.second;
514 unsigned int pl_u = planes_u[rpId].size();
515 unsigned int pl_v = planes_v[rpId].size();
518 const auto &rp_pat_it = patterns->find(rpId);
520 unsigned int pat_u = 0, pat_v = 0;
521 if (rp_pat_it != patterns->end())
523 for (
auto &
p : *rp_pat_it)
525 if (!
p.getFittable())
539 if (pl_u == 0 && pl_v == 0) category = 0;
541 if (category == -1 && pat_u + pat_v <= 1)
549 if (pat_u == 1 && pat_v == 1) category = 2;
551 if (category == -1) category = 3;
553 pp.event_category->Fill(category);
557 set<unsigned int> rps_with_tracks;
559 for (
auto &ds : *tracks)
563 rps_with_tracks.insert(rpId);
565 auto plIt = potPlots.find(rpId);
566 if (plIt == potPlots.end())
568 auto &
plots = plIt->second;
576 unsigned int n_pl_in_fit_u = 0, n_pl_in_fit_v = 0;
577 for (
auto &hds : ft.getHits())
592 plots.h_planes_fit_u->Fill(n_pl_in_fit_u);
593 plots.h_planes_fit_v->Fill(n_pl_in_fit_v);
608 double x = ft.getX0() - rp_x;
609 double y = ft.getY0() - rp_y;
611 plots.trackHitsCumulativeHist->Fill(x, y);
613 double U = x * rod_U.x() + y * rod_U.y();
614 double V = x * rod_V.x() + y * rod_V.y();
616 plots.track_u_profile->Fill(U);
617 plots.track_v_profile->Fill(V);
622 map<unsigned int, map<unsigned int, map<unsigned int, unsigned int>>> triggerSectorMap;
623 for (
const auto &
dp : *digi)
629 set<unsigned int> sectors;
630 for (
const auto &
d :
dp)
632 unsigned int sector =
d.getStripNumber() / 32;
633 sectors.insert(sector);
636 for (
const auto §or : sectors)
637 triggerSectorMap[rpId][uvFlag][sector]++;
640 for (
auto &rpp : triggerSectorMap)
642 const unsigned int rpId = rpp.first;
646 set<unsigned int> triggerSectorsU;
647 for (
const auto sp : rpp.second[0])
650 triggerSectorsU.insert(sp.first);
653 set<unsigned int> triggerSectorsV;
654 for (
const auto sp : rpp.second[1])
657 triggerSectorsV.insert(sp.first);
660 auto plIt = potPlots.find(rpId);
661 if (plIt == potPlots.end())
663 auto &
plots = plIt->second;
665 const bool high_mult = (triggerSectorsU.size() > 2 && triggerSectorsV.size() > 2);
667 const bool has_track = (rps_with_tracks.find(rpId) != rps_with_tracks.end());
669 for (
const auto &secU : triggerSectorsU)
671 for (
const auto &secV : triggerSectorsV)
673 plots.triggerSectorUVCorrelation_all->Fill(secV, secU);
676 plots.triggerSectorUVCorrelation_mult2->Fill(secV, secU);
679 plots.triggerSectorUVCorrelation_track->Fill(secV, secU);
Detector ID class for TOTEM Si strip detectors.
bool isStripsCoordinateUDirection() const
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tokenDigi
Event setup record containing the real (actual) geometry information.
std::map< unsigned int, PlanePlots > planePlots
edm::EDGetTokenT< edm::DetSetVector< TotemRPRecHit > > tokenRecHit
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPattern
DDTranslation translation() const
CTPPSDetId getRPId() const
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
CLHEP::Hep3Vector getRPTranslation(unsigned int id) const
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster
CLHEP::Hep3Vector localToGlobalDirection(unsigned int id, const CLHEP::Hep3Vector &) const
void setPlane(uint32_t det)
Base class for CTPPS detector IDs.
ESHandle< TrackerGeometry > geometry
std::map< unsigned int, PotPlots > potPlots
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
CLHEP::Hep3Vector globalToLocal(const DetGeomDesc *, const CLHEP::Hep3Vector &) const
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus