CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CachedTrajectory.h
Go to the documentation of this file.
1 #ifndef TrackAssociator_CachedTrajectory_h
2 #define TrackAssociator_CachedTrajectory_h 1
3 // -*- C++ -*-
4 //
5 // Package: TrackAssociator
6 // Class: CachedTrajectory
7 //
8 /*
9 
10  Description: CachedTrajectory is a transient class, which stores a set of
11  * trajectory states that can be used as starting points when there is need
12  * propagate the same track to a number of different surfaces, which might
13  * not be know in advance.
14 
15  Implementation:
16  <Notes on implementation>
17 */
18 //
19 // Original Author: Dmytro Kovalskyi
20 // Created: Fri Apr 21 10:59:41 PDT 2006
21 //
22 //
23 
31 #include <deque>
33 
34 std::vector<SteppingHelixStateInfo> propagateThoughFromIP(const SteppingHelixStateInfo& state,
35  const Propagator* prop,
36  const FiducialVolume& volume,
37  int nsteps,
38  float step,
39  float minR,
40  float minZ,
41  float maxR,
42  float maxZ);
43 
45 public:
46  const std::vector<SteppingHelixStateInfo>& getEcalTrajectory() const;
47  const std::vector<SteppingHelixStateInfo>& getHcalTrajectory() const;
48  const std::vector<SteppingHelixStateInfo>& getHOTrajectory() const;
49  const std::vector<SteppingHelixStateInfo>& getPreshowerTrajectory() const;
50 
51 private:
53  friend std::vector<SteppingHelixStateInfo> propagateThoughFromIP(const SteppingHelixStateInfo& state,
54  const Propagator* ptr,
55  const FiducialVolume& volume,
56  int nsteps,
57  float step,
58  float minR,
59  float minZ,
60  float maxR,
61  float maxZ);
62 
66 
68 
71 
72  void propagateForward(SteppingHelixStateInfo& state, float distance) dso_internal;
73  void propagate(SteppingHelixStateInfo& state, const Plane& plane) dso_internal;
74  void propagate(SteppingHelixStateInfo& state, const Cylinder& cylinder) dso_internal;
75 
77  TrajectoryStateOnSurface propagate(const Plane* plane) dso_internal;
78 
81  std::pair<float, float> trajectoryDelta(TrajectorType) dso_internal;
82 
83  void setPropagator(const Propagator* ptr) dso_internal { propagator_ = ptr; }
85 
89  void getTrajectory(std::vector<SteppingHelixStateInfo>&, const FiducialVolume&, int steps = 4) dso_internal;
90 
92  void findHcalTrajectory(const FiducialVolume&) dso_internal;
93  void findHOTrajectory(const FiducialVolume&) dso_internal;
94  void findPreshowerTrajectory(const FiducialVolume&) dso_internal;
95 
97  WideTrajectoryType) dso_internal;
98 
99  SteppingHelixStateInfo getStateAtEcal() dso_internal;
100  SteppingHelixStateInfo getStateAtPreshower() dso_internal;
101  SteppingHelixStateInfo getStateAtHcal() dso_internal;
102  SteppingHelixStateInfo getStateAtHO() dso_internal;
103 
104  //get the innermost state of the whole trajectory
105  SteppingHelixStateInfo getInnerState() dso_internal;
106  //get the outermost state of the whole trajectory
107  SteppingHelixStateInfo getOuterState() dso_internal;
108 
109  // specify the detector global boundaries to limit the propagator
110  // units: cm
111  // HINT: use lower bounds to limit propagateAll() action within
112  // smaller region, such as ECAL for example
113  void setMaxDetectorRadius(float r = 800.) dso_internal { maxRho_ = r; }
114  void setMaxDetectorLength(float l = 2200.) dso_internal { maxZ_ = l / 2.; }
115  void setMaxHORadius(float r = 800.) dso_internal { HOmaxRho_ = r; }
116  void setMaxHOLength(float l = 2200.) dso_internal { HOmaxZ_ = l / 2.; }
117  void setMinDetectorRadius(float r = 0.) dso_internal { minRho_ = r; }
118  void setMinDetectorLength(float l = 0.) dso_internal { minZ_ = l / 2.; }
119 
120  void setPropagationStep(float s = 20.) { step_ = s; }
122 
123 protected:
124  static int sign(float number) dso_internal {
125  if (number == 0)
126  return 0;
127  if (number > 0)
128  return 1;
129  else
130  return -1;
131  }
132 
133  std::pair<float, float> delta(const double& theta1, const double& theta2, const double& phi1, const double& phi2)
134  dso_internal;
135 
136  float distance(const Plane* plane, int index) dso_internal {
137  if (index < 0 || fullTrajectory_.empty() || (unsigned int)index >= fullTrajectory_.size())
138  return 0;
139  return plane->localZ(fullTrajectory_[index].position());
140  }
141 
142  std::deque<SteppingHelixStateInfo> fullTrajectory_;
143  std::vector<SteppingHelixStateInfo> ecalTrajectory_;
144  std::vector<SteppingHelixStateInfo> hcalTrajectory_;
145  std::vector<SteppingHelixStateInfo> hoTrajectory_;
146  std::vector<SteppingHelixStateInfo> preshowerTrajectory_;
147  std::vector<GlobalPoint> wideEcalTrajectory_;
148  std::vector<GlobalPoint> wideHcalTrajectory_;
149  std::vector<GlobalPoint> wideHOTrajectory_;
151 
153 
155 
156  float maxRho_;
157  float maxZ_;
158  float HOmaxRho_;
159  float HOmaxZ_;
160  float minRho_;
161  float minZ_;
162  float step_;
163 };
164 #endif
SteppingHelixStateInfo getStateAtHO()
float getPropagationStep() const
SteppingHelixStateInfo stateAtIP_
std::vector< SteppingHelixStateInfo > ecalTrajectory_
const std::vector< SteppingHelixStateInfo > & getHOTrajectory() const
void findPreshowerTrajectory(const FiducialVolume &)
const std::vector< SteppingHelixStateInfo > & getHcalTrajectory() const
const Propagator * propagator_
void setMinDetectorLength(float l=0.)
void setMinDetectorRadius(float r=0.)
void setMaxHOLength(float l=2200.)
void setPropagationStep(float s=20.)
void getTrajectory(std::vector< SteppingHelixStateInfo > &, const FiducialVolume &, int steps=4)
std::vector< GlobalPoint > wideHcalTrajectory_
const std::vector< SteppingHelixStateInfo > & getPreshowerTrajectory() const
void findHcalTrajectory(const FiducialVolume &)
Definition: Plane.h:16
std::vector< GlobalPoint > wideEcalTrajectory_
SteppingHelixStateInfo getStateAtPreshower()
std::vector< SteppingHelixStateInfo > hoTrajectory_
std::vector< GlobalPoint > wideHOTrajectory_
bool propagateAll(const SteppingHelixStateInfo &initialState)
propagate through the whole detector, returns true if successful
const std::vector< SteppingHelixStateInfo > & getEcalTrajectory() const
float distance(const Plane *plane, int index)
void setMaxHORadius(float r=800.)
SteppingHelixStateInfo getInnerState()
#define dso_internal
Definition: Visibility.h:13
std::pair< float, float > trajectoryDelta(TrajectorType)
std::vector< SteppingHelixStateInfo > preshowerTrajectory_
friend std::vector< SteppingHelixStateInfo > propagateThoughFromIP(const SteppingHelixStateInfo &state, const Propagator *ptr, const FiducialVolume &volume, int nsteps, float step, float minR, float minZ, float maxR, float maxZ)
std::vector< GlobalPoint > * getWideTrajectory(const std::vector< SteppingHelixStateInfo > &, WideTrajectoryType)
SteppingHelixStateInfo getOuterState()
void setPropagator(const Propagator *ptr)
std::pair< float, float > delta(const double &theta1, const double &theta2, const double &phi1, const double &phi2)
void propagate(SteppingHelixStateInfo &state, const Plane &plane)
std::deque< SteppingHelixStateInfo > fullTrajectory_
void findEcalTrajectory(const FiducialVolume &)
SteppingHelixStateInfo getStateAtEcal()
static int position[264][3]
Definition: ReadPGInfo.cc:289
void findHOTrajectory(const FiducialVolume &)
std::vector< SteppingHelixStateInfo > propagateThoughFromIP(const SteppingHelixStateInfo &state, const Propagator *prop, const FiducialVolume &volume, int nsteps, float step, float minR, float minZ, float maxR, float maxZ)
step
Definition: StallMonitor.cc:94
void propagateForward(SteppingHelixStateInfo &state, float distance)
void setStateAtIP(const SteppingHelixStateInfo &state)
static int sign(float number)
void setMaxDetectorLength(float l=2200.)
SteppingHelixStateInfo getStateAtHcal()
std::vector< SteppingHelixStateInfo > hcalTrajectory_
void setMaxDetectorRadius(float r=800.)