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 
97 
102 
103  std::shared_ptr<CSCDigiMatcher> cscDigiMatcher_;
104  std::shared_ptr<GEMDigiMatcher> gemDigiMatcher_;
105 
108 
109  // all stubs (not necessarily matching) in crossed chambers with digis
110  std::map<unsigned int, CSCCLCTDigiContainer> chamber_to_clcts_all_;
111  std::map<unsigned int, CSCALCTDigiContainer> chamber_to_alcts_all_;
112  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_lcts_all_;
113  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_mplcts_all_;
114 
115  // all matching stubs in crossed chambers with digis
116  std::map<unsigned int, CSCCLCTDigiContainer> chamber_to_clcts_;
117  std::map<unsigned int, CSCALCTDigiContainer> chamber_to_alcts_;
118  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_lcts_;
119  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_mplcts_;
120 
121  template <class D>
122  std::set<unsigned int> selectDetIds(D&, int) const;
123 
125 
131 
136 
141 
146 };
147 
148 template <class D>
149 std::set<unsigned int> CSCStubMatcher::selectDetIds(D& digis, int csc_type) const {
150  std::set<unsigned int> result;
151  for (auto& p : digis) {
152  auto id = p.first;
153  if (csc_type > 0) {
154  CSCDetId detId(id);
155  if (MuonHitHelper::toCSCType(detId.station(), detId.ring()) != csc_type)
156  continue;
157  }
158  result.insert(p.first);
159  }
160  return result;
161 }
162 
163 #endif
CSCStubMatcher::allLCTsInChamber
const CSCCorrelatedLCTDigiContainer & allLCTsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:362
CSCCorrelatedLCTDigiCollection.h
CSCStubMatcher::bestAlctInChamber
CSCALCTDigi bestAlctInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:415
CSCStubMatcher::alctsInChamber
const CSCALCTDigiContainer & alctsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:380
SimVertex
Definition: SimVertex.h:5
CSCStubMatcher::csc_geom_
edm::ESHandle< CSCGeometry > csc_geom_
Definition: CSCStubMatcher.h:106
CSCStubMatcher::minNHitsChamberALCT_
int minNHitsChamberALCT_
Definition: CSCStubMatcher.h:127
GEMDigiMatcher.h
edm::EDGetTokenT< CSCCLCTDigiCollection >
CSCStubMatcher::getGlobalPosition
GlobalPoint getGlobalPosition(unsigned int rawId, const CSCCorrelatedLCTDigi &lct) const
Definition: CSCStubMatcher.cc:543
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
CSCStubMatcher::maxBXALCT_
int maxBXALCT_
Definition: CSCStubMatcher.h:138
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCStubMatcher::verboseALCT_
bool verboseALCT_
Definition: CSCStubMatcher.h:132
CSCStubMatcher::cscGeometry_
const CSCGeometry * cscGeometry_
Definition: CSCStubMatcher.h:107
CSCStubMatcher::lctsInChamber
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:386
CSCStubMatcher::cscDigiMatcher_
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher_
Definition: CSCStubMatcher.h:103
CSCStubMatcher::nChambersWithLCT
int nChambersWithLCT(int min_quality=0) const
Definition: CSCStubMatcher.cc:495
MuonHitHelper::CSC_ALL
Definition: MuonHitHelper.h:15
CSCCorrelatedLCTDigiContainer
std::vector< CSCCorrelatedLCTDigi > CSCCorrelatedLCTDigiContainer
Definition: CSCStubMatcher.h:20
CSCStubMatcher::clctToken_
edm::EDGetTokenT< CSCCLCTDigiCollection > clctToken_
Definition: CSCStubMatcher.h:93
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:515
CSCStubMatcher::mplctsH_
edm::Handle< CSCCorrelatedLCTDigiCollection > mplctsH_
Definition: CSCStubMatcher.h:101
CSCStubMatcher::no_alcts_
CSCALCTDigiContainer no_alcts_
Definition: CSCStubMatcher.h:143
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:118
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:112
CSCStubMatcher::bestClctInChamber
CSCCLCTDigi bestClctInChamber(unsigned int) const
best matching from a particular crossed chamber
Definition: CSCStubMatcher.cc:398
CSCStubMatcher::clctsH_
edm::Handle< CSCCLCTDigiCollection > clctsH_
Definition: CSCStubMatcher.h:98
CSCStubMatcher::selectDetIds
std::set< unsigned int > selectDetIds(D &, int) const
Definition: CSCStubMatcher.h:149
CSCStubMatcher::minNHitsChamberLCT_
int minNHitsChamberLCT_
Definition: CSCStubMatcher.h:129
CSCStubMatcher::chamber_to_mplcts_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_
Definition: CSCStubMatcher.h:119
CSCStubMatcher::allCLCTsInChamber
const CSCCLCTDigiContainer & allCLCTsInChamber(unsigned int) const
all stubs (not necessarily matching) from a particular crossed chamber
Definition: CSCStubMatcher.cc:350
CSCStubMatcher::clcts
std::map< unsigned int, CSCCLCTDigiContainer > clcts() const
all matching lcts
Definition: CSCStubMatcher.h:59
CSCStubMatcher::verboseLCT_
bool verboseLCT_
Definition: CSCStubMatcher.h:134
CSCStubMatcher::lctsH_
edm::Handle< CSCCorrelatedLCTDigiCollection > lctsH_
Definition: CSCStubMatcher.h:100
CSCStubMatcher::bestLctInChamber
CSCCorrelatedLCTDigi bestLctInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:432
edm::ESHandle< CSCGeometry >
CSCStubMatcher::verboseCLCT_
bool verboseCLCT_
Definition: CSCStubMatcher.h:133
CSCStubMatcher::clctsInChamber
const CSCCLCTDigiContainer & clctsInChamber(unsigned int) const
all matching from a particular crossed chamber
Definition: CSCStubMatcher.cc:374
CSCStubMatcher::minBXCLCT_
int minBXCLCT_
Definition: CSCStubMatcher.h:137
CSCStubMatcher::alctsH_
edm::Handle< CSCALCTDigiCollection > alctsH_
Definition: CSCStubMatcher.h:99
Point3DBase< float, GlobalTag >
CSCStubMatcher::allMPLCTsInChamber
const CSCCorrelatedLCTDigiContainer & allMPLCTsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:368
OrderedSet.t
t
Definition: OrderedSet.py:90
CSCStubMatcher::minNHitsChamberMPLCT_
int minNHitsChamberMPLCT_
Definition: CSCStubMatcher.h:130
CSCStubMatcher::chamber_to_clcts_
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_
Definition: CSCStubMatcher.h:116
CSCStubMatcher::chamber_to_mplcts_all_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
Definition: CSCStubMatcher.h:113
CSCCLCTDigiContainer
std::vector< CSCCLCTDigi > CSCCLCTDigiContainer
Definition: CSCStubMatcher.h:19
CSCStubMatcher::minNHitsChamberCLCT_
int minNHitsChamberCLCT_
Definition: CSCStubMatcher.h:128
CSCStubMatcher::matchMPLCTsToSimTrack
void matchMPLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection &)
Definition: CSCStubMatcher.cc:291
CSCStubMatcher::mplctsInChamber
const CSCCorrelatedLCTDigiContainer & mplctsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:392
CSCStubMatcher::matchCLCTsToSimTrack
void matchCLCTsToSimTrack(const CSCCLCTDigiCollection &)
Definition: CSCStubMatcher.cc:77
edm::ParameterSet
Definition: ParameterSet.h:36
CSCStubMatcher::bestMplctInChamber
CSCCorrelatedLCTDigi bestMplctInChamber(unsigned int) const
CSCStubMatcher::matchALCTsToSimTrack
void matchALCTsToSimTrack(const CSCALCTDigiCollection &)
Definition: CSCStubMatcher.cc:141
CSCStubMatcher::minBXALCT_
int minBXALCT_
Definition: CSCStubMatcher.h:138
CSCStubMatcher::chamberIdsAllMPLCT
std::set< unsigned int > chamberIdsAllMPLCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:330
CSCDetId
Definition: CSCDetId.h:26
CSCStubMatcher::chamberIdsMPLCT
std::set< unsigned int > chamberIdsMPLCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:346
CSCStubMatcher::init
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
Definition: CSCStubMatcher.cc:43
CSCStubMatcher::no_clcts_
CSCCLCTDigiContainer no_clcts_
Definition: CSCStubMatcher.h:142
CSCStubMatcher::~CSCStubMatcher
~CSCStubMatcher()
Definition: CSCStubMatcher.h:26
CSCStubMatcher::hsFromSimHitMean_
bool hsFromSimHitMean_
Definition: CSCStubMatcher.h:124
CSCStubMatcher::alctToken_
edm::EDGetTokenT< CSCALCTDigiCollection > alctToken_
Definition: CSCStubMatcher.h:94
CSCStubMatcher::chamberIdsAllALCT
std::set< unsigned int > chamberIdsAllALCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:322
CSCStubMatcher::mplctToken_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > mplctToken_
Definition: CSCStubMatcher.h:96
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:455
CSCStubMatcher::minNHitsChamber_
int minNHitsChamber_
Definition: CSCStubMatcher.h:126
edm::EventSetup
Definition: EventSetup.h:57
CSCCorrelatedLCTDigiCollection
CSCALCTDigiContainer
std::vector< CSCALCTDigi > CSCALCTDigiContainer
Definition: CSCStubMatcher.h:18
CSCStubMatcher::mplcts
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > mplcts() const
Definition: CSCStubMatcher.h:62
CSCStubMatcher::gemDigiMatcher
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher()
Definition: CSCStubMatcher.h:85
CSCStubMatcher::CSCStubMatcher
CSCStubMatcher(edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
Definition: CSCStubMatcher.cc:8
CSCStubMatcher::chamber_to_alcts_
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_
Definition: CSCStubMatcher.h:117
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:318
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
CSCDigiMatcher.h
CSCStubMatcher::no_mplcts_
CSCCorrelatedLCTDigiContainer no_mplcts_
Definition: CSCStubMatcher.h:145
CSCStubMatcher::minBXMPLCT_
int minBXMPLCT_
Definition: CSCStubMatcher.h:140
SimTrack
Definition: SimTrack.h:6
CSCCLCTDigiCollection
CSCALCTDigi
Definition: CSCALCTDigi.h:16
CSCStubMatcher::verboseMPLCT_
bool verboseMPLCT_
Definition: CSCStubMatcher.h:135
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:326
CSCStubMatcher::no_lcts_
CSCCorrelatedLCTDigiContainer no_lcts_
Definition: CSCStubMatcher.h:144
CSCStubMatcher::chamber_to_clcts_all_
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_all_
Definition: CSCStubMatcher.h:110
CSCStubMatcher::gemDigiMatcher_
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
Definition: CSCStubMatcher.h:104
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:334
CSCALCTDigiCollection.h
mps_fire.result
result
Definition: mps_fire.py:303
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
CSCStubMatcher::zpositionOfLayer
float zpositionOfLayer(unsigned int detid, int layer) const
Definition: CSCStubMatcher.cc:449
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:342
CSCStubMatcher::chamberIdsALCT
std::set< unsigned int > chamberIdsALCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:338
CSCStubMatcher::lctToken_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lctToken_
Definition: CSCStubMatcher.h:95
CSCStubMatcher::chamber_to_alcts_all_
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_
Definition: CSCStubMatcher.h:111
edm::Event
Definition: Event.h:73
CSCStubMatcher::maxBXLCT_
int maxBXLCT_
Definition: CSCStubMatcher.h:139
CSCStubMatcher
Definition: CSCStubMatcher.h:22
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
CSCStubMatcher::allALCTsInChamber
const CSCALCTDigiContainer & allALCTsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:356
CSCStubMatcher::minBXLCT_
int minBXLCT_
Definition: CSCStubMatcher.h:139
CSCStubMatcher::maxBXCLCT_
int maxBXCLCT_
Definition: CSCStubMatcher.h:137
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
CSCStubMatcher::nChambersWithALCT
int nChambersWithALCT(int min_quality=0) const
Definition: CSCStubMatcher.cc:475
CSCStubMatcher::matchLCTsToSimTrack
void matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection &)
Definition: CSCStubMatcher.cc:199
CSCStubMatcher::maxBXMPLCT_
int maxBXMPLCT_
Definition: CSCStubMatcher.h:140
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
CSCStubMatcher::lctInChamber
bool lctInChamber(const CSCDetId &id, const CSCCorrelatedLCTDigi &lct) const
Definition: CSCStubMatcher.cc:535