|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef JETUNCERTAINTIES_HELPERS_H
6 #define JETUNCERTAINTIES_HELPERS_H
14 #include "TObjString.h"
15 #include "TObjArray.h"
23 #define JESUNC_ERROR_CODE -1234
24 #define JESUNC_NO_DEFAULT_CONSTRUCTOR ATH_MSG_FATAL("Default constructor is not supported");
25 #define JESUNC_SAFE_DELETE(T) { if(T) { delete T; T = NULL; } }
65 bool getTypeObjFromString<std::string>(
const std::string&
str, std::string&
obj);
71 bool getTypeObjFromString<std::string>(
const TString&
str, std::string&
obj);
93 std::vector<double>
getLogBins(
const size_t numBins,
const double minVal,
const double maxVal);
94 std::vector<double>
getUniformBins(
const size_t numBins,
const double minVal,
const double maxVal);
97 void scaleHistoAxes(TH1* toScale,
const double factorX=1,
const double factorY=1,
const double factorZ=1);
100 template <
typename T>
103 std::istringstream iss(
str);
108 template <
typename T>
111 std::string stdstr =
str.Data();
112 return isTypeObjFromString<T>(stdstr);
115 template <
typename T>
118 std::istringstream iss(
str);
121 template <
typename T>
126 printf(
"Failed to convert object: %s\n",
str.c_str());
130 template <
typename T>
133 std::string stdstr =
str.Data();
136 template <
typename T>
141 printf(
"ERROR: Failed to convert object: %s\n",
str.Data());
146 template <
typename T>
154 while(TObjString*
os=(TObjString*)istr())
170 template <
typename T>
177 while(TObjString*
os=(TObjString*)istr())
181 printf(
"ERROR: String \"%s\" is not the requested type\n",
os->GetString().Data());
path
python interpreter configuration --------------------------------------—
std::vector< double > getUniformBins(const size_t numBins, const double minVal, const double maxVal)
std::vector< double > getLogBins(const size_t numBins, const double minVal, const double maxVal)
T getTypeObjFromString(const TString &str)
void getAttribute(const SG::AuxElement &p, xAOD::JetFourMom_t &v) const
xAOD::JetFourMom_t operator()(const xAOD::Jet &jet) const
JetFourMomAccessor is an extension of JetAttributeAccessor::AccessorWrapper<xAOD::JetFourMom_t> Acces...
bool vectorize(const TString &str, const TString &sep, std::vector< T > &result)
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
bool isTypeObjFromString(const std::string &str)
bool fileExists(const TString &fileName)
TString findFilePath(const TString &fileName, const TString &path="", const TString &calibArea="")
void scaleHistoAxes(TH1 *toScale, const double factorX=1, const double factorY=1, const double factorZ=1)
bool getTypeObjFromString< TString >(const std::string &str, TString &obj)
TFile * readRootFile(const TString &fileName, const TString &path="", const TString &calibArea="")
bool getTypeObjFromString(const std::string &str, T &obj)
This header defines wrapper classes around SG::AuxElement::Accessor used internally in the Jet EDM.
bool getTypeObjFromString< bool >(const std::string &str, bool &obj)