LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "MVAReader.h"
Public Member Functions | |
MVAReader (const art::Event &evt, const art::InputTag &tag) | |
std::vector< FeatureVector< N > > const & | outputs () const |
Access the vector of the feature vectors. More... | |
std::array< float, N > | getOutput (size_t key) const |
Get copy of the MVA output vector at index "key". More... | |
std::array< float, N > | getOutput (art::Ptr< T > const &item) const |
Get copy of the MVA output vector idicated with art::Ptr::key(). More... | |
std::array< float, N > | getOutput (std::vector< art::Ptr< T >> const &items) const |
Get MVA results accumulated over the vector of items (eg. over hits associated to a cluster). More... | |
std::array< float, N > | getOutput (std::vector< art::Ptr< T >> const &items, std::vector< float > const &weights) const |
std::array< float, N > | getOutput (std::vector< art::Ptr< T >> const &items, std::function< float(T const &)> fweight) const |
const std::string & | outputName (size_t index) const |
Meaning/name of the index'th column in the collection of MVA output vectors. More... | |
T const & | item (size_t key) const |
Access data product at index "key". More... | |
std::vector< T > const & | items () const |
std::vector< FeatureVector< N > > const & | vectors () const |
Access the vector of the feature vectors. More... | |
std::array< float, N > | getVector (size_t key) const |
Get copy of the feature vector at index "key". More... | |
std::array< float, N > | getVector (art::Ptr< T > const &item) const |
Get copy of the feature vector idicated with art::Ptr::key(). More... | |
size_t | size () const |
Get the number of contained items (no. of data product objects equal to no. of feature vectors). More... | |
size_t | length () const |
Get the length of a single feature vector. More... | |
const std::string & | dataTag () const |
Get the input tag (string representation) of data product used to calculate feature vectors. More... | |
const art::Handle< std::vector< T > > & | dataHandle () const |
Access the data product handle. More... | |
const std::string & | columnName (size_t index) const |
Meaning/name of the index'th column in the collection of feature vectors. More... | |
int | getIndex (const std::string &name) const |
Index of column with given name, or -1 if name not found. More... | |
Static Public Member Functions | |
static std::unique_ptr< MVAReader > | create (const art::Event &evt, const art::InputTag &tag) |
Protected Member Functions | |
std::string | getProductName (std::type_info const &ti) const |
size_t | getProductHash (std::type_info const &ti) const |
template<class T , size_t N> | |
std::array< float, N > | pAccumulate (std::vector< art::Ptr< T >> const &items, std::vector< FeatureVector< N >> const &outs) const |
template<class T , size_t N> | |
std::array< float, N > | pAccumulate (std::vector< art::Ptr< T >> const &items, std::vector< float > const &weights, std::vector< FeatureVector< N >> const &outs) const |
template<class T , size_t N> | |
std::array< float, N > | pAccumulate (std::vector< art::Ptr< T >> const &items, std::function< float(T const &)> fweight, std::vector< FeatureVector< N >> const &outs) const |
template<class T , size_t N> | |
std::array< float, N > | pAccumulate (std::vector< art::Ptr< T >> const &items, std::function< float(art::Ptr< T > const &)> fweight, std::vector< FeatureVector< N >> const &outs) const |
template<class T , size_t N> | |
std::array< float, N > | pAccumulate (std::vector< art::Ptr< T >> const &items, std::vector< FeatureVector< N >> const &outs, std::array< char, N > const &mask) const |
Private Member Functions | |
MVAReader (const art::Event &evt, const art::InputTag &tag, bool &success) | |
Not-throwing constructor. More... | |
Helper for reading the reconstructed objects of type T together with associated N-outputs MVA results with their metadata (this class is not a data product).
Definition at line 103 of file MVAReader.h.
|
inline |
Create the wrapper for MVA data stored in the event evt with the provided input tag (the same tag which was used to save MVA results with MVAWriter class). Throws exception if data products not found in the event.
Definition at line 121 of file MVAReader.h.
|
inlineprivate |
Not-throwing constructor.
Definition at line 167 of file MVAReader.h.
|
inlineinherited |
Meaning/name of the index'th column in the collection of feature vectors.
Definition at line 79 of file MVAReader.h.
References anab::FVectorReader< T, N >::fDescription.
Referenced by anab::MVAReader< T, N >::outputName().
|
inlinestatic |
Create the wrapper for MVA data stored in the event evt with the provided input tag (the same tag which was used to save MVA results with MVAWriter class). Returns nullptr if data products not found in the event.
Definition at line 108 of file MVAReader.h.
Referenced by nnet::PointIdEffTest::analyze(), DUNE::NeutrinoShowerEff::checkCNNtrkshw(), trkf::PMAlgTrackMaker::getPdgFromCnnOnHits(), trkf::PMAlgTrackMaker::init(), and shower::EMShower::produce().
|
inlineinherited |
Access the data product handle.
Definition at line 76 of file MVAReader.h.
References anab::FVectorReader< T, N >::fDataHandle.
|
inlineinherited |
Get the input tag (string representation) of data product used to calculate feature vectors.
Definition at line 73 of file MVAReader.h.
References anab::FVectorReader< T, N >::fDescription.
|
inlineinherited |
Index of column with given name, or -1 if name not found.
Definition at line 82 of file MVAReader.h.
References anab::FVectorReader< T, N >::fDescription.
Referenced by pdsp::CheckCNNScore::analyze(), and nnet::PointIdEffTest::analyze().
|
inline |
Get copy of the MVA output vector at index "key".
Definition at line 127 of file MVAReader.h.
References anab::FVectorReader< T, N >::getVector().
Referenced by pdsp::CheckCNNScore::analyze().
|
inline |
Get copy of the MVA output vector idicated with art::Ptr::key().
Definition at line 130 of file MVAReader.h.
References anab::FVectorReader< T, N >::getVector(), and art::Ptr< T >::key().
|
inline |
Get MVA results accumulated over the vector of items (eg. over hits associated to a cluster).
Definition at line 136 of file MVAReader.h.
References anab::FVectorReader< T, N >::items().
|
inline |
Get MVA results accumulated with provided weights over the vector of items (eg. over clusters associated to a track, weighted by the cluster size; or over hits associated to a cluster, weighted by the hit area).
Definition at line 144 of file MVAReader.h.
References anab::FVectorReader< T, N >::items().
|
inline |
Get MVA results accumulated with provided weighting function over the vector of items (eg. over clusters associated to a track, weighted by the cluster size; or over hits associated to a cluster, weighted by the hit area).
Definition at line 153 of file MVAReader.h.
References anab::FVectorReader< T, N >::items().
|
inlineprotectedinherited |
Definition at line 29 of file MVAWrapperBase.h.
Referenced by anab::FVectorWriter< N >::getProductID(), and anab::FVectorWriter< N >::initOutputs().
|
protectedinherited |
Definition at line 17 of file MVAWrapperBase.cxx.
Referenced by anab::FVectorReader< T, N >::FVectorReader(), anab::FVectorWriter< N >::getProductID(), anab::FVectorWriter< N >::initOutputs(), and anab::FVectorWriter< N >::produces_using().
|
inlineinherited |
Get copy of the feature vector at index "key".
Access feature vector data at index "key". *** WOULD LIKE TO CHANGE TYPE OF FVEC DATA MEMBER TO std::array AND THEN ENABLE THIS FUNCTION ***
Definition at line 55 of file MVAReader.h.
References anab::FVectorReader< T, N >::fVectors.
Referenced by anab::MVAReader< T, N >::getOutput().
|
inlineinherited |
Get copy of the feature vector idicated with art::Ptr::key().
Definition at line 64 of file MVAReader.h.
References anab::FVectorReader< T, N >::getVector(), and art::Ptr< T >::key().
Referenced by anab::FVectorReader< T, N >::getVector().
|
inlineinherited |
Access data product at index "key".
Definition at line 44 of file MVAReader.h.
References anab::FVectorReader< T, N >::fDataHandle.
|
inlineinherited |
Definition at line 45 of file MVAReader.h.
References anab::FVectorReader< T, N >::fDataHandle.
Referenced by anab::MVAReader< T, N >::getOutput().
|
inlineinherited |
Get the length of a single feature vector.
Definition at line 70 of file MVAReader.h.
|
inline |
Meaning/name of the index'th column in the collection of MVA output vectors.
Definition at line 160 of file MVAReader.h.
References anab::FVectorReader< T, N >::columnName().
|
inline |
Access the vector of the feature vectors.
Definition at line 124 of file MVAReader.h.
References anab::FVectorReader< T, N >::vectors().
Referenced by nnet::PointIdEffTest::analyze().
|
protectedinherited |
Definition at line 73 of file MVAWrapperBase.h.
References trkf::fill().
|
protectedinherited |
Definition at line 119 of file MVAWrapperBase.h.
References trkf::fill(), and w.
|
protectedinherited |
Definition at line 173 of file MVAWrapperBase.h.
References trkf::fill(), and w.
|
protectedinherited |
Definition at line 227 of file MVAWrapperBase.h.
References trkf::fill(), and w.
|
protectedinherited |
Definition at line 285 of file MVAWrapperBase.h.
|
inlineinherited |
Get the number of contained items (no. of data product objects equal to no. of feature vectors).
Definition at line 67 of file MVAReader.h.
References anab::FVectorReader< T, N >::fVectors.
|
inlineinherited |
Access the vector of the feature vectors.
Definition at line 48 of file MVAReader.h.
References anab::FVectorReader< T, N >::fVectors.
Referenced by anab::MVAReader< T, N >::outputs().