CMS 3D CMS Logo

ChargeIsolation.h
Go to the documentation of this file.
1 /*
2 Functions to define isolation with respect to charge particles
3 
4 Authors: Seema Sharma, Sunanda Banerjee
5 Created: August 2009
6 */
7 
8 #ifndef CalibrationIsolatedParticlesChargeIsolation_h
9 #define CalibrationIsolatedParticlesChargeIsolation_h
10 
11 // system include files
12 #include <memory>
13 #include <cmath>
14 #include <string>
15 #include <map>
16 #include <vector>
17 
18 // user include files
21 
29 
35 
39 
40 namespace spr {
41  // Returns the maximum energy of a track within a NxN matrix around the
42  // impact of a given track on the ECAL surface. It assumes that all tracks
43  // are extrapolated to the ECAL surface and stored in a vectore *vdetIds*
44  double chargeIsolationEcal(unsigned int trkIndex,
45  std::vector<spr::propagatedTrackID>& vdetIds,
46  const CaloGeometry* geo,
47  const CaloTopology* caloTopology,
48  int ieta,
49  int iphi,
50  bool debug = false);
51 
52  double chargeIsolationGenEcal(unsigned int trkIndex,
53  std::vector<spr::propagatedGenParticleID>& trackIDs,
54  const CaloGeometry* geo,
55  const CaloTopology* caloTopology,
56  int ieta,
57  int iphi,
58  bool debug = false);
59 
60  // Returns the maximum energy of a track within a NxN matrix around the
61  // impact of a given track on the ECAL surface. It extrapolates all tracks
62  // in the collection to the ECAL surface in order to do the tests
63  double chargeIsolationEcal(const DetId& coreDet,
64  reco::TrackCollection::const_iterator trkItr,
66  const CaloGeometry* geo,
67  const CaloTopology* caloTopology,
68  const MagneticField* bField,
69  int ieta,
70  int iphi,
71  const std::string& theTrackQuality,
72  bool debug = false);
73 
74  // Returns the maximum energy of a track within a NxN matrix around the
75  // impact of a given track on the HCAL surface. It assumes that all tracks
76  // are extrapolated to the HCAL surface and stored in a vectore *vdetIds*
77  double chargeIsolationHcal(unsigned int trkIndex,
78  std::vector<spr::propagatedTrackID>& vdetIds,
79  const HcalTopology* topology,
80  int ieta,
81  int iphi,
82  bool debug = false);
83 
84  // Returns the maximum energy of a track within a NxN matrix around the
85  // impact of a given track on the HCAL surface. It extrapolates all tracks
86  // in the collection to the HCAL surface in order to do the tests
87  double chargeIsolationHcal(reco::TrackCollection::const_iterator trkItr,
89  const DetId ClosestCell,
90  const HcalTopology* topology,
91  const CaloSubdetectorGeometry* gHB,
92  const MagneticField* bField,
93  int ieta,
94  int iphi,
95  const std::string& theTrackQuality,
96  bool debug = false);
97 
98  bool chargeIsolation(const DetId anyCell, std::vector<DetId>& vdets);
99 
100  // Returns the maximum energy of a track within a cone of radius *dR*
101  // around the impact poiunt to the ECAL surface
102  double coneChargeIsolation(const edm::Event& iEvent,
103  const edm::EventSetup& iSetup,
104  reco::TrackCollection::const_iterator trkItr,
107  TrackAssociatorParameters& parameters_,
108  const std::string& theTrackQuality,
109  int& nNearTRKs,
110  int& nLayers_maxNearP,
111  int& trkQual_maxNearP,
112  double& maxNearP_goodTrk,
113  const GlobalPoint& hpoint1,
114  const GlobalVector& trackMom,
115  double dR);
116 
117  double chargeIsolationCone(unsigned int trkIndex,
118  std::vector<spr::propagatedTrackDirection>& trkDirs,
119  double dR,
120  int& nNearTRKs,
121  bool debug = false);
122 
123  double chargeIsolationGenCone(unsigned int trkIndex,
124  std::vector<spr::propagatedGenParticleID>& trackIDs,
125  double dR,
126  int& nNearTRKs,
127  bool debug = false);
128 
129  std::pair<double, double> chargeIsolationCone(unsigned int trkIndex,
130  std::vector<spr::propagatedTrackDirection>& trkDirs,
131  double dR,
132  bool debug = false);
133 
134  int coneChargeIsolation(const GlobalPoint& hpoint1,
135  const GlobalPoint& point2,
136  const GlobalVector& trackMom,
137  double dR);
138 
139  double chargeIsolation(const edm::Event& iEvent,
140  const edm::EventSetup& iSetup,
142  reco::TrackCollection::const_iterator trkItr,
144  const CaloSubdetectorGeometry* gEB,
145  const CaloSubdetectorGeometry* gEE,
147  TrackAssociatorParameters& parameters_,
148  int ieta,
149  int iphi,
150  const std::string& theTrackQuality,
151  bool debug = false);
152 
153  bool chargeIsolation(const DetId anyCell, CaloNavigator<DetId>& navigator, int deta, int dphi);
154 
155  double chargeIsolationEcal(const edm::Event& iEvent,
156  const edm::EventSetup& iSetup,
157  const DetId& coreDet,
158  reco::TrackCollection::const_iterator trkItr,
160  const CaloGeometry* geo,
161  const CaloTopology* caloTopology,
163  TrackAssociatorParameters& parameters_,
164  int ieta,
165  int iphi,
166  const std::string& theTrackQuality,
167  bool debug = false);
168 
169  double chargeIsolationHcal(const edm::Event& iEvent,
170  const edm::EventSetup& iSetup,
171  reco::TrackCollection::const_iterator trkItr,
173  const DetId ClosestCell,
174  const HcalTopology* topology,
175  const CaloSubdetectorGeometry* gHB,
177  TrackAssociatorParameters& parameters_,
178  int ieta,
179  int iphi,
180  const std::string& theTrackQuality,
181  bool debug = false);
182 
183 } // namespace spr
184 
185 #endif
double coneChargeIsolation(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::TrackCollection::const_iterator trkItr, edm::Handle< reco::TrackCollection > trkCollection, TrackDetectorAssociator &associator, TrackAssociatorParameters &parameters_, const std::string &theTrackQuality, int &nNearTRKs, int &nLayers_maxNearP, int &trkQual_maxNearP, double &maxNearP_goodTrk, const GlobalPoint &hpoint1, const GlobalVector &trackMom, double dR)
bool chargeIsolation(const DetId anyCell, std::vector< DetId > &vdets)
double chargeIsolationGenCone(unsigned int trkIndex, std::vector< spr::propagatedGenParticleID > &trackIDs, double dR, int &nNearTRKs, bool debug=false)
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
double chargeIsolationGenEcal(unsigned int trkIndex, std::vector< spr::propagatedGenParticleID > &trackIDs, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
double chargeIsolationEcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
int iEvent
Definition: GenABIO.cc:224
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
double chargeIsolationHcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)