1 #ifndef BasicTrajectoryState_H 2 #define BasicTrajectoryState_H 36 BTSCount(BTSCount
const&) {}
38 static unsigned int maxReferences;
39 static unsigned long long aveReferences;
40 static unsigned long long toteReferences;
42 void addReference()
const {
44 referenceMax_ =
std::max(referenceMax_, referenceCount_);
46 void removeReference()
const {
47 if (0 == --referenceCount_) {
48 delete const_cast<BTSCount*
>(
this);
52 unsigned int references()
const {
return referenceCount_; }
55 mutable unsigned int referenceCount_ = 0;
56 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) {
87 return std::make_shared<T>(std::forward<Args>(
args)...);
90 template <
typename T,
typename... Args>
91 static std::shared_ptr<BTSOS>
churn(Args&&...
args) {
99 const SurfaceType& aSurface,
103 theLocalParameters(),
104 theLocalParametersValid(
false),
106 theSurfaceSide(side),
107 theSurfaceP(&aSurface),
115 theLocalParameters(),
116 theLocalParametersValid(
false),
126 const SurfaceType& aSurface,
134 const SurfaceType& aSurface,
144 const SurfaceType& aSurface,
146 : theFreeState(par, err),
148 theLocalParameters(),
149 theLocalParametersValid(
false),
151 theSurfaceSide(side),
152 theSurfaceP(&aSurface),
161 const SurfaceType& aSurface,
163 : theFreeState(par, err),
165 theLocalParameters(),
166 theLocalParametersValid(
false),
168 theSurfaceSide(side),
169 theSurfaceP(&aSurface),
176 const SurfaceType& aSurface,
181 template <
typename... Args>
200 missingError(
" accesing cartesian error.");
203 return freeTrajectoryState(
true)->cartesianError();
208 missingError(
" accesing curvilinearerror.");
212 return freeTrajectoryState(
true)->curvilinearError();
218 if (withErrors && hasError()) {
219 checkCurvilinError();
221 return &theFreeState;
232 createLocalParameters();
233 return theLocalParameters;
242 missingError(
" accessing local error.");
243 return theLocalError;
246 UNLIKELY(theLocalError.invalid()) createLocalError();
247 return theLocalError;
250 const SurfaceType&
surface()
const {
return *theSurfaceP; }
252 double weight()
const {
return theWeight; }
259 bool hasError()
const {
return theFreeState.hasError() || theLocalError.valid(); }
264 const SurfaceType& aSurface,
266 const SurfaceSide side);
274 const SurfaceType& aSurface,
276 const SurfaceSide side);
281 const SurfaceSide side)
final;
288 virtual bool singleState()
const = 0;
291 static void notValid();
293 void missingError(
char const* where)
const;
296 void checkCurvilinError()
const;
299 void createLocalParameters()
const;
301 void createLocalError()
const;
310 mutable
bool theLocalParametersValid;
311 mutable
bool theValid;
313 SurfaceSide theSurfaceSide;
316 double theWeight = 0.;
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