55#ifndef ALICEO2_BASE_TRACK
66#define ALICEO2_BASE_TRACK
77
8- #include < iostream>
98#include < algorithm>
9+ #include < array>
10+ #include < iostream>
1011#include < string.h>
12+
1113#include " DetectorsBase/Constants.h"
1214#include " DetectorsBase/Utils.h"
1315
1416namespace AliceO2 {
1517 namespace Base {
1618 namespace Track {
1719
18- using namespace AliceO2 ::Base::Constants;
19- using namespace AliceO2 ::Base::Utils;
20- using namespace std ;
21-
2220 // aliases for track elements
2321 enum ParLabels : int {
2422 kY ,kZ ,kSnp ,kTgl ,kQ2Pt
@@ -47,7 +45,7 @@ namespace AliceO2 {
4745 // helper function
4846 float BetheBlochSolid (float bg, float rho=2 .33f ,float kp1=0 .20f ,float kp2=3 .00f ,
4947 float meanI=173e-9f ,float meanZA=0 .49848f );
50- void g3helx3 (float qfield, float step,array<float ,7 > &vect);
48+ void g3helx3 (float qfield, float step,std:: array<float ,7 > &vect);
5149
5250
5351 class TrackParBase { // track parameterization, kinematics only. This base class cannot be instantiated
@@ -63,30 +61,30 @@ namespace AliceO2 {
6361 float GetQ2Pt () const { return mP [kQ2Pt ]; }
6462
6563 // derived getters
66- float GetCurvature (float b) const { return mP [kQ2Pt ]*b*kB2C ;}
64+ float GetCurvature (float b) const { return mP [kQ2Pt ]*b*Constants:: kB2C ;}
6765 float GetSign () const { return mP [kQ2Pt ]>0 ? 1 .f :-1 .f ;}
6866 float GetPhi () const { return asinf (GetSnp ()) + GetAlpha ();}
6967 float GetPhiPos () const ;
7068
7169 float GetP () const ;
7270 float GetPt () const ;
73- void GetXYZ (array<float ,3 > &xyz) const ;
74- bool GetPxPyPz (array<float ,3 > &pxyz) const ;
75- bool GetPosDir (array<float ,9 > &posdirp) const ;
71+ void GetXYZ (std:: array<float ,3 > &xyz) const ;
72+ bool GetPxPyPz (std:: array<float ,3 > &pxyz) const ;
73+ bool GetPosDir (std:: array<float ,9 > &posdirp) const ;
7674
7775 // parameters manipulation
7876 bool RotateParam (float alpha);
7977 bool PropagateParamTo (float xk, float b);
80- bool PropagateParamTo (float xk, const array<float ,3 > &b);
78+ bool PropagateParamTo (float xk, const std:: array<float ,3 > &b);
8179 void InvertParam ();
8280
8381 void PrintParam () const ;
8482
8583 protected:
8684 // to keep this class non-virtual but derivable the c-tors and d-tor are protected
8785 TrackParBase () : mX {0 .},mAlpha {0 .} {}
88- TrackParBase (float x,float alpha, const array<float ,kNParams > &par);
89- TrackParBase (const array<float ,3 > &xyz,const array<float ,3 > &pxpypz, int sign, bool sectorAlpha=true );
86+ TrackParBase (float x,float alpha, const std:: array<float ,kNParams > &par);
87+ TrackParBase (const std:: array<float ,3 > &xyz,const std:: array<float ,3 > &pxpypz, int sign, bool sectorAlpha=true );
9088 TrackParBase (const TrackParBase&) = default ;
9189 TrackParBase (TrackParBase&&) = default ;
9290 TrackParBase& operator =(const TrackParBase& src) = default ;
@@ -101,8 +99,8 @@ namespace AliceO2 {
10199 class TrackParCov final : public TrackParBase { // track+error parameterization
102100 public:
103101 TrackParCov () : TrackParBase{} { }
104- TrackParCov (float x, float alpha, const array<float ,kNParams > &par, const array<float ,kCovMatSize > &cov);
105- TrackParCov (const array<float ,3 > &xyz,const array<float ,3 > &pxpypz,const array<float ,kLabCovMatSize > &cv, int sign, bool sectorAlpha=true );
102+ TrackParCov (float x, float alpha, const std:: array<float ,kNParams > &par, const std:: array<float ,kCovMatSize > &cov);
103+ TrackParCov (const std:: array<float ,3 > &xyz,const std:: array<float ,3 > &pxpypz,const std:: array<float ,kLabCovMatSize > &cv, int sign, bool sectorAlpha=true );
106104
107105 // /const float* GetCov() const { return mC; }
108106 float GetSigmaY2 () const { return mC [kSigY2 ]; }
@@ -126,11 +124,11 @@ namespace AliceO2 {
126124 // parameters + covmat manipulation
127125 bool Rotate (float alpha);
128126 bool PropagateTo (float xk, float b);
129- bool PropagateTo (float xk, const array<float ,3 > &b);
127+ bool PropagateTo (float xk, const std:: array<float ,3 > &b);
130128 void Invert ();
131129
132- float GetPredictedChi2 (const array<float ,2 > &p, const array<float ,3 > &cov) const ;
133- bool Update (const array<float ,2 > &p, const array<float ,3 > &cov);
130+ float GetPredictedChi2 (const std:: array<float ,2 > &p, const std:: array<float ,3 > &cov) const ;
131+ bool Update (const std:: array<float ,2 > &p, const std:: array<float ,3 > &cov);
134132
135133 bool CorrectForMaterial (float x2x0,float xrho,float mass,bool anglecorr=false ,float dedx=kCalcdEdxAuto );
136134
@@ -145,25 +143,25 @@ namespace AliceO2 {
145143 class TrackPar final : public TrackParBase { // track parameterization only
146144 public:
147145 TrackPar () {}
148- TrackPar (float x,float alpha, const array<float ,kNParams > &par) : TrackParBase{x,alpha,par} {}
149- TrackPar (const array<float ,3 > &xyz, const array<float ,3 > &pxpypz,int sign, bool sectorAlpha=true );
146+ TrackPar (float x,float alpha, const std:: array<float ,kNParams > &par) : TrackParBase{x,alpha,par} {}
147+ TrackPar (const std:: array<float ,3 > &xyz, const std:: array<float ,3 > &pxpypz,int sign, bool sectorAlpha=true );
150148 //
151149 void Print () const {PrintParam ();}
152150 };
153151
154152 // ____________________________________________________________
155- inline TrackParBase::TrackParBase (float x, float alpha, const array<float , kNParams > &par) : mX{x}, mAlpha {alpha} {
153+ inline TrackParBase::TrackParBase (float x, float alpha, const std:: array<float , kNParams > &par) : mX{x}, mAlpha {alpha} {
156154 // explicit constructor
157155 std::copy (par.begin (), par.end (), mP );
158156 }
159157
160158 // _______________________________________________________
161- inline void TrackParBase::GetXYZ (array<float ,3 > &xyz) const {
159+ inline void TrackParBase::GetXYZ (std:: array<float ,3 > &xyz) const {
162160 // track coordinates in lab frame
163161 xyz[0 ] = GetX ();
164162 xyz[1 ] = GetY ();
165163 xyz[2 ] = GetZ ();
166- RotateZ (xyz,GetAlpha ());
164+ Utils:: RotateZ (xyz,GetAlpha ());
167165 }
168166
169167 // _______________________________________________________
@@ -177,20 +175,20 @@ namespace AliceO2 {
177175 inline float TrackParBase::GetP () const {
178176 // return the track momentum
179177 float ptI = fabs (GetQ2Pt ());
180- return (ptI>kAlmost0 ) ? sqrtf (1 .f + GetTgl ()*GetTgl ())/ptI : kVeryBig ;
178+ return (ptI>Constants:: kAlmost0 ) ? sqrtf (1 .f + GetTgl ()*GetTgl ())/ptI : Constants:: kVeryBig ;
181179 }
182180
183181 // ____________________________________________________________
184182 inline float TrackParBase::GetPt () const {
185183 // return the track transverse momentum
186184 float ptI = fabs (GetQ2Pt ());
187- return (ptI>kAlmost0 ) ? 1 .f /ptI : kVeryBig ;
185+ return (ptI>Constants:: kAlmost0 ) ? 1 .f /ptI : Constants:: kVeryBig ;
188186 }
189187
190188 // ============================================================
191189
192190 // ____________________________________________________________
193- inline TrackParCov::TrackParCov (float x, float alpha, const array<float ,kNParams > &par, const array<float ,kCovMatSize > &cov)
191+ inline TrackParCov::TrackParCov (float x, float alpha, const std:: array<float ,kNParams > &par, const std:: array<float ,kCovMatSize > &cov)
194192 : TrackParBase{x,alpha,par} {
195193 // explicit constructor
196194 std::copy (cov.begin (), cov.end (), mC );
@@ -199,7 +197,7 @@ namespace AliceO2 {
199197 // ============================================================
200198
201199 // ____________________________________________________________
202- inline TrackPar::TrackPar (const array<float ,3 > &xyz, const array<float ,3 > &pxpypz,int sign, bool sectorAlpha)
200+ inline TrackPar::TrackPar (const std:: array<float ,3 > &xyz, const std:: array<float ,3 > &pxpypz,int sign, bool sectorAlpha)
203201 : TrackParBase{xyz,pxpypz,sign,sectorAlpha} {
204202 // explicit constructor
205203 }
0 commit comments