CMS 3D CMS Logo

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