CMS 3D CMS Logo

CSCStubMatcher.h
Go to the documentation of this file.
1 #ifndef Validation_MuonCSCDigis_CSCStubMatcher_h
2 #define Validation_MuonCSCDigis_CSCStubMatcher_h
3 
13 
17 
18 typedef std::vector<CSCALCTDigi> CSCALCTDigiContainer;
19 typedef std::vector<CSCCLCTDigi> CSCCLCTDigiContainer;
20 typedef std::vector<CSCCorrelatedLCTDigi> CSCCorrelatedLCTDigiContainer;
21 
23 public:
25 
27 
29  void init(const edm::Event& e, const edm::EventSetup& eventSetup);
30 
32  void match(const SimTrack& t, const SimVertex& v);
33 
35  std::set<unsigned int> chamberIdsAllCLCT(int csc_type = MuonHitHelper::CSC_ALL) const;
36  std::set<unsigned int> chamberIdsAllALCT(int csc_type = MuonHitHelper::CSC_ALL) const;
37  std::set<unsigned int> chamberIdsAllLCT(int csc_type = MuonHitHelper::CSC_ALL) const;
38  std::set<unsigned int> chamberIdsAllMPLCT(int csc_type = MuonHitHelper::CSC_ALL) const;
39 
41  std::set<unsigned int> chamberIdsCLCT(int csc_type = MuonHitHelper::CSC_ALL) const;
42  std::set<unsigned int> chamberIdsALCT(int csc_type = MuonHitHelper::CSC_ALL) const;
43  std::set<unsigned int> chamberIdsLCT(int csc_type = MuonHitHelper::CSC_ALL) const;
44  std::set<unsigned int> chamberIdsMPLCT(int csc_type = MuonHitHelper::CSC_ALL) const;
45 
47  const CSCCLCTDigiContainer& allCLCTsInChamber(unsigned int) const;
48  const CSCALCTDigiContainer& allALCTsInChamber(unsigned int) const;
49  const CSCCorrelatedLCTDigiContainer& allLCTsInChamber(unsigned int) const;
50  const CSCCorrelatedLCTDigiContainer& allMPLCTsInChamber(unsigned int) const;
51 
53  const CSCCLCTDigiContainer& clctsInChamber(unsigned int) const;
54  const CSCALCTDigiContainer& alctsInChamber(unsigned int) const;
55  const CSCCorrelatedLCTDigiContainer& lctsInChamber(unsigned int) const;
56  const CSCCorrelatedLCTDigiContainer& mplctsInChamber(unsigned int) const;
57 
59  std::map<unsigned int, CSCCLCTDigiContainer> clcts() const { return chamber_to_clcts_; }
60  std::map<unsigned int, CSCALCTDigiContainer> alcts() const { return chamber_to_alcts_; }
61  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> lcts() const { return chamber_to_lcts_; }
62  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> mplcts() const { return chamber_to_mplcts_; }
63 
65  CSCCLCTDigi bestClctInChamber(unsigned int) const;
66  CSCALCTDigi bestAlctInChamber(unsigned int) const;
67  CSCCorrelatedLCTDigi bestLctInChamber(unsigned int) const;
68  CSCCorrelatedLCTDigi bestMplctInChamber(unsigned int) const;
69 
70  //z position of certain layer
71  float zpositionOfLayer(unsigned int detid, int layer) const;
72 
74  int nChambersWithCLCT(int min_quality = 0) const;
75  int nChambersWithALCT(int min_quality = 0) const;
76  int nChambersWithLCT(int min_quality = 0) const;
77  int nChambersWithMPLCT(int min_quality = 0) const;
78 
79  bool lctInChamber(const CSCDetId& id, const CSCCorrelatedLCTDigi& lct) const;
80 
81  // get the position of an LCT in global coordinates
82  GlobalPoint getGlobalPosition(unsigned int rawId, const CSCCorrelatedLCTDigi& lct) const;
83 
84  std::shared_ptr<CSCDigiMatcher> cscDigiMatcher() { return cscDigiMatcher_; }
85  std::shared_ptr<GEMDigiMatcher> gemDigiMatcher() { return gemDigiMatcher_; }
86 
87 private:
92 
93  void clear();
94 
99 
104 
105  std::shared_ptr<CSCDigiMatcher> cscDigiMatcher_;
106  std::shared_ptr<GEMDigiMatcher> gemDigiMatcher_;
107 
110 
111  // all stubs (not necessarily matching) in crossed chambers with digis
112  std::map<unsigned int, CSCCLCTDigiContainer> chamber_to_clcts_all_;
113  std::map<unsigned int, CSCALCTDigiContainer> chamber_to_alcts_all_;
114  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_lcts_all_;
115  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_mplcts_all_;
116 
117  // all matching stubs in crossed chambers with digis
118  std::map<unsigned int, CSCCLCTDigiContainer> chamber_to_clcts_;
119  std::map<unsigned int, CSCALCTDigiContainer> chamber_to_alcts_;
120  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_lcts_;
121  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_mplcts_;
122 
123  template <class D>
124  std::set<unsigned int> selectDetIds(D&, int) const;
125 
127  bool useGEMs_;
128 
134 
139 
144 
149 };
150 
151 template <class D>
152 std::set<unsigned int> CSCStubMatcher::selectDetIds(D& digis, int csc_type) const {
153  std::set<unsigned int> result;
154  for (auto& p : digis) {
155  auto id = p.first;
156  if (csc_type > 0) {
157  CSCDetId detId(id);
158  if (MuonHitHelper::toCSCType(detId.station(), detId.ring()) != csc_type)
159  continue;
160  }
161  result.insert(p.first);
162  }
163  return result;
164 }
165 
166 #endif
CSCStubMatcher::clear
void clear()
Definition: CSCStubMatcher.cc:655
CSCStubMatcher::allLCTsInChamber
const CSCCorrelatedLCTDigiContainer & allLCTsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:456
CSCCorrelatedLCTDigiCollection.h
CSCStubMatcher::bestAlctInChamber
CSCALCTDigi bestAlctInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:509
CSCStubMatcher::alctsInChamber
const CSCALCTDigiContainer & alctsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:474
SimVertex
Definition: SimVertex.h:5
CSCStubMatcher::minNHitsChamberALCT_
int minNHitsChamberALCT_
Definition: CSCStubMatcher.h:130
GEMDigiMatcher.h
edm::EDGetTokenT< CSCCLCTDigiCollection >
CSCStubMatcher::getGlobalPosition
GlobalPoint getGlobalPosition(unsigned int rawId, const CSCCorrelatedLCTDigi &lct) const
Definition: CSCStubMatcher.cc:637
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
CSCStubMatcher::maxBXALCT_
int maxBXALCT_
Definition: CSCStubMatcher.h:141
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCStubMatcher::verboseALCT_
bool verboseALCT_
Definition: CSCStubMatcher.h:135
CSCStubMatcher::cscGeometry_
const CSCGeometry * cscGeometry_
Definition: CSCStubMatcher.h:109
CSCStubMatcher::lctsInChamber
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:480
CSCStubMatcher::cscDigiMatcher_
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher_
Definition: CSCStubMatcher.h:105
CSCStubMatcher::nChambersWithLCT
int nChambersWithLCT(int min_quality=0) const
Definition: CSCStubMatcher.cc:589
MuonHitHelper::CSC_ALL
Definition: MuonHitHelper.h:15
CSCStubMatcher::useGEMs_
bool useGEMs_
Definition: CSCStubMatcher.h:127
CSCCorrelatedLCTDigiContainer
std::vector< CSCCorrelatedLCTDigi > CSCCorrelatedLCTDigiContainer
Definition: CSCStubMatcher.h:20
CSCStubMatcher::clctToken_
edm::EDGetTokenT< CSCCLCTDigiCollection > clctToken_
Definition: CSCStubMatcher.h:95
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::Handle< CSCCLCTDigiCollection >
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCStubMatcher::nChambersWithMPLCT
int nChambersWithMPLCT(int min_quality=0) const
Definition: CSCStubMatcher.cc:609
CSCStubMatcher::mplctsH_
edm::Handle< CSCCorrelatedLCTDigiCollection > mplctsH_
Definition: CSCStubMatcher.h:103
CSCStubMatcher::no_alcts_
CSCALCTDigiContainer no_alcts_
Definition: CSCStubMatcher.h:146
CSCStubMatcher::alcts
std::map< unsigned int, CSCALCTDigiContainer > alcts() const
Definition: CSCStubMatcher.h:60
CSCStubMatcher::chamber_to_lcts_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_
Definition: CSCStubMatcher.h:120
CSCStubMatcher::cscDigiMatcher
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher()
Definition: CSCStubMatcher.h:84
CSCGeometry
Definition: CSCGeometry.h:24
CSCStubMatcher::chamber_to_lcts_all_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_all_
Definition: CSCStubMatcher.h:114
CSCStubMatcher::bestClctInChamber
CSCCLCTDigi bestClctInChamber(unsigned int) const
best matching from a particular crossed chamber
Definition: CSCStubMatcher.cc:492
CSCStubMatcher::clctsH_
edm::Handle< CSCCLCTDigiCollection > clctsH_
Definition: CSCStubMatcher.h:100
CSCStubMatcher::selectDetIds
std::set< unsigned int > selectDetIds(D &, int) const
Definition: CSCStubMatcher.h:152
CSCStubMatcher::minNHitsChamberLCT_
int minNHitsChamberLCT_
Definition: CSCStubMatcher.h:132
CSCStubMatcher::chamber_to_mplcts_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_
Definition: CSCStubMatcher.h:121
CSCStubMatcher::allCLCTsInChamber
const CSCCLCTDigiContainer & allCLCTsInChamber(unsigned int) const
all stubs (not necessarily matching) from a particular crossed chamber
Definition: CSCStubMatcher.cc:444
CSCStubMatcher::clcts
std::map< unsigned int, CSCCLCTDigiContainer > clcts() const
all matching lcts
Definition: CSCStubMatcher.h:59
CSCStubMatcher::verboseLCT_
bool verboseLCT_
Definition: CSCStubMatcher.h:137
CSCStubMatcher::lctsH_
edm::Handle< CSCCorrelatedLCTDigiCollection > lctsH_
Definition: CSCStubMatcher.h:102
CSCStubMatcher::bestLctInChamber
CSCCorrelatedLCTDigi bestLctInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:526
CSCStubMatcher::verboseCLCT_
bool verboseCLCT_
Definition: CSCStubMatcher.h:136
CSCStubMatcher::clctsInChamber
const CSCCLCTDigiContainer & clctsInChamber(unsigned int) const
all matching from a particular crossed chamber
Definition: CSCStubMatcher.cc:468
CSCStubMatcher::minBXCLCT_
int minBXCLCT_
Definition: CSCStubMatcher.h:140
CSCStubMatcher::alctsH_
edm::Handle< CSCALCTDigiCollection > alctsH_
Definition: CSCStubMatcher.h:101
Point3DBase< float, GlobalTag >
CSCStubMatcher::allMPLCTsInChamber
const CSCCorrelatedLCTDigiContainer & allMPLCTsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:462
CSCStubMatcher::geomToken_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomToken_
Definition: CSCStubMatcher.h:108
CSCStubMatcher::minNHitsChamberMPLCT_
int minNHitsChamberMPLCT_
Definition: CSCStubMatcher.h:133
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CSCStubMatcher::chamber_to_clcts_
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_
Definition: CSCStubMatcher.h:118
CSCStubMatcher::chamber_to_mplcts_all_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
Definition: CSCStubMatcher.h:115
CSCCLCTDigiContainer
std::vector< CSCCLCTDigi > CSCCLCTDigiContainer
Definition: CSCStubMatcher.h:19
CSCStubMatcher::minNHitsChamberCLCT_
int minNHitsChamberCLCT_
Definition: CSCStubMatcher.h:131
CSCStubMatcher::matchMPLCTsToSimTrack
void matchMPLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection &)
Definition: CSCStubMatcher.cc:383
CSCStubMatcher::mplctsInChamber
const CSCCorrelatedLCTDigiContainer & mplctsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:486
CSCStubMatcher::matchCLCTsToSimTrack
void matchCLCTsToSimTrack(const CSCCLCTDigiCollection &)
Definition: CSCStubMatcher.cc:81
edm::ParameterSet
Definition: ParameterSet.h:47
CSCStubMatcher::bestMplctInChamber
CSCCorrelatedLCTDigi bestMplctInChamber(unsigned int) const
CSCStubMatcher::matchALCTsToSimTrack
void matchALCTsToSimTrack(const CSCALCTDigiCollection &)
Definition: CSCStubMatcher.cc:181
CSCStubMatcher::minBXALCT_
int minBXALCT_
Definition: CSCStubMatcher.h:141
CSCStubMatcher::chamberIdsAllMPLCT
std::set< unsigned int > chamberIdsAllMPLCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:424
CSCDetId
Definition: CSCDetId.h:26
CSCStubMatcher::chamberIdsMPLCT
std::set< unsigned int > chamberIdsMPLCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:440
CSCStubMatcher::init
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
Definition: CSCStubMatcher.cc:47
CSCStubMatcher::no_clcts_
CSCCLCTDigiContainer no_clcts_
Definition: CSCStubMatcher.h:145
CSCStubMatcher::~CSCStubMatcher
~CSCStubMatcher()
Definition: CSCStubMatcher.h:26
CSCStubMatcher::alctToken_
edm::EDGetTokenT< CSCALCTDigiCollection > alctToken_
Definition: CSCStubMatcher.h:96
CSCStubMatcher::chamberIdsAllALCT
std::set< unsigned int > chamberIdsAllALCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:416
CSCStubMatcher::mplctToken_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > mplctToken_
Definition: CSCStubMatcher.h:98
CSCALCTDigiCollection
CSCStubMatcher::nChambersWithCLCT
int nChambersWithCLCT(int min_quality=0) const
How many CSC chambers with matching stubs of some minimal quality did this SimTrack hit?
Definition: CSCStubMatcher.cc:549
CSCStubMatcher::minNHitsChamber_
int minNHitsChamber_
Definition: CSCStubMatcher.h:129
edm::EventSetup
Definition: EventSetup.h:58
CSCCorrelatedLCTDigiCollection
CSCALCTDigiContainer
std::vector< CSCALCTDigi > CSCALCTDigiContainer
Definition: CSCStubMatcher.h:18
CSCStubMatcher::mplcts
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > mplcts() const
Definition: CSCStubMatcher.h:62
edm::ESGetToken< CSCGeometry, MuonGeometryRecord >
CSCStubMatcher::gemDigiMatcher
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher()
Definition: CSCStubMatcher.h:85
CSCStubMatcher::CSCStubMatcher
CSCStubMatcher(edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
Definition: CSCStubMatcher.cc:7
CSCStubMatcher::chamber_to_alcts_
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_
Definition: CSCStubMatcher.h:119
CSCStubMatcher::chamberIdsAllCLCT
std::set< unsigned int > chamberIdsAllCLCT(int csc_type=MuonHitHelper::CSC_ALL) const
crossed chamber detIds with not necessarily matching stubs
Definition: CSCStubMatcher.cc:412
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
CSCDigiMatcher.h
CSCStubMatcher::no_mplcts_
CSCCorrelatedLCTDigiContainer no_mplcts_
Definition: CSCStubMatcher.h:148
CSCStubMatcher::minBXMPLCT_
int minBXMPLCT_
Definition: CSCStubMatcher.h:143
SimTrack
Definition: SimTrack.h:9
CSCCLCTDigiCollection
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCStubMatcher::verboseMPLCT_
bool verboseMPLCT_
Definition: CSCStubMatcher.h:138
CSCStubMatcher::match
void match(const SimTrack &t, const SimVertex &v)
do the matching
Definition: CSCStubMatcher.cc:61
CSCStubMatcher::chamberIdsAllLCT
std::set< unsigned int > chamberIdsAllLCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:420
CSCStubMatcher::no_lcts_
CSCCorrelatedLCTDigiContainer no_lcts_
Definition: CSCStubMatcher.h:147
CSCStubMatcher::chamber_to_clcts_all_
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_all_
Definition: CSCStubMatcher.h:112
CSCStubMatcher::gemDigiMatcher_
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
Definition: CSCStubMatcher.h:106
CSCStubMatcher::addGhostLCTs_
bool addGhostLCTs_
Definition: CSCStubMatcher.h:126
CSCStubMatcher::lcts
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > lcts() const
Definition: CSCStubMatcher.h:61
CSCStubMatcher::chamberIdsCLCT
std::set< unsigned int > chamberIdsCLCT(int csc_type=MuonHitHelper::CSC_ALL) const
chamber detIds with matching stubs
Definition: CSCStubMatcher.cc:428
CSCALCTDigiCollection.h
mps_fire.result
result
Definition: mps_fire.py:311
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
CSCStubMatcher::zpositionOfLayer
float zpositionOfLayer(unsigned int detid, int layer) const
Definition: CSCStubMatcher.cc:543
CSCCLCTDigiCollection.h
MuonHitHelper::toCSCType
static int toCSCType(int st, int ri)
Definition: MuonHitHelper.cc:195
CSCStubMatcher::chamberIdsLCT
std::set< unsigned int > chamberIdsLCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:436
CSCStubMatcher::chamberIdsALCT
std::set< unsigned int > chamberIdsALCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:432
CSCStubMatcher::lctToken_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lctToken_
Definition: CSCStubMatcher.h:97
CSCStubMatcher::chamber_to_alcts_all_
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_
Definition: CSCStubMatcher.h:113
edm::Event
Definition: Event.h:73
CSCStubMatcher::maxBXLCT_
int maxBXLCT_
Definition: CSCStubMatcher.h:142
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
CSCStubMatcher
Definition: CSCStubMatcher.h:22
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
CSCStubMatcher::allALCTsInChamber
const CSCALCTDigiContainer & allALCTsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:450
CSCStubMatcher::minBXLCT_
int minBXLCT_
Definition: CSCStubMatcher.h:142
CSCStubMatcher::maxBXCLCT_
int maxBXCLCT_
Definition: CSCStubMatcher.h:140
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
CSCStubMatcher::nChambersWithALCT
int nChambersWithALCT(int min_quality=0) const
Definition: CSCStubMatcher.cc:569
CSCStubMatcher::matchLCTsToSimTrack
void matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection &)
Definition: CSCStubMatcher.cc:239
CSCStubMatcher::maxBXMPLCT_
int maxBXMPLCT_
Definition: CSCStubMatcher.h:143
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
CSCStubMatcher::lctInChamber
bool lctInChamber(const CSCDetId &id, const CSCCorrelatedLCTDigi &lct) const
Definition: CSCStubMatcher.cc:629