CbmRoot
LitMath.h
Go to the documentation of this file.
1
10
#ifndef LITMATH_H_
11
#define LITMATH_H_
12
13
#include "
LitScalTrack.h
"
14
#include "
LitTypes.h
"
15
16
namespace
lit
{
17
namespace
parallel {
18
26
inline
fscal
rcp
(
const
fscal
& a) {
return
1. / a; }
27
38
inline
fscal
sgn
(
const
fscal
& a) {
return
a < 0 ? -1 : (a > 0 ? 1 : 0); }
39
50
inline
unsigned
short
NDF
(
const
LitScalTrack
& track) {
51
short
ndf = 2 * track.
GetNofHits
() - 5;
52
if
(ndf > 0) {
53
return
ndf;
54
}
else
{
55
return
1;
56
}
57
58
// int ndf = 0;
59
// for (int i = 0; i < track->GetNofHits(); i++){
60
// if (track->GetHit(i)->GetType() == kLITPIXELHIT) ndf += 2;
61
// else if (track->GetHit(i)->GetType() == kLITSTRIPHIT) ndf++;
62
// }
63
// ndf -= 5;
64
// if (ndf > 0) return ndf; else return 1;
65
}
66
67
}
// namespace parallel
68
}
// namespace lit
69
#endif
/* LITMATH_H_ */
fscal
float fscal
Definition:
L1/vectors/P4_F32vec4.h:250
lit::parallel::LitScalTrack
Scalar track data class.
Definition:
LitScalTrack.h:33
lit::parallel::LitScalTrack::GetNofHits
unsigned short GetNofHits() const
Returns number of hits in track.
Definition:
LitScalTrack.h:66
LitTypes.h
Header files for SSE operations.
LitScalTrack.h
Scalar track data class.
lit::parallel::NDF
unsigned short NDF(const LitScalTrack &track)
Returns number of degrees of freedom for the track.
Definition:
LitMath.h:50
lit::parallel::rcp
fscal rcp(const fscal &a)
Returns reciprocal.
Definition:
LitMath.h:26
lit::parallel::sgn
fscal sgn(const fscal &a)
Returns sign of the input number.
Definition:
LitMath.h:38
lit
Definition:
LitTrackFinderNNVecElectron.h:19
reco
littrack
parallel
LitMath.h
Generated on Wed Oct 28 2020 15:11:49 for CbmRoot by
1.8.18