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 }
MaterialEffectsUpdator::updateStateInPlace
virtual bool updateStateInPlace(TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
Definition: MaterialEffectsUpdator.cc:26
anyDirection
Definition: PropagationDirection.h:4
materialEffect::Effect
Definition: MaterialEffectsUpdator.h:40
oppositeToMomentum
Definition: PropagationDirection.h:4
Surface
Definition: Surface.h:36
SurfaceSideDefinition::SurfaceSide
SurfaceSide
Definition: SurfaceSideDefinition.h:8
SurfaceSideDefinition::afterSurface
Definition: SurfaceSideDefinition.h:8
LocalTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: LocalTrajectoryError.h:60
materialEffect::Covariance::add
void add(AlgebraicSymMatrix55 &cov) const
Definition: MaterialEffectsUpdator.h:24
MaterialEffectsUpdator::MaterialEffectsUpdator
MaterialEffectsUpdator(float mass)
Definition: MaterialEffectsUpdator.cc:8
SurfaceSideDefinition::atCenterOfSurface
Definition: SurfaceSideDefinition.h:8
Surface::mediumProperties
const MediumProperties & mediumProperties() const
Definition: Surface.h:83
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
MaterialEffectsUpdator::updateState
virtual TrajectoryStateOnSurface updateState(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
Definition: MaterialEffectsUpdator.cc:15
MaterialEffectsUpdator.h
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
materialEffect::Effect::deltaCov
Covariance deltaCov
Definition: MaterialEffectsUpdator.h:45
TrajectoryStateOnSurface::hasError
bool hasError() const
Definition: TrajectoryStateOnSurface.h:56
SurfaceSideDefinition::beforeSurface
Definition: SurfaceSideDefinition.h:8
MaterialEffectsUpdator::~MaterialEffectsUpdator
virtual ~MaterialEffectsUpdator()
Definition: MaterialEffectsUpdator.cc:10
LocalTrajectoryParameters::updateP
bool updateP(float dP)
Update of momentum by a scalar dP.
Definition: LocalTrajectoryParameters.h:149
TrajectoryStateOnSurface::localParameters
const LocalTrajectoryParameters & localParameters() const
Definition: TrajectoryStateOnSurface.h:73
SurfaceSideDefinition.h
MaterialEffectsUpdator::compute
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect &effect) const =0
materialEffect::Effect::deltaP
float deltaP
Definition: MaterialEffectsUpdator.h:43
TrajectoryStateOnSurface::update
void update(const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
Definition: TrajectoryStateOnSurface.cc:6
SurfaceSideDefinition
Definition: SurfaceSideDefinition.h:7
MediumProperties::isValid
bool isValid() const
Definition: MediumProperties.h:26
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
TrajectoryStateOnSurface::surfaceSide
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
Definition: TrajectoryStateOnSurface.h:89
alongMomentum
Definition: PropagationDirection.h:4