|
ATLAS Offline Software
|
Helper class providing easy access to FileMetaData object holding file-level metadata about an xAOD file specific to B-physics derivations.
More...
#include <BPhysMetaDataHelper.h>
|
| BPhysMetaDataHelper (const xAOD::FileMetaData *fm) |
| Main constructor. More...
|
|
const xAOD::FileMetaData * | metaObj () const |
| Getter method for the cached xAOD::FileMetaData object. More...
|
|
void | setPrefix (std::string prefix) |
| Set prefix for variable names. More...
|
|
std::map< std::string, const std::type_info * > | varTypes () const |
| Map of metadata names and types. More...
|
|
TString | varTypesToString (TString header="") const |
| List of metadata names and types as string. More...
|
|
TString | metaDataToString (TString header="") const |
| Complete metadata contents as TString. More...
|
|
|
- Parameters
-
[in] | name | name of metadata variable (without prefix) |
[out] | val | value of metadata variable |
- Returns
- true if named variable exists
- Note
- applies prefix to each variable name
|
bool | value (const std::string &name, int &val) const |
|
bool | value (const std::string &name, float &val) const |
|
bool | value (const std::string &name, double &val) const |
|
bool | value (const std::string &name, bool &val) const |
|
bool | value (const std::string &name, std::string &val) const |
|
bool | value (const std::string &name, std::vector< int > &val) const |
|
bool | value (const std::string &name, std::vector< float > &val) const |
|
bool | value (const std::string &name, std::vector< double > &val) const |
|
bool | value (const std::string &name, std::vector< bool > &val) const |
|
bool | value (const std::string &name, std::vector< std::string > &val) const |
|
|
std::map< std::string, int > | valuesI () const |
|
std::map< std::string, float > | valuesF () const |
|
std::map< std::string, double > | valuesD () const |
|
std::map< std::string, bool > | valuesB () const |
|
std::map< std::string, std::string > | valuesS () const |
|
std::map< std::string, std::vector< int > > | valuesVI () const |
|
std::map< std::string, std::vector< float > > | valuesVF () const |
|
std::map< std::string, std::vector< double > > | valuesVD () const |
|
std::map< std::string, std::vector< bool > > | valuesVB () const |
|
std::map< std::string, std::vector< std::string > > | valuesVS () const |
|
Helper class providing easy access to FileMetaData object holding file-level metadata about an xAOD file specific to B-physics derivations.
- Author
- Wolfgang Walkowiak Wolfg.nosp@m.ang..nosp@m.Walko.nosp@m.wiak.nosp@m.@cern.nosp@m..ch
Definition at line 58 of file BPhysMetaDataHelper.h.
◆ BPhysMetaDataHelper()
◆ cacheVarTypes()
void xAOD::BPhysMetaDataHelper::cacheVarTypes |
( |
| ) |
const |
|
protected |
◆ metaDataToString()
TString xAOD::BPhysMetaDataHelper::metaDataToString |
( |
TString |
header = "" | ) |
const |
Complete metadata contents as TString.
- Parameters
-
[in] | header | optional header string for table |
- Returns
- TString with metadata contents as table
Definition at line 53 of file BPhysMetaDataHelper.cxx.
56 std::map<std::string, std::string>
ms =
valuesS();
57 for (
auto it =
ms.begin();
it !=
ms.end(); ++
it ) {
58 str += Form(
"%-30s :S : %s\n",
it->first.c_str(),
it->second.c_str());
60 std::map<std::string, int> mi =
valuesI();
61 for (
auto it = mi.begin();
it != mi.end(); ++
it ) {
62 str += Form(
"%-30s :I : %d\n",
it->first.c_str(),
it->second);
64 std::map<std::string, float>
mf =
valuesF();
65 for (
auto it =
mf.begin();
it !=
mf.end(); ++
it ) {
66 str += Form(
"%-30s :F : %f\n",
it->first.c_str(),
it->second);
68 std::map<std::string, double> md =
valuesD();
69 for (
auto it = md.begin();
it != md.end(); ++
it ) {
70 str += Form(
"%-30s :D : %f\n",
it->first.c_str(),
it->second);
72 std::map<std::string, bool>
mb =
valuesB();
73 for (
auto it =
mb.begin();
it !=
mb.end(); ++
it ) {
74 str += Form(
"%-30s :B : %s\n",
it->first.c_str(),
75 (
it->second ?
"True" :
"False") );
77 std::map<std::string, std::vector<int> > mvi =
valuesVI();
78 for (
auto it = mvi.begin();
it != mvi.end(); ++
it ) {
80 for (
auto &ent :
it->second) {
81 strv += Form(
"%d,", ent);
83 strv.Remove(TString::kTrailing,
',');
84 str += Form(
"%-30s :VI: [%s]\n",
it->first.c_str(), strv.Data());
86 std::map<std::string, std::vector<float> > mvf =
valuesVF();
87 for (
auto it = mvf.begin();
it != mvf.end(); ++
it ) {
89 for (
auto &ent :
it->second) {
90 strv += Form(
"%f,", ent);
92 strv.Remove(TString::kTrailing,
',');
93 str += Form(
"%-30s :VF: [%s]\n",
it->first.c_str(), strv.Data());
95 std::map<std::string, std::vector<double> > mvd =
valuesVD();
96 for (
auto it = mvd.begin();
it != mvd.end(); ++
it ) {
98 for (
auto &ent :
it->second) {
99 strv += Form(
"%f,", ent);
101 strv.Remove(TString::kTrailing,
',');
102 str += Form(
"%-30s :VD: [%s]\n",
it->first.c_str(), strv.Data());
104 std::map<std::string, std::vector<bool> > mvb =
valuesVB();
105 for (
auto it = mvb.begin();
it != mvb.end(); ++
it ) {
108 for (
auto &&ent :
it->second) {
109 strv += Form(
"%s,", ent ?
"True" :
"False");
111 strv.Remove(TString::kTrailing,
',');
112 str += Form(
"%-30s :VB: [%s]\n",
it->first.c_str(), strv.Data());
114 std::map<std::string, std::vector<std::string> > mvs =
valuesVS();
115 for (
auto it = mvs.begin();
it != mvs.end(); ++
it ) {
117 for (
auto &ent :
it->second) {
118 strv += Form(
"%s,", ent.c_str());;
120 strv.Remove(TString::kTrailing,
',');
121 str += Form(
"%-30s :VS: [%s]\n",
it->first.c_str(), strv.Data());
123 str.Remove(TString::kTrailing,
'\n');
◆ metaObj()
◆ setPrefix()
void xAOD::BPhysMetaDataHelper::setPrefix |
( |
std::string |
prefix | ) |
|
◆ value() [1/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
bool & |
val |
|
) |
| const |
◆ value() [2/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
double & |
val |
|
) |
| const |
◆ value() [3/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
float & |
val |
|
) |
| const |
◆ value() [4/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
int & |
val |
|
) |
| const |
◆ value() [5/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
std::string & |
val |
|
) |
| const |
◆ value() [6/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
std::vector< bool > & |
val |
|
) |
| const |
◆ value() [7/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
std::vector< double > & |
val |
|
) |
| const |
◆ value() [8/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
std::vector< float > & |
val |
|
) |
| const |
◆ value() [9/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
std::vector< int > & |
val |
|
) |
| const |
◆ value() [10/10]
bool xAOD::BPhysMetaDataHelper::value |
( |
const std::string & |
name, |
|
|
std::vector< std::string > & |
val |
|
) |
| const |
◆ valuesB()
std::map<std::string, bool> xAOD::BPhysMetaDataHelper::valuesB |
( |
| ) |
const |
◆ valuesD()
std::map<std::string, double> xAOD::BPhysMetaDataHelper::valuesD |
( |
| ) |
const |
◆ valuesF()
std::map<std::string, float> xAOD::BPhysMetaDataHelper::valuesF |
( |
| ) |
const |
◆ valuesI()
std::map<std::string, int> xAOD::BPhysMetaDataHelper::valuesI |
( |
| ) |
const |
◆ valuesS()
std::map<std::string, std::string> xAOD::BPhysMetaDataHelper::valuesS |
( |
| ) |
const |
◆ valuesVB()
std::map<std::string, std::vector<bool> > xAOD::BPhysMetaDataHelper::valuesVB |
( |
| ) |
const |
◆ valuesVD()
std::map<std::string, std::vector<double> > xAOD::BPhysMetaDataHelper::valuesVD |
( |
| ) |
const |
◆ valuesVF()
std::map<std::string, std::vector<float> > xAOD::BPhysMetaDataHelper::valuesVF |
( |
| ) |
const |
◆ valuesVI()
std::map<std::string, std::vector<int> > xAOD::BPhysMetaDataHelper::valuesVI |
( |
| ) |
const |
◆ valuesVS()
std::map<std::string, std::vector<std::string> > xAOD::BPhysMetaDataHelper::valuesVS |
( |
| ) |
const |
◆ varTypes()
std::map< std::string, const std::type_info * > xAOD::BPhysMetaDataHelper::varTypes |
( |
| ) |
const |
◆ varTypesToString()
TString xAOD::BPhysMetaDataHelper::varTypesToString |
( |
TString |
header = "" | ) |
const |
List of metadata names and types as string.
- Parameters
-
[in] | header | optional header string for table |
- Returns
- TString with list of variable types used by metadata
Definition at line 139 of file BPhysMetaDataHelper.cxx.
143 for (
auto &ent :
m_tmap) {
144 str += Form(
"%-30s : %s\n", ent.first.c_str(),
147 str.Remove(TString::kTrailing,
'\n');
◆ m_fm
◆ m_prefix
std::string xAOD::BPhysMetaDataHelper::m_prefix |
|
protected |
◆ m_tmap
std::map<std::string, const std::type_info*> xAOD::BPhysMetaDataHelper::m_tmap |
|
mutableprotected |
◆ m_tmapOk
bool xAOD::BPhysMetaDataHelper::m_tmapOk |
|
mutableprotected |
The documentation for this class was generated from the following files:
static AuxTypeRegistry & instance()
Return the singleton registry instance.
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Handle mappings between names and auxid_t.
size_t auxid_t
Identifier for a particular aux data item.
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items for this object.
std::string str(const TrigT2MbtsBits_v1 &trigT2MbtsBits)
const double mb
1mb to cm2
A set of aux data identifiers.