468 "ERROR in TotemDQMModuleRP::analyze > some of the required inputs are not valid. Skipping this event.\n" 469 <<
" status.isValid = " << status.
isValid() <<
"\n" 470 <<
" digi.isValid = " << digi.
isValid() <<
"\n" 471 <<
" digCluster.isValid = " << digCluster.
isValid() <<
"\n" 472 <<
" hits.isValid = " << hits.
isValid() <<
"\n" 473 <<
" patterns.isValid = " << patterns.
isValid() <<
"\n" 474 <<
" tracks.isValid = " << tracks.
isValid();
487 for (
auto &ds1 : *tracks)
489 for (
auto &tr1 : ds1)
495 unsigned int arm1 = rpId1.
arm();
496 unsigned int stNum1 = rpId1.station();
497 unsigned int rpNum1 = rpId1.rp();
498 if (stNum1 != 0 || (rpNum1 != 2 && rpNum1 != 3))
500 unsigned int idx1 = arm1*2 + rpNum1-2;
502 for (
auto &ds2 : *tracks)
504 for (
auto &tr2 : ds2)
510 unsigned int arm2 = rpId2.
arm();
511 unsigned int stNum2 = rpId2.station();
512 unsigned int rpNum2 = rpId2.rp();
513 if (stNum2 != 0 || (rpNum2 != 2 && rpNum2 != 3))
515 unsigned int idx2 = arm2*2 + rpNum2-2;
526 for (
auto &ds : *status)
529 unsigned int plNum = detId.
plane();
538 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
539 plots.vfat_missing->Fill(plNum,
s.getChipPosition());
542 if (
s.isECProgressError() ||
s.isBCProgressError())
544 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
545 plots.vfat_ec_bc_error->Fill(plNum,
s.getChipPosition());
548 if (
s.isIDMismatch() ||
s.isFootprintError() ||
s.isCRCError())
550 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
551 plots.vfat_corruption->Fill(plNum,
s.getChipPosition());
564 planePlots[detId].digi_profile_cumulative->Fill(dit->getStripNumber());
572 planePlots[detId].cluster_profile_cumulative->Fill(dit->getCenterStripPosition());
579 planePlots[detId].hit_multiplicity->Fill(it->size());
587 planePlots[detId].cluster_size->Fill(dit->getNumberOfStrips());
591 for (
auto &ds : *tracks)
602 for (
unsigned int plNum = 0; plNum < 10; ++plNum)
607 double ft_z = ft.getZ0();
608 double ft_x = ft.getX0() + ft.getTx() * (ft_z - rp_z);
609 double ft_y = ft.getY0() + ft.getTy() * (ft_z - rp_z);
611 double ft_v = geometry->
globalToLocal(plId, CLHEP::Hep3Vector(ft_x, ft_y, ft_z)).y();
613 bool hasMatchingHit =
false;
614 const auto &hit_ds_it = hits->find(plId);
615 if (hit_ds_it != hits->end())
617 for (
const auto &
h : *hit_ds_it)
619 bool match = (fabs(ft_v -
h.getPosition()) < 2.*0.066);
622 hasMatchingHit =
true;
630 pp.efficiency_den->Fill(ft_v);
632 pp.efficiency_num->Fill(ft_v);
642 map<unsigned int, set<unsigned int> > planes;
643 map<unsigned int, set<unsigned int> > planes_u;
644 map<unsigned int, set<unsigned int> > planes_v;
645 for (
const auto &ds : *hits)
651 unsigned int planeNum = detId.
plane();
654 planes[rpId].insert(planeNum);
655 if (detId.isStripsCoordinateUDirection())
656 planes_u[rpId].
insert(planeNum);
658 planes_v[rpId].insert(planeNum);
661 for (
const auto &ds : *status)
663 bool activity =
false;
664 for (
const auto &
s : ds)
666 if (
s.isNumberOfClustersSpecified() &&
s.getNumberOfClusters() > 0)
677 unsigned int planeNum = detId.
plane();
680 planes[rpId].insert(planeNum);
681 if (detId.isStripsCoordinateUDirection())
682 planes_u[rpId].
insert(planeNum);
684 planes_v[rpId].insert(planeNum);
688 for (std::map<unsigned int, PotPlots>::iterator it =
potPlots.begin(); it !=
potPlots.end(); it++)
690 it->second.activity->Fill(planes[it->first].size());
691 it->second.activity_u->Fill(planes_u[it->first].size());
692 it->second.activity_v->Fill(planes_v[it->first].size());
694 if (planes[it->first].size() >= 6)
696 it->second.activity_per_bx->Fill(
event.bunchCrossing());
697 it->second.activity_per_bx_short->Fill(
event.bunchCrossing());
704 unsigned int planeNum = detId.
plane();
709 pp.hit_plane_hist->Fill(planeNum, dit->getCenterStripPosition());
713 for (
auto &ds : *patterns)
720 unsigned int u = 0,
v = 0;
723 if (!
p.getFittable())
733 pp.patterns_u->Fill(u);
734 pp.patterns_v->Fill(
v);
741 auto &pp = it.second;
744 unsigned int pl_u = planes_u[rpId].size();
745 unsigned int pl_v = planes_v[rpId].size();
748 const auto &rp_pat_it = patterns->find(rpId);
750 unsigned int pat_u = 0, pat_v = 0;
751 if (rp_pat_it != patterns->end())
753 for (
auto &
p : *rp_pat_it)
755 if (!
p.getFittable())
769 if (pl_u == 0 && pl_v == 0) category = 0;
771 if (category == -1 && pat_u + pat_v <= 1)
779 if (pat_u == 1 && pat_v == 1) category = 2;
781 if (category == -1) category = 3;
783 pp.event_category->Fill(category);
787 for (
auto &ds : *tracks)
791 PotPlots &pp = potPlots[rpId];
799 unsigned int n_pl_in_fit_u = 0, n_pl_in_fit_v = 0;
800 for (
auto &hds : ft.getHits())
815 pp.h_planes_fit_u->Fill(n_pl_in_fit_u);
816 pp.h_planes_fit_v->Fill(n_pl_in_fit_v);
831 double x = ft.getX0() - rp_x;
832 double y = ft.getY0() - rp_y;
834 pp.trackHitsCumulativeHist->Fill(x, y);
836 double U = x * rod_U.x() + y * rod_U.y();
837 double V = x * rod_V.x() + y * rod_V.y();
839 pp.track_u_profile->Fill(U);
840 pp.track_v_profile->Fill(V);
851 map<unsigned int, unsigned int>
mTop, mHor, mBot;
860 for (
auto &ds : *tracks)
863 unsigned int rpNum = rpId.
rp();
871 if (rpNum == 0 || rpNum == 4)
873 if (rpNum == 2 || rpNum == 3)
875 if (rpNum == 1 || rpNum == 5)
880 for (
auto &
p : armPlots)
882 p.second.h_numRPWithTrack_top->Fill(mTop[
p.first]);
883 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first]);
884 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first]);
888 for (
auto &ds1 : *tracks)
890 for (
auto &tr1 : ds1)
896 unsigned int arm1 = rpId1.
arm();
897 unsigned int stNum1 = rpId1.station();
898 unsigned int rpNum1 = rpId1.rp();
899 unsigned int idx1 = stNum1/2 * 7 + rpNum1;
900 bool hor1 = (rpNum1 == 2 || rpNum1 == 3);
903 ArmPlots &ap = armPlots[armId];
905 for (
auto &ds2 : *tracks)
907 for (
auto &tr2 : ds2)
913 unsigned int arm2 = rpId2.
arm();
914 unsigned int stNum2 = rpId2.station();
915 unsigned int rpNum2 = rpId2.rp();
916 unsigned int idx2 = stNum2/2 * 7 + rpNum2;
917 bool hor2 = (rpNum2 == 2 || rpNum2 == 3);
922 ap.h_trackCorr->Fill(idx1, idx2);
925 ap.h_trackCorr_overlap->Fill(idx1, idx2);
Detector ID class for TOTEM Si strip detectors.
std::map< unsigned int, ArmPlots > armPlots
MonitorElement * events_per_bx
bool isStripsCoordinateUDirection() const
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tokenDigi
Event setup record containing the real (actual) geometry information.
const PhiMemoryImage patterns[9]
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
MonitorElement * h_trackCorr_hor
DDTranslation translation() const
CTPPSDetId getRPId() const
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
MonitorElement * events_per_bx_short
CLHEP::Hep3Vector getRPTranslation(unsigned int id) const
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster
CTPPSDetId getArmId() const
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