ATLAS Offline Software
BPhysMetaDataHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //
33 #ifndef XAOD_BPHYSMETADATAHELPER_H
34 #define XAOD_BPHYSMETADATAHELPER_H
35 
36 // System include(s):
37 #include <assert.h>
38 #include <map>
39 #include <iosfwd>
40 #include <vector>
41 
42 // ROOT include(s):
43 #include "TString.h"
44 
45 // EDM include(s):
47 
49 namespace xAOD {
50 
59 
60  public:
61 
71 
77  const xAOD::FileMetaData* metaObj() const;
78 
80  void setPrefix(std::string prefix);
81 
83  std::map<std::string, const std::type_info*> varTypes() const;
84 
90  TString varTypesToString(TString header="") const;
91 
98  TString metaDataToString(TString header="") const;
99 
110  bool value(const std::string& name, int& val) const;
111  bool value(const std::string& name, float& val) const;
112  bool value(const std::string& name, double& val) const;
113  bool value(const std::string& name, bool& val) const;
114  bool value(const std::string& name, std::string& val) const;
115  bool value(const std::string& name, std::vector<int>& val) const;
116  bool value(const std::string& name, std::vector<float>& val) const;
117  bool value(const std::string& name, std::vector<double>& val) const;
118  bool value(const std::string& name, std::vector<bool>& val) const;
119  bool value(const std::string& name, std::vector<std::string>& val) const;
121 
126  std::map<std::string, int> valuesI() const;
127  std::map<std::string, float> valuesF() const;
128  std::map<std::string, double> valuesD() const;
129  std::map<std::string, bool> valuesB() const;
130  std::map<std::string, std::string> valuesS() const;
131  std::map<std::string, std::vector<int> > valuesVI() const;
132  std::map<std::string, std::vector<float> > valuesVF() const;
133  std::map<std::string, std::vector<double> > valuesVD() const;
134  std::map<std::string, std::vector<bool> > valuesVB() const;
135  std::map<std::string, std::vector<std::string> > valuesVS() const;
137 
138  protected:
140  void cacheVarTypes() const;
141 
142  protected:
145 
147  std::string m_prefix;
148 
151 
153  mutable std::map<std::string, const std::type_info*> m_tmap;
155  mutable bool m_tmapOk;
156 
158 
159  }; // BPhysMetaDataHelper
160 
161 } // namespace xAOD
162 
163 #endif // XAOD_BPHYSMETADATAHELPER_H
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, std::vector< bool > &val) const
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, std::vector< float > &val) const
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, std::vector< std::string > &val) const
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
xAOD::BPhysMetaDataHelper::valuesVS
std::map< std::string, std::vector< std::string > > valuesVS() const
xAOD::BPhysMetaDataHelper::m_fm
const xAOD::FileMetaData * m_fm
FileMetaData object pointer.
Definition: BPhysMetaDataHelper.h:144
header
Definition: hcg.cxx:526
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, float &val) const
xAOD::BPhysMetaDataHelper::m_prefix
std::string m_prefix
Prefix for variable names.
Definition: BPhysMetaDataHelper.h:147
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, double &val) const
xAOD::BPhysMetaDataHelper::valuesS
std::map< std::string, std::string > valuesS() const
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::BPhysMetaDataHelper::valuesVB
std::map< std::string, std::vector< bool > > valuesVB() const
xAOD::BPhysMetaDataHelper
Helper class providing easy access to FileMetaData object holding file-level metadata about an xAOD f...
Definition: BPhysMetaDataHelper.h:58
xAOD::BPhysMetaDataHelper::valuesVD
std::map< std::string, std::vector< double > > valuesVD() const
xAOD::ATLAS_NOT_THREAD_SAFE
void ErrorHandler ATLAS_NOT_THREAD_SAFE(Int_t level, Bool_t abort, const char *location, const char *message)
Function filtering the warnings coming from ROOT.
Definition: Init.cxx:105
xAOD::BPhysMetaDataHelper::valuesF
std::map< std::string, float > valuesF() const
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, bool &val) const
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, int &val) const
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, std::vector< int > &val) const
xAOD::FileMetaData_v1
Class holding file-level metadata about an xAOD file.
Definition: FileMetaData_v1.h:34
xAOD::BPhysMetaDataHelper::valuesI
std::map< std::string, int > valuesI() const
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, std::string &val) const
xAOD::BPhysMetaDataHelper::m_tmap
std::map< std::string, const std::type_info * > m_tmap
map of metadata names and variable types
Definition: BPhysMetaDataHelper.h:153
xAOD::BPhysMetaDataHelper::value
bool value(const std::string &name, std::vector< double > &val) const
xAOD::BPhysMetaDataHelper::valuesVF
std::map< std::string, std::vector< float > > valuesVF() const
FileMetaData.h
xAOD::BPhysMetaDataHelper::m_tmapOk
bool m_tmapOk
flag indicating an up-to-date cache
Definition: BPhysMetaDataHelper.h:155
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
xAOD::BPhysMetaDataHelper::valuesVI
std::map< std::string, std::vector< int > > valuesVI() const
xAOD::BPhysMetaDataHelper::valuesB
std::map< std::string, bool > valuesB() const
xAOD::BPhysMetaDataHelper::valuesD
std::map< std::string, double > valuesD() const