CMS 3D CMS Logo

GsfPropagatorWithMaterial.cc
Go to the documentation of this file.
2 
8 
9 #include <atomic>
10 
12  const GsfMaterialEffectsUpdator& aMEUpdator) :
13  Propagator(aPropagator.propagationDirection()),
14  theGeometricalPropagator(new GsfPropagatorAdapter(aPropagator)),
15  theConvolutor(new FullConvolutionWithMaterial(aMEUpdator)),
16  theMaterialLocation(atDestination)
17 {
18 }
19 
21  const FullConvolutionWithMaterial& aConvolutor) :
22  Propagator(aGsfPropagator.propagationDirection()),
23  theGeometricalPropagator(aGsfPropagator.clone()),
24  theConvolutor(aConvolutor.clone()),
26 {
27 }
28 
29 std::pair<TrajectoryStateOnSurface,double>
31  const Plane& plane) const {
32  // add material before propagation?
33  //
34  TrajectoryStateOnSurface stateAtSource;
35  if ( materialAtSource() )
36  stateAtSource = convoluteStateWithMaterial(tsos,propagationDirection());
37  else
38  stateAtSource = tsos;
39  if ( !stateAtSource.isValid() ) return TsosWP(stateAtSource,0.);
40  //
41  // geometrical propagation
42  //
43  TsosWP propStateWP(theGeometricalPropagator->propagateWithPath(stateAtSource,plane));
44  if ( !(propStateWP.first).isValid() ) return propStateWP;
45  //
46  // return convoluted state
47  //
48  return convoluteWithMaterial(propStateWP);
49 }
50 
51 std::pair<TrajectoryStateOnSurface,double>
53  const Cylinder& cylinder) const {
54  // add material before propagation?
55  //
56  TrajectoryStateOnSurface stateAtSource;
57  if ( materialAtSource() )
58  stateAtSource = convoluteStateWithMaterial(tsos,propagationDirection());
59  else
60  stateAtSource = tsos;
61  if ( !stateAtSource.isValid() ) return TsosWP(stateAtSource,0.);
62  //
63  // geometrical propagation
64  //
65  TsosWP propStateWP(theGeometricalPropagator->propagateWithPath(stateAtSource,cylinder));
66  if ( !(propStateWP.first).isValid() ) return propStateWP;
67  //
68  // return convoluted state
69  //
70  return convoluteWithMaterial(propStateWP);
71 }
72 
73 std::pair<TrajectoryStateOnSurface,double>
75  const Plane& plane) const {
76  static std::atomic<int> nWarn(0);
77  if ( nWarn++<5 )
78  edm::LogInfo("GsfPropagatorWithMaterial")
79  << "GsfPropagatorWithMaterial used from FTS: input state might have been collapsed!";
80  TsosWP propStateWP = theGeometricalPropagator->propagateWithPath(fts,plane);
81  if ( !(propStateWP.first).isValid() || materialAtSource() ) return propStateWP;
82  //
83  // return convoluted state
84  //
85  return convoluteWithMaterial(propStateWP);
86 }
87 
88 std::pair<TrajectoryStateOnSurface,double>
90  const Cylinder& cylinder) const {
91  static std::atomic<int> nWarn(0);
92  if ( nWarn++<5 )
93  edm::LogInfo("GsfPropagatorWithMaterial")
94  << "GsfPropagatorWithMaterial used from FTS: input state might have been collapsed!";
95  TsosWP propStateWP = theGeometricalPropagator->propagateWithPath(fts,cylinder);
96  if ( !(propStateWP.first).isValid() || materialAtSource() ) return propStateWP;
97  //
98  // return convoluted state
99  //
100  return convoluteWithMaterial(propStateWP);
101 }
102 
103 
107 }
108 
109 std::pair<TrajectoryStateOnSurface,double>
111 {
112  //
113  // convolute with material
114  //
115  PropagationDirection propDir = PropagationDirectionFromPath()(aStateWithPath.second,
117  return TsosWP((*theConvolutor)(aStateWithPath.first,propDir),
118  aStateWithPath.second);
119 }
120 
123  const PropagationDirection propDir) const
124 {
125  //
126  // convolute with material
127  //
128  return (*theConvolutor)(tsos,propDir);
129 }
130 
131 bool
135  throw cms::Exception("LogicError")
136  << "PropagatorWithMaterial: propagation direction = anyDirection is "
137  << "incompatible with adding of material at source";
138  }
139  }
142 }
143 
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:140
PropagationDirection
Definition: Plane.h:17
TrajectoryStateOnSurface convoluteStateWithMaterial(const TrajectoryStateOnSurface, const PropagationDirection) const
Convolution of state with material effects.
std::pair< TrajectoryStateOnSurface, double > TsosWP
GsfPropagatorWithMaterial(const Propagator &Propagator, const GsfMaterialEffectsUpdator &MEUpdator)
std::pair< TrajectoryStateOnSurface, double > convoluteWithMaterial(const std::pair< TrajectoryStateOnSurface, double > &) const
Convolution of state+path with material effects.
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:151
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &, const Plane &) const override
bool materialAtSource() const
Inclusion of material at the source?
DeepCopyPointerByClone< GsfPropagatorAdapter > theGeometricalPropagator
void setPropagationDirection(PropagationDirection dir) override
DeepCopyPointerByClone< FullConvolutionWithMaterial > theConvolutor
void setPropagationDirection(PropagationDirection dir) override
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &, const Plane &) const override
GsfPropagatorWithMaterial * clone() const override
dbl *** dir
Definition: mlp_gen.cc:35