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 
28 
29 #include <map>
30 #include <set>
31 #include <vector>
32 
34  public:
35  // constructor
37 
38  // destructor
40 
41  // initialize the event
42  void init(const edm::Event& e, const edm::EventSetup& eventSetup);
43 
44  // do the matching
45  void match(const SimTrack& t, const SimVertex& v);
46 
47  // access to all the Muon SimHits (use MuonSubdetId::SubSystem)
48  const edm::PSimHitContainer& simHits(int) const;
49 
50  // partitions' detIds with SimHits
51  std::set<unsigned int> detIds(int type = 0) const;
52 
53  // chamber detIds with SimHits
54  std::set<unsigned int> chamberIds(int type = 0) const;
55 
56  // simhits from a particular partition, chamber
57  const edm::PSimHitContainer& hitsInDetId(unsigned int) const;
58  const edm::PSimHitContainer& hitsInChamber(unsigned int) const;
59 
60  // calculate Global average position for a provided collection of simhits
62 
63  // calculate Global average momentum for a provided collection of simhits in
64  // CSC
66 
67  // calculate the average position at the second station
69 
70  protected:
71  std::vector<unsigned int> getIdsOfSimTrackShower(
72  unsigned trk_id, const edm::SimTrackContainer& simTracks,
74 
76  bool simMuOnly_;
78  bool verbose_;
80 
82 
86 
90 
93  // input collection
95 
96  std::vector<unsigned> track_ids_;
97  std::map<unsigned int, unsigned int> trkid_to_index_;
98 
100 
101  // selected hits
103  std::map<unsigned int, edm::PSimHitContainer> detid_to_hits_;
104  std::map<unsigned int, edm::PSimHitContainer> chamber_to_hits_;
105 
107 };
108 
109 #endif
type
Definition: HCALResponse.h:21
const TrackingGeometry * geometry_
edm::PSimHitContainer hits_
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
edm::SimTrackContainer simTracks_
std::set< unsigned int > chamberIds(int type=0) const
edm::Handle< edm::SimVertexContainer > simVerticesH_
edm::EDGetTokenT< edm::SimVertexContainer > simVertexInput_
std::vector< unsigned > track_ids_
GlobalPoint simHitsMeanPositionStation(int n) const
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
edm::PSimHitContainer simHits_
edm::SimVertexContainer simVertices_
const edm::PSimHitContainer & simHits(int) const
edm::ParameterSet simHitPSet_
GlobalVector simHitsMeanMomentum(const edm::PSimHitContainer &sim_hits) const
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
std::map< unsigned int, unsigned int > trkid_to_index_
edm::PSimHitContainer no_hits_
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
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_
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 edm::PSimHitContainer & hitsInChamber(unsigned int) const
std::set< unsigned int > detIds(int type=0) const
std::vector< SimTrack > SimTrackContainer