test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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>
36  const FiducialVolume& volume,int nsteps,
37  float step, float minR, float minZ, float maxR, float maxZ);
38 
40  public:
41 
42  const std::vector<SteppingHelixStateInfo>& getEcalTrajectory() const;
43  const std::vector<SteppingHelixStateInfo>& getHcalTrajectory() const;
44  const std::vector<SteppingHelixStateInfo>& getHOTrajectory() const;
45  const std::vector<SteppingHelixStateInfo>& getPreshowerTrajectory() const;
46 
47 private:
49  friend std::vector<SteppingHelixStateInfo>
51  const FiducialVolume& volume,int nsteps,
52  float step, float minR, float minZ, float maxR, float maxZ);
53 
57 
59 
62 
63  void propagateForward(SteppingHelixStateInfo& state, float distance) dso_internal;
64  void propagate(SteppingHelixStateInfo& state, const Plane& plane) dso_internal;
65  void propagate(SteppingHelixStateInfo& state, const Cylinder& cylinder) dso_internal;
66 
68  TrajectoryStateOnSurface propagate(const Plane* plane) dso_internal;
69 
72  std::pair<float,float> trajectoryDelta( TrajectorType ) dso_internal;
73 
74  void setPropagator(const Propagator* ptr) dso_internal { propagator_ = ptr; }
76 
80  void getTrajectory(std::vector<SteppingHelixStateInfo>&,
81  const FiducialVolume&,
82  int steps = 4) dso_internal;
83 
85  void findHcalTrajectory(const FiducialVolume&) dso_internal;
86  void findHOTrajectory(const FiducialVolume&) dso_internal;
87  void findPreshowerTrajectory(const FiducialVolume&) dso_internal;
88 
89  std::vector<GlobalPoint>* getWideTrajectory(const std::vector<SteppingHelixStateInfo>&,
90  WideTrajectoryType) dso_internal;
91 
92  SteppingHelixStateInfo getStateAtEcal() dso_internal;
93  SteppingHelixStateInfo getStateAtPreshower() dso_internal;
94  SteppingHelixStateInfo getStateAtHcal() dso_internal;
95  SteppingHelixStateInfo getStateAtHO() dso_internal;
96 
97  //get the innermost state of the whole trajectory
98  SteppingHelixStateInfo getInnerState() dso_internal;
99  //get the outermost state of the whole trajectory
100  SteppingHelixStateInfo getOuterState() dso_internal;
101 
102  // specify the detector global boundaries to limit the propagator
103  // units: cm
104  // HINT: use lower bounds to limit propagateAll() action within
105  // smaller region, such as ECAL for example
106  void setMaxDetectorRadius(float r = 800.) dso_internal { maxRho_ = r;}
107  void setMaxDetectorLength(float l = 2200.) dso_internal { maxZ_ = l/2.;}
108  void setMaxHORadius(float r = 800.) dso_internal { HOmaxRho_ = r;}
109  void setMaxHOLength(float l = 2200.) dso_internal { HOmaxZ_ = l/2.;}
110  void setMinDetectorRadius(float r = 0.) dso_internal { minRho_ = r;}
111  void setMinDetectorLength(float l = 0.) dso_internal { minZ_ = l/2.;}
112 
113  void setPropagationStep(float s = 20.){ step_ = s;}
115 
116 protected:
117 
118  static int sign (float number) dso_internal {
119  if (number ==0) return 0;
120  if (number > 0)
121  return 1;
122  else
123  return -1;
124  }
125 
126  std::pair<float,float> delta( const double& theta1,
127  const double& theta2,
128  const double& phi1,
129  const double& phi2) dso_internal;
130 
131  float distance(const Plane* plane, int index) dso_internal {
132  if (index<0 || fullTrajectory_.empty() || (unsigned int)index >= fullTrajectory_.size()) return 0;
133  return plane->localZ(fullTrajectory_[index].position());
134  }
135 
136  std::deque<SteppingHelixStateInfo> fullTrajectory_;
137  std::vector<SteppingHelixStateInfo> ecalTrajectory_;
138  std::vector<SteppingHelixStateInfo> hcalTrajectory_;
139  std::vector<SteppingHelixStateInfo> hoTrajectory_;
140  std::vector<SteppingHelixStateInfo> preshowerTrajectory_;
141  std::vector<GlobalPoint> wideEcalTrajectory_;
142  std::vector<GlobalPoint> wideHcalTrajectory_;
143  std::vector<GlobalPoint> wideHOTrajectory_;
145 
147 
149 
150  float maxRho_;
151  float maxZ_;
152  float HOmaxRho_;
153  float HOmaxZ_;
154  float minRho_;
155  float minZ_;
156  float step_;
157 
158 };
159 #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:17
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()
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_
string const
Definition: compareJSON.py:14
void findEcalTrajectory(const FiducialVolume &)
#define dso_internal
SteppingHelixStateInfo getStateAtEcal()
static int position[264][3]
Definition: ReadPGInfo.cc:509
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)
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.)