8 #ifndef _DChargedTrack_
9 #define _DChargedTrack_
15 #include <JANA/JObject.h>
30 int Get_Charge(
void)
const;
31 bool Contains_Charge(
int locCharge)
const;
37 void toStrings(vector<pair<string,string> > &items)
const
39 AddString(items,
"Nhypotheses",
"%d", dChargedTrackHypotheses.size());
45 for(
unsigned int loc_i = 0; loc_i < dChargedTrackHypotheses.size(); ++loc_i)
47 if(
ParticleCharge(dChargedTrackHypotheses[loc_i]->PID()) == locCharge)
56 return ((locChargedTrackHypothesis == NULL) ? 0 :
ParticleCharge(locChargedTrackHypothesis->
PID()));
61 for(
unsigned int loc_i = 0; loc_i < dChargedTrackHypotheses.size(); ++loc_i)
63 if(dChargedTrackHypotheses[loc_i]->PID() == locPID)
64 return dChargedTrackHypotheses[loc_i];
71 if(dChargedTrackHypotheses.empty())
73 double locBestFOM = -2.0;
75 for(
size_t loc_i = 0; loc_i < dChargedTrackHypotheses.size(); ++loc_i)
77 if(dChargedTrackHypotheses[loc_i]->Get_FOM() > locBestFOM)
79 locBestChargedTrackHypothesis = dChargedTrackHypotheses[loc_i];
80 locBestFOM = locBestChargedTrackHypothesis->
Get_FOM();
83 return locBestChargedTrackHypothesis;
88 if(dChargedTrackHypotheses.empty())
90 double locBestFOM = -2.0;
92 for(
size_t loc_i = 0; loc_i < dChargedTrackHypotheses.size(); ++loc_i)
95 unsigned int locNDF = locTimeBasedTrack->
Ndof;
96 double locFOM = (locNDF > 0) ? TMath::Prob(locTimeBasedTrack->chisq, locNDF) : numeric_limits<double>::quiet_NaN();
97 if(locFOM > locBestFOM)
99 locBestChargedTrackHypothesis = dChargedTrackHypotheses[loc_i];
103 return locBestChargedTrackHypothesis;
106 #endif // _DChargedTrack_
const DChargedTrackHypothesis * Get_BestTrackingFOM(void) const
const DTrackTimeBased * Get_TrackTimeBased(void) const
static int ParticleCharge(Particle_t p)
const DChargedTrackHypothesis * Get_Hypothesis(Particle_t locPID) const
int Get_Charge(void) const
double Get_FOM(void) const
bool Contains_Charge(int locCharge) const
void toStrings(vector< pair< string, string > > &items) const
int Ndof
Number of degrees of freedom in the fit.
const DChargedTrackHypothesis * Get_BestFOM(void) const
vector< const DChargedTrackHypothesis * > dChargedTrackHypotheses
Particle_t PID(void) const