Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
anab::MVADescription< N > Class Template Reference

#include <MVAOutput.h>

Public Member Functions

 MVADescription ()
 
 MVADescription (std::string const &dataTag, std::string const &outputInstance, std::vector< std::string > const &outputNames=std::vector< std::string >(N,""))
 
 MVADescription (std::string const &outputInstance, std::vector< std::string > const &outputNames=std::vector< std::string >(N,""))
 
const std::stringoutputInstance () const
 
size_t size () const
 
const std::stringdataTag () const
 
void setDataTag (const std::string &tag)
 
const std::stringoutputName (size_t index) const
 
void setOutputNames (std::vector< std::string > const &outputNames)
 
int getIndex (const std::string &name) const
 

Static Public Member Functions

static short Class_Version ()
 

Private Attributes

std::string fDataTag
 Tag of the reco data products (art::InputTag format) More...
 
std::string fOutputInstance
 Instance name of the feature vector collection. More...
 
std::string fOutputNames [N]
 Feature vector entries names/meaning. More...
 

Friends

std::ostream & operator<< (std::ostream &o, MVADescription const &a)
 

Detailed Description

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

Metadata associated to feature vectors. The idea is to link entire collection of objects to the collection of vectors, and add metadata like the meaning of columns in vectors using a single object.

Definition at line 98 of file MVAOutput.h.

Constructor & Destructor Documentation

template<size_t N>
anab::MVADescription< N >::MVADescription ( )
inline

Definition at line 101 of file MVAOutput.h.

101 { }
template<size_t N>
anab::MVADescription< N >::MVADescription ( std::string const &  dataTag,
std::string const &  outputInstance,
std::vector< std::string > const &  outputNames = std::vectorstd::string >(N, "") 
)
inline

Definition at line 113 of file MVAOutput.h.

114  :
115  fDataTag(dataTag),
117  {
118  setOutputNames(outputNames);
119  }
const std::string & dataTag() const
Definition: MVAOutput.h:140
void setOutputNames(std::vector< std::string > const &outputNames)
Definition: MVAOutput.h:152
std::string fOutputInstance
Instance name of the feature vector collection.
Definition: MVAOutput.h:108
const std::string & outputInstance() const
Definition: MVAOutput.h:136
std::string fDataTag
Tag of the reco data products (art::InputTag format)
Definition: MVAOutput.h:107
template<size_t N>
anab::MVADescription< N >::MVADescription ( std::string const &  outputInstance,
std::vector< std::string > const &  outputNames = std::vectorstd::string >(N, "") 
)
inline

Definition at line 121 of file MVAOutput.h.

122  :
123  fDataTag(""), // initialize with empty data tag, so it should be assigned later
125  {
126  setOutputNames(outputNames);
127  }
void setOutputNames(std::vector< std::string > const &outputNames)
Definition: MVAOutput.h:152
std::string fOutputInstance
Instance name of the feature vector collection.
Definition: MVAOutput.h:108
const std::string & outputInstance() const
Definition: MVAOutput.h:136
std::string fDataTag
Tag of the reco data products (art::InputTag format)
Definition: MVAOutput.h:107

Member Function Documentation

template<size_t N>
static short anab::MVADescription< N >::Class_Version ( )
inlinestatic

Definition at line 104 of file MVAOutput.h.

104 { return 10; }
template<size_t N>
const std::string& anab::MVADescription< N >::dataTag ( ) const
inline

Definition at line 140 of file MVAOutput.h.

140 { return fDataTag; }
std::string fDataTag
Tag of the reco data products (art::InputTag format)
Definition: MVAOutput.h:107
template<size_t N>
int anab::MVADescription< N >::getIndex ( const std::string name) const
inline

Definition at line 158 of file MVAOutput.h.

159  {
160  for (size_t i = 0; i < N; ++i) { if (fOutputNames[i] == name) { return i; } }
161  return -1; // not found
162  }
static QCString name
Definition: declinfo.cpp:673
std::string fOutputNames[N]
Feature vector entries names/meaning.
Definition: MVAOutput.h:109
template<size_t N>
const std::string& anab::MVADescription< N >::outputInstance ( ) const
inline

Definition at line 136 of file MVAOutput.h.

136 { return fOutputInstance; }
std::string fOutputInstance
Instance name of the feature vector collection.
Definition: MVAOutput.h:108
template<size_t N>
const std::string& anab::MVADescription< N >::outputName ( size_t  index) const
inline

Definition at line 147 of file MVAOutput.h.

148  {
149  if (index < N) { return fOutputNames[index]; }
150  else { throw cet::exception("MVADescription") << "Index out of range: " << index << std::endl; }
151  }
std::string fOutputNames[N]
Feature vector entries names/meaning.
Definition: MVAOutput.h:109
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
template<size_t N>
void anab::MVADescription< N >::setDataTag ( const std::string tag)
inline

Definition at line 141 of file MVAOutput.h.

142  {
143  if (fDataTag.empty()) { fDataTag = tag; }
144  else { throw cet::exception("MVADescription") << "Data tag already assigned: " << fDataTag << std::endl; }
145  }
std::string fDataTag
Tag of the reco data products (art::InputTag format)
Definition: MVAOutput.h:107
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
template<size_t N>
void anab::MVADescription< N >::setOutputNames ( std::vector< std::string > const &  outputNames)
inline

Definition at line 152 of file MVAOutput.h.

153  {
154  if (outputNames.size() <= N) { for (size_t i = 0; i < outputNames.size(); ++i) { fOutputNames[i] = outputNames[i]; } }
155  else { throw cet::exception("FeatureVector") << "Expected max length of outputNames: " << N << ", provided: " << outputNames.size() << std::endl; }
156  }
std::string fOutputNames[N]
Feature vector entries names/meaning.
Definition: MVAOutput.h:109
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
template<size_t N>
size_t anab::MVADescription< N >::size ( void  ) const
inline

Definition at line 138 of file MVAOutput.h.

Friends And Related Function Documentation

template<size_t N>
std::ostream& operator<< ( std::ostream &  o,
MVADescription< N > const &  a 
)
friend

Definition at line 129 of file MVAOutput.h.

130  {
131  o << "MVADescription: prepared for " << a.fDataTag << ", instance name " << a.fOutputInstance << ", " << N << " outputs:" << std::endl;
132  for (size_t i = 0; i < N; ++i) { o << " " << a.fOutputNames[i] << std::endl; }
133  return o;
134  }
const double a
QTextStream & endl(QTextStream &s)

Member Data Documentation

template<size_t N>
std::string anab::MVADescription< N >::fDataTag
private

Tag of the reco data products (art::InputTag format)

Definition at line 107 of file MVAOutput.h.

template<size_t N>
std::string anab::MVADescription< N >::fOutputInstance
private

Instance name of the feature vector collection.

Definition at line 108 of file MVAOutput.h.

template<size_t N>
std::string anab::MVADescription< N >::fOutputNames[N]
private

Feature vector entries names/meaning.

Definition at line 109 of file MVAOutput.h.


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