ATLAS Offline Software
MCJESInputBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef JETTOOLHELPERS_MCJESINPUTBASE_H
6 #define JETTOOLHELPERS_MCJESINPUTBASE_H
7 
8 
9 #include "TString.h"
10 #include "TEnv.h"
11 
13 #include "AsgTools/AsgTool.h"
15 #include <memory>
16 #include <string>
17 class TAxis;
18 
19 namespace JetHelper {
20 
23 
24 class MCJESInputBase :public asg::AsgTool, virtual public IVarTool
25 {
27 
28  public:
30  MCJESInputBase(const std::string& myname);
32  virtual ~MCJESInputBase() {};
34  std::string getFileName() const { return m_fileName; };
36  Gaudi::Property< std::string > m_corrName { this, "corrName", "JES", "MCJES input" };
37 
38  private:
39  // support functions to extract information from text files
40  double getLogPolN(const double *factors, double x) const;
41  std::vector<double> VectorizeD(const TString& str, TString sep=" ") const;
42  int getEtaBin(double eta_det) const;
44  Gaudi::Property< std::string > m_fileName { this, "inputfile", "/afs/cern.ch/work/s/stapiaar/JetDev4/athena/JetToolHelpers/data/file_JES.config", "File containing histograms" };
46  Gaudi::Property< std::string > m_jetAlgo { this, "jetAlgo", "AntiKt4EMPFlow", "jet collection" };
47 
48  protected:
49  std::unique_ptr<TEnv> m_config;
50  unsigned int m_nPar{}; // number of parameters in config file
51  const static unsigned int s_nEtaBins = 90;
52  const static unsigned int s_nParMax = 9;
56  TAxis * m_etaBinAxis{};
57 
61  double getJES(const double X, const double Y=0, const double Emax=-1) const;
63  double getEtaCorr(const double X, const double Y=0) const;
65  double getEmaxJES(const double Y) const;
66 };
67 } // namespace JetHelper
68 #endif
JetHelper::MCJESInputBase::m_etaCorrFactors
double m_etaCorrFactors[s_nEtaBins][s_nParMax]
Definition: MCJESInputBase.h:54
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
JetHelper::MCJESInputBase::m_config
std::unique_ptr< TEnv > m_config
Definition: MCJESInputBase.h:49
JetHelper::MCJESInputBase::s_nParMax
static const unsigned int s_nParMax
Definition: MCJESInputBase.h:52
JetHelper::MCJESInputBase::m_fileName
Gaudi::Property< std::string > m_fileName
name of the text file
Definition: MCJESInputBase.h:44
JetHelper
class IJetCalibStep
Definition: IInputVariable.h:18
JetHelper::MCJESInputBase::getEtaCorr
double getEtaCorr(const double X, const double Y=0) const
return Eta correction
IVarTool.h
x
#define x
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
JetHelper::MCJESInputBase::getEtaBin
int getEtaBin(double eta_det) const
JetHelper::MCJESInputBase::m_jetAlgo
Gaudi::Property< std::string > m_jetAlgo
jet collection to be calibrated
Definition: MCJESInputBase.h:46
JetHelper::MCJESInputBase::VectorizeD
std::vector< double > VectorizeD(const TString &str, TString sep=" ") const
JetHelper::MCJESInputBase::m_corrName
Gaudi::Property< std::string > m_corrName
This property allow the user to choose the type of correction.
Definition: MCJESInputBase.h:36
JetHelper::IVarTool
Definition: IVarTool.h:23
JetHelper::MCJESInputBase::getJES
double getJES(const double X, const double Y=0, const double Emax=-1) const
return MCJES calibration factor
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
grepfile.sep
sep
Definition: grepfile.py:38
JetHelper::MCJESInputBase::readMCJESFromText
bool readMCJESFromText()
This function fill the ntuples with calibration factors.
JetHelper::MCJESInputBase::m_energyFreezeJES
double m_energyFreezeJES[s_nEtaBins]
Definition: MCJESInputBase.h:55
JetHelper::MCJESInputBase::m_JESFactors
double m_JESFactors[s_nEtaBins][s_nParMax]
Definition: MCJESInputBase.h:53
GlobalVariables.Emax
Emax
Definition: GlobalVariables.py:185
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
JetHelper::MCJESInputBase::m_nPar
unsigned int m_nPar
Definition: MCJESInputBase.h:50
JetHelper::MCJESInputBase::s_nEtaBins
static const unsigned int s_nEtaBins
Definition: MCJESInputBase.h:51
JetHelper::MCJESInputBase
Class MCJESInputBase This class implement common function used by Text file input
Definition: MCJESInputBase.h:25
str
Definition: BTagTrackIpAccessor.cxx:11
JetHelper::MCJESInputBase::~MCJESInputBase
virtual ~MCJESInputBase()
Destructor.
Definition: MCJESInputBase.h:32
JetHelper::MCJESInputBase::getLogPolN
double getLogPolN(const double *factors, double x) const
JetHelper::MCJESInputBase::getEmaxJES
double getEmaxJES(const double Y) const
return Emax
AsgTool.h
JetHelper::MCJESInputBase::getFileName
std::string getFileName() const
This function return the name of the file with the MCJES factors.
Definition: MCJESInputBase.h:34
JetHelper::MCJESInputBase::MCJESInputBase
MCJESInputBase(const std::string &myname)
Constructor for standalone usage.
JetHelper::MCJESInputBase::m_etaBinAxis
TAxis * m_etaBinAxis
Definition: MCJESInputBase.h:56