All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
anab::MVAWriter< N > Class Template Reference

#include <MVAWriter.h>

Inheritance diagram for anab::MVAWriter< N >:
anab::FVectorWriter< N > anab::MVAWrapperBase anab::FVectorWrapperBase

Public Member Functions

 MVAWriter (art::ProducesCollector &collector, const char *name="")
 
void setOutput (FVector_ID id, size_t key, std::array< float, N > const &values)
 
void setOutput (FVector_ID id, size_t key, std::array< double, N > const &values)
 
void setOutput (FVector_ID id, size_t key, std::vector< float > const &values)
 
void setOutput (FVector_ID id, size_t key, std::vector< double > const &values)
 
void addOutput (FVector_ID id, std::array< float, N > const &values)
 
void addOutput (FVector_ID id, std::array< double, N > const &values)
 
void addOutput (FVector_ID id, std::vector< float > const &values)
 
void addOutput (FVector_ID id, std::vector< double > const &values)
 
template<class T >
std::array< float, NgetOutput (std::vector< art::Ptr< T > > const &items) const
 
template<class T >
std::array< float, NgetOutput (std::vector< art::Ptr< T > > const &items, std::vector< float > const &weights) const
 
template<class T >
std::array< float, NgetOutput (std::vector< art::Ptr< T > > const &items, std::function< float(T const &)> fweight) const
 
template<class T >
std::array< float, NgetOutput (std::vector< art::Ptr< T > > const &items, std::function< float(art::Ptr< T > const &)> fweight) const
 
template<class T >
std::array< float, NgetOutput (size_t key) const
 Get copy of the MVA output vector for the type T, at index "key". More...
 
template<class T >
std::array< float, NgetOutput (art::Ptr< T > const &item) const
 Get copy of the MVA output vector for the type T, idicated with art::Ptr::key(). More...
 
- Public Member Functions inherited from anab::FVectorWriter< N >
 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, NgetVector (size_t key) const
 Get copy of the feature vector for the type T, at index "key". More...
 
template<class T >
std::array< float, NgetVector (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)
 

Additional Inherited Members

- Protected Member Functions inherited from anab::FVectorWriter< N >
template<class T >
FVector_ID getProductID () const
 
- Protected Member Functions inherited from anab::FVectorWrapperBase
std::string getProductName (std::type_info const &ti) const
 
size_t getProductHash (std::type_info const &ti) const
 
- Protected Member Functions inherited from anab::MVAWrapperBase
template<class T , size_t N>
std::array< float, NpAccumulate (std::vector< art::Ptr< T > > const &items, std::vector< FeatureVector< N > > const &outs) const
 
