CMS 3D CMS Logo

CaloPropagateTrack.h
Go to the documentation of this file.
1 #ifndef CalibrationIsolatedParticlesCaloPropagateTrack_h
2 #define CalibrationIsolatedParticlesCaloPropagateTrack_h
3 
4 #include <cmath>
5 #include <vector>
6 #include <string>
7 
16 
17 //sim track
24 
28 
29 namespace spr {
30 
31  struct propagatedTrack {
32  propagatedTrack() { ok = false; }
33  bool ok;
36  };
37 
40  ok = false;
41  okECAL = false;
42  okHCAL = false;
43  }
44  bool ok, okECAL, okHCAL;
46  double etaECAL, etaHCAL;
47  double phiECAL, phiHCAL;
48  reco::TrackCollection::const_iterator trkItr;
49  };
50 
53  ok = false;
54  okECAL = false;
55  okHCAL = false;
56  }
57  bool ok, okECAL, okHCAL;
61  reco::TrackCollection::const_iterator trkItr;
62  };
63 
66  ok = okECAL = okHCAL = false;
67  charge = pdgId = 0;
68  }
69  bool ok, okECAL, okHCAL;
73  int charge, pdgId;
74  HepMC::GenEvent::particle_const_iterator trkItr;
75  };
76 
79  ok = okECAL = okHCAL = false;
80  charge = pdgId = 0;
81  }
82  bool ok, okECAL, okHCAL;
86  int charge, pdgId;
87  reco::GenParticleCollection::const_iterator trkItr;
88  };
89 
90  struct trackAtOrigin {
91  trackAtOrigin() { ok = false; }
92  bool ok;
93  int charge;
96  };
97 
98  // Returns a vector of DetID's of closest cell on the ECAL/HCAL surface of
99  // all the tracks in the collection. Also saves a boolean if extrapolation
100  // is satisfactory
101  std::vector<spr::propagatedTrackID> propagateCosmicCALO(edm::Handle<reco::TrackCollection>& trkCollection,
102  const CaloGeometry* geo,
103  const MagneticField* bField,
104  const std::string& theTrackQuality,
105  bool debug = false);
106  std::vector<spr::propagatedTrackID> propagateCALO(edm::Handle<reco::TrackCollection>& trkCollection,
107  const CaloGeometry* geo,
108  const MagneticField* bField,
109  const std::string& theTrackQuality,
110  bool debug = false);
112  const CaloGeometry* geo,
113  const MagneticField* bField,
114  const std::string& theTrackQuality,
115  std::vector<spr::propagatedTrackID>& vdets,
116  bool debug = false);
118  const CaloGeometry* geo,
119  const MagneticField* bField,
120  const std::string& theTrackQuality,
121  std::vector<spr::propagatedTrackDirection>& trkDir,
122  bool debug = false);
124  const CaloGeometry* geo,
125  const MagneticField* bField,
126  bool debug = false);
127  std::vector<spr::propagatedGenTrackID> propagateCALO(const HepMC::GenEvent* genEvent,
128  const ParticleDataTable* pdt,
129  const CaloGeometry* geo,
130  const MagneticField* bField,
131  double etaMax = 3.0,
132  bool debug = false);
133  std::vector<spr::propagatedGenParticleID> propagateCALO(edm::Handle<reco::GenParticleCollection>& genParticles,
134  const ParticleDataTable* pdt,
135  const CaloGeometry* geo,
136  const MagneticField* bField,
137  double etaMax = 3.0,
138  bool debug = false);
139  spr::propagatedTrackDirection propagateCALO(unsigned int thisTrk,
142  const CaloGeometry* geo,
143  const MagneticField* bField,
144  bool debug = false);
148  const CaloGeometry* geo,
149  const MagneticField* bField,
150  bool debug = false);
151  std::pair<bool, HcalDetId> propagateHCALBack(const reco::Track*,
152  const CaloGeometry* geo,
153  const MagneticField* bField,
154  bool debug = false);
155 
156  // Propagate tracks to the ECAL surface and optionally returns the
157  // extrapolated point (and the track direction at point of extrapolation)
159  spr::propagatedTrack propagateTrackToECAL(unsigned int thisTrk,
162  const MagneticField*,
163  bool debug = false);
164  std::pair<math::XYZPoint, bool> propagateECAL(const reco::Track*, const MagneticField*, bool debug = false);
165  std::pair<DetId, bool> propagateIdECAL(const HcalDetId& id,
166  const CaloGeometry* geo,
167  const MagneticField*,
168  bool debug = false);
169  std::pair<math::XYZPoint, bool> propagateECAL(
170  const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField*, bool debug = false);
171 
172  // Propagate tracks to the HCAL surface and optionally returns the
173  // extrapolated point (and the track direction at point of extrapolation)
175  spr::propagatedTrack propagateTrackToHCAL(unsigned int thisTrk,
178  const MagneticField*,
179  bool debug = false);
180  std::pair<math::XYZPoint, bool> propagateHCAL(const reco::Track*, const MagneticField*, bool debug = false);
181  std::pair<math::XYZPoint, bool> propagateHCAL(
182  const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField*, bool debug = false);
183 
184  // Propagate the track to the end of the tracker and returns the extrapolated
185  // point and optionally the length of the track upto the end
186  std::pair<math::XYZPoint, bool> propagateTracker(const reco::Track*, const MagneticField*, bool debug = false);
187  std::pair<math::XYZPoint, double> propagateTrackerEnd(const reco::Track*, const MagneticField*, bool debug = false);
188 
190  const GlobalVector& momentum,
191  int charge,
192  const MagneticField*,
193  float zdist,
194  float radius,
195  float corner,
196  bool debug = false);
197 
198  // Gives the vertex and momentum of a SimTrack
199  spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk,
202  bool debug = false);
203 
204  //Get HcalDetID's for two values of r/z
205  bool propagateHCAL(const reco::Track* track,
206  const CaloGeometry* geo,
207  const MagneticField* bField,
208  bool typeRZ,
209  const std::pair<double, double> rz,
210  bool debug);
211  bool propagateHCAL(unsigned int thisTrk,
214  const CaloGeometry* geo,
215  const MagneticField* bField,
216  bool typeRZ,
217  const std::pair<double, double> rz,
218  bool debug);
219  std::pair<HcalDetId, HcalDetId> propagateHCAL(const CaloGeometry* geo,
220  const MagneticField* bField,
221  const GlobalPoint& vertex,
222  const GlobalVector& momentum,
223  int charge,
224  bool typeRZ,
225  const std::pair<double, double> rz,
226  bool debug);
227 
228 } // namespace spr
229 #endif
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
HepPDT::ParticleDataTable ParticleDataTable
std::pair< DetId, bool > propagateIdECAL(const HcalDetId &id, const CaloGeometry *geo, const MagneticField *, bool debug=false)
reco::GenParticleCollection::const_iterator trkItr
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
HepMC::GenEvent::particle_const_iterator trkItr
reco::TrackCollection::const_iterator trkItr
spr::propagatedTrackDirection propagateHCALBack(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
std::pair< math::XYZPoint, bool > propagateTracker(const reco::Track *, const MagneticField *, bool debug=false)
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
spr::propagatedTrack propagateTrackToECAL(const reco::Track *, const MagneticField *, bool debug=false)
Definition: DetId.h:17
#define debug
Definition: HDRShower.cc:19
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< spr::propagatedTrackID > propagateCosmicCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
std::pair< math::XYZPoint, double > propagateTrackerEnd(const reco::Track *, const MagneticField *, bool debug=false)
reco::TrackCollection::const_iterator trkItr
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)