CMS 3D CMS Logo

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

#include <BasicTrajectoryState.h>

Inheritance diagram for BasicTrajectoryState:
ReferenceCountedPoolAllocated BlockWipedPoolAllocated BasicMultiTrajectoryState BasicSingleTrajectoryState

Public Types

typedef BasicTrajectoryState BTSOS
 
typedef ProxyBase< BTSOS,
CopyUsingClone< BTSOS > > 
Proxy
 
typedef
ReferenceCountingPointer
< BasicTrajectoryState
RCPtr
 
typedef
SurfaceSideDefinition::SurfaceSide 
SurfaceSide
 

Public Member Functions

 BasicTrajectoryState ()
 
 BasicTrajectoryState (const Surface &aSurface)
 construct invalid trajectory state (without parameters) More...
 
 BasicTrajectoryState (const FreeTrajectoryState &fts, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const CartesianTrajectoryError &err, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const CurvilinearTrajectoryError &err, const Surface &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface, double weight=1.)
 
 BasicTrajectoryState (const GlobalTrajectoryParameters &par, const CurvilinearTrajectoryError &err, const Surface &aSurface, double weight)
 
 BasicTrajectoryState (const LocalTrajectoryParameters &par, const Surface &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
 
 BasicTrajectoryState (const LocalTrajectoryParameters &par, const LocalTrajectoryError &err, const Surface &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface, double weight=1.)
 
 BasicTrajectoryState (const LocalTrajectoryParameters &par, const LocalTrajectoryError &err, const Surface &aSurface, const MagneticField *field, double weight)
 
virtual bool canUpdateLocalParameters () const
 
const CartesianTrajectoryError cartesianError () const
 
TrackCharge charge () const
 
virtual BasicTrajectoryStateclone () const =0
 
virtual std::vector
< TrajectoryStateOnSurface
components () 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 rescaleError (double factor)
 
double signedInverseMomentum () const
 
const Surfacesurface () const
 
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 ~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 ()
 

Private Member Functions

void checkCurvilinError () const
 
void checkGlobalParameters () 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

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

Friends

class ProxyBase< BTSOS, CopyUsingClone< BTSOS > >
 
class ReferenceCountingPointer< BasicTrajectoryState >
 

Additional Inherited Members

- 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 ()
 
- 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
 
static bool s_usePool =false
 

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 48 of file BasicTrajectoryState.h.

Member Typedef Documentation

Definition at line 51 of file BasicTrajectoryState.h.

Definition at line 52 of file BasicTrajectoryState.h.

Definition at line 53 of file BasicTrajectoryState.h.

Definition at line 54 of file BasicTrajectoryState.h.

Constructor & Destructor Documentation

BasicTrajectoryState::BasicTrajectoryState ( )
inline

Definition at line 62 of file BasicTrajectoryState.h.

62 {}
BasicTrajectoryState::BasicTrajectoryState ( const Surface aSurface)
explicit

construct invalid trajectory state (without parameters)

Definition at line 144 of file BasicTrajectoryState.cc.

144  :
145  theFreeState(0),
149  theGlobalParamsUp2Date(false),
151  theSurfaceP( &aSurface),
152  theWeight(0.),
153  theField(0)
154 {}
ConstReferenceCountingPointer< Surface > theSurfaceP
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError
BasicTrajectoryState::~BasicTrajectoryState ( )
virtual

Definition at line 157 of file BasicTrajectoryState.cc.

157 {}
BasicTrajectoryState::BasicTrajectoryState ( 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 14 of file BasicTrajectoryState.cc.

16  :
22  theSurfaceSide(side),
23  theSurfaceP( &aSurface),
24  theWeight(1.),
26 {}
ConstReferenceCountingPointer< Surface > theSurfaceP
const GlobalTrajectoryParameters & parameters() const
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
LocalTrajectoryParameters theLocalParameters
const MagneticField & magneticField() const
LocalTrajectoryError theLocalError
BasicTrajectoryState::BasicTrajectoryState ( 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 BasicTrajectoryState.cc.

31  :
37  theSurfaceSide(side),
38  theSurfaceP( &aSurface),
39  theWeight(1.),
40  theField( &par.magneticField())
41 {}
ConstReferenceCountingPointer< Surface > theSurfaceP
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
LocalTrajectoryParameters theLocalParameters
const MagneticField & magneticField() const
LocalTrajectoryError theLocalError
BasicTrajectoryState::BasicTrajectoryState ( 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 44 of file BasicTrajectoryState.cc.

47  :
48  theFreeState( new FreeTrajectoryState(par, err)),
53  theSurfaceSide(side),
54  theSurfaceP( &aSurface),
55  theWeight(1.),
56  theField( &par.magneticField())
57 {}
ConstReferenceCountingPointer< Surface > theSurfaceP
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
LocalTrajectoryParameters theLocalParameters
const MagneticField & magneticField() const
LocalTrajectoryError theLocalError
BasicTrajectoryState::BasicTrajectoryState ( 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 60 of file BasicTrajectoryState.cc.

64  :
65  theFreeState( new FreeTrajectoryState(par, err)),
70  theSurfaceSide(side),
71  theSurfaceP( &aSurface),
73  theField( &par.magneticField())
74 {}
ConstReferenceCountingPointer< Surface > theSurfaceP
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
virtual double weight() const
LocalTrajectoryParameters theLocalParameters
const MagneticField & magneticField() const
LocalTrajectoryError theLocalError
BasicTrajectoryState::BasicTrajectoryState ( 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 77 of file BasicTrajectoryState.cc.

80  :
81  theFreeState( new FreeTrajectoryState(par, err)),
87  theSurfaceP( &aSurface),
89  theField( &par.magneticField())
90 {}
ConstReferenceCountingPointer< Surface > theSurfaceP
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
virtual double weight() const
LocalTrajectoryParameters theLocalParameters
const MagneticField & magneticField() const
LocalTrajectoryError theLocalError
BasicTrajectoryState::BasicTrajectoryState ( 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 93 of file BasicTrajectoryState.cc.

96  :
97  theFreeState(0),
99  theLocalParameters(par),
101  theGlobalParamsUp2Date(false),
102  theSurfaceSide(side),
103  theSurfaceP( &aSurface),
104  theWeight(1.),
105  theField(field)
106 {}
ConstReferenceCountingPointer< Surface > theSurfaceP
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError
BasicTrajectoryState::BasicTrajectoryState ( 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 109 of file BasicTrajectoryState.cc.

114  :
115  theFreeState(0),
116  theLocalError(err),
117  theLocalParameters(par),
119  theGlobalParamsUp2Date(false),
120  theSurfaceSide(side),
121  theSurfaceP( &aSurface),
122  theWeight(weight),
123  theField(field)
124 {}
ConstReferenceCountingPointer< Surface > theSurfaceP
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
virtual double weight() const
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError
BasicTrajectoryState::BasicTrajectoryState ( 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 127 of file BasicTrajectoryState.cc.

131  :
132  theFreeState(0),
133  theLocalError(err),
134  theLocalParameters(par),
136  theGlobalParamsUp2Date(false),
138  theSurfaceP( &aSurface),
139  theWeight(weight),
140  theField(field)
141 {}
ConstReferenceCountingPointer< Surface > theSurfaceP
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
virtual double weight() const
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError

Member Function Documentation

virtual bool BasicTrajectoryState::canUpdateLocalParameters ( ) const
inlinevirtual

Reimplemented in BasicMultiTrajectoryState.

Definition at line 231 of file BasicTrajectoryState.h.

231 { return true; }
const CartesianTrajectoryError BasicTrajectoryState::cartesianError ( ) const
inline

Definition at line 162 of file BasicTrajectoryState.h.

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

162  {
163  if unlikely(!hasError()) {
164  missingError(" accesing cartesian error.");
165  return CartesianTrajectoryError();
166  }
168  }
CartesianTrajectoryError cartesianError() const
#define unlikely(x)
Definition: Likely.h:21
void missingError(char const *where) const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
TrackCharge BasicTrajectoryState::charge ( void  ) const
inline

Definition at line 152 of file BasicTrajectoryState.h.

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

Referenced by PixelTrackBuilder::build().

152  {
153  return freeTrajectoryState(false)->charge();
154  }
TrackCharge charge() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
void BasicTrajectoryState::checkCurvilinError ( ) const
private

Definition at line 214 of file BasicTrajectoryState.cc.

References createLocalParameters(), FreeTrajectoryState::hasCurvilinearError(), JacobianLocalToCurvilinear::jacobian(), likely, localParameters(), LocalTrajectoryError::matrix(), FreeTrajectoryState::setCurvilinearError(), surface(), theField, theFreeState, theLocalError, theLocalParametersValid, and unlikely.

Referenced by freeTrajectoryState().

214  {
216 
218 
219 
221  const AlgebraicMatrix55& jac = loc2Curv.jacobian();
222 
223  const AlgebraicSymMatrix55 &cov = ROOT::Math::Similarity(jac, theLocalError.matrix());
224 
225  theFreeState->setCurvilinearError( cov );
226 
227  verifyLocalErr(theLocalError);
228  verifyCurvErr(cov);
229 }
const Surface & surface() const
bool hasCurvilinearError() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
#define unlikely(x)
Definition: Likely.h:21
DeepCopyPointer< FreeTrajectoryState > theFreeState
void createLocalParameters() const
const MagneticField * theField
string const
Definition: compareJSON.py:14
const LocalTrajectoryParameters & localParameters() const
#define likely(x)
Definition: Likely.h:20
LocalTrajectoryError theLocalError
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
void BasicTrajectoryState::checkGlobalParameters ( ) const
private

Definition at line 192 of file BasicTrajectoryState.cc.

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

Referenced by freeTrajectoryState().

192  {
194 
195  // cout<<"!theGlobalParamsUp2Date"<<endl;
197  // calculate global parameters from local
199  GlobalVector p = surface().toGlobal(theLocalParameters.momentum());
200  // replace in place
201  FreeTrajectoryState * fts = &(*theFreeState);
202  if (fts) {
203  fts->~FreeTrajectoryState();
205  }else {
206  theFreeState.replaceWith(new FreeTrajectoryState(x, p,
208  theField));
209  }
210 }
const Surface & surface() const
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
TrackCharge charge() const
Charge (-1, 0 or 1)
#define likely(x)
Definition: Likely.h:20
static int position[264][3]
Definition: ReadPGInfo.cc:509
LocalTrajectoryParameters theLocalParameters
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
x
Definition: VDTMath.h:216
virtual BasicTrajectoryState* BasicTrajectoryState::clone ( ) const
pure virtual
std::vector< TrajectoryStateOnSurface > BasicTrajectoryState::components ( ) const
virtual

Reimplemented in BasicMultiTrajectoryState.

Definition at line 343 of file BasicTrajectoryState.cc.

References query::result.

343  {
344  std::vector<TrajectoryStateOnSurface> result; result.reserve(1);
345  result.push_back( const_cast<BasicTrajectoryState*>(this));
346  return result;
347 }
tuple result
Definition: query.py:137
void BasicTrajectoryState::createLocalError ( ) const
private

Definition at line 245 of file BasicTrajectoryState.cc.

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

Referenced by localError().

245  {
248  else theLocalError = InvalidError();
249 }
bool hasCurvilinearError() const
void createLocalErrorFromCurvilinearError() const
DeepCopyPointer< FreeTrajectoryState > theFreeState
#define likely(x)
Definition: Likely.h:20
LocalTrajectoryError theLocalError
void BasicTrajectoryState::createLocalErrorFromCurvilinearError ( ) const
private

Definition at line 252 of file BasicTrajectoryState.cc.

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

Referenced by createLocalError().

252  {
253 
255  const AlgebraicMatrix55& jac = curv2Loc.jacobian();
256 
257  const AlgebraicSymMatrix55 &cov =
258  ROOT::Math::Similarity(jac, theFreeState->curvilinearError().matrix());
259  // cout<<"Clocal via curvilinear error"<<endl;
261 
262  verifyCurvErr(theFreeState->curvilinearError());
263  verifyLocalErr(theLocalError);
264 
265 }
const Surface & surface() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const CurvilinearTrajectoryError & curvilinearError() const
DeepCopyPointer< FreeTrajectoryState > theFreeState
const MagneticField * theField
const LocalTrajectoryParameters & localParameters() const
const AlgebraicSymMatrix55 & matrix() const
LocalTrajectoryError theLocalError
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
void BasicTrajectoryState::createLocalParameters ( ) const
private

Definition at line 234 of file BasicTrajectoryState.cc.

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

Referenced by checkCurvilinError(), and localParameters().

234  {
237 // believe p.z() never exactly equals 0.
238  bool isCharged = theFreeState->charge()!=0;
241  p.x()/p.z(), p.y()/p.z(), x.x(), x.y(), p.z()>0. ? 1.:-1., isCharged);
243 }
const Surface & surface() const
T y() const
Definition: PV3DBase.h:62
TrackCharge charge() const
T mag() const
Definition: PV3DBase.h:66
DeepCopyPointer< FreeTrajectoryState > theFreeState
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:63
GlobalVector momentum() const
GlobalPoint position() const
LocalTrajectoryParameters theLocalParameters
x
Definition: VDTMath.h:216
T x() const
Definition: PV3DBase.h:61
double signedInverseMomentum() const
const CurvilinearTrajectoryError& BasicTrajectoryState::curvilinearError ( ) const
inline

Definition at line 169 of file BasicTrajectoryState.h.

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

Referenced by PixelTrackBuilder::build().

169  {
170  if unlikely(!hasError()) {
171  missingError(" accesing curvilinearerror.");
172  static CurvilinearTrajectoryError crap;
173  return crap;
174  }
176  }
const CurvilinearTrajectoryError & curvilinearError() const
#define unlikely(x)
Definition: Likely.h:21
void missingError(char const *where) const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
FreeTrajectoryState * BasicTrajectoryState::freeTrajectoryState ( bool  withErrors = true) const

Definition at line 330 of file BasicTrajectoryState.cc.

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

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

330  {
331  if(!isValid()) notValid();
333  if(withErrors && hasError()) { // this is the right thing
335  }
336  return &(*theFreeState);
337 }
void checkGlobalParameters() const
GlobalVector BasicTrajectoryState::globalDirection ( ) const
inline

Definition at line 149 of file BasicTrajectoryState.h.

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

149  {
150  return freeTrajectoryState(false)->momentum().unit();
151  }
GlobalVector momentum() const
Vector3DBase unit() const
Definition: Vector3DBase.h:57
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
GlobalVector BasicTrajectoryState::globalMomentum ( ) const
inline

Definition at line 146 of file BasicTrajectoryState.h.

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

Referenced by PixelTrackBuilder::build().

146  {
147  return freeTrajectoryState(false)->momentum();
148  }
GlobalVector momentum() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
const GlobalTrajectoryParameters& BasicTrajectoryState::globalParameters ( void  ) const
inline

Definition at line 140 of file BasicTrajectoryState.h.

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

140  {
141  return freeTrajectoryState(false)->parameters();
142  }
const GlobalTrajectoryParameters & parameters() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
GlobalPoint BasicTrajectoryState::globalPosition ( ) const
inline

Definition at line 143 of file BasicTrajectoryState.h.

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

Referenced by PixelTrackBuilder::build().

143  {
144  return freeTrajectoryState(false)->position();
145  }
GlobalPoint position() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
bool BasicTrajectoryState::hasError ( void  ) const
inline
bool BasicTrajectoryState::isValid ( void  ) const
inline

Definition at line 134 of file BasicTrajectoryState.h.

References theFreeState, and theLocalParametersValid.

Referenced by freeTrajectoryState(), and localParameters().

134  {
136  }
DeepCopyPointer< FreeTrajectoryState > theFreeState
LocalVector BasicTrajectoryState::localDirection ( ) const
inline

Definition at line 196 of file BasicTrajectoryState.h.

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

196  {
197  return localMomentum().unit();
198  }
Vector3DBase unit() const
Definition: Vector3DBase.h:57
LocalVector localMomentum() const
const LocalTrajectoryError& BasicTrajectoryState::localError ( ) const
inline

Definition at line 200 of file BasicTrajectoryState.h.

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

200  {
201  if unlikely(!hasError()) {
202  missingError(" accessing local error.");
203  return theLocalError;
204  }
206  return theLocalError;
207  }
#define unlikely(x)
Definition: Likely.h:21
void missingError(char const *where) const
LocalTrajectoryError theLocalError
LocalVector BasicTrajectoryState::localMomentum ( ) const
inline

Definition at line 193 of file BasicTrajectoryState.h.

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

Referenced by localDirection().

193  {
194  return localParameters().momentum();
195  }
LocalVector momentum() const
Momentum vector in the local frame.
const LocalTrajectoryParameters & localParameters() const
const LocalTrajectoryParameters& BasicTrajectoryState::localParameters ( ) const
inline
LocalPoint BasicTrajectoryState::localPosition ( ) const
inline

Definition at line 190 of file BasicTrajectoryState.h.

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

190  {
191  return localParameters().position();
192  }
LocalPoint position() const
Local x and y position coordinates.
const LocalTrajectoryParameters & localParameters() const
const MagneticField* BasicTrajectoryState::magneticField ( ) const
inline

Definition at line 181 of file BasicTrajectoryState.h.

References theField.

181 { return theField; }
const MagneticField * theField
void BasicTrajectoryState::missingError ( char const *  where) const
private

Definition at line 177 of file BasicTrajectoryState.cc.

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

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

177  {
178  std::stringstream form;
179  form<<"BasicTrajectoryState: attempt to access errors when none available "
180  <<where<<".\nfreestate pointer: " <<theFreeState
181  <<"\nlocal error valid/values :"<< theLocalError.valid() << "\n"
182  << theLocalError.matrix();
183 
184  edm::LogWarning("BasicTrajectoryState") << form.str();
185 
186  // throw TrajectoryStateException(form.str());
187 }
DeepCopyPointer< FreeTrajectoryState > theFreeState
const AlgebraicSymMatrix55 & matrix() const
LocalTrajectoryError theLocalError
void BasicTrajectoryState::notValid ( )
staticprivate

Definition at line 159 of file BasicTrajectoryState.cc.

Referenced by freeTrajectoryState(), and localParameters().

159  {
160  throw TrajectoryStateException("TrajectoryStateOnSurface is invalid and cannot return any parameters");
161 }
void BasicTrajectoryState::rescaleError ( double  factor)

Definition at line 307 of file BasicTrajectoryState.cc.

References benchmark_cfg::errors, hasError(), i, j, LocalTrajectoryError::matrix(), missingError(), MagneticField::nominalValue(), FreeTrajectoryState::rescaleError(), theField, theFreeState, theLocalError, unlikely, and LocalTrajectoryError::valid().

307  {
308  if unlikely(!hasError()) missingError(" trying to rescale");
309  if (theFreeState)
310  theFreeState->rescaleError(factor);
311 
312  if (theLocalError.valid()){
313  //do it by hand if the free state is not around.
314  bool zeroField = (theField->nominalValue()==0);
315  if unlikely(zeroField){
317  //scale the 0 indexed covariance by the square root of the factor
318  for (unsigned int i=1;i!=5;++i) errors(i,0)*=factor;
319  double factor_squared=factor*factor;
320  //scale all others by the scaled factor
321  for (unsigned int i=1;i!=5;++i) for (unsigned int j=i;j!=5;++j) errors(i,j)*=factor_squared;
322  //term 0,0 is not scaled at all
324  }
325  else theLocalError *= (factor*factor);
326  }
327 }
int i
Definition: DBlmapReader.cc:9
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:57
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
void rescaleError(double factor)
#define unlikely(x)
Definition: Likely.h:21
DeepCopyPointer< FreeTrajectoryState > theFreeState
int j
Definition: DBlmapReader.cc:9
const AlgebraicSymMatrix55 & matrix() const
const MagneticField * theField
void missingError(char const *where) const
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
LocalTrajectoryError theLocalError
double BasicTrajectoryState::signedInverseMomentum ( ) const
inline

Definition at line 155 of file BasicTrajectoryState.h.

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

155  {
157  }
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
double signedInverseMomentum() const
const Surface& BasicTrajectoryState::surface ( ) const
inline

Definition at line 209 of file BasicTrajectoryState.h.

References theSurfaceP.

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

209  {
210  return *theSurfaceP;
211  }
ConstReferenceCountingPointer< Surface > theSurfaceP
SurfaceSide BasicTrajectoryState::surfaceSide ( ) const
inline

Position relative to material, defined relative to momentum vector.

Definition at line 220 of file BasicTrajectoryState.h.

References theSurfaceSide.

220  {
221  return theSurfaceSide;
222  }
double BasicTrajectoryState::transverseCurvature ( ) const
inline

Definition at line 158 of file BasicTrajectoryState.h.

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

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

Reimplemented in BasicMultiTrajectoryState.

Definition at line 270 of file BasicTrajectoryState.cc.

References AlCaHLTBitMon_ParallelJobs::p, theField, theGlobalParamsUp2Date, theLocalError, theLocalParameters, theLocalParametersValid, theSurfaceP, theSurfaceSide, and theWeight.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), BasicMultiTrajectoryState::combine(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

274 {
276  if (&aSurface != &*theSurfaceP) theSurfaceP.reset(&aSurface);
277  theField=field;
278  theSurfaceSide = side;
279  theWeight = 1.0;
281 
282  theGlobalParamsUp2Date = false;
284 }
ConstReferenceCountingPointer< Surface > theSurfaceP
const MagneticField * theField
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError
void BasicTrajectoryState::update ( const LocalTrajectoryParameters p,
const LocalTrajectoryError err,
const Surface aSurface,
const MagneticField field,
const SurfaceSide  side,
double  weight 
)
virtual

Reimplemented in BasicMultiTrajectoryState.

Definition at line 287 of file BasicTrajectoryState.cc.

References AlCaHLTBitMon_ParallelJobs::p, theField, theGlobalParamsUp2Date, theLocalError, theLocalParameters, theLocalParametersValid, theSurfaceP, theSurfaceSide, theWeight, and weight().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

293 {
295  theLocalError = err;
296  if (&aSurface != &*theSurfaceP) theSurfaceP.reset(&aSurface);
297  theField=field;
298  theSurfaceSide = side;
299  theWeight = weight;
300 
301  theGlobalParamsUp2Date = false;
303 
304 }
ConstReferenceCountingPointer< Surface > theSurfaceP
const MagneticField * theField
virtual double weight() const
LocalTrajectoryParameters theLocalParameters
LocalTrajectoryError theLocalError
virtual double BasicTrajectoryState::weight ( void  ) const
inlinevirtual

Definition at line 213 of file BasicTrajectoryState.h.

References theWeight.

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

213 {return theWeight;}

Friends And Related Function Documentation

friend class ProxyBase< BTSOS, CopyUsingClone< BTSOS > >
friend

Definition at line 57 of file BasicTrajectoryState.h.

Definition at line 58 of file BasicTrajectoryState.h.

Member Data Documentation

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

Definition at line 273 of file BasicTrajectoryState.h.

Referenced by checkGlobalParameters(), and update().

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

Definition at line 277 of file BasicTrajectoryState.h.

Referenced by surface(), and update().

SurfaceSide BasicTrajectoryState::theSurfaceSide
private

Definition at line 276 of file BasicTrajectoryState.h.

Referenced by surfaceSide(), and update().

double BasicTrajectoryState::theWeight
private

Definition at line 279 of file BasicTrajectoryState.h.

Referenced by update(), and weight().