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 
95  void addGhostLCTs(const CSCCorrelatedLCTDigi& lct11,
96  const CSCCorrelatedLCTDigi& lct22,
97  CSCCorrelatedLCTDigiContainer& lctcontainer) const;
98 
103 
108 
109  std::shared_ptr<CSCDigiMatcher> cscDigiMatcher_;
110  std::shared_ptr<GEMDigiMatcher> gemDigiMatcher_;
111 
114 
115  // all stubs (not necessarily matching) in crossed chambers with digis
116  std::map<unsigned int, CSCCLCTDigiContainer> chamber_to_clcts_all_;
117  std::map<unsigned int, CSCALCTDigiContainer> chamber_to_alcts_all_;
118  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_lcts_all_;
119  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_mplcts_all_;
120 
121  // all matching stubs in crossed chambers with digis
122  std::map<unsigned int, CSCCLCTDigiContainer> chamber_to_clcts_;
123  std::map<unsigned int, CSCALCTDigiContainer> chamber_to_alcts_;
124  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_lcts_;
125  std::map<unsigned int, CSCCorrelatedLCTDigiContainer> chamber_to_mplcts_;
126 
127  template <class D>
128  std::set<unsigned int> selectDetIds(D&, int) const;
129 
131  bool useGEMs_;
132 
138 
143 
148 
153 };
154 
155 template <class D>
156 std::set<unsigned int> CSCStubMatcher::selectDetIds(D& digis, int csc_type) const {
157  std::set<unsigned int> result;
158  for (auto& p : digis) {
159  auto id = p.first;
160  if (csc_type > 0) {
161  CSCDetId detId(id);
162  if (MuonHitHelper::toCSCType(detId.station(), detId.ring()) != csc_type)
163  continue;
164  }
165  result.insert(p.first);
166  }
167  return result;
168 }
169 
170 #endif
CSCStubMatcher::clear
void clear()
Definition: CSCStubMatcher.cc:636
CSCStubMatcher::allLCTsInChamber
const CSCCorrelatedLCTDigiContainer & allLCTsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:437
CSCCorrelatedLCTDigiCollection.h
CSCStubMatcher::bestAlctInChamber
CSCALCTDigi bestAlctInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:490
CSCStubMatcher::alctsInChamber
const CSCALCTDigiContainer & alctsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:455
SimVertex
Definition: SimVertex.h:5
CSCStubMatcher::minNHitsChamberALCT_
int minNHitsChamberALCT_
Definition: CSCStubMatcher.h:134
GEMDigiMatcher.h
edm::EDGetTokenT< CSCCLCTDigiCollection >
CSCStubMatcher::getGlobalPosition
GlobalPoint getGlobalPosition(unsigned int rawId, const CSCCorrelatedLCTDigi &lct) const
Definition: CSCStubMatcher.cc:618
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
CSCStubMatcher::maxBXALCT_
int maxBXALCT_
Definition: CSCStubMatcher.h:145
CSCStubMatcher::verboseALCT_
bool verboseALCT_
Definition: CSCStubMatcher.h:139
CSCStubMatcher::cscGeometry_
const CSCGeometry * cscGeometry_
Definition: CSCStubMatcher.h:113
CSCStubMatcher::lctsInChamber
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:461
CSCStubMatcher::cscDigiMatcher_
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher_
Definition: CSCStubMatcher.h:109
CSCStubMatcher::nChambersWithLCT
int nChambersWithLCT(int min_quality=0) const
Definition: CSCStubMatcher.cc:570
CSCStubMatcher::addGhostLCTs
void addGhostLCTs(const CSCCorrelatedLCTDigi &lct11, const CSCCorrelatedLCTDigi &lct22, CSCCorrelatedLCTDigiContainer &lctcontainer) const
Definition: CSCStubMatcher.cc:648
MuonHitHelper::CSC_ALL
Definition: MuonHitHelper.h:15
CSCStubMatcher::useGEMs_
bool useGEMs_
Definition: CSCStubMatcher.h:131
CSCCorrelatedLCTDigiContainer
std::vector< CSCCorrelatedLCTDigi > CSCCorrelatedLCTDigiContainer
Definition: CSCStubMatcher.h:20
CSCStubMatcher::clctToken_
edm::EDGetTokenT< CSCCLCTDigiCollection > clctToken_
Definition: CSCStubMatcher.h:99
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:590
CSCStubMatcher::mplctsH_
edm::Handle< CSCCorrelatedLCTDigiCollection > mplctsH_
Definition: CSCStubMatcher.h:107
CSCStubMatcher::no_alcts_
CSCALCTDigiContainer no_alcts_
Definition: CSCStubMatcher.h:150
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:124
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:118
CSCStubMatcher::bestClctInChamber
CSCCLCTDigi bestClctInChamber(unsigned int) const
best matching from a particular crossed chamber
Definition: CSCStubMatcher.cc:473
CSCStubMatcher::clctsH_
edm::Handle< CSCCLCTDigiCollection > clctsH_
Definition: CSCStubMatcher.h:104
CSCStubMatcher::selectDetIds
std::set< unsigned int > selectDetIds(D &, int) const
Definition: CSCStubMatcher.h:156
CSCStubMatcher::minNHitsChamberLCT_
int minNHitsChamberLCT_
Definition: CSCStubMatcher.h:136
CSCStubMatcher::chamber_to_mplcts_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_
Definition: CSCStubMatcher.h:125
CSCStubMatcher::allCLCTsInChamber
const CSCCLCTDigiContainer & allCLCTsInChamber(unsigned int) const
all stubs (not necessarily matching) from a particular crossed chamber
Definition: CSCStubMatcher.cc:425
CSCStubMatcher::clcts
std::map< unsigned int, CSCCLCTDigiContainer > clcts() const
all matching lcts
Definition: CSCStubMatcher.h:59
CSCStubMatcher::verboseLCT_
bool verboseLCT_
Definition: CSCStubMatcher.h:141
CSCStubMatcher::lctsH_
edm::Handle< CSCCorrelatedLCTDigiCollection > lctsH_
Definition: CSCStubMatcher.h:106
CSCStubMatcher::bestLctInChamber
CSCCorrelatedLCTDigi bestLctInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:507
CSCStubMatcher::verboseCLCT_
bool verboseCLCT_
Definition: CSCStubMatcher.h:140
CSCStubMatcher::clctsInChamber
const CSCCLCTDigiContainer & clctsInChamber(unsigned int) const
all matching from a particular crossed chamber
Definition: CSCStubMatcher.cc:449
CSCStubMatcher::minBXCLCT_
int minBXCLCT_
Definition: CSCStubMatcher.h:144
CSCStubMatcher::alctsH_
edm::Handle< CSCALCTDigiCollection > alctsH_
Definition: CSCStubMatcher.h:105
Point3DBase< float, GlobalTag >
CSCStubMatcher::allMPLCTsInChamber
const CSCCorrelatedLCTDigiContainer & allMPLCTsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:443
CSCStubMatcher::geomToken_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomToken_
Definition: CSCStubMatcher.h:112
CSCStubMatcher::minNHitsChamberMPLCT_
int minNHitsChamberMPLCT_
Definition: CSCStubMatcher.h:137
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:122
CSCStubMatcher::chamber_to_mplcts_all_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
Definition: CSCStubMatcher.h:119
CSCCLCTDigiContainer
std::vector< CSCCLCTDigi > CSCCLCTDigiContainer
Definition: CSCStubMatcher.h:19
CSCStubMatcher::minNHitsChamberCLCT_
int minNHitsChamberCLCT_
Definition: CSCStubMatcher.h:135
CSCStubMatcher::matchMPLCTsToSimTrack
void matchMPLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection &)
Definition: CSCStubMatcher.cc:364
CSCStubMatcher::mplctsInChamber
const CSCCorrelatedLCTDigiContainer & mplctsInChamber(unsigned int) const
Definition: CSCStubMatcher.cc:467
CSCStubMatcher::matchCLCTsToSimTrack
void matchCLCTsToSimTrack(const CSCCLCTDigiCollection &)
Definition: CSCStubMatcher.cc:81
edm::ParameterSet
Definition: ParameterSet.h:47
CSCStubMatcher::bestMplctInChamber
CSCCorrelatedLCTDigi bestMplctInChamber(unsigned int) const
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCStubMatcher::matchALCTsToSimTrack
void matchALCTsToSimTrack(const CSCALCTDigiCollection &)
Definition: CSCStubMatcher.cc:181
CSCStubMatcher::minBXALCT_
int minBXALCT_
Definition: CSCStubMatcher.h:145
CSCStubMatcher::chamberIdsAllMPLCT
std::set< unsigned int > chamberIdsAllMPLCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:405
CSCDetId
Definition: CSCDetId.h:26
CSCStubMatcher::chamberIdsMPLCT
std::set< unsigned int > chamberIdsMPLCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:421
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:149
CSCStubMatcher::~CSCStubMatcher
~CSCStubMatcher()
Definition: CSCStubMatcher.h:26
CSCStubMatcher::alctToken_
edm::EDGetTokenT< CSCALCTDigiCollection > alctToken_
Definition: CSCStubMatcher.h:100
CSCStubMatcher::chamberIdsAllALCT
std::set< unsigned int > chamberIdsAllALCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:397
CSCStubMatcher::mplctToken_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > mplctToken_
Definition: CSCStubMatcher.h:102
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:530
CSCStubMatcher::minNHitsChamber_
int minNHitsChamber_
Definition: CSCStubMatcher.h:133
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:123
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:393
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
CSCDigiMatcher.h
CSCStubMatcher::no_mplcts_
CSCCorrelatedLCTDigiContainer no_mplcts_
Definition: CSCStubMatcher.h:152
CSCStubMatcher::minBXMPLCT_
int minBXMPLCT_
Definition: CSCStubMatcher.h:147
SimTrack
Definition: SimTrack.h:9
CSCCLCTDigiCollection
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCStubMatcher::verboseMPLCT_
bool verboseMPLCT_
Definition: CSCStubMatcher.h:142
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:401
CSCStubMatcher::no_lcts_
CSCCorrelatedLCTDigiContainer no_lcts_
Definition: CSCStubMatcher.h:151
CSCStubMatcher::chamber_to_clcts_all_
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_all_
Definition: CSCStubMatcher.h:116
CSCStubMatcher::gemDigiMatcher_
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
Definition: CSCStubMatcher.h:110
CSCStubMatcher::addGhostLCTs_
bool addGhostLCTs_
Definition: CSCStubMatcher.h:130
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:409
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:524
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:417
CSCStubMatcher::chamberIdsALCT
std::set< unsigned int > chamberIdsALCT(int csc_type=MuonHitHelper::CSC_ALL) const
Definition: CSCStubMatcher.cc:413
CSCStubMatcher::lctToken_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lctToken_
Definition: CSCStubMatcher.h:101
CSCStubMatcher::chamber_to_alcts_all_
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_
Definition: CSCStubMatcher.h:117
edm::Event
Definition: Event.h:73
CSCStubMatcher::maxBXLCT_
int maxBXLCT_
Definition: CSCStubMatcher.h:146
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:431
CSCStubMatcher::minBXLCT_
int minBXLCT_
Definition: CSCStubMatcher.h:146
CSCStubMatcher::maxBXCLCT_
int maxBXCLCT_
Definition: CSCStubMatcher.h:144
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
CSCStubMatcher::nChambersWithALCT
int nChambersWithALCT(int min_quality=0) const
Definition: CSCStubMatcher.cc:550
CSCStubMatcher::matchLCTsToSimTrack
void matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection &)
Definition: CSCStubMatcher.cc:239
CSCStubMatcher::maxBXMPLCT_
int maxBXMPLCT_
Definition: CSCStubMatcher.h:147
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
CSCStubMatcher::lctInChamber
bool lctInChamber(const CSCDetId &id, const CSCCorrelatedLCTDigi &lct) const
Definition: CSCStubMatcher.cc:610