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.13 2009/09/06 16:32:46 dmytro Exp $
22 //
23 //
24 
32 #include <deque>
33 
35  public:
39 
40  void reset_trajectory();
41 
43  bool propagateAll(const SteppingHelixStateInfo& initialState);
44 
46  void propagate(SteppingHelixStateInfo& state, const Plane& plane);
47  void propagate(SteppingHelixStateInfo& state, const Cylinder& cylinder);
48 
51 
54  std::pair<float,float> trajectoryDelta( TrajectorType );
55 
56  void setPropagator(const Propagator* ptr){ propagator_ = ptr; }
58 
62  void getTrajectory(std::vector<SteppingHelixStateInfo>&,
63  const FiducialVolume&,
64  int steps = 4);
65 
68  void findHOTrajectory(const FiducialVolume&);
70 
71  const std::vector<SteppingHelixStateInfo>& getEcalTrajectory();
72  const std::vector<SteppingHelixStateInfo>& getHcalTrajectory();
73  const std::vector<SteppingHelixStateInfo>& getHOTrajectory();
74  const std::vector<SteppingHelixStateInfo>& getPreshowerTrajectory();
75 
76  std::vector<GlobalPoint>* getWideTrajectory(const std::vector<SteppingHelixStateInfo>&,
78 
83 
84  //get the innermost state of the whole trajectory
86  //get the outermost state of the whole trajectory
88 
89  // specify the detector global boundaries to limit the propagator
90  // units: cm
91  // HINT: use lower bounds to limit propagateAll() action within
92  // smaller region, such as ECAL for example
93  void setMaxDetectorRadius(float r = 800.){ maxRho_ = r;}
94  void setMaxDetectorLength(float l = 2200.){ maxZ_ = l/2.;}
95  void setMaxHORadius(float r = 800.) { HOmaxRho_ = r;}
96  void setMaxHOLength(float l = 2200.) { HOmaxZ_ = l/2.;}
97  void setMinDetectorRadius(float r = 0.){ minRho_ = r;}
98  void setMinDetectorLength(float l = 0.){ minZ_ = l/2.;}
99 
100  void setPropagationStep(float s = 20.){ step_ = s;}
101  float getPropagationStep() const { return step_;}
102 
103  protected:
104 
105  static int sign (float number){
106  if (number ==0) return 0;
107  if (number > 0)
108  return 1;
109  else
110  return -1;
111  }
112 
113  std::pair<float,float> delta( const double& theta1,
114  const double& theta2,
115  const double& phi1,
116  const double& phi2);
117 
118  float distance(const Plane* plane, int index) {
119  if (index<0 || fullTrajectory_.empty() || (unsigned int)index >= fullTrajectory_.size()) return 0;
120  return plane->localZ(fullTrajectory_[index].position());
121  }
122 
123  std::deque<SteppingHelixStateInfo> fullTrajectory_;
124  std::vector<SteppingHelixStateInfo> ecalTrajectory_;
125  std::vector<SteppingHelixStateInfo> hcalTrajectory_;
126  std::vector<SteppingHelixStateInfo> hoTrajectory_;
127  std::vector<SteppingHelixStateInfo> preshowerTrajectory_;
128  std::vector<GlobalPoint> wideEcalTrajectory_;
129  std::vector<GlobalPoint> wideHcalTrajectory_;
130  std::vector<GlobalPoint> wideHOTrajectory_;
132 
134 
136 
137  float maxRho_;
138  float maxZ_;
139  float HOmaxRho_;
140  float HOmaxZ_;
141  float minRho_;
142  float minZ_;
143  float step_;
144 
145 };
146 #endif
SteppingHelixStateInfo getStateAtHO()
const std::vector< SteppingHelixStateInfo > & getHcalTrajectory()
float getPropagationStep() const
SteppingHelixStateInfo stateAtIP_
std::vector< SteppingHelixStateInfo > ecalTrajectory_
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.)
float localZ(const GlobalPoint &gp) const
Fast access to distance from plane for a point.
Definition: Plane.h:52
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
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
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()
std::pair< float, float > trajectoryDelta(TrajectorType)
std::vector< SteppingHelixStateInfo > preshowerTrajectory_
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 &)
const std::vector< SteppingHelixStateInfo > & getHOTrajectory()
char state
Definition: procUtils.cc:75
SteppingHelixStateInfo getStateAtEcal()
void findHOTrajectory(const FiducialVolume &)
const std::vector< SteppingHelixStateInfo > & getPreshowerTrajectory()
string s
Definition: asciidump.py:422
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.)