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