CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PropagatorWithMaterial.cc
Go to the documentation of this file.
7 #include <string>
8 
9 using namespace std;
11  const float mass,
12  const MagneticField * mf,
13  const float maxDPhi,
14  bool useRungeKutta,
15  float ptMin) :
16  Propagator(dir),
17  theGeometricalPropagator(),
18  theMEUpdator(new CombinedMaterialEffectsUpdator(mass, ptMin)),
19  theMaterialLocation(atDestination), field(mf),useRungeKutta_(useRungeKutta) {
20 
21  if(useRungeKutta_)
24 
25 }
26 
28  const MaterialEffectsUpdator& aMEUpdator,
29  const MagneticField * mf,
30  bool useRungeKutta) :
31  Propagator(aPropagator.propagationDirection()),
32  theGeometricalPropagator(aPropagator.clone()),
33  theMEUpdator(aMEUpdator.clone()),
34  theMaterialLocation(atDestination), field(mf),useRungeKutta_(useRungeKutta) {}
35 
36 pair<TrajectoryStateOnSurface,double>
38  const Plane& plane) const {
39  TsosWP newTsosWP = theGeometricalPropagator->propagateWithPath(fts,plane);
40  if ( (newTsosWP.first).isValid() && !materialAtSource() ) {
41  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
42  PropagationDirectionFromPath()(newTsosWP.second,
44  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
45  }
46  return newTsosWP;
47 }
48 
49 pair<TrajectoryStateOnSurface,double>
51  const Cylinder& cylinder) const {
52  TsosWP newTsosWP = theGeometricalPropagator->propagateWithPath(fts,cylinder);
53  if ( (newTsosWP.first).isValid() && !materialAtSource() ) {
54  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
55  PropagationDirectionFromPath()(newTsosWP.second,
57  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
58  }
59  return newTsosWP;
60 }
61 
62 
63 pair<TrajectoryStateOnSurface,double>
65  const Plane& plane) const {
66  //
67  // add material at starting surface, if requested
68  //
69  TsosWP newTsosWP(tsos,0.);
70  if ( materialAtSource() ) {
71  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,propagationDirection());
72  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
73  }
74  if ( !newTsosWP.first.isValid() ) return newTsosWP;
75  //
76  // geometrical propagation
77  //
78  newTsosWP = theGeometricalPropagator->propagateWithPath(newTsosWP.first,plane);
79  if ( !newTsosWP.first.isValid() || materialAtSource() ) return newTsosWP;
80  //
81  // add material at destination surface, if requested
82  //
83  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
84  PropagationDirectionFromPath()(newTsosWP.second,
86  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
87  return newTsosWP;
88 }
89 
90 pair<TrajectoryStateOnSurface,double>
92  const Cylinder& cylinder) const {
93  //
94  // add material at starting surface, if requested
95  //
96  TsosWP newTsosWP(tsos,0.);
97  if ( materialAtSource() ) {
98  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,propagationDirection());
99  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
100  }
101  if ( !newTsosWP.first.isValid() ) return newTsosWP;
102  //
103  // geometrical propagation
104  //
105  newTsosWP = theGeometricalPropagator->propagateWithPath(newTsosWP.first,cylinder);
106  if ( !(newTsosWP.first).isValid() || materialAtSource() ) return newTsosWP;
107  //
108  // add material at destination surface, if requested
109  //
110  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
111  PropagationDirectionFromPath()(newTsosWP.second,
113  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
114  return newTsosWP;
115 }
116 
120 }
121 
122 bool
126  string message("PropagatorWithMaterial: propagation direction = anyDirection is ");
127  message += "incompatible with adding of material at source";
128  throw cms::Exception("TrackingTools/MaterialEffects",message);
129  }
130  }
133 }
bool materialAtSource() const
Inclusion of material at the source?
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
std::pair< TrajectoryStateOnSurface, double > TsosWP
virtual bool updateStateInPlace(TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
PropagationDirection
Definition: Plane.h:17
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:74
DeepCopyPointerByClone< MaterialEffectsUpdator > theMEUpdator
DeepCopyPointerByClone< Propagator > theGeometricalPropagator
MaterialLocation theMaterialLocation
T * clone(const T *tp)
Definition: Ptr.h:42
string message
Definition: argparse.py:126
PropagatorWithMaterial(PropagationDirection dir, const float mass, const MagneticField *mf=0, const float maxDPhi=1.6, bool useRungeKutta=false, float ptMin=-1.)
virtual void setPropagationDirection(PropagationDirection dir) const
Propagation direction.
virtual void setPropagationDirection(PropagationDirection dir) const
Definition: Propagator.h:132
dbl *** dir
Definition: mlp_gen.cc:35
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &tsos, const Plane &plane) const