CMS 3D CMS Logo

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