CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfPropagatorWithMaterial.cc
Go to the documentation of this file.
2 
8 
10  const GsfMaterialEffectsUpdator& aMEUpdator) :
11  Propagator(aPropagator.propagationDirection()),
12  theGeometricalPropagator(new GsfPropagatorAdapter(aPropagator)),
13  theConvolutor(new FullConvolutionWithMaterial(aMEUpdator)),
14  theMaterialLocation(atDestination)
15 {
16  // if ( propWithPathTimer1==0 ) defineTimer();
17 }
18 
20  const FullConvolutionWithMaterial& aConvolutor) :
21  Propagator(aGsfPropagator.propagationDirection()),
22  theGeometricalPropagator(aGsfPropagator.clone()),
23  theConvolutor(aConvolutor.clone()),
24  theMaterialLocation(atDestination)
25 {
26  // if ( propWithPathTimer1==0 ) defineTimer();
27 }
28 
29 // void
30 // GsfPropagatorWithMaterial::defineTimer()
31 // {
32 // if ( propWithPathTimer1==0 ) {
33 // propWithPathTimer1 =
34 // &(*TimingReport::current())[string("GsfPropagatorWithMaterial:toPlane")];
35 // propWithPathTimer2 =
36 // &(*TimingReport::current())[string("GsfPropagatorWithMaterial:toCylinder")];
37 // static SimpleConfigurable<bool> timeConf(false,"GsfPropagatorWithMaterial:activateTiming");
38 // if ( timeConf.value() ) {
39 // propWithPathTimer1->switchCPU(false);
40 // propWithPathTimer2->switchCPU(false);
41 // }
42 // else {
43 // propWithPathTimer1->switchOn(false);
44 // propWithPathTimer2->switchOn(false);
45 // }
46 // }
47 // }
48 
49 std::pair<TrajectoryStateOnSurface,double>
51  const Plane& plane) const {
52  // TimeMe t1(*propWithPathTimer1,false);
53  //
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,plane));
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 Cylinder& cylinder) const {
76  // TimeMe t2(*propWithPathTimer2,false);
77  //
78  // add material before propagation?
79  //
80  TrajectoryStateOnSurface stateAtSource;
81  if ( materialAtSource() )
82  stateAtSource = convoluteStateWithMaterial(tsos,propagationDirection());
83  else
84  stateAtSource = tsos;
85  if ( !stateAtSource.isValid() ) return TsosWP(stateAtSource,0.);
86  //
87  // geometrical propagation
88  //
89  TsosWP propStateWP(theGeometricalPropagator->propagateWithPath(stateAtSource,cylinder));
90  if ( !(propStateWP.first).isValid() ) return propStateWP;
91  //
92  // return convoluted state
93  //
94  return convoluteWithMaterial(propStateWP);
95 }
96 
97 std::pair<TrajectoryStateOnSurface,double>
99  const Plane& plane) const {
100  static int nWarn(0);
101  if ( nWarn++<5 )
102  edm::LogInfo("GsfPropagatorWithMaterial")
103  << "GsfPropagatorWithMaterial used from FTS: input state might have been collapsed!";
104  TsosWP propStateWP = theGeometricalPropagator->propagateWithPath(fts,plane);
105  if ( !(propStateWP.first).isValid() || materialAtSource() ) return propStateWP;
106  //
107  // return convoluted state
108  //
109  return convoluteWithMaterial(propStateWP);
110 }
111 
112 std::pair<TrajectoryStateOnSurface,double>
114  const Cylinder& cylinder) const {
115  static int nWarn(0);
116  if ( nWarn++<5 )
117  edm::LogInfo("GsfPropagatorWithMaterial")
118  << "GsfPropagatorWithMaterial used from FTS: input state might have been collapsed!";
119  TsosWP propStateWP = theGeometricalPropagator->propagateWithPath(fts,cylinder);
120  if ( !(propStateWP.first).isValid() || materialAtSource() ) return propStateWP;
121  //
122  // return convoluted state
123  //
124  return convoluteWithMaterial(propStateWP);
125 }
126 
127 
131 }
132 
133 std::pair<TrajectoryStateOnSurface,double>
135 {
136  //
137  // convolute with material
138  //
139  PropagationDirection propDir = PropagationDirectionFromPath()(aStateWithPath.second,
141  return TsosWP((*theConvolutor)(aStateWithPath.first,propDir),
142  aStateWithPath.second);
143 }
144 
147  const PropagationDirection propDir) const
148 {
149  //
150  // convolute with material
151  //
152  return (*theConvolutor)(tsos,propDir);
153 }
154 
155 bool
159  throw cms::Exception("LogicError")
160  << "PropagatorWithMaterial: propagation direction = anyDirection is "
161  << "incompatible with adding of material at source";
162  }
163  }
166 }
167 
168 // TimingReport::Item* GsfPropagatorWithMaterial::propWithPathTimer1(0);
169 // TimingReport::Item* GsfPropagatorWithMaterial::propWithPathTimer2(0);
virtual void setPropagationDirection(PropagationDirection dir) const
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &tsos, const Surface &surface) const
PropagationDirection
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const TrajectoryStateOnSurface &tsos, const Surface &surface) const
Definition: Plane.h:17
TrajectoryStateOnSurface convoluteStateWithMaterial(const TrajectoryStateOnSurface, const PropagationDirection) const
Convolution of state with material effects.
virtual PropagationDirection propagationDirection() const GCC11_FINAL
Definition: Propagator.h:145
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.
bool materialAtSource() const
Inclusion of material at the source?
DeepCopyPointerByClone< GsfPropagatorAdapter > theGeometricalPropagator
virtual void setPropagationDirection(PropagationDirection dir) const
DeepCopyPointerByClone< FullConvolutionWithMaterial > theConvolutor
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
virtual void setPropagationDirection(PropagationDirection dir) const
Definition: Propagator.h:134
dbl *** dir
Definition: mlp_gen.cc:35