LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "MVAWriter.h"
Public Member Functions | |
FVectorWriter (art::EDProducer *module, 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::EDProducer * | fProducer |
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 26 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 33 of file MVAWriter.h.
|
inline |
Definition at line 79 of file MVAWriter.h.
Referenced by anab::MVAWriter< N >::addOutput(), and hit::DPRawHitFinder::produce().
|
inline |
Definition at line 80 of file MVAWriter.h.
|
inline |
Definition at line 81 of file MVAWriter.h.
|
inline |
Definition at line 82 of file MVAWriter.h.
|
inlineprivate |
Definition at line 145 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 246 of file MVAWriter.h.
References anab::FVectorWriter< N >::fRegisteredDataTypes, and s.
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 278 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 31 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 233 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 98 of file MVAWriter.h.
|
inline |
Get copy of the feature vector for the type T, idicated with art::Ptr::key().
Definition at line 108 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(), and hit::DPRawHitFinder::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 70 of file MVAWriter.h.
|
inline |
Definition at line 75 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 293 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 94 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 258 of file MVAWriter.h.
References anab::FVectorWriter< N >::dataTypeRegistered(), anab::FVectorWriter< N >::fInstanceName, anab::FVectorWriter< N >::fIsDescriptionRegistered, anab::FVectorWriter< N >::fProducer, anab::FVectorWriter< N >::fRegisteredDataTypes, and anab::FVectorWrapperBase::getProductName().
Referenced by hit::DPRawHitFinder::DPRawHitFinder(), 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 326 of file MVAWriter.h.
References anab::FVectorWriter< N >::clearEventData(), anab::FVectorWriter< N >::descriptionExists(), 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(), 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 85 of file MVAWriter.h.
|
inline |
Definition at line 59 of file MVAWriter.h.
Referenced by anab::MVAWriter< N >::setOutput().
|
inline |
Definition at line 60 of file MVAWriter.h.
|
inline |
Definition at line 61 of file MVAWriter.h.
|
inline |
Definition at line 62 of file MVAWriter.h.
|
inline |
Get the number of contained feature vectors.
Definition at line 91 of file MVAWriter.h.
|
friend |
Definition at line 116 of file MVAWriter.h.
|
private |
Definition at line 144 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::descriptionExists(), anab::FVectorWriter< N >::initOutputs(), and anab::FVectorWriter< N >::saveOutputs().
|
private |
Definition at line 137 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 140 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::produces_using().
|
private |
Definition at line 136 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::produces_using().
|
private |
Definition at line 139 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::dataTypeRegistered(), anab::FVectorWriter< N >::produces_using(), and anab::FVectorWriter< N >::saveOutputs().
|
private |
Definition at line 142 of file MVAWriter.h.
Referenced by anab::FVectorWriter< N >::getProductID(), and anab::FVectorWriter< N >::initOutputs().
|
protected |
Definition at line 132 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().