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;
10 
12 
13 
15  const float mass,
16  const MagneticField * mf,
17  const float maxDPhi,
18  bool useRungeKutta,
19  float ptMin,bool useOldAnalPropLogic) :
20  Propagator(dir),
21  theGeometricalPropagator(),
22  theMEUpdator(new CombinedMaterialEffectsUpdator(mass, ptMin)),
23  theMaterialLocation(atDestination), field(mf),useRungeKutta_(useRungeKutta) {
24 
25  if(useRungeKutta_)
28  useOldAnalPropLogic));
29 
30 }
31 
33  const MaterialEffectsUpdator& aMEUpdator,
34  const MagneticField * mf,
35  bool useRungeKutta) :
36  Propagator(aPropagator.propagationDirection()),
37  theGeometricalPropagator(aPropagator.clone()),
38  theMEUpdator(aMEUpdator.clone()),
39  theMaterialLocation(atDestination), field(mf),useRungeKutta_(useRungeKutta) {}
40 
41 pair<TrajectoryStateOnSurface,double>
43  const Plane& plane) const {
44  TsosWP newTsosWP = theGeometricalPropagator->propagateWithPath(fts,plane);
45  if ( (newTsosWP.first).isValid() && !materialAtSource() ) {
46  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
47  PropagationDirectionFromPath()(newTsosWP.second,
49  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
50  }
51  return newTsosWP;
52 }
53 
54 pair<TrajectoryStateOnSurface,double>
56  const Cylinder& cylinder) const {
57  TsosWP newTsosWP = theGeometricalPropagator->propagateWithPath(fts,cylinder);
58  if ( (newTsosWP.first).isValid() && !materialAtSource() ) {
59  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
60  PropagationDirectionFromPath()(newTsosWP.second,
62  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
63  }
64  return newTsosWP;
65 }
66 
67 
68 pair<TrajectoryStateOnSurface,double>
70  const Plane& plane) const {
71  //
72  // add material at starting surface, if requested
73  //
74  TsosWP newTsosWP(tsos,0.);
75  if ( materialAtSource() ) {
76  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,propagationDirection());
77  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
78  }
79  if ( !newTsosWP.first.isValid() ) return newTsosWP;
80  //
81  // geometrical propagation
82  //
83  newTsosWP = theGeometricalPropagator->propagateWithPath(newTsosWP.first,plane);
84  if ( !newTsosWP.first.isValid() || materialAtSource() ) return newTsosWP;
85  //
86  // add material at destination surface, if requested
87  //
88  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
89  PropagationDirectionFromPath()(newTsosWP.second,
91  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
92  return newTsosWP;
93 }
94 
95 pair<TrajectoryStateOnSurface,double>
97  const Cylinder& cylinder) const {
98  //
99  // add material at starting surface, if requested
100  //
101  TsosWP newTsosWP(tsos,0.);
102  if ( materialAtSource() ) {
103  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,propagationDirection());
104  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
105  }
106  if ( !newTsosWP.first.isValid() ) return newTsosWP;
107  //
108  // geometrical propagation
109  //
110  newTsosWP = theGeometricalPropagator->propagateWithPath(newTsosWP.first,cylinder);
111  if ( !(newTsosWP.first).isValid() || materialAtSource() ) return newTsosWP;
112  //
113  // add material at destination surface, if requested
114  //
115  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
116  PropagationDirectionFromPath()(newTsosWP.second,
118  if (!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
119  return newTsosWP;
120 }
121 
125 }
126 
127 bool
131  string message("PropagatorWithMaterial: propagation direction = anyDirection is ");
132  message += "incompatible with adding of material at source";
133  throw cms::Exception("TrackingTools/MaterialEffects",message);
134  }
135  }
138 }
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:77
PropagatorWithMaterial(PropagationDirection dir, const float mass, const MagneticField *mf=0, const float maxDPhi=1.6, bool useRungeKutta=false, float ptMin=-1., bool useOldGeoPropLogic=true)
DeepCopyPointerByClone< MaterialEffectsUpdator > theMEUpdator
DeepCopyPointerByClone< Propagator > theGeometricalPropagator
MaterialLocation theMaterialLocation
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
tuple mass
Definition: scaleCards.py:27
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