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 
30 
31 namespace spr{
32 
33  struct propagatedTrack {
34  propagatedTrack() {ok=false;}
35  bool ok;
38  };
39 
41  propagatedTrackID() {ok=false; okECAL=false; okHCAL=false;}
42  bool ok, okECAL, okHCAL;
43  DetId detIdECAL, detIdHCAL, detIdEHCAL;
44  double etaECAL, etaHCAL;
45  double phiECAL, phiHCAL;
46  reco::TrackCollection::const_iterator trkItr;
47  };
48 
50  propagatedTrackDirection() {ok=false; okECAL=false; okHCAL=false;}
51  bool ok, okECAL, okHCAL;
52  DetId detIdECAL, detIdHCAL, detIdEHCAL;
53  GlobalPoint pointECAL, pointHCAL;
54  GlobalVector directionECAL, directionHCAL;
55  reco::TrackCollection::const_iterator trkItr;
56  };
57 
60  ok=okECAL=okHCAL=false;
61  charge=pdgId=0;
62  }
63  bool ok, okECAL, okHCAL;
64  DetId detIdECAL, detIdHCAL, detIdEHCAL;
65  GlobalPoint pointECAL, pointHCAL;
66  GlobalVector directionECAL, directionHCAL;
67  int charge, pdgId;
68  HepMC::GenEvent::particle_const_iterator trkItr;
69  };
70 
73  ok=okECAL=okHCAL=false;
74  charge=pdgId=0;
75  }
76  bool ok, okECAL, okHCAL;
77  DetId detIdECAL, detIdHCAL, detIdEHCAL;
78  GlobalPoint pointECAL, pointHCAL;
79  GlobalVector directionECAL, directionHCAL;
80  int charge, pdgId;
81  reco::GenParticleCollection::const_iterator trkItr;
82  };
83 
84  struct trackAtOrigin {
85  trackAtOrigin() {ok=false;}
86  bool ok;
87  int charge;
90  };
91 
92  // Returns a vector of DetID's of closest cell on the ECAL/HCAL surface of
93  // all the tracks in the collection. Also saves a boolean if extrapolation
94  // is satisfactory
95  std::vector<spr::propagatedTrackID> propagateCosmicCALO(edm::Handle<reco::TrackCollection>& trkCollection, const CaloGeometry* geo, const MagneticField* bField, std::string & theTrackQuality, bool debug=false);
96  std::vector<spr::propagatedTrackID> propagateCALO(edm::Handle<reco::TrackCollection>& trkCollection, const CaloGeometry* geo, const MagneticField* bField, std::string & theTrackQuality, bool debug=false);
97  void propagateCALO(edm::Handle<reco::TrackCollection>& trkCollection, const CaloGeometry* geo, const MagneticField* bField, std::string & theTrackQuality, std::vector<spr::propagatedTrackID>& vdets, bool debug=false);
98  void propagateCALO(edm::Handle<reco::TrackCollection>& trkCollection, const CaloGeometry* geo, const MagneticField* bField, std::string & theTrackQuality, std::vector<spr::propagatedTrackDirection>& trkDir, bool debug=false);
100  std::vector<spr::propagatedGenTrackID> propagateCALO(const HepMC::GenEvent * genEvent, edm::ESHandle<ParticleDataTable>& pdt, const CaloGeometry* geo, const MagneticField* bField, double etaMax=3.0, bool debug=false);
101  std::vector<spr::propagatedGenParticleID> propagateCALO(edm::Handle<reco::GenParticleCollection>& genParticles, edm::ESHandle<ParticleDataTable>& pdt, const CaloGeometry* geo, const MagneticField* bField, double etaMax=3.0, bool debug=false);
104  std::pair<bool,HcalDetId> propagateHCALBack(const reco::Track*, const CaloGeometry* geo, const MagneticField* bField, bool debug=false);
105 
106  // Propagate tracks to the ECAL surface and optionally returns the
107  // extrapolated point (and the track direction at point of extrapolation)
110  std::pair<math::XYZPoint,bool> propagateECAL(const reco::Track*, const MagneticField*, bool debug=false);
111  std::pair<DetId,bool> propagateIdECAL(const HcalDetId& id, const CaloGeometry* geo, const MagneticField*, bool debug=false);
112  std::pair<math::XYZPoint,bool> propagateECAL(const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField*, bool debug=false);
113 
114  // Propagate tracks to the HCAL surface and optionally returns the
115  // extrapolated point (and the track direction at point of extrapolation)
118  std::pair<math::XYZPoint,bool> propagateHCAL(const reco::Track*, const MagneticField*, bool debug=false);
119  std::pair<math::XYZPoint,bool> propagateHCAL(const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField*, bool debug=false);
120 
121  // Propagate the track to the end of the tracker and returns the extrapolated
122  // point and optionally the length of the track upto the end
123  std::pair<math::XYZPoint,bool> propagateTracker(const reco::Track*, const MagneticField*, bool debug=false);
124  std::pair<math::XYZPoint,double> propagateTrackerEnd(const reco::Track*, const MagneticField*, bool debug=false);
125 
126  spr::propagatedTrack propagateCalo(const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField*, float zdist, float radius, float corner, bool debug=false);
127 
128  // Gives the vertex and momentum of a SimTrack
130 
131 }
132 #endif
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
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:18
#define debug
Definition: HDRShower.cc:19
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::pair< math::XYZPoint, double > propagateTrackerEnd(const reco::Track *, const MagneticField *, bool debug=false)
std::vector< spr::propagatedTrackID > propagateCosmicCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
reco::TrackCollection::const_iterator trkItr
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)