5#ifndef JETUNCERTAINTIES_HELPERS_H
6#define JETUNCERTAINTIES_HELPERS_H
14#include "TObjString.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; } }
81 std::vector<T>
vectorize(
const TString&
str,
const TString& sep);
87 TString
findFilePath(
const TString& fileName,
const TString& path =
"",
const TString& calibArea =
"");
90 TFile*
readRootFile(
const TString& fileName,
const TString& path =
"",
const TString& calibArea =
"");
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);
103 std::istringstream iss(
str);
105 return !(iss >> obj).fail();
111 std::string stdstr =
str.Data();
118 std::istringstream iss(
str);
119 return !(iss >> obj).fail();
126 printf(
"Failed to convert object: %s\n",
str.c_str());
133 std::string stdstr =
str.Data();
141 printf(
"ERROR: Failed to convert object: %s\n",
str.Data());
152 TObjArray* tokens =
str.Tokenize(sep);
154 while(TObjString* os=(TObjString*)istr())
174 TObjArray* tokens =
str.Tokenize(sep);
177 while(TObjString* os=(TObjString*)istr())
181 printf(
"ERROR: String \"%s\" is not the requested type\n",os->GetString().Data());
This header defines wrapper classes around SG::AuxElement::Accessor used internally in the Jet EDM.
JetFourMomAccessor is an extension of JetAttributeAccessor::AccessorWrapper<xAOD::JetFourMom_t> Acces...
xAOD::JetFourMom_t operator()(const xAOD::Jet &jet) const
AccessorWrapper(const std::string &n)
void getAttribute(const SG::AuxElement &p, xAOD::JetFourMom_t &v) const
bool isTypeObjFromString(const std::string &str)
bool getTypeObjFromString< TString >(const std::string &str, TString &obj)
void scaleHistoAxes(TH1 *toScale, const double factorX=1, const double factorY=1, const double factorZ=1)
bool fileExists(const TString &fileName)
std::vector< double > getLogBins(const size_t numBins, const double minVal, const double maxVal)
bool getTypeObjFromString(const std::string &str, T &obj)
bool getTypeObjFromString< bool >(const std::string &str, bool &obj)
TFile * readRootFile(const TString &fileName, const TString &path="", const TString &calibArea="")
bool vectorize(const TString &str, const TString &sep, std::vector< T > &result)
bool getTypeObjFromString< std::string >(const std::string &str, std::string &obj)
TString findFilePath(const TString &fileName, const TString &path="", const TString &calibArea="")
std::vector< double > getUniformBins(const size_t numBins, const double minVal, const double maxVal)
Jet_v1 Jet
Definition of the current "jet version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.