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,
107 const SurfaceType& aSurface,
116 const SurfaceType& aSurface,
129 const SurfaceType& aSurface,
138 const SurfaceType& aSurface,
140 theFreeState(par, err),
142 theLocalParameters(),
143 theLocalParametersValid(
false),
145 theSurfaceSide(side),
146 theSurfaceP( &aSurface),
155 const SurfaceType& aSurface,
161 template<
typename... Args>
173 return theFreeState.parameters();
176 return theFreeState.position();
179 return theFreeState.momentum();
182 return theFreeState.momentum().
unit();
185 return theFreeState.charge();
188 return theFreeState.signedInverseMomentum();
191 return theFreeState.transverseCurvature();
196 missingError(
" accesing cartesian error.");
199 return freeTrajectoryState(
true)->cartesianError();
203 missingError(
" accesing curvilinearerror.");
207 return freeTrajectoryState(
true)->curvilinearError();
214 if(withErrors && hasError()) {
215 checkCurvilinError();
217 return &theFreeState;
226 if unlikely(!theLocalParametersValid)
227 createLocalParameters();
228 return theLocalParameters;
231 return localParameters().position();
234 return localParameters().momentum();
237 return localMomentum().
unit();
242 missingError(
" accessing local error.");
243 return theLocalError;
245 if unlikely(theLocalError.invalid()) createLocalError();
246 return theLocalError;
253 double weight()
const {
return theWeight;}
261 return theSurfaceSide;
265 return theFreeState.hasError() || theLocalError.valid();
272 const SurfaceType& aSurface,
274 const SurfaceSide side ) ;
284 const SurfaceType& aSurface,
286 const SurfaceSide side);
291 const SurfaceSide side)
final;
294 return theFreeState.setCurvilinearError();
300 virtual bool singleState()
const=0;
304 static void notValid();
307 void missingError(
char const * where)
const;
310 void checkCurvilinError()
const;
313 void createLocalParameters()
const;
315 void createLocalError()
const;
316 void createLocalErrorFromCurvilinearError() const
dso_internal;
325 mutable
bool theLocalParametersValid;
326 mutable
bool theValid;
329 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
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
const LocalTrajectoryParameters & localParameters() const
virtual bool canUpdateLocalParameters() const
LocalVector localDirection() const
LocalVector localMomentum() const
const CurvilinearTrajectoryError & curvilinearError() const
ProxyBase11< BTSOS > Proxy
BasicTrajectoryState BTSOS