Skip to content

Commit f1ff49c

Browse files
authored
Merge pull request #168 from sungbinoh/feature/sungbino_likepid_into_cafmaker
Adding SRTrkLikelihoodPID class into the StandardRecord
2 parents 2134793 + a4d4562 commit f1ff49c

4 files changed

Lines changed: 72 additions & 1 deletion

File tree

sbnanaobj/StandardRecord/SRTrack.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "sbnanaobj/StandardRecord/SRTrackTruth.h"
1010
#include "sbnanaobj/StandardRecord/SRTrkChi2PID.h"
11+
#include "sbnanaobj/StandardRecord/SRTrkLikelihoodPID.h"
1112
#include "sbnanaobj/StandardRecord/SRTrkMCS.h"
1213
#include "sbnanaobj/StandardRecord/SRTrkRange.h"
1314
#include "sbnanaobj/StandardRecord/SRCRTHitMatch.h"
@@ -45,6 +46,7 @@ namespace caf
4546
SRVector3D end; ///< End point of track
4647

4748
SRTrkChi2PID chi2pid[3]; ///< Per-plane Chi2 Particle ID
49+
SRTrkLikelihoodPID likepid[3]; ///< Per-plane likelihood-based Particle ID variabeles (@f$ \lambda = \sum -\ln L / L_{max} @f$ where @f$\Sigma@f$ is done over hits)
4850
SRTrackCalo calo[3]; ///< Per-plane Calorimetry information
4951
Plane_t bestplane; ///< Plane index with the most hits. -1 if no calorimetry
5052

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @file sbnanaobj/StandardRecord/SRTrkLikelihoodPID.cxx
3+
* @brief An `SRTrkLikelihoodPID` is a high level track ParticlePID object for
4+
* for larana LikelihoodPIDAlg results.
5+
* @author Sungbin Oh (sungbino@fnal.gov)
6+
*/
7+
8+
#include "sbnanaobj/StandardRecord/SRTrkLikelihoodPID.h"
9+
10+
#include "sbnanaobj/StandardRecord/SRConstants.h"
11+
12+
namespace caf
13+
{
14+
15+
SRTrkLikelihoodPID::SRTrkLikelihoodPID():
16+
pdg(-999),
17+
pid_ndof(-99),
18+
lambda_muon(caf::kSignalingNaN),
19+
lambda_pion(caf::kSignalingNaN),
20+
lambda_proton(caf::kSignalingNaN)
21+
{ }
22+
23+
void SRTrkLikelihoodPID::setDefault()
24+
{
25+
pdg = 0;
26+
pid_ndof = -5;
27+
lambda_muon = -5.0;
28+
lambda_pion = -5.0;
29+
lambda_proton = -5.0;
30+
}
31+
32+
} // end namespace caf
33+
////////////////////////////////////////////////////////////////////////
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* @file sbnanaobj/StandardRecord/SRTrkLikelihoodPID.h
3+
* @brief An `SRTrkLikelihoodPID` is a high level track ParticlePID object for
4+
* for larana LikelihoodPIDAlg results.
5+
* @author Sungbin Oh (sungbino@fnal.gov)
6+
*/
7+
#ifndef SRTRKLIKELIHOODPID_H
8+
#define SRTRKLIKELIHOODPID_H
9+
10+
namespace caf
11+
{
12+
/// Track PID from dE/dx v. likelihood from dE/dx PDF measured with residual range-based kinetic energy and hit pitch
13+
class SRTrkLikelihoodPID
14+
{
15+
public:
16+
17+
SRTrkLikelihoodPID();
18+
19+
int pdg; ///< Likelihood PID pdg
20+
int pid_ndof; ///< Number of degress of freedom in likelihood PID
21+
float lambda_muon; ///< Sum of -lnL/L_max (muon hypothesis)
22+
float lambda_pion; ///< Sum of -lnL/L_max (charged pion hypothesis)
23+
float lambda_proton; ///< Sum of -lnL/L_max (proton hypothesis)
24+
25+
void setDefault();
26+
};
27+
28+
} // end namespace
29+
30+
#endif // SRTRKLIKELIHOODPID_H
31+
//////////////////////////////////////////////////////////////////////////////

sbnanaobj/StandardRecord/classes_def.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@
117117
<version ClassVersion="10" checksum="3777054621"/>
118118
</class>
119119

120-
<class name="caf::SRTrack" ClassVersion="15">
120+
<class name="caf::SRTrack" ClassVersion="16">
121+
<version ClassVersion="16" checksum="4075719476"/>
121122
<version ClassVersion="15" checksum="175611744"/>
122123
<version ClassVersion="14" checksum="3934033130"/>
123124
<version ClassVersion="13" checksum="522362999"/>
@@ -167,6 +168,10 @@
167168
<version ClassVersion="10" checksum="3162028429"/>
168169
</class>
169170

171+
<class name="caf::SRTrkLikelihoodPID" ClassVersion="10">
172+
<version ClassVersion="10" checksum="2386830952"/>
173+
</class>
174+
170175
<class name="caf::SRTrkMCS" ClassVersion="11">
171176
<version ClassVersion="11" checksum="2241616344"/>
172177
<version ClassVersion="10" checksum="4182678053"/>

0 commit comments

Comments
 (0)