CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
BasicSingleTrajectoryState Class Reference

vvv DEBUG More...

#include <BasicSingleTrajectoryState.h>

Inheritance diagram for BasicSingleTrajectoryState:
BasicTrajectoryState ReferenceCountedPoolAllocated BlockWipedPoolAllocated

Public Member Functions

 BasicSingleTrajectoryState (const FreeTrajectoryState &fts, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicSingleTrajectoryState (const GlobalTrajectoryParameters &par, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicSingleTrajectoryState (const GlobalTrajectoryParameters &par, const CartesianTrajectoryError &err, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicSingleTrajectoryState (const GlobalTrajectoryParameters &par, const CurvilinearTrajectoryError &err, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface, double weight=1.)
 
 BasicSingleTrajectoryState (const GlobalTrajectoryParameters &par, const CurvilinearTrajectoryError &err, const Surface &aSurface, double weight)
 
 BasicSingleTrajectoryState (const LocalTrajectoryParameters &par, const Surface &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicSingleTrajectoryState (const LocalTrajectoryParameters &par, const LocalTrajectoryError &err, const Surface &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface, double weight=1.)
 
 BasicSingleTrajectoryState (const LocalTrajectoryParameters &par, const LocalTrajectoryError &err, const Surface &aSurface, const MagneticField *field, double weight)
 
 BasicSingleTrajectoryState (const Surface &aSurface)
 construct invalid trajectory state (without parameters) More...
 
virtual bool canUpdateLocalParameters () const
 
const CartesianTrajectoryErrorcartesianError () const
 
TrackCharge charge () const
 
BasicSingleTrajectoryStateclone () const
 
const CurvilinearTrajectoryErrorcurvilinearError () const
 
FreeTrajectoryStatefreeTrajectoryState (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 missingError (char const *where) const
 
void rescaleError (double factor)
 
double signedInverseMomentum () const
 
const Surfacesurface () const
 
virtual SurfaceSide surfaceSide () const
 Position relative to material, defined relative to momentum vector. More...
 
double transverseCurvature () const
 
virtual void update (const LocalTrajectoryParameters &p, const Surface &aSurface, const MagneticField *field, const SurfaceSide side)
 
virtual void update (const LocalTrajectoryParameters &p, const LocalTrajectoryError &err, const Surface &aSurface, const MagneticField *field, const SurfaceSide side, double weight)
 
virtual double weight () const
 
virtual ~BasicSingleTrajectoryState ()
 
- Public Member Functions inherited from BasicTrajectoryState
virtual std::vector
< TrajectoryStateOnSurface
components () const
 
virtual ~BasicTrajectoryState ()
 
- Public Member Functions inherited from ReferenceCountedPoolAllocated
void addReference () const
 
const
ReferenceCountedPoolAllocated
operator= (const ReferenceCountedPoolAllocated &)
 
 ReferenceCountedPoolAllocated ()
 
 ReferenceCountedPoolAllocated (const ReferenceCountedPoolAllocated &iRHS)
 
unsigned int references () const
 
void removeReference () const
 
virtual ~ReferenceCountedPoolAllocated ()
 
- Public Member Functions inherited from BlockWipedPoolAllocated
virtual ~BlockWipedPoolAllocated ()
 

Static Public Member Functions

static void notValid ()
 
- Static Public Member Functions inherited from BlockWipedPoolAllocated
static BlockWipedAllocatorallocator (size_t s)
 
static void operator delete (void *p, size_t s)
 
static void * operator new (size_t s, void *p)
 
static void * operator new (size_t s)
 
static BlockWipedAllocator::Stat stat (size_t s)
 
static void usePool ()
 

Private Member Functions

void checkCartesianError () const
 
void checkCurvilinError () const
 
void checkGlobalParameters () const
 
void createLocalError () const
 
void createLocalErrorFromCartesianError () const
 
void createLocalErrorFromCurvilinearError () const
 
void createLocalParameters () const
 

Private Attributes

bool theCartesianErrorUp2Date
 
bool theCurvilinErrorUp2Date
 
const MagneticFieldtheField
 
DeepCopyPointer
< FreeTrajectoryState
theFreeState
 
bool theGlobalParamsUp2Date
 
LocalTrajectoryError theLocalError
 
bool theLocalErrorValid
 
LocalTrajectoryParameters theLocalParameters
 
bool theLocalParametersValid
 
ConstReferenceCountingPointer
< Surface
theSurfaceP
 
SurfaceSide theSurfaceSide
 
double theWeight
 

Additional Inherited Members

- Public Types inherited from BasicTrajectoryState
typedef BasicTrajectoryState BTSOS
 
typedef ProxyBase< BTSOS,
CopyUsingClone< BTSOS > > 
Proxy
 
typedef
ReferenceCountingPointer
< BasicTrajectoryState
RCPtr
 
typedef
SurfaceSideDefinition::SurfaceSide 
SurfaceSide
 
- Static Public Attributes inherited from ReferenceCountedPoolAllocated
static int s_alive =0
 
static int s_referenced =0
 
- Static Public Attributes inherited from BlockWipedPoolAllocated
static int s_alive =0
 

Detailed Description

vvv DEBUG

Concrete implementation for the state of one trajectory on a surface.

Definition at line 24 of file BasicSingleTrajectoryState.h.

Constructor & Destructor Documentation

BasicSingleTrajectoryState::BasicSingleTrajectoryState ( const FreeTrajectoryState fts,
const Surface aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)

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

Definition at line 11 of file BasicSingleTrajectoryState.cc.

Referenced by clone().

13  :
15  theLocalError(),
18  theLocalErrorValid(false),
22  theSurfaceSide(side),
23  theSurfaceP( &aSurface),
24  theWeight(1.),
26 {}
DeepCopyPointer< FreeTrajectoryState > theFreeState
ConstReferenceCountingPointer< Surface > theSurfaceP
const GlobalTrajectoryParameters & parameters() const
bool hasCurvilinearError() const
bool hasCartesianError() const
const MagneticField & magneticField() const
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState::BasicSingleTrajectoryState ( const GlobalTrajectoryParameters par,
const Surface aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)

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

Definition at line 29 of file BasicSingleTrajectoryState.cc.

31  :
33  theLocalError(),
36  theLocalErrorValid(false),
40  theSurfaceSide(side),
41  theSurfaceP( &aSurface),
42  theWeight(1.),
43  theField( &par.magneticField())
44 {}
DeepCopyPointer< FreeTrajectoryState > theFreeState
ConstReferenceCountingPointer< Surface > theSurfaceP
const MagneticField & magneticField() const
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState::BasicSingleTrajectoryState ( const GlobalTrajectoryParameters par,
const CartesianTrajectoryError err,
const Surface aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface 
)

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

Definition at line 47 of file BasicSingleTrajectoryState.cc.

50  :
51  theFreeState( new FreeTrajectoryState(par, err)),
52  theLocalError(),
55  theLocalErrorValid(false),
59  theSurfaceSide(side),
60  theSurfaceP( &aSurface),
61  theWeight(1.),
62  theField( &par.magneticField())
63 {}
DeepCopyPointer< FreeTrajectoryState > theFreeState
ConstReferenceCountingPointer< Surface > theSurfaceP
const MagneticField & magneticField() const
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState::BasicSingleTrajectoryState ( const GlobalTrajectoryParameters par,
const CurvilinearTrajectoryError err,
const Surface aSurface,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface,
double  weight = 1. 
)

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 66 of file BasicSingleTrajectoryState.cc.

70  :
71  theFreeState( new FreeTrajectoryState(par, err)),
72  theLocalError(),
75  theLocalErrorValid(false),
79  theSurfaceSide(side),
80  theSurfaceP( &aSurface),
82  theField( &par.magneticField())
83 {}
DeepCopyPointer< FreeTrajectoryState > theFreeState
ConstReferenceCountingPointer< Surface > theSurfaceP
const MagneticField & magneticField() const
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState::BasicSingleTrajectoryState ( const GlobalTrajectoryParameters par,
const CurvilinearTrajectoryError err,
const Surface aSurface,
double  weight 
)

Constructor from global parameters, errors and surface. For multi-states the weight should be specified explicitely. For backward compatibility without specification of the side of the surface.

Definition at line 86 of file BasicSingleTrajectoryState.cc.

89  :
90  theFreeState( new FreeTrajectoryState(par, err)),
91  theLocalError(),
94  theLocalErrorValid(false),
99  theSurfaceP( &aSurface),
100  theWeight(weight),
101  theField( &par.magneticField())
102 {}
DeepCopyPointer< FreeTrajectoryState > theFreeState
ConstReferenceCountingPointer< Surface > theSurfaceP
const MagneticField & magneticField() const
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState::BasicSingleTrajectoryState ( const LocalTrajectoryParameters par,
const Surface 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.

Definition at line 105 of file BasicSingleTrajectoryState.cc.

108  :
109  theFreeState(0),
110  theLocalError(),
111  theLocalParameters(par),
113  theLocalErrorValid(false),
114  theGlobalParamsUp2Date(false),
117  theSurfaceSide(side),
118  theSurfaceP( &aSurface),
119  theWeight(1.),
120  theField(field)
121 {}
DeepCopyPointer< FreeTrajectoryState > theFreeState
ConstReferenceCountingPointer< Surface > theSurfaceP
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState::BasicSingleTrajectoryState ( const LocalTrajectoryParameters par,
const LocalTrajectoryError err,
const Surface aSurface,
const MagneticField field,
const SurfaceSide  side = SurfaceSideDefinition::atCenterOfSurface,
double  weight = 1. 
)

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 124 of file BasicSingleTrajectoryState.cc.

129  :
130  theFreeState(0),
131  theLocalError(err),
132  theLocalParameters(par),
134  theLocalErrorValid(true),
135  theGlobalParamsUp2Date(false),
138  theSurfaceSide(side),
139  theSurfaceP( &aSurface),
140  theWeight(weight),
141  theField(field)
142 {}
DeepCopyPointer< FreeTrajectoryState > theFreeState
ConstReferenceCountingPointer< Surface > theSurfaceP
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState::BasicSingleTrajectoryState ( const LocalTrajectoryParameters par,
const LocalTrajectoryError err,
const Surface aSurface,
const MagneticField field,
double  weight 
)

Constructor from local parameters, errors and surface. For multi-states the weight should be specified explicitely. For backward compatibility without specification of the side of the surface.

Definition at line 145 of file BasicSingleTrajectoryState.cc.

149  :
150  theFreeState(0),
151  theLocalError(err),
152  theLocalParameters(par),
154  theLocalErrorValid(true),
155  theGlobalParamsUp2Date(false),
159  theSurfaceP( &aSurface),
160  theWeight(weight),
161  theField(field)
162 {}
DeepCopyPointer< FreeTrajectoryState > theFreeState
ConstReferenceCountingPointer< Surface > theSurfaceP
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState::BasicSingleTrajectoryState ( const Surface aSurface)

construct invalid trajectory state (without parameters)

Definition at line 165 of file BasicSingleTrajectoryState.cc.

165  :
166  theFreeState(0),
167  theLocalError(),
170  theLocalErrorValid(false),
171  theGlobalParamsUp2Date(false),
175  theSurfaceP( &aSurface),
176  theWeight(0.),
177  theField(0)
178 {}
DeepCopyPointer< FreeTrajectoryState > theFreeState
ConstReferenceCountingPointer< Surface > theSurfaceP
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState::~BasicSingleTrajectoryState ( )
virtual

Definition at line 181 of file BasicSingleTrajectoryState.cc.

181 {}

Member Function Documentation

virtual bool BasicSingleTrajectoryState::canUpdateLocalParameters ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 182 of file BasicSingleTrajectoryState.h.

182 { return true; }
const CartesianTrajectoryError& BasicSingleTrajectoryState::cartesianError ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 126 of file BasicSingleTrajectoryState.h.

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

126  {
127  if(!hasError()) missingError(" accesing cartesian error.");
129  }
void missingError(char const *where) const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
const CartesianTrajectoryError & cartesianError() const
TrackCharge BasicSingleTrajectoryState::charge ( void  ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 117 of file BasicSingleTrajectoryState.h.

References FreeTrajectoryState::charge(), and freeTrajectoryState().

Referenced by PixelTrackBuilder::build().

117  {
118  return freeTrajectoryState(false)->charge();
119  }
TrackCharge charge() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
void BasicSingleTrajectoryState::checkCartesianError ( ) const
private

Definition at line 239 of file BasicSingleTrajectoryState.cc.

References createLocalError(), createLocalParameters(), JacobianLocalToCartesian::jacobian(), localParameters(), LocalTrajectoryError::matrix(), FreeTrajectoryState::setCartesianError(), surface(), theCartesianErrorUp2Date, theFreeState, theLocalError, theLocalErrorValid, and theLocalParametersValid.

Referenced by freeTrajectoryState().

239  {
244 
246  const AlgebraicMatrix65& jac = loc2Cart.jacobian();
247 
248  const AlgebraicSymMatrix66 &cov = ROOT::Math::Similarity(jac, theLocalError.matrix());
249 
250  //theFreeState->setCartesianError( CartesianTrajectoryError(cov) );
252  }
253 }
DeepCopyPointer< FreeTrajectoryState > theFreeState
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
const LocalTrajectoryParameters & localParameters() const
const AlgebraicSymMatrix55 & matrix() const
void setCartesianError(const CartesianTrajectoryError &err)
ROOT::Math::SMatrix< double, 6, 5, ROOT::Math::MatRepStd< double, 6, 5 > > AlgebraicMatrix65
void BasicSingleTrajectoryState::checkCurvilinError ( ) const
private

Definition at line 221 of file BasicSingleTrajectoryState.cc.

References createLocalError(), createLocalParameters(), JacobianLocalToCurvilinear::jacobian(), localParameters(), LocalTrajectoryError::matrix(), FreeTrajectoryState::setCurvilinearError(), surface(), theCurvilinErrorUp2Date, theField, theFreeState, theLocalError, theLocalErrorValid, and theLocalParametersValid.

Referenced by freeTrajectoryState().

221  {
224  // after createLocalParameters we can be sure theFreeState is not null
226  // cout<<"!theCurvilinErrorUp2Date: create curviError from local"<<endl;
228 
230  const AlgebraicMatrix55& jac = loc2Curv.jacobian();
231 
232  const AlgebraicSymMatrix55 &cov = ROOT::Math::Similarity(jac, theLocalError.matrix());
233 
234  //theFreeState->setCurvilinearError( CurvilinearTrajectoryError(cov) );
236  }
237 }
DeepCopyPointer< FreeTrajectoryState > theFreeState
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const LocalTrajectoryParameters & localParameters() const
const AlgebraicSymMatrix55 & matrix() const
void setCurvilinearError(const CurvilinearTrajectoryError &err)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
void BasicSingleTrajectoryState::checkGlobalParameters ( ) const
private

Definition at line 199 of file BasicSingleTrajectoryState.cc.

References LocalTrajectoryParameters::charge(), LocalTrajectoryParameters::momentum(), L1TEmulatorMonitor_cff::p, LocalTrajectoryParameters::position(), DeepCopyPointer< T >::replaceWith(), surface(), theCartesianErrorUp2Date, theCurvilinErrorUp2Date, theField, theFreeState, theGlobalParamsUp2Date, theLocalParameters, Surface::toGlobal(), and x.

Referenced by freeTrajectoryState().

199  {
201  // cout<<"!theGlobalParamsUp2Date"<<endl;
202  theGlobalParamsUp2Date = true;
203  theCurvilinErrorUp2Date = false;
204  theCartesianErrorUp2Date = false;
205  // calculate global parameters from local
208  // replace in place
209  FreeTrajectoryState * fts = &(*theFreeState);
210  if (fts) {
211  fts->~FreeTrajectoryState();
213  }else {
216  theField));
217  }
218  }
219 }
DeepCopyPointer< FreeTrajectoryState > theFreeState
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
LocalPoint position() const
Local x and y position coordinates.
LocalVector momentum() const
Momentum vector in the local frame.
TrackCharge charge() const
Charge (-1, 0 or 1)
void replaceWith(T *otherP)
Definition: DDAxes.h:10
LocalTrajectoryParameters theLocalParameters
BasicSingleTrajectoryState* BasicSingleTrajectoryState::clone ( void  ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 173 of file BasicSingleTrajectoryState.h.

References BasicSingleTrajectoryState().

173  {
174  return new BasicSingleTrajectoryState(*this);
175  }
BasicSingleTrajectoryState(const FreeTrajectoryState &fts, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
void BasicSingleTrajectoryState::createLocalError ( ) const
private
void BasicSingleTrajectoryState::createLocalErrorFromCartesianError ( ) const
private

Definition at line 290 of file BasicSingleTrajectoryState.cc.

References funct::C, FreeTrajectoryState::cartesianError(), JacobianCartesianToLocal::jacobian(), localParameters(), CartesianTrajectoryError::matrix(), surface(), theFreeState, theLocalError, and theLocalErrorValid.

Referenced by createLocalError().

290  {
291 
293  const AlgebraicMatrix56& jac = cart2Loc.jacobian();
294 
295 
296  const AlgebraicSymMatrix55 &C =
297  ROOT::Math::Similarity(jac, theFreeState->cartesianError().matrix());
299  theLocalErrorValid = true;
300 }
DeepCopyPointer< FreeTrajectoryState > theFreeState
ROOT::Math::SMatrix< double, 5, 6, ROOT::Math::MatRepStd< double, 5, 6 > > AlgebraicMatrix56
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const LocalTrajectoryParameters & localParameters() const
const AlgebraicSymMatrix66 & matrix() const
const CartesianTrajectoryError & cartesianError() const
void BasicSingleTrajectoryState::createLocalErrorFromCurvilinearError ( ) const
private

Definition at line 277 of file BasicSingleTrajectoryState.cc.

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

Referenced by createLocalError().

277  {
278 
280  const AlgebraicMatrix55& jac = curv2Loc.jacobian();
281 
282  const AlgebraicSymMatrix55 &cov =
283  ROOT::Math::Similarity(jac, theFreeState->curvilinearError().matrix());
284  // cout<<"Clocal via curvilinear error"<<endl;
286  theLocalErrorValid = true;
287 }
DeepCopyPointer< FreeTrajectoryState > theFreeState
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const CurvilinearTrajectoryError & curvilinearError() const
const LocalTrajectoryParameters & localParameters() const
const AlgebraicSymMatrix55 & matrix() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
void BasicSingleTrajectoryState::createLocalParameters ( ) const
private

Definition at line 256 of file BasicSingleTrajectoryState.cc.

References FreeTrajectoryState::charge(), PV3DBase< T, PVType, FrameType >::mag(), FreeTrajectoryState::momentum(), L1TEmulatorMonitor_cff::p, FreeTrajectoryState::position(), FreeTrajectoryState::signedInverseMomentum(), surface(), theFreeState, theLocalParameters, theLocalParametersValid, GloballyPositioned< T >::toLocal(), x, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by checkCartesianError(), checkCurvilinError(), and localParameters().

256  {
259 // believe p.z() never exactly equals 0.
260  bool isCharged = theFreeState->charge()!=0;
263  p.x()/p.z(), p.y()/p.z(), x.x(), x.y(), p.z()>0. ? 1.:-1., isCharged);
265 }
DeepCopyPointer< FreeTrajectoryState > theFreeState
T y() const
Definition: PV3DBase.h:57
TrackCharge charge() const
T mag() const
Definition: PV3DBase.h:61
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:58
GlobalVector momentum() const
GlobalPoint position() const
Definition: DDAxes.h:10
T x() const
Definition: PV3DBase.h:56
double signedInverseMomentum() const
LocalTrajectoryParameters theLocalParameters
const CurvilinearTrajectoryError& BasicSingleTrajectoryState::curvilinearError ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 130 of file BasicSingleTrajectoryState.h.

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

Referenced by PixelTrackBuilder::build().

130  {
131  if(!hasError()) missingError(" accesing curvilinearerror.");
133  }
void missingError(char const *where) const
const CurvilinearTrajectoryError & curvilinearError() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
FreeTrajectoryState * BasicSingleTrajectoryState::freeTrajectoryState ( bool  withErrors = true) const
virtual

Implements BasicTrajectoryState.

Definition at line 366 of file BasicSingleTrajectoryState.cc.

References checkCartesianError(), checkCurvilinError(), checkGlobalParameters(), hasError(), isValid(), and notValid().

Referenced by cartesianError(), charge(), curvilinearError(), globalDirection(), globalMomentum(), globalParameters(), globalPosition(), signedInverseMomentum(), and transverseCurvature().

366  {
367  if(!isValid()) notValid();
369  //if(hasError()) { // let's start like this to see if we alloc less
370  if(withErrors && hasError()) { // this is the right thing
373  }
374  return &(*theFreeState);
375 }
GlobalVector BasicSingleTrajectoryState::globalDirection ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 114 of file BasicSingleTrajectoryState.h.

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

114  {
115  return freeTrajectoryState(false)->momentum().unit();
116  }
GlobalVector momentum() const
Vector3DBase unit() const
Definition: Vector3DBase.h:57
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
GlobalVector BasicSingleTrajectoryState::globalMomentum ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 111 of file BasicSingleTrajectoryState.h.

References freeTrajectoryState(), and FreeTrajectoryState::momentum().

Referenced by PixelTrackBuilder::build().

111  {
112  return freeTrajectoryState(false)->momentum();
113  }
GlobalVector momentum() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
const GlobalTrajectoryParameters& BasicSingleTrajectoryState::globalParameters ( void  ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 105 of file BasicSingleTrajectoryState.h.

References freeTrajectoryState(), and FreeTrajectoryState::parameters().

105  {
106  return freeTrajectoryState(false)->parameters();
107  }
const GlobalTrajectoryParameters & parameters() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
GlobalPoint BasicSingleTrajectoryState::globalPosition ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 108 of file BasicSingleTrajectoryState.h.

References freeTrajectoryState(), and FreeTrajectoryState::position().

Referenced by PixelTrackBuilder::build().

108  {
109  return freeTrajectoryState(false)->position();
110  }
GlobalPoint position() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
bool BasicSingleTrajectoryState::hasError ( void  ) const
virtual
bool BasicSingleTrajectoryState::isValid ( void  ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 95 of file BasicSingleTrajectoryState.h.

References theFreeState, and theLocalParametersValid.

Referenced by freeTrajectoryState(), and localParameters().

95  {
97  }
DeepCopyPointer< FreeTrajectoryState > theFreeState
LocalVector BasicSingleTrajectoryState::localDirection ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 153 of file BasicSingleTrajectoryState.h.

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

153  {
154  return localMomentum().unit();
155  }
Vector3DBase unit() const
Definition: Vector3DBase.h:57
const LocalTrajectoryError& BasicSingleTrajectoryState::localError ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 157 of file BasicSingleTrajectoryState.h.

References createLocalError(), hasError(), missingError(), theLocalError, and theLocalErrorValid.

157  {
158  if (!hasError()) missingError(" accessing local error.");
159  if (!theLocalErrorValid)
161  return theLocalError;
162  }
void missingError(char const *where) const
LocalVector BasicSingleTrajectoryState::localMomentum ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 150 of file BasicSingleTrajectoryState.h.

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

Referenced by localDirection().

150  {
151  return localParameters().momentum();
152  }
const LocalTrajectoryParameters & localParameters() const
LocalVector momentum() const
Momentum vector in the local frame.
const LocalTrajectoryParameters& BasicSingleTrajectoryState::localParameters ( ) const
inlinevirtual
LocalPoint BasicSingleTrajectoryState::localPosition ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 147 of file BasicSingleTrajectoryState.h.

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

147  {
148  return localParameters().position();
149  }
LocalPoint position() const
Local x and y position coordinates.
const LocalTrajectoryParameters & localParameters() const
const MagneticField* BasicSingleTrajectoryState::magneticField ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 138 of file BasicSingleTrajectoryState.h.

References theField.

138 { return theField; }
void BasicSingleTrajectoryState::missingError ( char const *  where) const

Definition at line 188 of file BasicSingleTrajectoryState.cc.

References theFreeState, and theLocalErrorValid.

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

188  {
189  std::stringstream form;
190  form<<"TrajectoryStateOnSurface: attempt to access errors when none available "
191  <<where<<".\nfreestate pointer: "
192  <<theFreeState<<"\nlocal error valid :"<<theLocalErrorValid ;
193  throw TrajectoryStateException(form.str());
194 }
DeepCopyPointer< FreeTrajectoryState > theFreeState
void BasicSingleTrajectoryState::notValid ( )
static

Definition at line 183 of file BasicSingleTrajectoryState.cc.

Referenced by freeTrajectoryState(), and localParameters().

183  {
184  throw TrajectoryStateException("TrajectoryStateOnSurface is invalid and cannot return any parameters");
185 }
void BasicSingleTrajectoryState::rescaleError ( double  factor)
virtual

Implements BasicTrajectoryState.

Definition at line 343 of file BasicSingleTrajectoryState.cc.

References benchmark_cfg::errors, hasError(), i, MagneticField::inInverseGeV(), j, PV3DBase< T, PVType, FrameType >::mag2(), LocalTrajectoryError::matrix(), missingError(), FreeTrajectoryState::rescaleError(), theField, theFreeState, theLocalError, and theLocalErrorValid.

343  {
344  if (!hasError()) missingError(" trying to rescale");
345  if (theFreeState)
346  theFreeState->rescaleError(factor);
347 
348  if (theLocalErrorValid){
349  //do it by hand if the free state is not around.
350  bool zeroField =theField->inInverseGeV(GlobalPoint(0,0,0)).mag2()==0;
351  if (zeroField){
353  //scale the 0 indexed covariance by the square root of the factor
354  for (unsigned int i=1;i!=5;++i) errors(i,0)*=factor;
355  double factor_squared=factor*factor;
356  //scale all others by the scaled factor
357  for (unsigned int i=1;i!=5;++i) for (unsigned int j=i;j!=5;++j) errors(i,j)*=factor_squared;
358  //term 0,0 is not scaled at all
360  }
361  else theLocalError *= (factor*factor);
362  }
363 }
DeepCopyPointer< FreeTrajectoryState > theFreeState
int i
Definition: DBlmapReader.cc:9
T mag2() const
Definition: PV3DBase.h:60
void missingError(char const *where) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
virtual GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
int j
Definition: DBlmapReader.cc:9
const AlgebraicSymMatrix55 & matrix() const
void rescaleError(double factor)
double BasicSingleTrajectoryState::signedInverseMomentum ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 120 of file BasicSingleTrajectoryState.h.

References freeTrajectoryState(), and FreeTrajectoryState::signedInverseMomentum().

120  {
122  }
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
double signedInverseMomentum() const
const Surface& BasicSingleTrajectoryState::surface ( ) const
inlinevirtual
virtual SurfaceSide BasicSingleTrajectoryState::surfaceSide ( ) const
inlinevirtual

Position relative to material, defined relative to momentum vector.

Implements BasicTrajectoryState.

Definition at line 178 of file BasicSingleTrajectoryState.h.

References theSurfaceSide.

178  {
179  return theSurfaceSide;
180  }
double BasicSingleTrajectoryState::transverseCurvature ( ) const
inlinevirtual

Implements BasicTrajectoryState.

Definition at line 123 of file BasicSingleTrajectoryState.h.

References freeTrajectoryState(), and FreeTrajectoryState::transverseCurvature().

123  {
124  return freeTrajectoryState(false)->transverseCurvature();
125  }
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
double transverseCurvature() const
void BasicSingleTrajectoryState::update ( const LocalTrajectoryParameters p,
const Surface aSurface,
const MagneticField field,
const SurfaceSide  side 
)
virtual

Implements BasicTrajectoryState.

Definition at line 303 of file BasicSingleTrajectoryState.cc.

References L1TEmulatorMonitor_cff::p, theCartesianErrorUp2Date, theCurvilinErrorUp2Date, theGlobalParamsUp2Date, theLocalErrorValid, theLocalParameters, theLocalParametersValid, theSurfaceP, theSurfaceSide, and theWeight.

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

307 {
309  if (&aSurface != &*theSurfaceP) theSurfaceP.reset(&aSurface);
310  theSurfaceSide = side;
311  theWeight = 1.0;
312 
313  theGlobalParamsUp2Date = false;
314  theCartesianErrorUp2Date = false;
315  theCurvilinErrorUp2Date = false;
316  theLocalErrorValid = false;
318 }
ConstReferenceCountingPointer< Surface > theSurfaceP
LocalTrajectoryParameters theLocalParameters
void BasicSingleTrajectoryState::update ( const LocalTrajectoryParameters p,
const LocalTrajectoryError err,
const Surface aSurface,
const MagneticField field,
const SurfaceSide  side,
double  weight 
)
virtual

Implements BasicTrajectoryState.

Definition at line 321 of file BasicSingleTrajectoryState.cc.

References L1TEmulatorMonitor_cff::p, theCartesianErrorUp2Date, theCurvilinErrorUp2Date, theGlobalParamsUp2Date, theLocalError, theLocalErrorValid, theLocalParameters, theLocalParametersValid, theSurfaceP, theSurfaceSide, theWeight, and weight().

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

327 {
329  theLocalError = err;
330  if (&aSurface != &*theSurfaceP) theSurfaceP.reset(&aSurface);
331  theSurfaceSide = side;
332  theWeight = weight;
333 
334  theGlobalParamsUp2Date = false;
335  theCartesianErrorUp2Date = false;
336  theCurvilinErrorUp2Date = false;
337  theLocalErrorValid = true;
339 
340 }
ConstReferenceCountingPointer< Surface > theSurfaceP
LocalTrajectoryParameters theLocalParameters
virtual double BasicSingleTrajectoryState::weight ( ) const
inlinevirtual

Reimplemented from BasicTrajectoryState.

Definition at line 168 of file BasicSingleTrajectoryState.h.

References theWeight.

Referenced by update().

Member Data Documentation

bool BasicSingleTrajectoryState::theCartesianErrorUp2Date
mutableprivate
bool BasicSingleTrajectoryState::theCurvilinErrorUp2Date
mutableprivate

Definition at line 218 of file BasicSingleTrajectoryState.h.

Referenced by checkCurvilinError(), checkGlobalParameters(), and update().

const MagneticField* BasicSingleTrajectoryState::theField
private
DeepCopyPointer<FreeTrajectoryState> BasicSingleTrajectoryState::theFreeState
mutableprivate
bool BasicSingleTrajectoryState::theGlobalParamsUp2Date
mutableprivate

Definition at line 216 of file BasicSingleTrajectoryState.h.

Referenced by checkGlobalParameters(), and update().

LocalTrajectoryError BasicSingleTrajectoryState::theLocalError
mutableprivate
bool BasicSingleTrajectoryState::theLocalErrorValid
mutableprivate
LocalTrajectoryParameters BasicSingleTrajectoryState::theLocalParameters
mutableprivate
bool BasicSingleTrajectoryState::theLocalParametersValid
mutableprivate
ConstReferenceCountingPointer<Surface> BasicSingleTrajectoryState::theSurfaceP
private

Definition at line 222 of file BasicSingleTrajectoryState.h.

Referenced by surface(), and update().

SurfaceSide BasicSingleTrajectoryState::theSurfaceSide
private

Definition at line 221 of file BasicSingleTrajectoryState.h.

Referenced by surfaceSide(), and update().

double BasicSingleTrajectoryState::theWeight
private

Definition at line 224 of file BasicSingleTrajectoryState.h.

Referenced by update(), and weight().