Skip to content

Commit 7472af4

Browse files
committed
Attempt at making KFParticle::GetQ working on ARM
On ARM Linux, char is unsigned. One needs to use `signed char` explicitly.
1 parent 6302779 commit 7472af4

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

KFParticle/KFParticle.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class KFParticle :public KFParticleBase
113113
float GetPz () const ; ///< Retruns Z component of the momentum, fP[5].
114114
float GetE () const ; ///< Returns energy of the particle, fP[6].
115115
float GetS () const ; ///< Returns dS=l/p, l - decay length, fP[7], defined if production vertex is set.
116-
char GetQ () const ; ///< Returns charge of the particle.
116+
signed char GetQ () const ; ///< Returns charge of the particle.
117117
float GetChi2 () const ; ///< Returns Chi2 of the fit.
118118
Int_t GetNDF () const ; ///< Returns number of decrease of freedom.
119119

@@ -133,7 +133,7 @@ class KFParticle :public KFParticleBase
133133
const float& Pz () const { return fP[5]; } ///< Retruns Z component of the momentum, fP[5].
134134
const float& E () const { return fP[6]; } ///< Returns energy of the particle, fP[6].
135135
const float& S () const { return fP[7]; } ///< Returns dS=l/p, l - decay length, fP[7], defined if production vertex is set.
136-
const char& Q () const { return fQ; } ///< Returns charge of the particle.
136+
const signed char& Q () const { return fQ; } ///< Returns charge of the particle.
137137
const float& Chi2 () const { return fChi2; } ///< Returns Chi2 of the fit.
138138
const Int_t& NDF () const { return fNDF; } ///< Returns number of decrease of freedom.
139139

@@ -204,7 +204,7 @@ class KFParticle :public KFParticleBase
204204
float & Pz () ; ///< Modifier of Z component of the momentum, fP[5].
205205
float & E () ; ///< Modifier of energy of the particle, fP[6].
206206
float & S () ; ///< Modifier of dS=l/p, l - decay length, fP[7], defined if production vertex is set.
207-
char & Q () ; ///< Modifier of charge of the particle.
207+
signed char & Q () ; ///< Modifier of charge of the particle.
208208
float & Chi2 () ; ///< Modifier of Chi2 of the fit.
209209
Int_t & NDF () ; ///< Modifier of number of decrease of freedom.
210210

@@ -430,7 +430,7 @@ inline float KFParticle::GetS () const
430430
return KFParticleBase::GetS();
431431
}
432432

433-
inline char KFParticle::GetQ () const
433+
inline signed char KFParticle::GetQ () const
434434
{
435435
return KFParticleBase::GetQ();
436436
}
@@ -777,7 +777,7 @@ inline float & KFParticle::S()
777777
return KFParticleBase::S();
778778
}
779779

780-
inline char & KFParticle::Q()
780+
inline signed char & KFParticle::Q()
781781
{
782782
return KFParticleBase::Q();
783783
}

KFParticle/KFParticleBase.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class KFParticleBase :public TObject {
102102
float GetPz () const { return fP[5]; } ///< Retruns Z component of the momentum, fP[5].
103103
float GetE () const { return fP[6]; } ///< Returns energy of the particle, fP[6].
104104
float GetS () const { return fP[7]; } ///< Returns dS=l/p, l - decay length, fP[7], defined if production vertex is set.
105-
char GetQ () const { return fQ; } ///< Returns charge of the particle.
105+
signed char GetQ () const { return fQ; } ///< Returns charge of the particle.
106106
float GetChi2 () const { return fChi2; } ///< Returns Chi2 of the fit.
107107
Int_t GetNDF () const { return fNDF; } ///< Returns number of decrease of freedom.
108108

@@ -114,7 +114,7 @@ class KFParticleBase :public TObject {
114114
const float& Pz () const { return fP[5]; } ///< Retruns Z component of the momentum, fP[5].
115115
const float& E () const { return fP[6]; } ///< Returns energy of the particle, fP[6].
116116
const float& S () const { return fP[7]; } ///< Returns dS=l/p, l - decay length, fP[7], defined if production vertex is set.
117-
const char& Q () const { return fQ; } ///< Returns charge of the particle.
117+
const signed char& Q () const { return fQ; } ///< Returns charge of the particle.
118118
const float& Chi2 () const { return fChi2; } ///< Returns Chi2 of the fit.
119119
const Int_t& NDF () const { return fNDF; } ///< Returns number of decrease of freedom.
120120

@@ -147,7 +147,7 @@ class KFParticleBase :public TObject {
147147
float & Pz () { return fP[5]; } ///< Modifier of Z component of the momentum, fP[5].
148148
float & E () { return fP[6]; } ///< Modifier of energy of the particle, fP[6].
149149
float & S () { return fP[7]; } ///< Modifier of dS=l/p, l - decay length, fP[7], defined if production vertex is set.
150-
char & Q () { return fQ; } ///< Modifier of charge of the particle.
150+
signed char & Q () { return fQ; } ///< Modifier of charge of the particle.
151151
float & Chi2 () { return fChi2; } ///< Modifier of Chi2 of the fit.
152152
Int_t & NDF () { return fNDF; } ///< Modifier of number of decrease of freedom.
153153

@@ -275,7 +275,7 @@ class KFParticleBase :public TObject {
275275
Short_t fIdParentMcVx; ///< for track and McTrack for vertex.
276276
#endif
277277
Bool_t fAtProductionVertex; ///< Flag shows if particle is at the production point.
278-
char fQ; ///< The charge of the particle in the units of the elementary charge.
278+
signed char fQ; ///< The charge of the particle in the units of the elementary charge.
279279

280280
/** \brief Determines the method for the particle construction. \n
281281
** 0 - Energy considered as an independent veriable, fitted independently from momentum, without any constraints on mass \n

0 commit comments

Comments
 (0)