LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "MVAWriter.h"
Public Member Functions | |
FVectorWriter (art::ProducesCollector &collector, const char *name="") | |
template<class T > | |
void | produces_using () |
template<class T > | |
FVector_ID | initOutputs (std::string const &dataTag, size_t dataSize, std::vector< std::string > const &names=std::vector< std::string >(N,"")) |
template<class T > | |
FVector_ID | initOutputs (art::InputTag const &dataTag, size_t dataSize, std::vector< std::string > const &names=std::vector< std::string >(N,"")) |
void | setVector (FVector_ID id, size_t key, std::array< float, N > const &values) |
void | setVector (FVector_ID id, size_t key, std::array< double, N > const &values) |
void | setVector (FVector_ID id, size_t key, std::vector< float > const &values) |
void | setVector (FVector_ID id, size_t key, std::vector< double > const &values) |
template<class T > | |
FVector_ID | initOutputs (art::InputTag const &dataTag, std::vector< std::string > const &names=std::vector< std::string >(N,"")) |
template<class T > | |
FVector_ID | initOutputs (std::vector< std::string > const &names=std::vector< std::string >(N,"")) |
void | addVector (FVector_ID id, std::array< float, N > const &values) |
void | addVector (FVector_ID id, std::array< double, N > const &values) |
void | addVector (FVector_ID id, std::vector< float > const &values) |
void | addVector (FVector_ID id, std::vector< double > const &values) |
void | setDataTag (FVector_ID id, art::InputTag const &dataTag) |
Set tag of associated data products in case it was not ready at the initialization time. More... | |
void | saveOutputs (art::Event &evt) |
Check consistency and save all the results in the event. More... | |
size_t | size (FVector_ID id) const |
Get the number of contained feature vectors. More... | |
size_t | length () const |
Get the length of a single feature vector. More... | |
template<class T > | |
std::array< float, N > | getVector (size_t key) const |
Get copy of the feature vector for the type T, at index "key". More... | |
template<class T > | |
std::array< float, N > | getVector (art::Ptr< T > const &item) const |
Get copy of the feature vector for the type T, idicated with art::Ptr::key(). More... | |
template<class T > | |
anab::FVector_ID | getProductID () const |
template<class T > | |
anab::FVector_ID | initOutputs (std::string const &dataTag, size_t dataSize, std::vector< std::string > const &names) |
Protected Member Functions | |
template<class T > | |
FVector_ID | getProductID () const |
std::string | getProductName (std::type_info const &ti) const |
size_t | getProductHash (std::type_info const &ti) const |
Protected Attributes | |
std::vector< std::unique_ptr< std::vector< anab::FeatureVector< N > > > > | fVectors |
Private Member Functions | |
void | clearEventData () |
bool | dataTypeRegistered (const std::string &dname) const |
Check if the the writer is configured to write results for data product type name. More... | |
bool | descriptionExists (const std::string &tname) const |
Check if the containers for results prepared for "tname" data type are ready. More... | |
Private Attributes | |
art::ProducesCollector & | fCollector |
std::string | fInstanceName |
std::vector< std::string > | fRegisteredDataTypes |
bool | fIsDescriptionRegistered |
std::unordered_map< size_t, FVector_ID > | fTypeHashToID |
std::unique_ptr< std::vector< anab::FVecDescription< N > > > | fDescriptions |
Friends | |
std::ostream & | operator<< (std::ostream &o, FVectorWriter const &a) |
Definition at line 25 of file MVAWriter.h.
|
inline |
Name provided to the constructor is used as an instance name for FVecDescription<N> and FeatureVector<N> (for which it is combined with the processed data product names). The name is used as an instance name for the FVecDescription data product which lets you to save multiple vector collections from a single art module.
Definition at line 31 of file MVAWriter.h.
|
inline |
Definition at line 96 of file MVAWriter.h.
Referenced by anab::MVAWriter< 4 >::addOutput(), and hit::DPRawHitFinder::produce().
|
inline |
Definition at line 100 of file MVAWriter.h.
|
inline |
Definition at line 104 of file MVAWriter.h.
|
inline |
Definition at line 108 of file MVAWriter.h.
|
inlineprivate |
Definition at line 183 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::saveOutputs().
|
private |
Check if the the writer is configured to write results for data product type name.
Definition at line 330 of file MVAWriter.h.
References anab::FVectorWriter< N >::fRegisteredDataTypes.
Referenced by anab::FVectorWriter< 4 >::clearEventData(), anab::FVectorWriter< N >::initOutputs(), and anab::FVectorWriter< N >::produces_using().
|
private |
Check if the containers for results prepared for "tname" data type are ready.
Definition at line 360 of file MVAWriter.h.
References d, anab::FVectorWriter< N >::fDescriptions, anab::FVectorWriter< N >::fInstanceName, and n.
Referenced by anab::FVectorWriter< 4 >::clearEventData(), anab::FVectorWriter< N >::initOutputs(), and anab::FVectorWriter< N >::saveOutputs().
|
inlineprotectedinherited |
Definition at line 29 of file MVAWrapperBase.h.
Referenced by anab::FVectorWriter< N >::getProductID(), and anab::FVectorWriter< N >::initOutputs().
|
protected |
anab::FVector_ID anab::FVectorWriter< N >::getProductID | ( | ) | const |
Definition at line 317 of file MVAWriter.h.
References anab::FVectorWriter< N >::fTypeHashToID, anab::FVectorWrapperBase::getProductHash(), and anab::FVectorWrapperBase::getProductName().
|
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().
|
inline |
Get copy of the feature vector for the type T, at index "key".
Definition at line 130 of file MVAWriter.h.
|
inline |
Get copy of the feature vector for the type T, idicated with art::Ptr::key().
Definition at line 141 of file MVAWriter.h.
FVector_ID anab::FVectorWriter< N >::initOutputs | ( | std::string const & | dataTag, |
size_t | dataSize, | ||
std::vector< std::string > const & | names = std::vector< std::string >(N,"") |
||
) |
Initialize container for FeatureVectors and, if not yet done, the container for metadata, then creates metadata for data products of type T. FeatureVector container is initialized to hold dataSize vectors (if dataSize > 0): use setOutput() to store values. Returns index of collection which should be used when saving actual output values.
Referenced by anab::FVectorWriter< 4 >::FVectorWriter(), hit::DPRawHitFinder::produce(), nnet::EmTrackClusterId2out::produce(), nnet::EmTrackClusterId::produce(), and nnet::EmTrackMichelId::produce().
|
inline |
Definition at line 55 of file MVAWriter.h.
|
inline |
Initialize container for FeatureVectors and, if not yet done, the container for metadata, then creates metadata for data products of type T. FeatureVector container is initialized as EMPTY and vectors should be added with addOutput() function. Returns index of collection which should be used when adding actual output values.
Definition at line 84 of file MVAWriter.h.
|
inline |
Definition at line 91 of file MVAWriter.h.
anab::FVector_ID anab::FVectorWriter< N >::initOutputs | ( | std::string const & | dataTag, |
size_t | dataSize, | ||
std::vector< std::string > const & | names | ||
) |
Definition at line 374 of file MVAWriter.h.
References anab::FVectorWriter< N >::dataTypeRegistered(), anab::FVectorWriter< N >::descriptionExists(), anab::FVectorWriter< N >::fDescriptions, anab::FVectorWriter< N >::fInstanceName, anab::FVectorWriter< N >::fTypeHashToID, anab::FVectorWriter< N >::fVectors, anab::FVectorWrapperBase::getProductHash(), anab::FVectorWrapperBase::getProductName(), and lar::dump::vector().
|
inline |
Get the length of a single feature vector.
Definition at line 126 of file MVAWriter.h.
Register the collection of metadata type FVecDescription<N> (once for all data types for which vectors are saved) and the collection of FeatureVectors<N> (using data type name added to fInstanceName as instance name of the collection made for the type T).
Definition at line 341 of file MVAWriter.h.
References anab::FVectorWriter< N >::dataTypeRegistered(), anab::FVectorWriter< N >::fCollector, anab::FVectorWriter< N >::fInstanceName, anab::FVectorWriter< N >::fIsDescriptionRegistered, anab::FVectorWriter< N >::fRegisteredDataTypes, anab::FVectorWrapperBase::getProductName(), and art::ProducesCollector::produces().
Referenced by hit::DPRawHitFinder::DPRawHitFinder(), nnet::EmTrackClusterId::EmTrackClusterId(), nnet::EmTrackClusterId2out::EmTrackClusterId2out(), nnet::EmTrackMichelId::EmTrackMichelId(), and anab::FVectorWriter< 4 >::FVectorWriter().
void anab::FVectorWriter< N >::saveOutputs | ( | art::Event & | evt | ) |
Check consistency and save all the results in the event.
Definition at line 404 of file MVAWriter.h.
References anab::FVectorWriter< N >::clearEventData(), anab::FVectorWriter< N >::descriptionExists(), util::empty(), anab::FVectorWriter< N >::fDescriptions, anab::FVectorWriter< N >::fInstanceName, anab::FVectorWriter< N >::fRegisteredDataTypes, anab::FVectorWriter< N >::fVectors, n, and art::Event::put().
Referenced by hit::DPRawHitFinder::produce(), nnet::EmTrack< N >::produce(), nnet::EmTrackClusterId2out::produce(), nnet::EmTrackClusterId::produce(), nnet::EmTrackMichelId::produce(), and anab::FVectorWriter< 4 >::setDataTag().
|
inline |
Set tag of associated data products in case it was not ready at the initialization time.
Definition at line 114 of file MVAWriter.h.
|
inline |
Definition at line 62 of file MVAWriter.h.
Referenced by anab::MVAWriter< 4 >::setOutput().
|
inline |
Definition at line 66 of file MVAWriter.h.
|
inline |
Definition at line 70 of file MVAWriter.h.
|
inline |
Definition at line 74 of file MVAWriter.h.
|
inline |
Get the number of contained feature vectors.
Definition at line 123 of file MVAWriter.h.
|
friend |
Definition at line 150 of file MVAWriter.h.
|
private |
Definition at line 174 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::produces_using().
|
private |
Definition at line 182 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::descriptionExists(), anab::FVectorWriter< N >::initOutputs(), and anab::FVectorWriter< N >::saveOutputs().
|
private |
Definition at line 175 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::descriptionExists(), anab::FVectorWriter< N >::initOutputs(), anab::FVectorWriter< N >::produces_using(), and anab::FVectorWriter< N >::saveOutputs().
|
private |
Definition at line 178 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::produces_using().
|
private |
Definition at line 177 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::dataTypeRegistered(), anab::FVectorWriter< N >::produces_using(), and anab::FVectorWriter< N >::saveOutputs().
|
private |
Definition at line 180 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::getProductID(), and anab::FVectorWriter< N >::initOutputs().
|
protected |
Definition at line 170 of file MVAWriter.h.
Referenced by anab::FVectorWriter< 4 >::addVector(), anab::FVectorWriter< 4 >::getVector(), anab::FVectorWriter< N >::initOutputs(), anab::FVectorWriter< N >::saveOutputs(), anab::FVectorWriter< 4 >::setVector(), and anab::FVectorWriter< 4 >::size().