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 // $Id: CachedTrajectory.h,v 1.20 2011/04/21 06:58:12 innocent Exp $
22 //
23 //
24 
32 #include <deque>
34 
35 std::vector<SteppingHelixStateInfo>
37  const FiducialVolume& volume,int nsteps,
38  float step, float minR, float minZ, float maxR, float maxZ);
39 
40 
42 private:
44  friend std::vector<SteppingHelixStateInfo>
46  const FiducialVolume& volume,int nsteps,
47  float step, float minR, float minZ, float maxR, float maxZ);
48 
52 
54 
57 
58  void propagateForward(SteppingHelixStateInfo& state, float distance) dso_internal;
59  void propagate(SteppingHelixStateInfo& state, const Plane& plane) dso_internal;
60  void propagate(SteppingHelixStateInfo& state, const Cylinder& cylinder) dso_internal;
61 
63  TrajectoryStateOnSurface propagate(const Plane* plane) dso_internal;
64 
67  std::pair<float,float> trajectoryDelta( TrajectorType ) dso_internal;
68 
69  void setPropagator(const Propagator* ptr) dso_internal { propagator_ = ptr; }
71 
75  void getTrajectory(std::vector<SteppingHelixStateInfo>&,
76  const FiducialVolume&,
77  int steps = 4) dso_internal;
78 
80  void findHcalTrajectory(const FiducialVolume&) dso_internal;
81  void findHOTrajectory(const FiducialVolume&) dso_internal;
82  void findPreshowerTrajectory(const FiducialVolume&) dso_internal;
83 
84  const std::vector<SteppingHelixStateInfo>& getEcalTrajectory() dso_internal;
85  const std::vector<SteppingHelixStateInfo>& getHcalTrajectory() dso_internal;
86  const std::vector<SteppingHelixStateInfo>& getHOTrajectory() dso_internal;
87  const std::vector<SteppingHelixStateInfo>& getPreshowerTrajectory() 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()
const std::vector< SteppingHelixStateInfo > & getHcalTrajectory()
float getPropagationStep() const
SteppingHelixStateInfo stateAtIP_
std::vector< SteppingHelixStateInfo > ecalTrajectory_
list step
Definition: launcher.py:15
void findPreshowerTrajectory(const FiducialVolume &)
const Propagator * propagator_
void setMinDetectorLength(float l=0.)
const std::vector< SteppingHelixStateInfo > & getEcalTrajectory()
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_
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
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_
string const
Definition: compareJSON.py:14
void findEcalTrajectory(const FiducialVolume &)
const std::vector< SteppingHelixStateInfo > & getHOTrajectory()
char state
Definition: procUtils.cc:75
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)
const std::vector< SteppingHelixStateInfo > & getPreshowerTrajectory()
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.)