ATLAS Offline Software
CaloLCCoeffHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef CALOUTILS_CALOLCCOEFFHELPER_H
6 #define CALOUTILS_CALOLCCOEFFHELPER_H
7 
8 #include <fstream>
9 #include <string>
10 #include <optional>
13 
14 
16  public:
17 
19  virtual ~CaloLCCoeffHelper();
20 
21  static std::optional<CaloLocalHadCoeff> InitDataFromFile(const char *fname);
22  static void PrintData(CaloLocalHadCoeff *m_data, std::ostream &fout);
23  static void PrintData(CaloLocalHadCoeff *m_data, const char *fname);
24 
25  static const CaloLocalHadCoeff::LocalHadArea * getAreaFromName(const CaloLocalHadCoeff * m_coeff, const std::string& sname, int &m_indx) ;
26 
27  // Interpolate m_data, n_area in phase space point x, over dimensions dim (all if 0)
28  // return in pars
29  static bool Interpolate(const CaloLocalHadCoeff *m_data, const unsigned int n_area, std::vector<float> &x,
30  CaloLocalHadCoeff::LocalHadCoeff &pars, const std::vector<int> &dim, double xfit=0.);
31 
32  static CaloLocalHadDefs::LocalHadDimensionId getDimensionId(const std::string& dimensionName)
33  {
34  if(dimensionName == "DIMC_SIDE") {
36  }else if(dimensionName == "DIMC_ETA") {
38  }else if(dimensionName == "DIMC_PHI") {
40  }else if(dimensionName == "DIMC_ENER") {
42  }else if(dimensionName == "DIMC_EDENS") {
44  }else if(dimensionName == "DIMC_LAMBDA") {
46 
47  }else if(dimensionName == "DIMW_SIDE") {
49  }else if(dimensionName == "DIMW_ETA") {
51  }else if(dimensionName == "DIMW_PHI") {
53  }else if(dimensionName == "DIMW_ENER") {
55  }else if(dimensionName == "DIMW_EDENS") {
57 
58  }else if(dimensionName == "DIMO_SIDE") {
60  }else if(dimensionName == "DIMO_PHI") {
62  }else if(dimensionName == "DIMO_ENER") {
64  }else if(dimensionName == "DIMO_ETA") {
66  }else if(dimensionName == "DIMO_LAMBDA") {
68 
69  }else if(dimensionName == "DIMD_EMFRAC") {
71  }else if(dimensionName == "DIMD_SIDE") {
73  }else if(dimensionName == "DIMD_ETA") {
75  }else if(dimensionName == "DIMD_PHI") {
77  }else if(dimensionName == "DIMD_ENER") {
79  }else if(dimensionName == "DIMD_LAMBDA") {
81 
82  }else{
83  //std::cout << " CaloUtils/CaloLocalHadCoeffHelper/getDimensionId() -> Error! Unknown dimension '" << dimensionName << "'" << std::endl;
85  }
86  }
87 
88  private:
89  static std::optional<CaloLocalHadCoeff::LocalHadDimension> parse_dim(const std::string &sLine);
90 
91 };
92 
93 
94 
95 #endif
CaloLocalHadDefs::DIMC_ENER
@ DIMC_ENER
Definition: CaloLocalHadDefs.h:50
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
CaloLocalHadDefs::DIMO_LAMBDA
@ DIMO_LAMBDA
Definition: CaloLocalHadDefs.h:64
CaloLocalHadDefs::DIMC_LAMBDA
@ DIMC_LAMBDA
Definition: CaloLocalHadDefs.h:52
CaloLCCoeffHelper::getAreaFromName
static const CaloLocalHadCoeff::LocalHadArea * getAreaFromName(const CaloLocalHadCoeff *m_coeff, const std::string &sname, int &m_indx)
Definition: CaloLCCoeffHelper.cxx:39
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
CaloLocalHadDefs::DIMD_ETA
@ DIMD_ETA
Definition: CaloLocalHadDefs.h:68
CaloLocalHadDefs.h
CaloLocalHadDefs::DIMD_EMFRAC
@ DIMD_EMFRAC
Definition: CaloLocalHadDefs.h:66
m_data
std::vector< T > m_data
Definition: TrackTruthMatchingBaseAlg.cxx:660
CaloLocalHadDefs::DIMO_PHI
@ DIMO_PHI
Definition: CaloLocalHadDefs.h:61
CaloLocalHadDefs::DIMU_UNKNOWN
@ DIMU_UNKNOWN
Definition: CaloLocalHadDefs.h:73
CaloLCCoeffHelper::getDimensionId
static CaloLocalHadDefs::LocalHadDimensionId getDimensionId(const std::string &dimensionName)
Definition: CaloLCCoeffHelper.h:32
CaloLCCoeffHelper::InitDataFromFile
static std::optional< CaloLocalHadCoeff > InitDataFromFile(const char *fname)
Definition: CaloLCCoeffHelper.cxx:56
CaloLCCoeffHelper::~CaloLCCoeffHelper
virtual ~CaloLCCoeffHelper()
CaloLocalHadDefs::DIMW_EDENS
@ DIMW_EDENS
Definition: CaloLocalHadDefs.h:58
x
#define x
CaloLocalHadDefs::DIMW_SIDE
@ DIMW_SIDE
Definition: CaloLocalHadDefs.h:54
CaloLocalHadDefs::LocalHadDimensionId
LocalHadDimensionId
enums to identify user dimensions id number DIMC_* - classification, DIMW_*-weighting,...
Definition: CaloLocalHadDefs.h:45
CaloLocalHadDefs::DIMC_PHI
@ DIMC_PHI
Definition: CaloLocalHadDefs.h:49
CaloLocalHadCoeff::LocalHadCoeff
std::vector< float > LocalHadCoeff
Correction parameters for one general bin.
Definition: CaloLocalHadCoeff.h:220
CaloLocalHadDefs::DIMO_SIDE
@ DIMO_SIDE
Definition: CaloLocalHadDefs.h:60
CaloLocalHadDefs::DIMC_EDENS
@ DIMC_EDENS
Definition: CaloLocalHadDefs.h:51
CaloLocalHadDefs::DIMO_ENER
@ DIMO_ENER
Definition: CaloLocalHadDefs.h:62
dqt_zlumi_alleff_HIST.fout
fout
Definition: dqt_zlumi_alleff_HIST.py:59
CaloLocalHadDefs::DIMO_ETA
@ DIMO_ETA
Definition: CaloLocalHadDefs.h:63
CaloLocalHadCoeff
Hold binned correction data for local hadronic calibration procedure.
Definition: CaloLocalHadCoeff.h:41
CaloLCCoeffHelper::CaloLCCoeffHelper
CaloLCCoeffHelper()
CaloLCCoeffHelper
Definition: CaloLCCoeffHelper.h:15
CaloLocalHadDefs::DIMD_ENER
@ DIMD_ENER
Definition: CaloLocalHadDefs.h:70
CaloLCCoeffHelper::Interpolate
static bool Interpolate(const CaloLocalHadCoeff *m_data, const unsigned int n_area, std::vector< float > &x, CaloLocalHadCoeff::LocalHadCoeff &pars, const std::vector< int > &dim, double xfit=0.)
Definition: CaloLCCoeffHelper.cxx:230
CaloLocalHadDefs::DIMC_SIDE
@ DIMC_SIDE
Definition: CaloLocalHadDefs.h:47
CaloLocalHadDefs::DIMW_ETA
@ DIMW_ETA
Definition: CaloLocalHadDefs.h:55
CaloLocalHadDefs::DIMC_ETA
@ DIMC_ETA
Definition: CaloLocalHadDefs.h:48
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
CaloLocalHadCoeff.h
CaloLocalHadDefs::DIMD_PHI
@ DIMD_PHI
Definition: CaloLocalHadDefs.h:69
CaloLocalHadDefs::DIMW_ENER
@ DIMW_ENER
Definition: CaloLocalHadDefs.h:57
CaloLocalHadCoeff::LocalHadArea
Definition of correction area.
Definition: CaloLocalHadCoeff.h:145
CaloLocalHadDefs::DIMD_SIDE
@ DIMD_SIDE
Definition: CaloLocalHadDefs.h:67
CaloLCCoeffHelper::parse_dim
static std::optional< CaloLocalHadCoeff::LocalHadDimension > parse_dim(const std::string &sLine)
Definition: CaloLCCoeffHelper.cxx:341
CaloLocalHadDefs::DIMD_LAMBDA
@ DIMD_LAMBDA
Definition: CaloLocalHadDefs.h:71
CaloLocalHadDefs::DIMW_PHI
@ DIMW_PHI
Definition: CaloLocalHadDefs.h:56
CaloLCCoeffHelper::PrintData
static void PrintData(CaloLocalHadCoeff *m_data, std::ostream &fout)
Definition: CaloLCCoeffHelper.cxx:162