template<class T , size_t N>
std::array< float, NpAccumulate (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, NpAccumulate (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, NpAccumulate (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, NpAccumulate (std::vector< art::Ptr< T > > const &items, std::vector< FeatureVector< N > > const &outs, std::array< char, N > const &mask) const
 
- Protected Attributes inherited from anab::FVectorWriter< N >
std::vector< std::unique_ptr
< std::vector
< anab::FeatureVector< N > > > > 
fVectors
 

Detailed Description

template<size_t N>
class anab::MVAWriter< N >

Helper for registering in the art::EDProducer all data products needed for N-output MVA results: keep MVADescriptions<N> for all types T in one collection while separate instance names are used for the MVA output value collections for each type T. Use one instance of this class per one MVA model, applied to one or more types.

Definition at line 162 of file MVAWriter.h.

Constructor & Destructor Documentation

template<size_t N>
anab::MVAWriter< N >::MVAWriter ( art::ProducesCollector &  collector,
const char *  name = "" 
)
inline

Name provided to the constructor is used as an instance name for MVADescription<N> and FeatureVector<N> (for which it is combined with the processed data product names). Good idea is to use the name as an indication of what MVA model was used on the data (like eg. "emtrack" for outputs from a model distinguishing EM from track-like hits and clusters). The name is used as an instance name for the MVADescription data product which lets you to save multiple MVA results from a single art module.

Definition at line 171 of file MVAWriter.h.

171  :
172  FVectorWriter<N>(collector, name)
173  { }
then echo fcl name

Member Function Documentation

template<size_t N>
void anab::MVAWriter< N >::addOutput ( FVector_ID  id,
std::array< float, N > const &  values 
)
inline

Definition at line 180 of file MVAWriter.h.

180 { FVectorWriter<N>::addVector(id, values); }
void addVector(FVector_ID id, std::array< float, N > const &values)
Definition: MVAWriter.h:78
template<size_t N>
void anab::MVAWriter< N >::addOutput ( FVector_ID  id,
std::array< double, N > const &  values 
)
inline

Definition at line 181 of file MVAWriter.h.

181 { FVectorWriter<N>::addVector(id, values); }
void addVector(FVector_ID id, std::array< float, N > const &values)
Definition: MVAWriter.h:78
template<size_t N>
void anab::MVAWriter< N >::addOutput ( FVector_ID  id,
std::vector< float > const &  values 
)
inline

Definition at line 182 of file MVAWriter.h.

182 { FVectorWriter<N>::addVector(id, values); }
void addVector(FVector_ID id, std::array< float, N > const &values)
Definition: MVAWriter.h:78
template<size_t N>
void anab::MVAWriter< N >::addOutput ( FVector_ID  id,
std::vector< double > const &  values 
)
inline

Definition at line 183 of file MVAWriter.h.

183 { FVectorWriter<N>::addVector(id, values); }
void addVector(FVector_ID id, std::array< float, N > const &values)
Definition: MVAWriter.h:78
template<size_t N>
template<class T >
std::array<float, N> anab::MVAWriter< N >::getOutput ( std::vector< art::Ptr< T > > const &  items) const
inline

Get MVA results accumulated over the vector of items (eg. over hits associated to a cluster). NOTE: MVA outputs for these items has to be added to the MVAWriter first!

Definition at line 189 of file MVAWriter.h.

190  { return pAccumulate<T, N>(items, *(FVectorWriter<N>::fVectors[FVectorWriter<N>::template getProductID<T>()])); }
template<size_t N>
template<class T >
std::array<float, N> anab::MVAWriter< N >::getOutput ( std::vector< art::Ptr< T > > const &  items,
std::vector< float > const &  weights 
) const
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). NOTE: MVA outputs for these items has to be added to the MVAWriter first!

Definition at line 197 of file MVAWriter.h.

199  { return pAccumulate<T, N>(items, weights, *(FVectorWriter<N>::fVectors[FVectorWriter<N>::template getProductID<T>()])); }
template<size_t N>
template<class T >
std::array<float, N> anab::MVAWriter< N >::getOutput ( std::vector< art::Ptr< T > > const &  items,
std::function< float(T const &)>  fweight 
) const
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). NOTE: MVA outputs for these items has to be added to the MVAWriter first!

Definition at line 206 of file MVAWriter.h.

208  { return pAccumulate<T, N>(items, fweight, *(FVectorWriter<N>::fVectors[FVectorWriter<N>::template getProductID<T>()])); }
template<size_t N>
template<class T >
std::array<float, N> anab::MVAWriter< N >::getOutput ( std::vector< art::Ptr< T > > const &  items,
std::function< float(art::Ptr< T > const &)>  fweight 
) const
inline

Definition at line 211 of file MVAWriter.h.

213  { return pAccumulate<T, N>(items, fweight, *(FVectorWriter<N>::fVectors[FVectorWriter<N>::template getProductID<T>()])); }
template<size_t N>
template<class T >
std::array<float, N> anab::MVAWriter< N >::getOutput ( size_t  key) const
inline

Get copy of the MVA output vector for the type T, at index "key".

Definition at line 217 of file MVAWriter.h.

217 { return FVectorWriter<N>::template getVector<T>(key); }
template<size_t N>
template<class T >
std::array<float, N> anab::MVAWriter< N >::getOutput ( art::Ptr< T > const &  item) const
inline

Get copy of the MVA output vector for the type T, idicated with art::Ptr::key().

Definition at line 221 of file MVAWriter.h.

221 { return FVectorWriter<N>::template getVector<T>(item); }
template<size_t N>
void anab::MVAWriter< N >::setOutput ( FVector_ID  id,
size_t  key,
std::array< float, N > const &  values 
)
inline

Definition at line 175 of file MVAWriter.h.

175 { FVectorWriter<N>::setVector(id, key, values); }
void setVector(FVector_ID id, size_t key, std::array< float, N > const &values)
Definition: MVAWriter.h:58
template<size_t N>
void anab::MVAWriter< N >::setOutput ( FVector_ID  id,
size_t  key,
std::array< double, N > const &  values 
)
inline

Definition at line 176 of file MVAWriter.h.

176 { FVectorWriter<N>::setVector(id, key, values); }
void setVector(FVector_ID id, size_t key, std::array< float, N > const &values)
Definition: MVAWriter.h:58
template<size_t N>
void anab::MVAWriter< N >::setOutput ( FVector_ID  id,
size_t  key,
std::vector< float > const &  values 
)
inline

Definition at line 177 of file MVAWriter.h.

177 { FVectorWriter<N>::setVector(id, key, values); }
void setVector(FVector_ID id, size_t key, std::array< float, N > const &values)
Definition: MVAWriter.h:58
template<size_t N>
void anab::MVAWriter< N >::setOutput ( FVector_ID  id,
size_t  key,
std::vector< double > const &  values 
)
inline

Definition at line 178 of file MVAWriter.h.

178 { FVectorWriter<N>::setVector(id, key, values); }
void setVector(FVector_ID id, size_t key, std::array< float, N > const &values)
Definition: MVAWriter.h:58

The documentation for this class was generated from the following file: