CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
BasicTrajectoryState Class Referenceabstract

#include <BasicTrajectoryState.h>

Inheritance diagram for BasicTrajectoryState:
BasicMultiTrajectoryState BasicSingleTrajectoryState

Public Types

typedef BasicTrajectoryState BTSOS
 
using Components = std::vector< TrajectoryStateOnSurface >
 
typedef Proxy::pointer pointer
 
typedef ProxyBase11< BTSOSProxy
 
typedef SurfaceSideDefinition::SurfaceSide SurfaceSide
 
typedef Surface SurfaceType
 

Public Member Functions

 BasicTrajectoryState ()
 
 BasicTrajectoryState (const SurfaceType &aSurface)
 construct invalid trajectory state (without parameters) More...
 
 BasicTrajectoryState (const FreeTrajectoryState &fts, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicTrajectoryState (const FreeTrajectoryState &fts)
 
 BasicTrajectoryState (const LocalTrajectoryParameters &par, const LocalTrajectoryError &err, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicTrajectoryState (const LocalTrajectoryParameters &par, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const CartesianTrajectoryError &err, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const CurvilinearTrajectoryError &err, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
template<typename... Args>
 BasicTrajectoryState (double iweight, Args &&... args)
 
virtual bool canUpdateLocalParameters () const
 
const CartesianTrajectoryError cartesianError () const
 
TrackCharge charge () const
 
virtual pointer clone () const =0
 
virtual Components const & components () const =0
 
const CurvilinearTrajectoryErrorcurvilinearError () const
 
FreeTrajectoryState const * freeTrajectoryState (bool withErrors=true) const
 
GlobalVector globalDirection () const
 
GlobalVector globalMomentum () const
 
const GlobalTrajectoryParametersglobalParameters () const
 
GlobalPoint globalPosition () const
 
bool hasError () const
 
bool isValid () const
 
LocalVector localDirection () const
 
const LocalTrajectoryErrorlocalError () const
 
LocalVector localMomentum () const
 
const LocalTrajectoryParameterslocalParameters () const
 
LocalPoint localPosition () const
 
const MagneticFieldmagneticField () const
 
void rescaleError (double factor)
 
CurvilinearTrajectoryErrorsetCurvilinearError ()
 
double signedInverseMomentum () const
 
virtual bool singleState () const =0
 
const SurfaceTypesurface () const
 
SurfaceSide surfaceSide () const
 Position relative to material, defined relative to momentum vector. More...
 
double transverseCurvature () const
 
virtual void update (const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side)
 
virtual void update (const LocalTrajectoryParameters &p, const SurfaceSide side) final
 
virtual void update (double weight, const LocalTrajectoryParameters &p, const LocalTrajectoryError &err, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side)
 
virtual void update (const LocalTrajectoryParameters &p, const LocalTrajectoryError &err, const SurfaceSide side) final
 
double weight () const
 
virtual ~BasicTrajectoryState ()
 

Static Public Member Functions

template<typename T , typename... Args>
static std::shared_ptr< BTSOSbuild (Args &&... args)
 
template<typename T , typename... Args>
static std::shared_ptr< BTSOSchurn (Args &&... args)
 

Private Member Functions

void checkCurvilinError () const
 
void createLocalError () const
 
void createLocalErrorFromCurvilinearError () const
 
void createLocalParameters () const
 
void missingError (char const *where) const
 

Static Private Member Functions

static void notValid ()
 

Private Attributes

FreeTrajectoryState theFreeState
 
LocalTrajectoryError theLocalError
 
LocalTrajectoryParameters theLocalParameters
 
bool theLocalParametersValid
 
ConstReferenceCountingPointer< SurfaceTypetheSurfaceP
 
SurfaceSide theSurfaceSide
 
bool theValid
 
double theWeight = 0.
 

Detailed Description

No so Abstract (anyore) base class for TrajectoryState. It is ReferenceCounted.

VI 8/12/2011 content of BasicSingleTrajectoryState moved here.... fully devirtualized

Definition at line 66 of file BasicTrajectoryState.h.

Member Typedef Documentation

◆ BTSOS

Definition at line 68 of file BasicTrajectoryState.h.

◆ Components

Definition at line 282 of file BasicTrajectoryState.h.

◆ pointer

Definition at line 70 of file BasicTrajectoryState.h.

◆ Proxy

Definition at line 69 of file BasicTrajectoryState.h.

◆ SurfaceSide

Definition at line 71 of file BasicTrajectoryState.h.

◆ SurfaceType

Definition at line 72 of file BasicTrajectoryState.h.

Constructor & Destructor Documentation

◆ BasicTrajectoryState() [1/10]

BasicTrajectoryState::BasicTrajectoryState ( )
inline

Definition at line 76 of file BasicTrajectoryState.h.

◆ BasicTrajectoryState() [2/10]

BasicTrajectoryState::BasicTrajectoryState ( const SurfaceType aSurface)
explicit

construct invalid trajectory state (without parameters)

Definition at line 39 of file BasicTrajectoryState.cc.

◆ ~BasicTrajectoryState()

BasicTrajectoryState::~BasicTrajectoryState ( )
virtual

Definition at line 38 of file BasicTrajectoryState.cc.

38 {}

◆ BasicTrajectoryState() [3/10]

BasicTrajectoryState::BasicTrajectoryState ( const FreeTrajectoryState fts,
const SurfaceType aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)
inline

Constructor from FTS and surface. For surfaces with material the side of the surface should be specified explicitely.

Definition at line 98 of file BasicTrajectoryState.h.

101  : theFreeState(fts),
105  theValid(true),
106  theSurfaceSide(side),
107  theSurfaceP(&aSurface),
108  theWeight(1.) {}
ConstReferenceCountingPointer< SurfaceType > theSurfaceP
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError

◆ BasicTrajectoryState() [4/10]

BasicTrajectoryState::BasicTrajectoryState ( const FreeTrajectoryState fts)
inlineexplicit

Constructor from FTS: just a wrapper

Definition at line 112 of file BasicTrajectoryState.h.

113  : theFreeState(fts),
117  theValid(true),
118  theWeight(1.) {}
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError

◆ BasicTrajectoryState() [5/10]

BasicTrajectoryState::BasicTrajectoryState ( const LocalTrajectoryParameters par,
const LocalTrajectoryError err,
const SurfaceType aSurface,
const MagneticField field,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)

Constructor from local parameters, errors and surface. For surfaces with material the side of the surface should be specified explicitely. For multi-states the weight should be specified explicitely.

Definition at line 68 of file BasicTrajectoryState.cc.

73  : theFreeState(makeFTS(par, aSurface, field)),
75  theLocalParameters(par),
77  theValid(true),
78  theSurfaceSide(side),
79  theSurfaceP(&aSurface),
80  theWeight(1.) {}
ConstReferenceCountingPointer< SurfaceType > theSurfaceP
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError

◆ BasicTrajectoryState() [6/10]

BasicTrajectoryState::BasicTrajectoryState ( const LocalTrajectoryParameters par,
const SurfaceType aSurface,
const MagneticField field,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)
inline

Constructor from local parameters, errors and surface. For surfaces with material the side of the surface should be specified explicitely.

Definition at line 133 of file BasicTrajectoryState.h.

137  : BasicTrajectoryState(par, InvalidError(), aSurface, field, side) {}

◆ BasicTrajectoryState() [7/10]

BasicTrajectoryState::BasicTrajectoryState ( const GlobalTrajectoryParameters par,
const CartesianTrajectoryError err,
const SurfaceType aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)
inline

Constructor from global parameters, errors and surface. For surfaces with material the side of the surface should be specified explicitely.

Definition at line 142 of file BasicTrajectoryState.h.

146  : theFreeState(par, err),
150  theValid(true),
151  theSurfaceSide(side),
152  theSurfaceP(&aSurface),
153  theWeight(1.) {}
ConstReferenceCountingPointer< SurfaceType > theSurfaceP
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError

◆ BasicTrajectoryState() [8/10]

BasicTrajectoryState::BasicTrajectoryState ( const GlobalTrajectoryParameters par,
const CurvilinearTrajectoryError err,
const SurfaceType aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)
inline

Constructor from global parameters, errors and surface. For surfaces with material the side of the surface should be specified explicitely. For multi-states the weight should be specified explicitely.

Definition at line 159 of file BasicTrajectoryState.h.

163  : theFreeState(par, err),
167  theValid(true),
168  theSurfaceSide(side),
169  theSurfaceP(&aSurface),
170  theWeight(1.) {}
ConstReferenceCountingPointer< SurfaceType > theSurfaceP
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError

◆ BasicTrajectoryState() [9/10]

BasicTrajectoryState::BasicTrajectoryState ( const GlobalTrajectoryParameters par,
const SurfaceType aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)
inline

Constructor from global parameters and surface. For surfaces with material the side of the surface should be specified explicitely.

Definition at line 175 of file BasicTrajectoryState.h.

178  : BasicTrajectoryState(par, InvalidError(), aSurface, side) {}

◆ BasicTrajectoryState() [10/10]

template<typename... Args>
BasicTrajectoryState::BasicTrajectoryState ( double  iweight,
Args &&...  args 
)
inline

Definition at line 182 of file BasicTrajectoryState.h.

References theWeight.

182  : BasicTrajectoryState(std::forward<Args>(args)...) {
183  theWeight = iweight;
184  }

Member Function Documentation

◆ build()

template<typename T , typename... Args>
static std::shared_ptr<BTSOS> BasicTrajectoryState::build ( Args &&...  args)
inlinestatic

Definition at line 86 of file BasicTrajectoryState.h.

References writedatasetfile::args.

86  {
87  return std::make_shared<T>(std::forward<Args>(args)...);
88  }

◆ canUpdateLocalParameters()

virtual bool BasicTrajectoryState::canUpdateLocalParameters ( ) const
inlinevirtual

Reimplemented in BasicMultiTrajectoryState.

Definition at line 257 of file BasicTrajectoryState.h.

257 { return true; }

◆ cartesianError()

const CartesianTrajectoryError BasicTrajectoryState::cartesianError ( ) const
inline

Definition at line 197 of file BasicTrajectoryState.h.

References FreeTrajectoryState::cartesianError(), freeTrajectoryState(), hasError(), missingError(), and UNLIKELY.

197  {
198  if UNLIKELY (!hasError()) {
199  missingError(" accesing cartesian error.");
200  return CartesianTrajectoryError();
201  }
202  return freeTrajectoryState(true)->cartesianError();
203  }
CartesianTrajectoryError cartesianError() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
void missingError(char const *where) const
#define UNLIKELY(x)
Definition: Likely.h:21

◆ charge()

TrackCharge BasicTrajectoryState::charge ( void  ) const
inline

Definition at line 193 of file BasicTrajectoryState.h.

References FreeTrajectoryState::charge(), and theFreeState.

Referenced by PixelTrackBuilder::build().

193 { return theFreeState.charge(); }
TrackCharge charge() const
FreeTrajectoryState theFreeState

◆ checkCurvilinError()

void BasicTrajectoryState::checkCurvilinError ( ) const
private

Definition at line 112 of file BasicTrajectoryState.cc.

References createLocalParameters(), globalParameters(), FreeTrajectoryState::hasCurvilinearError(), JacobianLocalToCurvilinear::jacobian(), LIKELY, localParameters(), magneticField(), LocalTrajectoryError::matrix(), FreeTrajectoryState::setCurvilinearError(), surface(), theFreeState, theLocalError, theLocalParametersValid, and UNLIKELY.

Referenced by freeTrajectoryState().

112  {
114  return;
115 
118 
120  const AlgebraicMatrix55& jac = loc2Curv.jacobian();
121  const AlgebraicSymMatrix55& cov = ROOT::Math::Similarity(jac, theLocalError.matrix());
122 
124 
125  verifyLocalErr(theLocalError, theFreeState);
126  verifyCurvErr(cov, theFreeState);
127 }
const GlobalTrajectoryParameters & globalParameters() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
bool hasCurvilinearError() const
#define LIKELY(x)
Definition: Likely.h:20
const SurfaceType & surface() const
FreeTrajectoryState theFreeState
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
CurvilinearTrajectoryError & setCurvilinearError()
const LocalTrajectoryParameters & localParameters() const
const AlgebraicSymMatrix55 & matrix() const
#define UNLIKELY(x)
Definition: Likely.h:21
LocalTrajectoryError theLocalError
const MagneticField * magneticField() const

◆ churn()

template<typename T , typename... Args>
static std::shared_ptr<BTSOS> BasicTrajectoryState::churn ( Args &&...  args)
inlinestatic

Definition at line 91 of file BasicTrajectoryState.h.

References writedatasetfile::args.

91  {
92  return std::allocate_shared<T>(churn_allocator<T>(), std::forward<Args>(args)...);
93  }

◆ clone()

virtual pointer BasicTrajectoryState::clone ( ) const
pure virtual

◆ components()

virtual Components const& BasicTrajectoryState::components ( ) const
pure virtual

◆ createLocalError()

void BasicTrajectoryState::createLocalError ( ) const
private

Definition at line 145 of file BasicTrajectoryState.cc.

References createLocalErrorFromCurvilinearError(), FreeTrajectoryState::hasCurvilinearError(), LIKELY, theFreeState, and theLocalError.

Referenced by localError().

145  {
148  else
150 }
bool hasCurvilinearError() const
#define LIKELY(x)
Definition: Likely.h:20
FreeTrajectoryState theFreeState
void createLocalErrorFromCurvilinearError() const
LocalTrajectoryError theLocalError

◆ createLocalErrorFromCurvilinearError()

void BasicTrajectoryState::createLocalErrorFromCurvilinearError ( ) const
private

Definition at line 152 of file BasicTrajectoryState.cc.

References FreeTrajectoryState::curvilinearError(), globalParameters(), JacobianCurvilinearToLocal::jacobian(), localParameters(), magneticField(), CurvilinearTrajectoryError::matrix(), surface(), theFreeState, and theLocalError.

Referenced by createLocalError().

152  {
154  const AlgebraicMatrix55& jac = curv2Loc.jacobian();
155 
156  theLocalError = ROOT::Math::Similarity(jac, theFreeState.curvilinearError().matrix());
157 
158  verifyCurvErr(theFreeState.curvilinearError(), theFreeState);
159  verifyLocalErr(theLocalError, theFreeState);
160 }
const CurvilinearTrajectoryError & curvilinearError() const
const GlobalTrajectoryParameters & globalParameters() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
const SurfaceType & surface() const
const AlgebraicSymMatrix55 & matrix() const
FreeTrajectoryState theFreeState
const LocalTrajectoryParameters & localParameters() const
LocalTrajectoryError theLocalError
const MagneticField * magneticField() const

◆ createLocalParameters()

void BasicTrajectoryState::createLocalParameters ( ) const
private

Definition at line 130 of file BasicTrajectoryState.cc.

References FreeTrajectoryState::charge(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::position(), FreeTrajectoryState::signedInverseMomentum(), surface(), theFreeState, theLocalParameters, theLocalParametersValid, GloballyPositioned< T >::toLocal(), and x.

Referenced by checkCurvilinError(), and localParameters().

130  {
133  // believe p.z() never exactly equals 0.
134  bool isCharged = theFreeState.charge() != 0;
136  p.x() / p.z(),
137  p.y() / p.z(),
138  x.x(),
139  x.y(),
140  p.z() > 0. ? 1. : -1.,
141  isCharged);
143 }
LocalPoint toLocal(const GlobalPoint &gp) const
GlobalPoint position() const
TrackCharge charge() const
const SurfaceType & surface() const
GlobalVector momentum() const
double signedInverseMomentum() const
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters

◆ curvilinearError()

const CurvilinearTrajectoryError& BasicTrajectoryState::curvilinearError ( ) const
inline

Definition at line 204 of file BasicTrajectoryState.h.

References RefreshWebPage::crap, FreeTrajectoryState::curvilinearError(), freeTrajectoryState(), hasError(), missingError(), and UNLIKELY.

Referenced by PixelTrackBuilder::build().

204  {
205  if UNLIKELY (!hasError()) {
206  missingError(" accesing curvilinearerror.");
207  static const CurvilinearTrajectoryError crap;
208  return crap;
209  }
210  return freeTrajectoryState(true)->curvilinearError();
211  }
const CurvilinearTrajectoryError & curvilinearError() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
void missingError(char const *where) const
#define UNLIKELY(x)
Definition: Likely.h:21

◆ freeTrajectoryState()

FreeTrajectoryState const* BasicTrajectoryState::freeTrajectoryState ( bool  withErrors = true) const
inline

Definition at line 213 of file BasicTrajectoryState.h.

References checkCurvilinError(), hasError(), isValid(), notValid(), theFreeState, and UNLIKELY.

Referenced by cartesianError(), and curvilinearError().

213  {
214  if UNLIKELY (!isValid())
215  notValid();
216  if (withErrors && hasError()) { // this is the right thing
218  }
219  return &theFreeState;
220  }
FreeTrajectoryState theFreeState
#define UNLIKELY(x)
Definition: Likely.h:21

◆ globalDirection()

GlobalVector BasicTrajectoryState::globalDirection ( ) const
inline

Definition at line 192 of file BasicTrajectoryState.h.

References FreeTrajectoryState::momentum(), theFreeState, and Vector3DBase< T, FrameTag >::unit().

192 { return theFreeState.momentum().unit(); }
GlobalVector momentum() const
FreeTrajectoryState theFreeState
Vector3DBase unit() const
Definition: Vector3DBase.h:54

◆ globalMomentum()

GlobalVector BasicTrajectoryState::globalMomentum ( ) const
inline

Definition at line 191 of file BasicTrajectoryState.h.

References FreeTrajectoryState::momentum(), and theFreeState.

Referenced by PixelTrackBuilder::build().

191 { return theFreeState.momentum(); }
GlobalVector momentum() const
FreeTrajectoryState theFreeState

◆ globalParameters()

const GlobalTrajectoryParameters& BasicTrajectoryState::globalParameters ( void  ) const
inline

Definition at line 189 of file BasicTrajectoryState.h.

References FreeTrajectoryState::parameters(), and theFreeState.

Referenced by checkCurvilinError(), and createLocalErrorFromCurvilinearError().

189 { return theFreeState.parameters(); }
const GlobalTrajectoryParameters & parameters() const
FreeTrajectoryState theFreeState

◆ globalPosition()

GlobalPoint BasicTrajectoryState::globalPosition ( ) const
inline

Definition at line 190 of file BasicTrajectoryState.h.

References FreeTrajectoryState::position(), and theFreeState.

Referenced by PixelTrackBuilder::build().

190 { return theFreeState.position(); }
GlobalPoint position() const
FreeTrajectoryState theFreeState

◆ hasError()

bool BasicTrajectoryState::hasError ( void  ) const
inline

◆ isValid()

bool BasicTrajectoryState::isValid ( void  ) const
inline

◆ localDirection()

LocalVector BasicTrajectoryState::localDirection ( ) const
inline

Definition at line 234 of file BasicTrajectoryState.h.

References localMomentum(), and Vector3DBase< T, FrameTag >::unit().

234 { return localMomentum().unit(); }
Vector3DBase unit() const
Definition: Vector3DBase.h:54
LocalVector localMomentum() const

◆ localError()

const LocalTrajectoryError& BasicTrajectoryState::localError ( ) const
inline

Definition at line 236 of file BasicTrajectoryState.h.

References createLocalError(), hasError(), LocalTrajectoryError::invalid(), missingError(), theLocalError, and UNLIKELY.

236  {
237  if UNLIKELY (!hasError()) {
238  missingError(" accessing local error.");
239  return theLocalError;
240  }
243  return theLocalError;
244  }
void missingError(char const *where) const
#define UNLIKELY(x)
Definition: Likely.h:21
LocalTrajectoryError theLocalError

◆ localMomentum()

LocalVector BasicTrajectoryState::localMomentum ( ) const
inline

Definition at line 233 of file BasicTrajectoryState.h.

References localParameters(), and LocalTrajectoryParameters::momentum().

Referenced by localDirection().

233 { return localParameters().momentum(); }
LocalVector momentum() const
Momentum vector in the local frame.
const LocalTrajectoryParameters & localParameters() const

◆ localParameters()

const LocalTrajectoryParameters& BasicTrajectoryState::localParameters ( ) const
inline

◆ localPosition()

LocalPoint BasicTrajectoryState::localPosition ( ) const
inline

Definition at line 232 of file BasicTrajectoryState.h.

References localParameters(), and LocalTrajectoryParameters::position().

232 { return localParameters().position(); }
const LocalTrajectoryParameters & localParameters() const
LocalPoint position() const
Local x and y position coordinates.

◆ magneticField()

const MagneticField* BasicTrajectoryState::magneticField ( ) const
inline

◆ missingError()

void BasicTrajectoryState::missingError ( char const *  where) const
private

Definition at line 101 of file BasicTrajectoryState.cc.

References LocalTrajectoryError::matrix(), theFreeState, theLocalError, and LocalTrajectoryError::valid().

Referenced by cartesianError(), curvilinearError(), localError(), and rescaleError().

101  {
102  std::stringstream form;
103  form << "BasicTrajectoryState: attempt to access errors when none available " << where
104  << ".\nfreestate pointer: " << theFreeState << "\nlocal error valid/values :" << theLocalError.valid() << "\n"
105  << theLocalError.matrix();
106 
107  edm::LogWarning("BasicTrajectoryState") << form.str();
108 
109  // throw TrajectoryStateException(form.str());
110 }
FreeTrajectoryState theFreeState
const AlgebraicSymMatrix55 & matrix() const
Log< level::Warning, false > LogWarning
LocalTrajectoryError theLocalError

◆ notValid()

void BasicTrajectoryState::notValid ( )
staticprivate

Definition at line 82 of file BasicTrajectoryState.cc.

Referenced by freeTrajectoryState(), and localParameters().

82  {
83  throw TrajectoryStateException("TrajectoryStateOnSurface is invalid and cannot return any parameters");
84 }

◆ rescaleError()

void BasicTrajectoryState::rescaleError ( double  factor)

Definition at line 220 of file BasicTrajectoryState.cc.

References debug_messages_cfi::errors, hasError(), mps_fire::i, dqmiolumiharvest::j, magneticField(), LocalTrajectoryError::matrix(), missingError(), MagneticField::nominalValue(), FreeTrajectoryState::rescaleError(), theFreeState, theLocalError, UNLIKELY, and LocalTrajectoryError::valid().

220  {
221  if UNLIKELY (!hasError())
222  missingError(" trying to rescale");
224 
225  if (theLocalError.valid()) {
226  //do it by hand if the free state is not around.
227  bool zeroField = (magneticField()->nominalValue() == 0);
228  if UNLIKELY (zeroField) {
230  //scale the 0 indexed covariance by the square root of the factor
231  for (unsigned int i = 1; i != 5; ++i)
232  errors(i, 0) *= factor;
233  double factor_squared = factor * factor;
234  //scale all others by the scaled factor
235  for (unsigned int i = 1; i != 5; ++i)
236  for (unsigned int j = i; j != 5; ++j)
237  errors(i, j) *= factor_squared;
238  //term 0,0 is not scaled at all
240  } else
241  theLocalError *= (factor * factor);
242  }
243 }
void rescaleError(double factor)
void missingError(char const *where) const
FreeTrajectoryState theFreeState
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const AlgebraicSymMatrix55 & matrix() const
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:49
Definition: errors.py:1
#define UNLIKELY(x)
Definition: Likely.h:21
LocalTrajectoryError theLocalError
const MagneticField * magneticField() const

◆ setCurvilinearError()

CurvilinearTrajectoryError& BasicTrajectoryState::setCurvilinearError ( )
inline

Definition at line 279 of file BasicTrajectoryState.h.

References FreeTrajectoryState::setCurvilinearError(), and theFreeState.

279 { return theFreeState.setCurvilinearError(); }
FreeTrajectoryState theFreeState
CurvilinearTrajectoryError & setCurvilinearError()

◆ signedInverseMomentum()

double BasicTrajectoryState::signedInverseMomentum ( ) const
inline

Definition at line 194 of file BasicTrajectoryState.h.

References FreeTrajectoryState::signedInverseMomentum(), and theFreeState.

double signedInverseMomentum() const
FreeTrajectoryState theFreeState

◆ singleState()

virtual bool BasicTrajectoryState::singleState ( ) const
pure virtual

◆ surface()

const SurfaceType& BasicTrajectoryState::surface ( ) const
inline

Definition at line 246 of file BasicTrajectoryState.h.

References theSurfaceP.

Referenced by checkCurvilinError(), createLocalErrorFromCurvilinearError(), createLocalParameters(), and update().

246 { return *theSurfaceP; }
ConstReferenceCountingPointer< SurfaceType > theSurfaceP

◆ surfaceSide()

SurfaceSide BasicTrajectoryState::surfaceSide ( ) const
inline

Position relative to material, defined relative to momentum vector.

Definition at line 253 of file BasicTrajectoryState.h.

References theSurfaceSide.

253 { return theSurfaceSide; }

◆ transverseCurvature()

double BasicTrajectoryState::transverseCurvature ( ) const
inline

Definition at line 195 of file BasicTrajectoryState.h.

References theFreeState, and FreeTrajectoryState::transverseCurvature().

195 { return theFreeState.transverseCurvature(); }
double transverseCurvature() const
FreeTrajectoryState theFreeState

◆ update() [1/4]

void BasicTrajectoryState::update ( const LocalTrajectoryParameters p,
const SurfaceType aSurface,
const MagneticField field,
const SurfaceSide  side 
)
virtual

Reimplemented in BasicMultiTrajectoryState.

Definition at line 173 of file BasicTrajectoryState.cc.

References AlCaHLTBitMon_ParallelJobs::p, theFreeState, theLocalError, theLocalParameters, theLocalParametersValid, theSurfaceP, theSurfaceSide, theValid, and theWeight.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), BasicMultiTrajectoryState::combine(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

176  {
178  if (&aSurface != &*theSurfaceP)
179  theSurfaceP.reset(&aSurface);
180  theSurfaceSide = side;
181  theWeight = 1.0;
183  theFreeState = makeFTS(p, aSurface, field);
184 
185  theValid = true;
187 }
ConstReferenceCountingPointer< SurfaceType > theSurfaceP
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError

◆ update() [2/4]

void BasicTrajectoryState::update ( const LocalTrajectoryParameters p,
const SurfaceSide  side 
)
finalvirtual

Definition at line 163 of file BasicTrajectoryState.cc.

References magneticField(), GlobalTrajectoryParameters::magneticFieldInTesla(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::parameters(), surface(), theFreeState, theLocalError, theLocalParameters, theLocalParametersValid, theSurfaceSide, and theValid.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

163  {
165  theSurfaceSide = side;
168 
169  theValid = true;
171 }
const GlobalTrajectoryParameters & parameters() const
const SurfaceType & surface() const
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError
const MagneticField * magneticField() const

◆ update() [3/4]

void BasicTrajectoryState::update ( double  weight,
const LocalTrajectoryParameters p,
const LocalTrajectoryError err,
const SurfaceType aSurface,
const MagneticField field,
const SurfaceSide  side 
)
virtual

Reimplemented in BasicMultiTrajectoryState.

Definition at line 189 of file BasicTrajectoryState.cc.

References submitPVResolutionJobs::err, AlCaHLTBitMon_ParallelJobs::p, theFreeState, theLocalError, theLocalParameters, theLocalParametersValid, theSurfaceP, theSurfaceSide, theValid, theWeight, and weight().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

194  {
196  theLocalError = err;
197  if (&aSurface != &*theSurfaceP)
198  theSurfaceP.reset(&aSurface);
199  theSurfaceSide = side;
200  theWeight = weight;
201  theFreeState = makeFTS(p, aSurface, field);
202 
203  theValid = true;
205 }
ConstReferenceCountingPointer< SurfaceType > theSurfaceP
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError

◆ update() [4/4]

void BasicTrajectoryState::update ( const LocalTrajectoryParameters p,
const LocalTrajectoryError err,
const SurfaceSide  side 
)
finalvirtual

Definition at line 207 of file BasicTrajectoryState.cc.

References submitPVResolutionJobs::err, magneticField(), GlobalTrajectoryParameters::magneticFieldInTesla(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::parameters(), surface(), theFreeState, theLocalError, theLocalParameters, theLocalParametersValid, theSurfaceSide, and theValid.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

209  {
211  theLocalError = err;
212  theSurfaceSide = side;
215 
216  theValid = true;
218 }
const GlobalTrajectoryParameters & parameters() const
const SurfaceType & surface() const
FreeTrajectoryState theFreeState
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError
const MagneticField * magneticField() const

◆ weight()

double BasicTrajectoryState::weight ( ) const
inline

Definition at line 248 of file BasicTrajectoryState.h.

References theWeight.

Referenced by BasicMultiTrajectoryState::combine(), and update().

248 { return theWeight; }

Member Data Documentation

◆ theFreeState

FreeTrajectoryState BasicTrajectoryState::theFreeState
mutableprivate

◆ theLocalError

LocalTrajectoryError BasicTrajectoryState::theLocalError
mutableprivate

◆ theLocalParameters

LocalTrajectoryParameters BasicTrajectoryState::theLocalParameters
mutableprivate

Definition at line 304 of file BasicTrajectoryState.h.

Referenced by createLocalParameters(), localParameters(), and update().

◆ theLocalParametersValid

bool BasicTrajectoryState::theLocalParametersValid
mutableprivate

◆ theSurfaceP

ConstReferenceCountingPointer<SurfaceType> BasicTrajectoryState::theSurfaceP
private

Definition at line 310 of file BasicTrajectoryState.h.

Referenced by surface(), and update().

◆ theSurfaceSide

SurfaceSide BasicTrajectoryState::theSurfaceSide
private

Definition at line 309 of file BasicTrajectoryState.h.

Referenced by surfaceSide(), and update().

◆ theValid

bool BasicTrajectoryState::theValid
mutableprivate

Definition at line 307 of file BasicTrajectoryState.h.

Referenced by isValid(), and update().

◆ theWeight

double BasicTrajectoryState::theWeight = 0.
private

Definition at line 312 of file BasicTrajectoryState.h.

Referenced by BasicTrajectoryState(), update(), and weight().