86 #include "art_root_io/TFileService.h" 87 #include "art_root_io/TFileDirectory.h" 101 #include "TRandom3.h" 115 produces<std::vector<ctp::CTPResult>>();
116 produces<art::Assns<recob::Track,ctp::CTPResult>>();
133 fPIDTree = tfs->make<TTree>(
"pidTree",
"pidTree");
152 std::unique_ptr< std::vector<ctp::CTPResult> > resultCol(
new std::vector<ctp::CTPResult>);
173 int thisTrackID = -999;
176 unsigned int nCaloPoints = 0;
183 thisTrackID = trk.
key();
184 nCaloPoints = calo->dEdx().size();
190 resultCol->push_back(thisPID);
202 if (!thisPID.
IsValid())
continue;
static art::Ptr< recob::Track > GetTrack(const art::Ptr< recob::PFParticle > &pParticle, const art::Event &evt, const std::string &pParticleLabel, const std::string &trackLabel)
Get the track associated to this particle. Should only be called if IsTrack method succeeds...
Class containing some utility functions for all things CVN.
Class storing the result from the convolutional track PID.
std::vector< float > fPionScoreVector
Class containing some utility functions for all things CVN.
Utility containing helpful functions for end users to access information about Tracks.
const int GetTruePDGCode(const art::Ptr< recob::PFParticle >, const art::Event &evt) const
EDProducer(fhicl::ParameterSet const &pset)
void produce(art::Event &evt)
Functions to help use the convolutional track PID.
float GetPionScore() const
std::string fParticleLabel
std::vector< unsigned int > fCaloPoints
float GetProtonScore() const
std::vector< int > fPDGVector
static std::vector< art::Ptr< recob::Track > > GetTracks(const art::Event &evt, const std::string &label)
Get the tracks from the event. This function shouldn't be used as the basis of an analysis...
#define DEFINE_ART_MODULE(klass)
float GetMuonScore() const
Utility containing helpful functions for end users to access information about Showers.
key_type key() const noexcept
T get(std::string const &key) const
CTPEvaluator(fhicl::ParameterSet const &pset)
Constructor.
Utility containing helpful functions for end users to access information about PFParticles.
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Utility containing helpful functions for end users to access products from events.
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
std::vector< float > fProtonScoreVector
Declaration of signal hit object.
fhicl::ParameterSet fHelperPars
virtual ~CTPEvaluator()
Destructor.
Provides recob::Track data product.
static art::Ptr< anab::Calorimetry > GetCalorimetry(const art::Ptr< recob::Track > &pTrack, const art::Event &evt, const std::string &trackLabel, const std::string &caloLabel)
Get the particle associated with the track.
static bool IsTrack(const art::Ptr< recob::PFParticle > &pParticle, const art::Event &evt, const std::string &pParticleLabel, const std::string &trackLabel)
Check if this particle has an associated track.
auto const & get(AssnsNode< L, R, D > const &r)
static std::vector< art::Ptr< recob::PFParticle > > GetPFParticles(const art::Event &evt, const std::string &label)
Get the particles from the event.
QTextStream & endl(QTextStream &s)
const ctp::CTPResult RunConvolutionalTrackPID(const art::Ptr< recob::PFParticle > particle, const art::Event &evt) const
std::vector< float > fMuonScoreVector