ATLAS Offline Software
PtEndcapLUT.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGL2MUONSA_PTENDCAPLUT_H
6 #define TRIGL2MUONSA_PTENDCAPLUT_H
7 
9 
10 #include "GaudiKernel/Service.h"
11 #include "GaudiKernel/IInterface.h"
12 
13 #include <map>
14 #include <cstring>
15 #define ETAS1 5
16 #define PHIS1 6
17 #define PTS1 3
18 
19 namespace TrigL2MuonSA {
20 
21 class PtEndcapLUT: public AthAlgTool
22 {
23  public:
25 
26  public:
27 
28  PtEndcapLUT(const std::string& type,
29  const std::string& name,
30  const IInterface* parent);
31  ~PtEndcapLUT(void);
32 
33  StatusCode readLUT(const std::string& lut_fileName);
34  StatusCode readLUTSigmaMean(const std::string& lut_mean, const std::string& lut_sigma);
35 
36  double alpha(double z1, double r1, double z2, double r2) const;
37  double radius(double z1, double r1, double s1, double z2, double r2, double s2, double deltar) const;
38  double lookup(int side, int charge, DataType type, int iEta, int iPhi, double value) const;
39  double ptcombined(int iEta, int iPhi, double ApT, double BpT, double &CApT, double &CBpT) const;
40 private:
41  double m_meana[ETAS1][PHIS1][PTS1]{};
42  double m_meanb[ETAS1][PHIS1][PTS1]{};
43  double m_meanc[ETAS1][PHIS1][PTS1]{};
44  double m_sigmaa[ETAS1][PHIS1][PTS1]{};
45  double m_sigmab[ETAS1][PHIS1][PTS1]{};
46  double m_sigmac[ETAS1][PHIS1][PTS1]{};
47 
48  enum sizes { ETAS = 30, PHIS = 12, PHISEE = 192};
49 
50  struct KeyType
51  {
52  int m_side;
53  int m_charge;
57  bool operator<(const KeyType& other) const;
58  std::string toString() const;
59  };
60 
61  struct TableType
62  {
63  double m_xcepts[ETAS][PHISEE];
64  double m_slopes[ETAS][PHISEE];
66  {
67  memset(m_xcepts, 0, sizeof(m_xcepts));
68  memset(m_slopes, 0, sizeof(m_slopes));
69  }
70  };
71 
72  typedef std::map<KeyType, TableType*> TableMap;
73 
74  static DataType s2dt(const char* type);
75  static const char* dt2s(DataType type);
76 
78 
79 };
80 
81 }
82 
83 #endif
TrigL2MuonSA::PtEndcapLUT::KeyType::operator<
bool operator<(const KeyType &other) const
Definition: PtEndcapLUT.cxx:35
TrigL2MuonSA::PtEndcapLUT::KeyType::m_side
int m_side
0 = -, 1 = +
Definition: PtEndcapLUT.h:52
TrigL2MuonSA::PtEndcapLUT::m_meanc
double m_meanc[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:43
TrigL2MuonSA::PtEndcapLUT::TableType
Definition: PtEndcapLUT.h:62
ETAS1
#define ETAS1
Definition: PtEndcapLUT.h:15
TrigL2MuonSA::PtEndcapLUT::m_meanb
double m_meanb[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:42
TrigL2MuonSA::PtEndcapLUT::INVRADIUSPOL2
@ INVRADIUSPOL2
Definition: PtEndcapLUT.h:24
TrigL2MuonSA::PtEndcapLUT::radius
double radius(double z1, double r1, double s1, double z2, double r2, double s2, double deltar) const
Definition: PtEndcapLUT.cxx:139
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
TrigL2MuonSA::PtEndcapLUT::lookup
double lookup(int side, int charge, DataType type, int iEta, int iPhi, double value) const
Definition: PtEndcapLUT.cxx:180
TrigL2MuonSA::PtEndcapLUT::PHIS
@ PHIS
Definition: PtEndcapLUT.h:48
TrigL2MuonSA::PtEndcapLUT::KeyType::toString
std::string toString() const
Definition: PtEndcapLUT.cxx:49
athena.value
value
Definition: athena.py:124
TrigL2MuonSA::PtEndcapLUT::KeyType::KeyType
KeyType(int side, int charge, DataType type)
Definition: PtEndcapLUT.h:55
TrigL2MuonSA::PtEndcapLUT::KeyType
Definition: PtEndcapLUT.h:51
TrigL2MuonSA::PtEndcapLUT::sizes
sizes
Definition: PtEndcapLUT.h:48
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TrigL2MuonSA::PtEndcapLUT::m_sigmac
double m_sigmac[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:46
TrigL2MuonSA::PtEndcapLUT::TableMap
std::map< KeyType, TableType * > TableMap
Definition: PtEndcapLUT.h:72
TrigL2MuonSA::PtEndcapLUT::~PtEndcapLUT
~PtEndcapLUT(void)
Definition: PtEndcapLUT.cxx:25
TrigL2MuonSA::PtEndcapLUT::KeyType::m_charge
int m_charge
0 = -, 1 = +
Definition: PtEndcapLUT.h:53
TrigL2MuonSA::PtEndcapLUT::CSCPOL2
@ CSCPOL2
Definition: PtEndcapLUT.h:24
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigL2MuonSA::PtEndcapLUT::m_sigmaa
double m_sigmaa[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:44
TrigL2MuonSA::PtEndcapLUT::readLUTSigmaMean
StatusCode readLUTSigmaMean(const std::string &lut_mean, const std::string &lut_sigma)
Definition: PtEndcapLUT.cxx:385
AthAlgTool.h
TrigL2MuonSA::PtEndcapLUT::readLUT
StatusCode readLUT(const std::string &lut_fileName)
Definition: PtEndcapLUT.cxx:59
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigL2MuonSA::PtEndcapLUT::ALPHAPOL2
@ ALPHAPOL2
Definition: PtEndcapLUT.h:24
TrigL2MuonSA::PtEndcapLUT::s2dt
static DataType s2dt(const char *type)
Definition: PtEndcapLUT.cxx:266
TrigL2MuonSA::PtEndcapLUT::PtEndcapLUT
PtEndcapLUT(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PtEndcapLUT.cxx:15
TrigL2MuonSA::PtEndcapLUT::DataType
DataType
Definition: PtEndcapLUT.h:24
TrigL2MuonSA::PtEndcapLUT
Definition: PtEndcapLUT.h:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigL2MuonSA::PtEndcapLUT::ETAS
@ ETAS
Definition: PtEndcapLUT.h:48
charge
double charge(const T &p)
Definition: AtlasPID.h:756
TrigL2MuonSA::PtEndcapLUT::m_tables
TableMap m_tables
Definition: PtEndcapLUT.h:77
TrigL2MuonSA::PtEndcapLUT::TGCALPHAPOL2
@ TGCALPHAPOL2
Definition: PtEndcapLUT.h:24
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
TrigL2MuonSA::PtEndcapLUT::m_meana
double m_meana[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:41
PHIS1
#define PHIS1
Definition: PtEndcapLUT.h:16
PTS1
#define PTS1
Definition: PtEndcapLUT.h:17
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TrigL2MuonSA::PtEndcapLUT::alpha
double alpha(double z1, double r1, double z2, double r2) const
Definition: PtEndcapLUT.cxx:123
TrigL2MuonSA::PtEndcapLUT::TableType::m_slopes
double m_slopes[ETAS][PHISEE]
Definition: PtEndcapLUT.h:64
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
TrigL2MuonSA::PtEndcapLUT::BETAPOL2
@ BETAPOL2
Definition: PtEndcapLUT.h:24
TrigL2MuonSA::PtEndcapLUT::KeyType::m_type
DataType m_type
Definition: PtEndcapLUT.h:54
AthAlgTool
Definition: AthAlgTool.h:26
TrigL2MuonSA::PtEndcapLUT::INVALID
@ INVALID
Definition: PtEndcapLUT.h:24
TrigL2MuonSA::PtEndcapLUT::ptcombined
double ptcombined(int iEta, int iPhi, double ApT, double BpT, double &CApT, double &CBpT) const
Definition: PtEndcapLUT.cxx:310
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:77
TrigL2MuonSA::PtEndcapLUT::m_sigmab
double m_sigmab[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:45
TrigL2MuonSA::PtEndcapLUT::dt2s
static const char * dt2s(DataType type)
Definition: PtEndcapLUT.cxx:280
TrigL2MuonSA::PtEndcapLUT::TableType::TableType
TableType()
Definition: PtEndcapLUT.h:65
TrigL2MuonSA::PtEndcapLUT::TableType::m_xcepts
double m_xcepts[ETAS][PHISEE]
Definition: PtEndcapLUT.h:63
TrigL2MuonSA
Definition: AlignmentBarrelLUT.h:13
TrigL2MuonSA::PtEndcapLUT::PHISEE
@ PHISEE
Definition: PtEndcapLUT.h:48