453 "ERROR in TotemDQMModuleRP::analyze > some of the required inputs are not valid. Skipping this event.\n" 454 <<
" status.isValid = " << status.
isValid() <<
"\n" 455 <<
" digi.isValid = " << digi.
isValid() <<
"\n" 456 <<
" digCluster.isValid = " << digCluster.
isValid() <<
"\n" 457 <<
" hits.isValid = " << hits.
isValid() <<
"\n" 458 <<
" patterns.isValid = " << patterns.
isValid() <<
"\n" 459 <<
" tracks.isValid = " << tracks.
isValid();
472 for (
auto &ds1 : *tracks)
474 for (
auto &tr1 : ds1)
479 unsigned int rpId1 = ds1.detId();
480 unsigned int arm1 = rpId1 / 100;
481 unsigned int stNum1 = (rpId1 / 10) % 10;
482 unsigned int rpNum1 = rpId1 % 10;
483 if (stNum1 != 0 || (rpNum1 != 2 && rpNum1 != 3))
485 unsigned int idx1 = arm1*2 + rpNum1-2;
487 for (
auto &ds2 : *tracks)
489 for (
auto &tr2 : ds2)
494 unsigned int rpId2 = ds2.detId();
495 unsigned int arm2 = rpId2 / 100;
496 unsigned int stNum2 = (rpId2 / 10) % 10;
497 unsigned int rpNum2 = rpId2 % 10;
498 if (stNum2 != 0 || (rpNum2 != 2 && rpNum2 != 3))
500 unsigned int idx2 = arm2*2 + rpNum2-2;
511 for (
auto &ds : *status)
514 unsigned int plNum = detId.
plane();
523 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
524 plots.vfat_missing->Fill(plNum,
s.getChipPosition());
527 if (
s.isECProgressError() ||
s.isBCProgressError())
529 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
530 plots.vfat_ec_bc_error->Fill(plNum,
s.getChipPosition());
533 if (
s.isIDMismatch() ||
s.isFootprintError() ||
s.isCRCError())
535 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
536 plots.vfat_corruption->Fill(plNum,
s.getChipPosition());
549 planePlots[detId].digi_profile_cumulative->Fill(dit->getStripNumber());
557 planePlots[detId].cluster_profile_cumulative->Fill(dit->getCenterStripPosition());
564 planePlots[detId].hit_multiplicity->Fill(it->size());
572 planePlots[detId].cluster_size->Fill(dit->getNumberOfStrips());
576 for (
auto &ds : *tracks)
578 unsigned int rpDecId = ds.detId();
579 unsigned int armIdx = rpDecId / 100;
580 unsigned int stIdx = (rpDecId / 10) % 10;
581 unsigned int rpIdx = rpDecId % 10;
591 for (
unsigned int plNum = 0; plNum < 10; ++plNum)
595 double ft_z = ft.getZ0();
596 double ft_x = ft.getX0() + ft.getTx() * (ft_z - rp_z);
597 double ft_y = ft.getY0() + ft.getTy() * (ft_z - rp_z);
599 double ft_v = geometry->
GlobalToLocal(plId, CLHEP::Hep3Vector(ft_x, ft_y, ft_z)).y();
601 bool hasMatchingHit =
false;
602 const auto &hit_ds_it = hits->find(plId);
603 if (hit_ds_it != hits->end())
605 for (
const auto &
h : *hit_ds_it)
607 bool match = (fabs(ft_v -
h.getPosition()) < 2.*0.066);
610 hasMatchingHit =
true;
618 pp.efficiency_den->Fill(ft_v);
620 pp.efficiency_num->Fill(ft_v);
630 map<unsigned int, set<unsigned int> > planes;
631 map<unsigned int, set<unsigned int> > planes_u;
632 map<unsigned int, set<unsigned int> > planes_v;
633 for (
const auto &ds : *hits)
639 unsigned int planeNum = detId.
plane();
642 planes[rpId].insert(planeNum);
643 if (detId.isStripsCoordinateUDirection())
644 planes_u[rpId].
insert(planeNum);
646 planes_v[rpId].insert(planeNum);
649 for (
const auto &ds : *status)
651 bool activity =
false;
652 for (
const auto &
s : ds)
654 if (
s.isNumberOfClustersSpecified() &&
s.getNumberOfClusters() > 0)
665 unsigned int planeNum = detId.
plane();
668 planes[rpId].insert(planeNum);
669 if (detId.isStripsCoordinateUDirection())
670 planes_u[rpId].
insert(planeNum);
672 planes_v[rpId].insert(planeNum);
676 for (std::map<unsigned int, PotPlots>::iterator it =
potPlots.begin(); it !=
potPlots.end(); it++)
678 it->second.activity->Fill(planes[it->first].size());
679 it->second.activity_u->Fill(planes_u[it->first].size());
680 it->second.activity_v->Fill(planes_v[it->first].size());
682 if (planes[it->first].size() >= 6)
684 it->second.activity_per_bx->Fill(
event.bunchCrossing());
685 it->second.activity_per_bx_short->Fill(
event.bunchCrossing());
692 unsigned int planeNum = detId.
plane();
697 pp.hit_plane_hist->Fill(planeNum, dit->getCenterStripPosition());
701 for (
auto &ds : *patterns)
703 unsigned int rpDecId = ds.detId();
704 unsigned int armIdx = rpDecId / 100;
705 unsigned int stIdx = (rpDecId / 10) % 10;
706 unsigned int rpIdx = rpDecId % 10;
712 unsigned int u = 0,
v = 0;
715 if (!
p.getFittable())
725 pp.patterns_u->Fill(u);
726 pp.patterns_v->Fill(
v);
733 auto &pp = it.second;
736 unsigned int pl_u = planes_u[rpId].size();
737 unsigned int pl_v = planes_v[rpId].size();
740 unsigned int rpDecId = rpId.getRPDecimalId();
741 const auto &rp_pat_it = patterns->find(rpDecId);
743 unsigned int pat_u = 0, pat_v = 0;
744 if (rp_pat_it != patterns->end())
746 for (
auto &
p : *rp_pat_it)
748 if (!
p.getFittable())
762 if (pl_u == 0 && pl_v == 0) category = 0;
764 if (category == -1 && pat_u + pat_v <= 1)
772 if (pat_u == 1 && pat_v == 1) category = 2;
774 if (category == -1) category = 3;
776 pp.event_category->Fill(category);
780 for (
auto &ds : *tracks)
782 unsigned int rpDecId = ds.detId();
783 unsigned int armIdx = rpDecId / 100;
784 unsigned int stIdx = (rpDecId / 10) % 10;
785 unsigned int rpIdx = rpDecId % 10;
788 PotPlots &pp = potPlots[rpId];
796 unsigned int n_pl_in_fit_u = 0, n_pl_in_fit_v = 0;
797 for (
auto &hds : ft.getHits())
812 pp.h_planes_fit_u->Fill(n_pl_in_fit_u);
813 pp.h_planes_fit_v->Fill(n_pl_in_fit_v);
828 double x = ft.getX0() - rp_x;
829 double y = ft.getY0() - rp_y;
831 pp.trackHitsCumulativeHist->Fill(x, y);
833 double U = x * rod_U.x() + y * rod_U.y();
834 double V = x * rod_V.x() + y * rod_V.y();
836 pp.track_u_profile->Fill(U);
837 pp.track_v_profile->Fill(V);
848 map<unsigned int, unsigned int>
mTop, mHor, mBot;
857 for (
auto &ds : *tracks)
859 unsigned int rpDecId = ds.detId();
860 unsigned int armIdx = rpDecId / 100;
861 unsigned int stIdx = (rpDecId / 10) % 10;
862 unsigned int rpIdx = rpDecId % 10;
865 unsigned int rpNum = rpId.
rp();
874 if (rpNum == 0 || rpNum == 4)
876 if (rpNum == 2 || rpNum == 3)
878 if (rpNum == 1 || rpNum == 5)
883 for (
auto &
p : armPlots)
885 p.second.h_numRPWithTrack_top->Fill(mTop[
p.first]);
886 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first]);
887 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first]);
891 for (
auto &ds1 : *tracks)
893 for (
auto &tr1 : ds1)
898 unsigned int rpDecId1 = ds1.detId();
899 unsigned int arm1 = rpDecId1 / 100;
900 unsigned int stNum1 = (rpDecId1 / 10) % 10;
901 unsigned int rpNum1 = rpDecId1 % 10;
902 unsigned int idx1 = stNum1/2 * 7 + rpNum1;
903 bool hor1 = (rpNum1 == 2 || rpNum1 == 3);
906 ArmPlots &ap = armPlots[armId];
908 for (
auto &ds2 : *tracks)
910 for (
auto &tr2 : ds2)
915 unsigned int rpDecId2 = ds2.detId();
916 unsigned int arm2 = rpDecId2 / 100;
917 unsigned int stNum2 = (rpDecId2 / 10) % 10;
918 unsigned int rpNum2 = rpDecId2 % 10;
919 unsigned int idx2 = stNum2/2 * 7 + rpNum2;
920 bool hor2 = (rpNum2 == 2 || rpNum2 == 3);
925 ap.h_trackCorr->Fill(idx1, idx2);
928 ap.h_trackCorr_overlap->Fill(idx1, idx2);
Detector ID class for TOTEM Si strip detectors.
CLHEP::Hep3Vector GetRPGlobalTranslation(int copy_no) const
position of a RP package (translation z corresponds to the first plane - TODO check it) ...
std::map< unsigned int, ArmPlots > armPlots
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
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
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)
CLHEP::Hep3Vector GlobalToLocal(DetGeomDesc *gd, const CLHEP::Hep3Vector r) const
MonitorElement * events_per_bx_short
CLHEP::Hep3Vector LocalToGlobalDirection(unsigned int id, const CLHEP::Hep3Vector dir) const
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster
CTPPSDetId getArmId() const
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.
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus