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(unsigned trk_id,
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
Vector3DBase
Definition: Vector3DBase.h:8
MuonSimHitMatcher::simHitsMeanMomentum
GlobalVector simHitsMeanMomentum(const edm::PSimHitContainer &sim_hits) const
Definition: MuonSimHitMatcher.cc:119
MuonSimHitMatcher::simVerticesH_
edm::Handle< edm::SimVertexContainer > simVerticesH_
Definition: MuonSimHitMatcher.h:88
SimVertex
Definition: SimVertex.h:5
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
TrackingGeometry
Definition: TrackingGeometry.h:26
ESHandle.h
MuonSimHitMatcher::geometry_
const TrackingGeometry * geometry_
Definition: MuonSimHitMatcher.h:81
edm::EDGetTokenT< edm::SimVertexContainer >
MuonSimHitMatcher::verbose_
bool verbose_
Definition: MuonSimHitMatcher.h:78
PSimHitContainer.h
MuonSimHitMatcher::detid_to_hits_
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
Definition: MuonSimHitMatcher.h:103
MuonSimHitMatcher::~MuonSimHitMatcher
~MuonSimHitMatcher()
Definition: MuonSimHitMatcher.h:39
MuonSimHitMatcher::simHitsMeanPosition
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
Definition: MuonSimHitMatcher.cc:99
MuonSimHitMatcher::simTracks_
edm::SimTrackContainer simTracks_
Definition: MuonSimHitMatcher.h:91
TrackCandidateProducer_cfi.simTracks
simTracks
Definition: TrackCandidateProducer_cfi.py:15
TrackingGeometry.h
findQualityFiles.v
v
Definition: findQualityFiles.py:179
MuonSimHitMatcher::detIds
std::set< unsigned int > detIds(int type=0) const
edm::Handle< edm::SimTrackContainer >
MuonSimHitMatcher::chamberIds
std::set< unsigned int > chamberIds(int type=0) const
MuonSimHitMatcher::simHits_
edm::PSimHitContainer simHits_
Definition: MuonSimHitMatcher.h:94
MuonSimHitMatcher::simVertices_
edm::SimVertexContainer simVertices_
Definition: MuonSimHitMatcher.h:92
MuonSimHitMatcher::simVertexInput_
edm::EDGetTokenT< edm::SimVertexContainer > simVertexInput_
Definition: MuonSimHitMatcher.h:83
MuonSimHitMatcher::simHitsMeanPositionStation
GlobalPoint simHitsMeanPositionStation(int n) const
MuonSimHitMatcher::simHitPSet_
edm::ParameterSet simHitPSet_
Definition: MuonSimHitMatcher.h:106
MuonSimHitMatcher::simHits
const edm::PSimHitContainer & simHits(int) const
Definition: MuonSimHitMatcher.cc:85
MuonSimHitMatcher::trkid_to_index_
std::map< unsigned int, unsigned int > trkid_to_index_
Definition: MuonSimHitMatcher.h:97
Point3DBase< float, GlobalTag >
OrderedSet.t
t
Definition: OrderedSet.py:90
MuonSimHitMatcher::track_ids_
std::vector< unsigned > track_ids_
Definition: MuonSimHitMatcher.h:96
MuonSimHitMatcher::no_hits_
edm::PSimHitContainer no_hits_
Definition: MuonSimHitMatcher.h:99
MuonSimHitMatcher::discardEleHits_
bool discardEleHits_
Definition: MuonSimHitMatcher.h:77
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
MuonSimHitMatcher
Definition: MuonSimHitMatcher.h:33
MuonSimHitMatcher::match
void match(const SimTrack &t, const SimVertex &v)
do the matching
Definition: MuonSimHitMatcher.cc:26
MuonSimHitMatcher::hasGeometry_
bool hasGeometry_
Definition: MuonSimHitMatcher.h:79
MuonSimHitMatcher::chamber_to_hits_
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
Definition: MuonSimHitMatcher.h:104
edm::EventSetup
Definition: EventSetup.h:57
MuonSimHitMatcher::verboseSimTrack_
bool verboseSimTrack_
Definition: MuonSimHitMatcher.h:75
MuonSimHitMatcher::simHitInput_
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
Definition: MuonSimHitMatcher.h:85
InputTag.h
MuonSimHitMatcher::hitsInDetId
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
Definition: MuonSimHitMatcher.cc:87
type
type
Definition: HCALResponse.h:21
MuonSimHitMatcher::simTracksH_
edm::Handle< edm::SimTrackContainer > simTracksH_
Definition: MuonSimHitMatcher.h:87
TrapezoidalStripTopology.h
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
SimTrack
Definition: SimTrack.h:6
Frameworkfwd.h
options_cfi.eventSetup
eventSetup
Definition: options_cfi.py:12
MuonSimHitMatcher::getIdsOfSimTrackShower
std::vector< unsigned int > getIdsOfSimTrackShower(unsigned trk_id, const edm::SimTrackContainer &simTracks, const edm::SimVertexContainer &simVertices)
Definition: MuonSimHitMatcher.cc:47
EventSetup.h
MuonSimHitMatcher::simMuOnly_
bool simMuOnly_
Definition: MuonSimHitMatcher.h:76
MuonSimHitMatcher::simHitsH_
edm::Handle< edm::PSimHitContainer > simHitsH_
Definition: MuonSimHitMatcher.h:89
MuonSimHitMatcher::hitsInChamber
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
Definition: MuonSimHitMatcher.cc:93
MuonSimHitMatcher::simTrackInput_
edm::EDGetTokenT< edm::SimTrackContainer > simTrackInput_
Definition: MuonSimHitMatcher.h:84
ConsumesCollector.h
HGCalValidator_cfi.simVertices
simVertices
Definition: HGCalValidator_cfi.py:43
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
ParameterSet.h
MuonGeometryRecord.h
MuonHitHelper.h
MuonSimHitMatcher::hits_
edm::PSimHitContainer hits_
Definition: MuonSimHitMatcher.h:102
edm::Event
Definition: Event.h:73
MuonSimHitMatcher::init
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
Definition: MuonSimHitMatcher.cc:17
GlobalPoint.h
SimTrackContainer.h
edm::SimVertexContainer
std::vector< SimVertex > SimVertexContainer
Definition: SimVertexContainer.h:12
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
SimVertexContainer.h
deltaPhi.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
MuonSimHitMatcher::MuonSimHitMatcher
MuonSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
Definition: MuonSimHitMatcher.cc:7