466 "ERROR in TotemDQMModuleRP::analyze > some of the required inputs are not valid. Skipping this event.\n" 467 <<
" status.isValid = " << status.
isValid() <<
"\n" 468 <<
" digi.isValid = " << digi.
isValid() <<
"\n" 469 <<
" digCluster.isValid = " << digCluster.
isValid() <<
"\n" 470 <<
" hits.isValid = " << hits.
isValid() <<
"\n" 471 <<
" patterns.isValid = " << patterns.
isValid() <<
"\n" 472 <<
" tracks.isValid = " << tracks.
isValid();
485 for (
auto &ds1 : *tracks)
487 for (
auto &tr1 : ds1)
493 unsigned int arm1 = rpId1.
arm();
494 unsigned int stNum1 = rpId1.station();
495 unsigned int rpNum1 = rpId1.rp();
496 if (stNum1 != 0 || (rpNum1 != 2 && rpNum1 != 3))
498 unsigned int idx1 = arm1*2 + rpNum1-2;
500 for (
auto &ds2 : *tracks)
502 for (
auto &tr2 : ds2)
508 unsigned int arm2 = rpId2.
arm();
509 unsigned int stNum2 = rpId2.station();
510 unsigned int rpNum2 = rpId2.rp();
511 if (stNum2 != 0 || (rpNum2 != 2 && rpNum2 != 3))
513 unsigned int idx2 = arm2*2 + rpNum2-2;
524 for (
auto &ds : *status)
527 unsigned int plNum = detId.
plane();
536 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
537 plots.vfat_missing->Fill(plNum,
s.getChipPosition());
540 if (
s.isECProgressError() ||
s.isBCProgressError())
542 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
543 plots.vfat_ec_bc_error->Fill(plNum,
s.getChipPosition());
546 if (
s.isIDMismatch() ||
s.isFootprintError() ||
s.isCRCError())
548 plots.vfat_problem->Fill(plNum,
s.getChipPosition());
549 plots.vfat_corruption->Fill(plNum,
s.getChipPosition());
562 planePlots[detId].digi_profile_cumulative->Fill(dit->getStripNumber());
570 planePlots[detId].cluster_profile_cumulative->Fill(dit->getCenterStripPosition());
577 planePlots[detId].hit_multiplicity->Fill(it->size());
585 planePlots[detId].cluster_size->Fill(dit->getNumberOfStrips());
589 for (
auto &ds : *tracks)
600 for (
unsigned int plNum = 0; plNum < 10; ++plNum)
605 double ft_z = ft.getZ0();
606 double ft_x = ft.getX0() + ft.getTx() * (ft_z - rp_z);
607 double ft_y = ft.getY0() + ft.getTy() * (ft_z - rp_z);
609 double ft_v = geometry->
GlobalToLocal(plId, CLHEP::Hep3Vector(ft_x, ft_y, ft_z)).y();
611 bool hasMatchingHit =
false;
612 const auto &hit_ds_it = hits->find(plId);
613 if (hit_ds_it != hits->end())
615 for (
const auto &
h : *hit_ds_it)
617 bool match = (fabs(ft_v -
h.getPosition()) < 2.*0.066);
620 hasMatchingHit =
true;
628 pp.efficiency_den->Fill(ft_v);
630 pp.efficiency_num->Fill(ft_v);
640 map<unsigned int, set<unsigned int> > planes;
641 map<unsigned int, set<unsigned int> > planes_u;
642 map<unsigned int, set<unsigned int> > planes_v;
643 for (
const auto &ds : *hits)
649 unsigned int planeNum = detId.
plane();
652 planes[rpId].insert(planeNum);
653 if (detId.isStripsCoordinateUDirection())
654 planes_u[rpId].
insert(planeNum);
656 planes_v[rpId].insert(planeNum);
659 for (
const auto &ds : *status)
661 bool activity =
false;
662 for (
const auto &
s : ds)
664 if (
s.isNumberOfClustersSpecified() &&
s.getNumberOfClusters() > 0)
675 unsigned int planeNum = detId.
plane();
678 planes[rpId].insert(planeNum);
679 if (detId.isStripsCoordinateUDirection())
680 planes_u[rpId].
insert(planeNum);
682 planes_v[rpId].insert(planeNum);
686 for (std::map<unsigned int, PotPlots>::iterator it =
potPlots.begin(); it !=
potPlots.end(); it++)
688 it->second.activity->Fill(planes[it->first].size());
689 it->second.activity_u->Fill(planes_u[it->first].size());
690 it->second.activity_v->Fill(planes_v[it->first].size());
692 if (planes[it->first].size() >= 6)
694 it->second.activity_per_bx->Fill(
event.bunchCrossing());
695 it->second.activity_per_bx_short->Fill(
event.bunchCrossing());
702 unsigned int planeNum = detId.
plane();
707 pp.hit_plane_hist->Fill(planeNum, dit->getCenterStripPosition());
711 for (
auto &ds : *patterns)
718 unsigned int u = 0,
v = 0;
721 if (!
p.getFittable())
731 pp.patterns_u->Fill(u);
732 pp.patterns_v->Fill(
v);
739 auto &pp = it.second;
742 unsigned int pl_u = planes_u[rpId].size();
743 unsigned int pl_v = planes_v[rpId].size();
746 const auto &rp_pat_it = patterns->find(rpId);
748 unsigned int pat_u = 0, pat_v = 0;
749 if (rp_pat_it != patterns->end())
751 for (
auto &
p : *rp_pat_it)
753 if (!
p.getFittable())
767 if (pl_u == 0 && pl_v == 0) category = 0;
769 if (category == -1 && pat_u + pat_v <= 1)
777 if (pat_u == 1 && pat_v == 1) category = 2;
779 if (category == -1) category = 3;
781 pp.event_category->Fill(category);
785 for (
auto &ds : *tracks)
789 PotPlots &pp = potPlots[rpId];
797 unsigned int n_pl_in_fit_u = 0, n_pl_in_fit_v = 0;
798 for (
auto &hds : ft.getHits())
813 pp.h_planes_fit_u->Fill(n_pl_in_fit_u);
814 pp.h_planes_fit_v->Fill(n_pl_in_fit_v);
829 double x = ft.getX0() - rp_x;
830 double y = ft.getY0() - rp_y;
832 pp.trackHitsCumulativeHist->Fill(x, y);
834 double U = x * rod_U.x() + y * rod_U.y();
835 double V = x * rod_V.x() + y * rod_V.y();
837 pp.track_u_profile->Fill(U);
838 pp.track_v_profile->Fill(V);
849 map<unsigned int, unsigned int>
mTop, mHor, mBot;
858 for (
auto &ds : *tracks)
861 unsigned int rpNum = rpId.
rp();
869 if (rpNum == 0 || rpNum == 4)
871 if (rpNum == 2 || rpNum == 3)
873 if (rpNum == 1 || rpNum == 5)
878 for (
auto &
p : armPlots)
880 p.second.h_numRPWithTrack_top->Fill(mTop[
p.first]);
881 p.second.h_numRPWithTrack_hor->Fill(mHor[
p.first]);
882 p.second.h_numRPWithTrack_bot->Fill(mBot[
p.first]);
886 for (
auto &ds1 : *tracks)
888 for (
auto &tr1 : ds1)
894 unsigned int arm1 = rpId1.
arm();
895 unsigned int stNum1 = rpId1.station();
896 unsigned int rpNum1 = rpId1.rp();
897 unsigned int idx1 = stNum1/2 * 7 + rpNum1;
898 bool hor1 = (rpNum1 == 2 || rpNum1 == 3);
901 ArmPlots &ap = armPlots[armId];
903 for (
auto &ds2 : *tracks)
905 for (
auto &tr2 : ds2)
911 unsigned int arm2 = rpId2.
arm();
912 unsigned int stNum2 = rpId2.station();
913 unsigned int rpNum2 = rpId2.rp();
914 unsigned int idx2 = stNum2/2 * 7 + rpNum2;
915 bool hor2 = (rpNum2 == 2 || rpNum2 == 3);
920 ap.h_trackCorr->Fill(idx1, idx2);
923 ap.h_trackCorr_overlap->Fill(idx1, idx2);
Detector ID class for TOTEM Si strip detectors.
const DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
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
MonitorElement * events_per_bx
bool isStripsCoordinateUDirection() const
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tokenDigi
Event setup record containing the real (actual) geometry information.
CLHEP::Hep3Vector LocalToGlobalDirection(unsigned int id, const CLHEP::Hep3Vector &dir) const
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)
MonitorElement * events_per_bx_short
CLHEP::Hep3Vector GlobalToLocal(const DetGeomDesc *gd, const CLHEP::Hep3Vector &r) const
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster
CTPPSDetId getArmId() 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.
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus