CMS 3D CMS Logo

CaloSimInfo.h
Go to the documentation of this file.
1 /*
2 Functions to give the details of parent track of SimHits.
3 
4 Authors: Seema Sharma, Sunanda Banerjee
5 Created: August 2009
6 */
7 
8 #ifndef CalibrationIsolatedParticlesCaloSimInfo_h
9 #define CalibrationIsolatedParticlesCaloSimInfo_h
10 
11 // system include files
12 #include <memory>
13 #include <map>
14 #include <vector>
15 #include <string>
16 
17 // user include files
19 
21 
27 
33 
39 
40 namespace spr {
41 
42  struct caloSimInfo {
44  double pdgMatched;
45  double eMatched;
46  double eGamma;
47  double eNeutralHad;
48  double eChargedHad;
49  double eRest;
50  double eTotal;
51  };
52 
53  // takes the EcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in a symmetric matrix (2*ieta+1)*(2*iphi+1)
54  template <typename T>
55  void eECALSimInfo(const edm::Event&,
56  const DetId& det,
57  const CaloGeometry* geo,
58  const CaloTopology* caloTopology,
59  edm::Handle<T>& hitsEB,
60  edm::Handle<T>& hitsEE,
63  const reco::Track* pTrack,
64  TrackerHitAssociator& associate,
65  int ieta,
66  int iphi,
68  double timeCut = 150,
69  bool debug = false);
70 
71  template <typename T>
72  std::map<std::string, double> eECALSimInfo(const edm::Event&,
73  const DetId& det,
74  const CaloGeometry* geo,
75  const CaloTopology* caloTopology,
76  edm::Handle<T>& hitsEB,
77  edm::Handle<T>& hitsEE,
80  const reco::Track* pTrack,
81  TrackerHitAssociator& associate,
82  int ieta,
83  int iphi,
84  double timeCut = 150,
85  bool debug = false);
86 
87  // takes the EcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in an symmetric matrix (ietaE+ietaW+1)*(iphiN+iphiS+1)
88  template <typename T>
89  void eECALSimInfo(const edm::Event&,
90  const DetId& det,
91  const CaloGeometry* geo,
92  const CaloTopology* caloTopology,
93  edm::Handle<T>& hitsEB,
94  edm::Handle<T>& hitsEE,
97  const reco::Track* pTrack,
98  TrackerHitAssociator& associate,
99  int ietaE,
100  int ietaW,
101  int iphiN,
102  int iphiS,
103  caloSimInfo& info,
104  double timeCut = 150,
105  bool debug = false);
106 
107  // takes the HcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in a symmetric matrix (2*ieta+1)*(2*iphi+1)
108  template <typename T>
109  std::map<std::string, double> eHCALSimInfo(const edm::Event&,
110  const HcalTopology* topology,
111  const DetId& det,
112  const CaloGeometry* geo,
116  const reco::Track* pTrack,
117  TrackerHitAssociator& associate,
118  int ieta,
119  int iphi,
120  double timeCut = 150,
121  bool includeHO = false,
122  bool debug = false);
123  template <typename T>
124  void eHCALSimInfo(const edm::Event&,
125  const HcalTopology* topology,
126  const DetId& det,
127  const CaloGeometry* geo,
131  const reco::Track* pTrack,
132  TrackerHitAssociator& associate,
133  int ieta,
134  int iphi,
135  caloSimInfo& info,
136  double timeCut = 150,
137  bool includeHO = false,
138  bool debug = false);
139 
140  //takes the HcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in an symmetric matrix (ietaE+ietaW+1)*(iphiN+iphiS+1)
141  template <typename T>
142  void eHCALSimInfo(const edm::Event&,
143  const HcalTopology* topology,
144  const DetId& det,
145  const CaloGeometry* geo,
149  const reco::Track* pTrack,
150  TrackerHitAssociator& associate,
151  int ietaE,
152  int ietaW,
153  int iphiN,
154  int iphiS,
155  caloSimInfo& info,
156  double timeCut = 150,
157  bool includeHO = false,
158  bool debug = false);
159 
160  // takes the HcalSimHits and returns a map energy matched to SimTrack, photons, neutral hadrons etc. in a symmetric matrix (2*ieta+1)*(2*iphi+1) and also a multiplicity vector
161  template <typename T>
162  std::map<std::string, double> eHCALSimInfo(const edm::Event& iEvent,
163  const HcalTopology* topology,
164  const DetId& det,
168  const reco::Track* pTrack,
169  TrackerHitAssociator& associate,
170  int ieta,
171  int iphi,
172  std::vector<int>& multiplicityVector,
173  bool debug = false);
174 
175  // Actual function which does the matching of SimHits to SimTracks using geantTrackId
176  template <typename T>
177  void eCaloSimInfo(std::vector<DetId> vdets,
178  const CaloGeometry* geo,
179  edm::Handle<T>& hitsEB,
180  edm::Handle<T>& hitsEE,
183  edm::SimTrackContainer::const_iterator trkInfo,
184  caloSimInfo& info,
185  double timeCut = 150,
186  bool debug = false);
187  template <typename T>
188  void eCaloSimInfo(const CaloGeometry* geo,
192  std::vector<typename T::const_iterator> hit,
193  edm::SimTrackContainer::const_iterator trkInfo,
194  caloSimInfo& info,
195  double timeCut = 150,
196  bool includeHO = false,
197  bool debug = false);
198  std::map<std::string, double> eCaloSimInfo(caloSimInfo& info);
199 
200  // Returns total energy of CaloSimHits which originate from the matching SimTrack
201  template <typename T>
202  double eCaloSimInfo(const edm::Event&,
203  const CaloGeometry* geo,
207  const reco::Track* pTrack,
208  TrackerHitAssociator& associate,
209  double timeCut = 150,
210  bool includeHO = false,
211  bool debug = false);
212 
213  template <typename T>
214  double eCaloSimInfo(const edm::Event&,
215  const CaloGeometry* geo,
216  edm::Handle<T>& hitsEB,
217  edm::Handle<T>& hitsEE,
220  const reco::Track* pTrack,
221  TrackerHitAssociator& associate,
222  double timeCut = 150,
223  bool debug = false);
224 
225  template <typename T>
226  std::map<std::string, double> eCaloSimInfo(edm::Handle<T>& hits,
229  std::vector<typename T::const_iterator> hit,
230  edm::SimTrackContainer::const_iterator trkInfo,
231  std::vector<int>& multiplicityVector,
232  bool debug = false);
233 
234  double timeOfFlight(DetId id, const CaloGeometry* geo, bool debug = false);
235 } // namespace spr
236 
237 #include "Calibration/IsolatedParticles/interface/CaloSimInfo.icc"
238 #endif
static const TGPicture * info(bool iBackgroundIsBlack)
void eCaloSimInfo(std::vector< DetId > vdets, const CaloGeometry *geo, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, edm::SimTrackContainer::const_iterator trkInfo, caloSimInfo &info, double timeCut=150, bool debug=false)
CaloTopology const * topology(0)
double eNeutralHad
Definition: CaloSimInfo.h:47
double eChargedHad
Definition: CaloSimInfo.h:48
int iEvent
Definition: GenABIO.cc:224
std::map< std::string, double > eHCALSimInfo(const edm::Event &, const HcalTopology *topology, const DetId &det, const CaloGeometry *geo, edm::Handle< T > &hits, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, double timeCut=150, bool includeHO=false, bool debug=false)
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
void eECALSimInfo(const edm::Event &, const DetId &det, const CaloGeometry *geo, const CaloTopology *caloTopology, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const reco::Track *pTrack, TrackerHitAssociator &associate, int ieta, int iphi, caloSimInfo &info, double timeCut=150, bool debug=false)
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
Definition: CaloSimInfo.cc:17