261 "ERROR in TotemDQMModuleRP::analyze > some of the required inputs are not valid. Skipping this event.\n" 262 <<
" status.isValid = " << status.
isValid() <<
"\n" 263 <<
" digi.isValid = " << digi.
isValid() <<
"\n" 264 <<
" digCluster.isValid = " << digCluster.
isValid() <<
"\n" 265 <<
" hits.isValid = " << hits.
isValid() <<
"\n" 266 <<
" patterns.isValid = " << patterns.
isValid() <<
"\n" 267 <<
" tracks.isValid = " << tracks.
isValid();
276 for (
auto &ds : *status)
279 unsigned int plNum = detId.
plane();
285 auto &
plots = it->second;
291 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
292 plots.vfat_missing->Fill(plNum,
s.getChipPosition());
295 if (
s.isECProgressError() ||
s.isBCProgressError())
297 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
298 plots.vfat_ec_bc_error->Fill(plNum,
s.getChipPosition());
301 if (
s.isIDMismatch() ||
s.isFootprintError() ||
s.isCRCError())
303 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
304 plots.vfat_corruption->Fill(plNum,
s.getChipPosition());
320 auto &
plots = plIt->second;
323 plots.digi_profile_cumulative->Fill(dit->getStripNumber());
334 auto &
plots = plIt->second;
337 plots.hit_multiplicity->Fill(it->size());
342 plots.cluster_profile_cumulative->Fill(dit->getCenterStripPosition());
345 plots.cluster_size->Fill(dit->getNumberOfStrips());
350 for (
auto &ds : *tracks)
361 for (
unsigned int plNum = 0; plNum < 10; ++plNum)
369 auto &
plots = plIt->second;
371 double ft_z = ft.getZ0();
372 double ft_x = ft.getX0() + ft.getTx() * (ft_z - rp_z);
373 double ft_y = ft.getY0() + ft.getTy() * (ft_z - rp_z);
375 double ft_v = geometry->
globalToLocal(plId, CLHEP::Hep3Vector(ft_x, ft_y, ft_z)).y();
377 bool hasMatchingHit =
false;
378 const auto &hit_ds_it = hits->find(plId);
379 if (hit_ds_it != hits->end())
381 for (
const auto &
h : *hit_ds_it)
383 bool match = (fabs(ft_v -
h.getPosition()) < 2.*0.066);
386 hasMatchingHit =
true;
392 plots.efficiency_den->Fill(ft_v);
394 plots.efficiency_num->Fill(ft_v);
404 map<unsigned int, set<unsigned int> > planes;
405 map<unsigned int, set<unsigned int> > planes_u;
406 map<unsigned int, set<unsigned int> > planes_v;
407 for (
const auto &ds : *hits)
413 unsigned int planeNum = detId.
plane();
416 planes[
rpId].insert(planeNum);
417 if (detId.isStripsCoordinateUDirection())
418 planes_u[rpId].
insert(planeNum);
420 planes_v[
rpId].insert(planeNum);
423 for (
const auto &ds : *status)
425 bool activity =
false;
426 for (
const auto &
s : ds)
428 if (
s.isNumberOfClustersSpecified() &&
s.getNumberOfClusters() > 0)
439 unsigned int planeNum = detId.
plane();
442 planes[
rpId].insert(planeNum);
443 if (detId.isStripsCoordinateUDirection())
444 planes_u[rpId].
insert(planeNum);
446 planes_v[
rpId].insert(planeNum);
450 for (std::map<unsigned int, PotPlots>::iterator it =
potPlots.begin(); it !=
potPlots.end(); it++)
452 it->second.activity->Fill(planes[it->first].size());
453 it->second.activity_u->Fill(planes_u[it->first].size());
454 it->second.activity_v->Fill(planes_v[it->first].size());
456 if (planes[it->first].size() >= 6)
458 it->second.activity_per_bx->Fill(
event.bunchCrossing());
459 it->second.activity_per_bx_short->Fill(
event.bunchCrossing());
466 unsigned int planeNum = detId.
plane();
472 auto &
plots = plIt->second;
475 plots.hit_plane_hist->Fill(planeNum, dit->getCenterStripPosition());
479 for (
auto &ds : *patterns)
486 auto &
plots = plIt->second;
489 unsigned int u = 0,
v = 0;
492 if (!
p.getFittable())
502 plots.patterns_u->Fill(u);
503 plots.patterns_v->Fill(
v);
510 auto &
pp = it.second;
513 unsigned int pl_u = planes_u[
rpId].size();
514 unsigned int pl_v = planes_v[
rpId].size();
517 const auto &rp_pat_it = patterns->find(rpId);
519 unsigned int pat_u = 0, pat_v = 0;
520 if (rp_pat_it != patterns->end())
522 for (
auto &
p : *rp_pat_it)
524 if (!
p.getFittable())
538 if (pl_u == 0 && pl_v == 0) category = 0;
540 if (category == -1 && pat_u + pat_v <= 1)
548 if (pat_u == 1 && pat_v == 1) category = 2;
550 if (category == -1) category = 3;
552 pp.event_category->Fill(category);
556 set<unsigned int> rps_with_tracks;
558 for (
auto &ds : *tracks)
562 rps_with_tracks.insert(rpId);
564 auto plIt = potPlots.find(rpId);
565 if (plIt == potPlots.end())
567 auto &
plots = plIt->second;
575 unsigned int n_pl_in_fit_u = 0, n_pl_in_fit_v = 0;
576 for (
auto &hds : ft.getHits())
591 plots.h_planes_fit_u->Fill(n_pl_in_fit_u);
592 plots.h_planes_fit_v->Fill(n_pl_in_fit_v);
607 double x = ft.getX0() - rp_x;
608 double y = ft.getY0() - rp_y;
610 plots.trackHitsCumulativeHist->Fill(x, y);
612 double U = x * rod_U.x() + y * rod_U.y();
613 double V = x * rod_V.x() + y * rod_V.y();
615 plots.track_u_profile->Fill(U);
616 plots.track_v_profile->Fill(V);
621 map<unsigned int, map<unsigned int, map<unsigned int, unsigned int>>> triggerSectorMap;
622 for (
const auto &dp : *digi)
628 set<unsigned int> sectors;
629 for (
const auto &
d : dp)
631 unsigned int sector =
d.getStripNumber() / 32;
632 sectors.insert(sector);
635 for (
const auto §or : sectors)
636 triggerSectorMap[
rpId][uvFlag][sector]++;
639 for (
auto &rpp : triggerSectorMap)
641 const unsigned int rpId = rpp.first;
645 set<unsigned int> triggerSectorsU;
646 for (
const auto sp : rpp.second[0])
649 triggerSectorsU.insert(sp.first);
652 set<unsigned int> triggerSectorsV;
653 for (
const auto sp : rpp.second[1])
656 triggerSectorsV.insert(sp.first);
659 auto plIt = potPlots.find(rpId);
660 if (plIt == potPlots.end())
662 auto &
plots = plIt->second;
664 const bool high_mult = (triggerSectorsU.size() > 2 && triggerSectorsV.size() > 2);
666 const bool has_track = (rps_with_tracks.find(rpId) != rps_with_tracks.end());
668 for (
const auto &secU : triggerSectorsU)
670 for (
const auto &secV : triggerSectorsV)
672 plots.triggerSectorUVCorrelation_all->Fill(secV, secU);
675 plots.triggerSectorUVCorrelation_mult2->Fill(secV, secU);
678 plots.triggerSectorUVCorrelation_track->Fill(secV, secU);
Detector ID class for TOTEM Si strip detectors.
Translation translation() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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
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.
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
CLHEP::Hep3Vector globalToLocal(const DetGeomDesc *, const CLHEP::Hep3Vector &) const
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus