CMS 3D CMS Logo

CSCRecHitMatcher.h
Go to the documentation of this file.
1 #ifndef Validation_CSCRecHits_CSCRecHitMatcher_h
2 #define Validation_CSCRecHits_CSCRecHitMatcher_h
3 
24 
25 #include <vector>
26 #include <map>
27 #include <set>
28 
29 typedef std::vector<CSCRecHit2D> CSCRecHit2DContainer;
30 typedef std::vector<CSCSegment> CSCSegmentContainer;
31 
33 public:
34  // constructor
36 
37  // destructor
39 
40  // initialize the event
41  void init(const edm::Event& e, const edm::EventSetup& eventSetup);
42 
43  // do the matching
44  void match(const SimTrack& t, const SimVertex& v);
45 
46  // layer detIds with CSCRecHit2D
47  std::set<unsigned int> layerIdsCSCRecHit2D() const;
48  // chamber detIds with CSCRecHit2D
49  std::set<unsigned int> chamberIdsCSCRecHit2D() const;
50  // chamber detIds with CSCSegment
51  std::set<unsigned int> chamberIdsCSCSegment() const;
52 
53  //CSC rechits from a particular layer or chamber
54  const CSCRecHit2DContainer& cscRecHit2DsInLayer(unsigned int) const;
55  const CSCRecHit2DContainer& cscRecHit2DsInChamber(unsigned int) const;
56  //CSC segments from a particular chamber
57  const CSCSegmentContainer& cscSegmentsInChamber(unsigned int) const;
58 
59  const CSCSegmentContainer cscSegments() const;
60  const CSCRecHit2DContainer cscRecHit2Ds() const;
61 
62  // check if a certain rechit appears in a container
63  bool cscRecHit2DInContainer(const CSCRecHit2D&, const CSCRecHit2DContainer&) const;
64  bool cscSegmentInContainer(const CSCSegment&, const CSCSegmentContainer&) const;
65 
66  // check if a certain rechit was matched to a simtrack
67  bool isCSCRecHit2DMatched(const CSCRecHit2D&) const;
68  bool isCSCSegmentMatched(const CSCSegment&) const;
69 
70  int nCSCRecHit2Ds() const;
71  int nCSCSegments() const;
72  bool areCSCSegmentsSame(const CSCSegment&, const CSCSegment&) const;
73  bool areCSCRecHit2DsSame(const CSCRecHit2D&, const CSCRecHit2D&) const;
74 
75  int nCSCRecHit2DsInLayer(unsigned int) const;
76  int nCSCRecHit2DsInChamber(unsigned int) const;
77  int nCSCSegmentsInChamber(unsigned int) const;
78 
79  CSCSegment bestCSCSegment(unsigned int);
80 
81  GlobalPoint globalPoint(const CSCSegment&) const;
82 
83 private:
84  std::unique_ptr<CSCDigiMatcher> cscDigiMatcher_;
85 
88 
91 
94 
97 
101 
105 
106  std::map<unsigned int, CSCRecHit2DContainer> layer_to_cscRecHit2D_;
107  std::map<unsigned int, CSCRecHit2DContainer> chamber_to_cscRecHit2D_;
108  std::map<unsigned int, CSCSegmentContainer> chamber_to_cscSegment_;
109 
112 };
113 
114 #endif
const CSCSegmentContainer & cscSegmentsInChamber(unsigned int) const
std::map< unsigned int, CSCRecHit2DContainer > chamber_to_cscRecHit2D_
bool isCSCSegmentMatched(const CSCSegment &) const
int nCSCRecHit2DsInLayer(unsigned int) const
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
int nCSCRecHit2DsInChamber(unsigned int) const
std::map< unsigned int, CSCSegmentContainer > chamber_to_cscSegment_
void matchCSCRecHit2DsToSimTrack(const CSCRecHit2DCollection &)
bool areCSCRecHit2DsSame(const CSCRecHit2D &, const CSCRecHit2D &) const
CSCRecHitMatcher(edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
bool isCSCRecHit2DMatched(const CSCRecHit2D &) const
std::set< unsigned int > chamberIdsCSCRecHit2D() const
const CSCRecHit2DContainer & cscRecHit2DsInLayer(unsigned int) const
const CSCRecHit2DContainer cscRecHit2Ds() const
edm::EDGetTokenT< CSCRecHit2DCollection > cscRecHit2DToken_
GlobalPoint globalPoint(const CSCSegment &) const
const CSCRecHit2DContainer & cscRecHit2DsInChamber(unsigned int) const
CSCSegment bestCSCSegment(unsigned int)
std::map< unsigned int, CSCRecHit2DContainer > layer_to_cscRecHit2D_
int nCSCRecHit2Ds() const
const CSCGeometry * cscGeometry_
edm::Handle< CSCSegmentCollection > cscSegmentH_
const CSCSegmentContainer cscSegments() const
std::set< unsigned int > chamberIdsCSCSegment() const
int nCSCSegments() const
void matchCSCSegmentsToSimTrack(const CSCSegmentCollection &)
edm::EDGetTokenT< CSCSegmentCollection > cscSegmentToken_
std::vector< CSCSegment > CSCSegmentContainer
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
std::set< unsigned int > layerIdsCSCRecHit2D() const
bool cscRecHit2DInContainer(const CSCRecHit2D &, const CSCRecHit2DContainer &) const
bool areCSCSegmentsSame(const CSCSegment &, const CSCSegment &) const
CSCSegmentContainer no_cscSegments_
std::unique_ptr< CSCDigiMatcher > cscDigiMatcher_
void match(const SimTrack &t, const SimVertex &v)
do the matching
bool cscSegmentInContainer(const CSCSegment &, const CSCSegmentContainer &) const
CSCRecHit2DContainer no_cscRecHit2Ds_
edm::Handle< CSCRecHit2DCollection > cscRecHit2DH_
int nCSCSegmentsInChamber(unsigned int) const
std::vector< CSCRecHit2D > CSCRecHit2DContainer