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.
6 #include <string>
7 
8 using namespace std;
9 
11 
12 
14  const float mass,
15  const MagneticField * mf,
16  const float maxDPhi,
17  bool useRungeKutta,
18  float ptMin,bool useOldAnalPropLogic) :
19  Propagator(dir),
20  rkProduct(mf,dir),
21  theGeometricalPropagator(useRungeKutta ?
22  rkProduct.propagator.clone() :
23  new AnalyticalPropagator(mf,dir,maxDPhi,useOldAnalPropLogic)
24  ),
25  theMEUpdator(new CombinedMaterialEffectsUpdator(mass, ptMin)),
26  theMaterialLocation(atDestination), field(mf),useRungeKutta_(useRungeKutta) {
27 
28 
29 }
30 
31 pair<TrajectoryStateOnSurface,double>
33  const Plane& plane) const {
34  TsosWP newTsosWP = theGeometricalPropagator->propagateWithPath(fts,plane);
35  if ( (newTsosWP.first).isValid() && !materialAtSource() ) {
36  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
37  PropagationDirectionFromPath()(newTsosWP.second,
39  if unlikely(!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
40  }
41  return newTsosWP;
42 }
43 
44 pair<TrajectoryStateOnSurface,double>
46  const Cylinder& cylinder) const {
47  TsosWP newTsosWP = theGeometricalPropagator->propagateWithPath(fts,cylinder);
48  if ( (newTsosWP.first).isValid() && !materialAtSource() ) {
49  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
50  PropagationDirectionFromPath()(newTsosWP.second,
52  if unlikely(!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
53  }
54  return newTsosWP;
55 }
56 
57 
58 pair<TrajectoryStateOnSurface,double>
60  const Plane& plane) const {
61  //
62  // add material at starting surface, if requested
63  //
64  TsosWP newTsosWP(tsos,0.);
65  if ( materialAtSource() ) {
66  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,propagationDirection());
67  if unlikely(!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
68  }
69  if unlikely( !newTsosWP.first.isValid() ) return newTsosWP;
70  //
71  // geometrical propagation
72  //
73  newTsosWP = theGeometricalPropagator->propagateWithPath(newTsosWP.first,plane);
74  if unlikely( !newTsosWP.first.isValid() || materialAtSource() ) return newTsosWP;
75  //
76  // add material at destination surface, if requested
77  //
78  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
79  PropagationDirectionFromPath()(newTsosWP.second,
81  if unlikely(!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
82  return newTsosWP;
83 }
84 
85 pair<TrajectoryStateOnSurface,double>
87  const Cylinder& cylinder) const {
88  //
89  // add material at starting surface, if requested
90  //
91  TsosWP newTsosWP(tsos,0.);
92  if ( materialAtSource() ) {
93  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,propagationDirection());
94  if unlikely(!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
95  }
96  if unlikely( !newTsosWP.first.isValid() ) return newTsosWP;
97  //
98  // geometrical propagation
99  //
100  newTsosWP = theGeometricalPropagator->propagateWithPath(newTsosWP.first,cylinder);
101  if unlikely( !(newTsosWP.first).isValid() || materialAtSource() ) return newTsosWP;
102  //
103  // add material at destination surface, if requested
104  //
105  bool updateOk = theMEUpdator->updateStateInPlace(newTsosWP.first,
106  PropagationDirectionFromPath()(newTsosWP.second,
108  if unlikely(!updateOk) newTsosWP.first = TrajectoryStateOnSurface();
109  return newTsosWP;
110 }
111 
115 }
116 
117 bool
120  throw cms::Exception("TrackingTools/MaterialEffects",
121  "PropagatorWithMaterial: propagation direction = anyDirection is incompatible with adding of material at source");
122 
125 }
tuple propagator
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:140
bool materialAtSource() const
Inclusion of material at the source?
std::pair< TrajectoryStateOnSurface, double > TsosWP
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:151
virtual bool updateStateInPlace(TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
PropagationDirection
Definition: Plane.h:17
#define unlikely(x)
PropagatorWithMaterial(PropagationDirection dir, const float mass, const MagneticField *mf=0, const float maxDPhi=1.6, bool useRungeKutta=false, float ptMin=-1., bool useOldGeoPropLogic=true)
tuple useRungeKutta
DeepCopyPointerByClone< MaterialEffectsUpdator > theMEUpdator
DeepCopyPointerByClone< Propagator > theGeometricalPropagator
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:15
MaterialLocation theMaterialLocation
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
virtual void setPropagationDirection(PropagationDirection dir) override
Propagation direction.
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &tsos, const Plane &plane) const override
dbl *** dir
Definition: mlp_gen.cc:35