@@ -951,6 +951,48 @@ namespace caf
951951 }
952952 }
953953
954+ void FillPlaneLikePID (const anab::ParticleID &particle_id, caf::SRTrkLikelihoodPID &srlikepid) {
955+
956+ // Loop over algorithm scores and extract the ones we want.
957+ // Get the ndof from any likelihood pid algorithm
958+ srlikepid.setDefault ();
959+
960+ std::vector<anab::sParticleIDAlgScores > const & AlgScoresVec = particle_id.ParticleIDAlgScores ();
961+ for (anab::sParticleIDAlgScores const & AlgScore: AlgScoresVec){
962+ if (AlgScore.fAlgName == " Likelihood" ){
963+ switch (std::abs (AlgScore.fAssumedPdg )) {
964+ case 13 : // lambda_mu
965+ srlikepid.lambda_muon = AlgScore.fValue ;
966+ srlikepid.pid_ndof = AlgScore.fNdf ;
967+ break ;
968+ case 211 : // lambda_pi
969+ srlikepid.lambda_pion = AlgScore.fValue ;
970+ srlikepid.pid_ndof = AlgScore.fNdf ;
971+ break ;
972+ case 2212 : // lambda_pr
973+ srlikepid.lambda_proton = AlgScore.fValue ;
974+ srlikepid.pid_ndof = AlgScore.fNdf ;
975+ break ;
976+ }
977+ }
978+ }
979+ }
980+
981+ void FillTrackLikePID (const std::vector<art::Ptr<anab::ParticleID>>& particleIDs,
982+ caf::SRTrack& srtrack,
983+ bool allowEmpty)
984+ {
985+ // get the particle ID's
986+ for (art::Ptr<anab::ParticleID> const & pidPtr: particleIDs) {
987+ const anab::ParticleID &particle_id = *pidPtr;
988+ if (particle_id.PlaneID ()) {
989+ unsigned plane_id = particle_id.PlaneID ().Plane ;
990+ assert (plane_id < 3 );
991+ FillPlaneLikePID (particle_id, srtrack.likepid [plane_id]);
992+ }
993+ }
994+ }
995+
954996 void FillTrackPlaneCalo (const anab::Calorimetry &calo,
955997 const std::vector<art::Ptr<recob::Hit>> &hits,
956998 bool fill_calo_points, float fillhit_rrstart, float fillhit_rrend,
0 commit comments