1 #ifndef BasicTrajectoryState_H 2 #define BasicTrajectoryState_H 37 BTSCount(BTSCount
const &){}
39 static unsigned int maxReferences;
40 static unsigned long long aveReferences;
41 static unsigned long long toteReferences;
43 void addReference()
const { ++referenceCount_ ; referenceMax_ =
std::max(referenceMax_, referenceCount_); }
44 void removeReference()
const {
45 if( 0 == --referenceCount_ ) {
46 delete const_cast<BTSCount*
>(
this);
50 unsigned int references()
const {
return referenceCount_;}
52 mutable unsigned int referenceCount_=0;
53 mutable unsigned int referenceMax_ =0;
82 virtual pointer
clone()
const=0;
84 template<
typename T,
typename... Args>
85 static std::shared_ptr<BTSOS>
build(Args && ...
args){
return std::make_shared<T>(std::forward<Args>(
args)...);}
87 template<
typename T,
typename... Args>
96 const SurfaceType& aSurface,
100 theLocalParameters(),
101 theLocalParametersValid(
false),
103 theSurfaceSide(side),
104 theSurfaceP( &aSurface),
115 theLocalParameters(),
116 theLocalParametersValid(
false),
130 const SurfaceType& aSurface,
139 const SurfaceType& aSurface,
152 const SurfaceType& aSurface,
154 theFreeState(par, err),
156 theLocalParameters(),
157 theLocalParametersValid(
false),
159 theSurfaceSide(side),
160 theSurfaceP( &aSurface),
171 const SurfaceType& aSurface,
173 theFreeState(par, err),
175 theLocalParameters(),
176 theLocalParametersValid(
false),
178 theSurfaceSide(side),
179 theSurfaceP( &aSurface),
188 const SurfaceType& aSurface,
194 template<
typename... Args>
206 return theFreeState.parameters();
209 return theFreeState.position();
212 return theFreeState.momentum();
215 return theFreeState.momentum().
unit();
218 return theFreeState.charge();
221 return theFreeState.signedInverseMomentum();
224 return theFreeState.transverseCurvature();
229 missingError(
" accesing cartesian error.");
232 return freeTrajectoryState(
true)->cartesianError();
236 missingError(
" accesing curvilinearerror.");
240 return freeTrajectoryState(
true)->curvilinearError();
247 if(withErrors && hasError()) {
248 checkCurvilinError();
250 return &theFreeState;
259 if unlikely(!theLocalParametersValid)
260 createLocalParameters();
261 return theLocalParameters;
264 return localParameters().position();
267 return localParameters().momentum();
270 return localMomentum().
unit();
275 missingError(
" accessing local error.");
276 return theLocalError;
278 if unlikely(theLocalError.invalid()) createLocalError();
279 return theLocalError;
286 double weight()
const {
return theWeight;}
294 return theSurfaceSide;
298 return theFreeState.hasError() || theLocalError.valid();
305 const SurfaceType& aSurface,
307 const SurfaceSide side ) ;
317 const SurfaceType& aSurface,
319 const SurfaceSide side);
324 const SurfaceSide side)
final;
327 return theFreeState.setCurvilinearError();
333 virtual bool singleState()
const=0;
337 static void notValid();
340 void missingError(
char const * where)
const;
343 void checkCurvilinError()
const;
346 void createLocalParameters()
const;
348 void createLocalError()
const;
349 void createLocalErrorFromCurvilinearError() const
dso_internal;
358 mutable
bool theLocalParametersValid;
359 mutable
bool theValid;
362 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