1 #ifndef BasicTrajectoryState_H 2 #define BasicTrajectoryState_H 38 BTSCount(BTSCount
const &){}
40 static unsigned int maxReferences;
41 static unsigned long long aveReferences;
42 static unsigned long long toteReferences;
44 void addReference()
const { ++referenceCount_ ; referenceMax_ =
std::max(referenceMax_, referenceCount_); }
45 void removeReference()
const {
46 if( 0 == --referenceCount_ ) {
47 delete const_cast<BTSCount*
>(
this);
51 unsigned int references()
const {
return referenceCount_;}
53 mutable unsigned int referenceCount_=0;
54 mutable unsigned int referenceMax_ =0;
83 virtual pointer
clone()
const=0;
85 template<
typename T,
typename... Args>
86 static std::shared_ptr<BTSOS>
build(Args && ...
args){
return std::make_shared<T>(std::forward<Args>(
args)...);}
88 template<
typename T,
typename... Args>
97 const SurfaceType& aSurface,
101 theLocalParameters(),
102 theLocalParametersValid(
false),
104 theSurfaceSide(side),
105 theSurfaceP( &aSurface),
116 theLocalParameters(),
117 theLocalParametersValid(
false),
131 const SurfaceType& aSurface,
140 const SurfaceType& aSurface,
153 const SurfaceType& aSurface,
155 theFreeState(par, err),
157 theLocalParameters(),
158 theLocalParametersValid(
false),
160 theSurfaceSide(side),
161 theSurfaceP( &aSurface),
172 const SurfaceType& aSurface,
174 theFreeState(par, err),
176 theLocalParameters(),
177 theLocalParametersValid(
false),
179 theSurfaceSide(side),
180 theSurfaceP( &aSurface),
189 const SurfaceType& aSurface,
195 template<
typename... Args>
207 return theFreeState.parameters();
210 return theFreeState.position();
213 return theFreeState.momentum();
216 return theFreeState.momentum().
unit();
219 return theFreeState.charge();
222 return theFreeState.signedInverseMomentum();
225 return theFreeState.transverseCurvature();
230 missingError(
" accesing cartesian error.");
233 return freeTrajectoryState(
true)->cartesianError();
237 missingError(
" accesing curvilinearerror.");
241 return freeTrajectoryState(
true)->curvilinearError();
248 if(withErrors && hasError()) {
249 checkCurvilinError();
251 return &theFreeState;
260 if UNLIKELY(!theLocalParametersValid)
261 createLocalParameters();
262 return theLocalParameters;
265 return localParameters().position();
268 return localParameters().momentum();
271 return localMomentum().
unit();
276 missingError(
" accessing local error.");
277 return theLocalError;
279 if UNLIKELY(theLocalError.invalid()) createLocalError();
280 return theLocalError;
287 double weight()
const {
return theWeight;}
295 return theSurfaceSide;
299 return theFreeState.hasError() || theLocalError.valid();
306 const SurfaceType& aSurface,
308 const SurfaceSide side ) ;
318 const SurfaceType& aSurface,
320 const SurfaceSide side);
325 const SurfaceSide side)
final;
328 return theFreeState.setCurvilinearError();
334 virtual bool singleState()
const=0;
338 static void notValid();
341 void missingError(
char const * where)
const;
344 void checkCurvilinError()
const;
347 void createLocalParameters()
const;
349 void createLocalError()
const;
350 void createLocalErrorFromCurvilinearError() const
dso_internal;
359 mutable
bool theLocalParametersValid;
360 mutable
bool theValid;
363 SurfaceSide theSurfaceSide;
GlobalPoint globalPosition() const
CurvilinearTrajectoryError & setCurvilinearError()
LocalPoint localPosition() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
const MagneticField * magneticField() const
SurfaceSideDefinition::SurfaceSide SurfaceSide
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
BasicTrajectoryState(const GlobalTrajectoryParameters &par, const CurvilinearTrajectoryError &err, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
const CartesianTrajectoryError cartesianError() const
BasicTrajectoryState(double iweight, Args &&...args)
TrackCharge charge() const
std::shared_ptr< T > pointer
BasicTrajectoryState(const LocalTrajectoryParameters &par, const SurfaceType &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
GlobalVector globalDirection() const
std::vector< TrajectoryStateOnSurface > Components
static std::shared_ptr< BTSOS > build(Args &&...args)
const LocalTrajectoryError & localError() const
BasicTrajectoryState(const FreeTrajectoryState &fts, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
double signedInverseMomentum() const
Vector3DBase unit() const
const SurfaceType & surface() const
static std::shared_ptr< BTSOS > churn(Args &&...args)
const GlobalTrajectoryParameters & globalParameters() const
double transverseCurvature() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
BasicTrajectoryState(const GlobalTrajectoryParameters &par, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
GlobalVector globalMomentum() const
BasicTrajectoryState(const GlobalTrajectoryParameters &par, const CartesianTrajectoryError &err, const SurfaceType &aSurface, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
const LocalTrajectoryParameters & localParameters() const
virtual bool canUpdateLocalParameters() const
LocalVector localDirection() const
LocalVector localMomentum() const
const CurvilinearTrajectoryError & curvilinearError() const
BasicTrajectoryState(const FreeTrajectoryState &fts)
ProxyBase11< BTSOS > Proxy
BasicTrajectoryState BTSOS