CMS 3D CMS Logo

MaterialEffectsUpdator.cc
Go to the documentation of this file.
3 
4 using namespace SurfaceSideDefinition;
5 
9 
11 
16  const PropagationDirection propDir) const {
17  TrajectoryStateOnSurface shallowCopy = TSoS;
18  // A TSOS is a proxy. Its contents will be really copied only if/when the updateStateInPlace attempts to change them
19  return updateStateInPlace(shallowCopy, propDir) ? shallowCopy : TrajectoryStateOnSurface();
20 }
21 
22 //
23 // Update of the trajectory state (implemented in base class since general for
24 // all classes returning deltaP and deltaCov.
25 //
27  const PropagationDirection propDir) const {
28  //
29  // Check if
30  // - material is associated to surface
31  // - propagation direction is not anyDirection
32  // - side of surface is not atCenterOfSurface (could be handled with 50% material?)
33  //
34  const Surface& surface = TSoS.surface();
35  if (!surface.mediumProperties().isValid() || propDir == anyDirection || TSoS.surfaceSide() == atCenterOfSurface)
36  return true;
37  //
38  // Check, if already on right side of surface
39  //
40  if ((propDir == alongMomentum && TSoS.surfaceSide() == afterSurface) ||
41  (propDir == oppositeToMomentum && TSoS.surfaceSide() == beforeSurface))
42  return true;
43  //
44  // Update momentum. In case of failure: return invalid state
45  //
47  Effect effect;
48  compute(TSoS, propDir, effect);
49  if (!lp.updateP(effect.deltaP))
50  return false;
51  //
52  // Update covariance matrix?
53  //
55  if (TSoS.hasError()) {
56  AlgebraicSymMatrix55 eloc = TSoS.localError().matrix();
57  effect.deltaCov.add(eloc);
58  //TSoS = TrajectoryStateOnSurface(lp,LocalTrajectoryError(eloc),surface, &(TSoS.globalParameters().magneticField()),side);
59  //TSoS.update(lp,LocalTrajectoryError(eloc),side);
60  TSoS.update(lp, eloc, side);
61  } else {
62  TSoS.update(lp, side);
63  //TSoS = TrajectoryStateOnSurface(lp,surface,&(TSoS.globalParameters().magneticField()),side);
64  }
65  return true;
66 }
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect &effect) const =0
const LocalTrajectoryError & localError() const
const LocalTrajectoryParameters & localParameters() const
PropagationDirection
const SurfaceType & surface() const
virtual bool updateStateInPlace(TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
void update(const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
virtual TrajectoryStateOnSurface updateState(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
const AlgebraicSymMatrix55 & matrix() const
void add(AlgebraicSymMatrix55 &cov) const
const MediumProperties & mediumProperties() const
Definition: Surface.h:83
bool updateP(float dP)
Update of momentum by a scalar dP.
bool isValid() const