CMS 3D CMS Logo

MuonSimHitMatcher.h
Go to the documentation of this file.
1 #ifndef Validation_MuonHits_MuonSimHitMatcher_h
2 #define Validation_MuonHits_MuonSimHitMatcher_h
3 
27 
28 #include <map>
29 #include <set>
30 #include <vector>
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  // access to all the Muon SimHits (use MuonSubdetId::SubSystem)
47  const edm::PSimHitContainer& simHits(int) const;
48 
49  // partitions' detIds with SimHits
50  std::set<unsigned int> detIds(int type = 0) const;
51 
52  // chamber detIds with SimHits
53  std::set<unsigned int> chamberIds(int type = 0) const;
54 
55  // simhits from a particular partition, chamber
56  const edm::PSimHitContainer& hitsInDetId(unsigned int) const;
57  const edm::PSimHitContainer& hitsInChamber(unsigned int) const;
58 
59  // calculate Global average position for a provided collection of simhits
61 
62  // calculate Global average momentum for a provided collection of simhits in
63  // CSC
65 
66  // calculate the average position at the second station
68 
69  const TrackingGeometry* geometry() { return geometry_; }
70 
71 protected:
72  std::vector<unsigned int> getIdsOfSimTrackShower(unsigned trk_id,
74  const edm::SimVertexContainer& simVertices);
75 
76  void clear();
77 
79  bool simMuOnly_;
81  bool verbose_;
83 
85 
89 
93 
96  // input collection
98 
99  std::vector<unsigned> track_ids_;
100  std::map<unsigned int, unsigned int> trkid_to_index_;
101 
103 
104  // selected hits
106  std::map<unsigned int, edm::PSimHitContainer> detid_to_hits_;
107  std::map<unsigned int, edm::PSimHitContainer> chamber_to_hits_;
108 
110 };
111 
112 #endif
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
const TrackingGeometry * geometry_
edm::PSimHitContainer hits_
std::set< unsigned int > detIds(int type=0) const
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
edm::SimTrackContainer simTracks_
GlobalPoint simHitsMeanPositionStation(int n) const
GlobalVector simHitsMeanMomentum(const edm::PSimHitContainer &sim_hits) const
edm::Handle< edm::SimVertexContainer > simVerticesH_
std::set< unsigned int > chamberIds(int type=0) const
edm::EDGetTokenT< edm::SimVertexContainer > simVertexInput_
const std::vector< float > & sim_hits()
Definition: LSTEff.cc:3312
std::vector< unsigned > track_ids_
const edm::PSimHitContainer & simHits(int) const
edm::PSimHitContainer simHits_
edm::SimVertexContainer simVertices_
edm::ParameterSet simHitPSet_
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
std::map< unsigned int, unsigned int > trkid_to_index_
edm::PSimHitContainer no_hits_
edm::Handle< edm::PSimHitContainer > simHitsH_
edm::Handle< edm::SimTrackContainer > simTracksH_
std::vector< SimVertex > SimVertexContainer
void match(const SimTrack &t, const SimVertex &v)
do the matching
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
edm::EDGetTokenT< edm::SimTrackContainer > simTrackInput_
MuonSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
std::vector< PSimHit > PSimHitContainer
std::vector< unsigned int > getIdsOfSimTrackShower(unsigned trk_id, const edm::SimTrackContainer &simTracks, const edm::SimVertexContainer &simVertices)
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
const TrackingGeometry * geometry()
std::vector< SimTrack > SimTrackContainer