CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RKTestPropagator.h
Go to the documentation of this file.
1 #ifndef RKTestPropagator_H
2 #define RKTestPropagator_H
3 
6 
8 //
9 // Wrapper to test RKPropagatorInS in central volume using Veikko's
10 // parametrized field... Martijn Mulders 29/6/07
11 //
13 
14 
17 class MagVolume;
20 
21 
22 class RKTestField : public MagneticField
23 {
24  public:
25  virtual GlobalVector inTesla ( const GlobalPoint& ) const {return GlobalVector(0,0,4);}
26 };
27 
29 public:
30 
31 RKTestFieldProvider (const MagneticField* field) : theField(field) {}
32 
33  virtual LocalVectorType valueInTesla( const LocalPointType& lp) const {
34  // NOTE: the following transformation only works for the central volume
35  // where global and local coordinates are numerically equal !
36  GlobalPoint gp(lp.x(), lp.y(), lp.z());
37  GlobalVector gv = theField->inTesla(gp);
38  return LocalVectorType(gv.x(),gv.y(),gv.z());
39  }
40 
41  private:
42 
44 
45 };
46 
47 class RKTestMagVolume : public MagVolume {
48 public:
50  DDSolidShape shape, const MagneticFieldProvider<float> * mfp) :
51  MagVolume( pos, rot, shape, mfp) {}
52 
53  virtual bool inside( const GlobalPoint& gp, double tolerance=0.) const {return true;}
54 
56  virtual const std::vector<VolumeSide>& faces() const {return theFaces;}
57 
58 private:
59  std::vector<VolumeSide> theFaces;
60 
61 };
62 
64 
65 class RKTestPropagator : public Propagator {
66  public:
67 
68 
69 
71  double tolerance = 5.e-5) :
72  theTolerance(tolerance),
73  theRealField(field),
74  RKField(field),
76  theRKProp(new RKPropagatorInS(RKVol, dir, tolerance)) {}
77 
79  propagate (const FreeTrajectoryState& state, const Plane& plane) const {return theRKProp->propagate(state,plane);}
80 
82  propagate (const FreeTrajectoryState& state, const Cylinder& cyl) const {
83  return theRKProp->propagate(state,cyl);}
84 
85  virtual std::pair< TrajectoryStateOnSurface, double>
86  propagateWithPath (const FreeTrajectoryState& state, const Plane& plane) const {
87  return theRKProp->propagateWithPath(state,plane);}
88 
89  virtual std::pair< TrajectoryStateOnSurface, double>
90  propagateWithPath (const FreeTrajectoryState& state, const Cylinder& cyl) const {return theRKProp->propagateWithPath(state,cyl);}
91 
93  const Plane& plane) const {return theRKProp->propagate(ts,plane);}
94 
97  }
98 
101  }
102 
103 
104  Propagator* clone() const
105  {
106 
108 
109  }
110 
111  virtual const MagneticField* magneticField() const { return theRealField;}
112 
113 
114  private:
120 };
121 
122 #endif
TkRotation< Scalar > RotationType
Definition: Definitions.h:29
virtual const std::vector< VolumeSide > & faces() const
Access to volume faces - dummy implementation.
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &state, const Cylinder &cyl) const
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
virtual PropagationDirection propagationDirection() const
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MagVolume.h:20
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
RKTestPropagator(const MagneticField *field, PropagationDirection dir=alongMomentum, double tolerance=5.e-5)
DDSolidShape
Definition: DDSolidShapes.h:6
T y() const
Definition: PV3DBase.h:62
RKTestMagVolume(const PositionType &pos, const RotationType &rot, DDSolidShape shape, const MagneticFieldProvider< float > *mfp)
PropagationDirection
RKTestFieldProvider(const MagneticField *field)
std::vector< VolumeSide > theFaces
Definition: Plane.h:17
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:77
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &state, const Cylinder &cyl) const
const MagneticField * theField
const MagneticField * theRealField
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &state, const Plane &plane) const
TrajectoryStateOnSurface propagate(const TrajectoryStateOnSurface &ts, const Plane &plane) const
T z() const
Definition: PV3DBase.h:63
virtual LocalVectorType valueInTesla(const LocalPointType &lp) const
Propagator * clone() const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &state, const Plane &plane) const
virtual bool inside(const GlobalPoint &gp, double tolerance=0.) const
virtual void setPropagationDirection(PropagationDirection dir) const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:12
Vector3DBase< float, LocalTag > LocalVectorType
char state
Definition: procUtils.cc:75
RKTestMagVolume RKVol
DeepCopyPointerByClone< Propagator > theRKProp
virtual const MagneticField * magneticField() const
virtual void setPropagationDirection(PropagationDirection dir) const
Definition: Propagator.h:132
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:61
virtual GlobalVector inTesla(const GlobalPoint &) const
Field value ad specified global point, in Tesla.
Global3DVector GlobalVector
Definition: GlobalVector.h:10
RKTestFieldProvider RKField