ATLAS Offline Software
TFCSLateralShapeParametrizationHitBase.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 TFCSLateralShapeParametrizationHitBase_h
6 #define TFCSLateralShapeParametrizationHitBase_h
7 
9 
10 class CaloGeometry;
11 
14 public:
15  TFCSLateralShapeParametrizationHitBase(const char *name = nullptr,
16  const char *title = nullptr);
17 
21  virtual double
23  const TFCSTruthState *truth,
24  const TFCSExtrapolationState *extrapol) const;
25 
29  virtual int get_number_of_hits(TFCSSimulationState &simulstate,
30  const TFCSTruthState *truth,
31  const TFCSExtrapolationState *extrapol) const;
32 
34  virtual float get_E_hit(TFCSSimulationState &simulstate,
35  const TFCSTruthState *truth,
36  const TFCSExtrapolationState *extrapol) const;
37 
39  virtual float getMinWeight() const;
40  virtual float getMaxWeight() const;
41 
42  class Hit {
43  public:
44  Hit()
45  : m_eta_x(0.), m_phi_y(0.), m_z(0.), m_E(0.), m_useXYZ(false),
46  m_center_r(0.), m_center_z(0.), m_center_eta(0.),
47  m_center_phi(0.){}; // for hits with the same energy, m_E should
48  // normalized to E(layer)/nhit
49  Hit(float eta, float phi, float E)
50  : m_eta_x(eta), m_phi_y(phi), m_z(0.), m_E(E), m_useXYZ(false), m_center_r(0.),
51  m_center_z(0.), m_center_eta(0.), m_center_phi(0.){};
52  Hit(float x, float y, float z, float E)
53  : m_eta_x(x), m_phi_y(y), m_z(z), m_E(E), m_useXYZ(true),
54  m_center_r(0.), m_center_z(0.), m_center_eta(0.), m_center_phi(0.){};
55 
56  inline void setEtaPhiZE(float eta, float phi, float z, float E) {
57  m_eta_x = eta;
58  m_phi_y = phi;
59  m_z = z;
60  m_E = E;
61  m_useXYZ = false;
62  }
63  inline void setXYZE(float x, float y, float z, float E) {
64  m_eta_x = x;
65  m_phi_y = y;
66  m_z = z;
67  m_E = E;
68  m_useXYZ = true;
69  }
70 
71  inline void reset_center() {
72  m_center_r = 0;
73  m_center_z = 0;
74  m_center_eta = 0;
75  m_center_phi = 0;
76  }
77 
78  inline void reset() {
79  m_eta_x = 0.;
80  m_phi_y = 0.;
81  m_z = 0.;
82  m_E = 0.;
83  m_useXYZ = false;
84  }
85 
86  inline float &eta() { return m_eta_x; };
87  inline float &phi() { return m_phi_y; };
88  inline float &x() { return m_eta_x; };
89  inline float &y() { return m_phi_y; };
90  inline float &E() { return m_E; };
91  inline float &z() { return m_z; }
92  inline float r() {
93  if (m_useXYZ)
94  return sqrt(m_eta_x * m_eta_x + m_phi_y * m_phi_y);
95  else
96  return m_z / sinh(m_eta_x);
97  }
98  inline float &center_r() { return m_center_r; }
99  inline float &center_z() { return m_center_z; }
100  inline float &center_eta() { return m_center_eta; }
101  inline float &center_phi() { return m_center_phi; }
102  inline void setCenter_r(float r) { m_center_r = r; }
103  inline void setCenter_z(float z) { m_center_z = z; }
104  inline void setCenter_eta(float eta) { m_center_eta = eta; }
105  inline void setCenter_phi(float phi) { m_center_phi = phi; }
106 
107  private:
108  float m_eta_x; // eta for barrel and end-cap, x for FCal
109  float m_phi_y; // phi for barrel and end-cap, y for FCal
110  float m_z;
111  float m_E;
112  bool m_useXYZ;
113  // Variables used to store extrapolated position
114  float m_center_r;
115  float m_center_z;
118  };
119 
124  virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate,
125  const TFCSTruthState *truth,
127 
128 private:
130  1) // TFCSLateralShapeParametrizationHitBase
131 };
132 
133 #endif
TFCSLateralShapeParametrizationHitBase::Hit::setCenter_phi
void setCenter_phi(float phi)
Definition: TFCSLateralShapeParametrizationHitBase.h:105
FCSReturnCode
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
Definition: TFCSParametrizationBase.h:41
TFCSLateralShapeParametrizationHitBase::simulate_hit
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol)
simulated one hit position with some energy.
Definition: TFCSLateralShapeParametrizationHitBase.cxx:50
TFCSLateralShapeParametrizationHitBase::Hit::reset_center
void reset_center()
Definition: TFCSLateralShapeParametrizationHitBase.h:71
TFCSLateralShapeParametrizationHitBase::Hit::x
float & x()
Definition: TFCSLateralShapeParametrizationHitBase.h:88
TFCSLateralShapeParametrizationHitBase::Hit::setXYZE
void setXYZE(float x, float y, float z, float E)
Definition: TFCSLateralShapeParametrizationHitBase.h:63
TFCSLateralShapeParametrizationHitBase::Hit::phi
float & phi()
Definition: TFCSLateralShapeParametrizationHitBase.h:87
TFCSLateralShapeParametrizationHitBase::Hit::m_center_r
float m_center_r
Definition: TFCSLateralShapeParametrizationHitBase.h:114
TFCSLateralShapeParametrizationHitBase::Hit::y
float & y()
Definition: TFCSLateralShapeParametrizationHitBase.h:89
TFCSLateralShapeParametrizationHitBase::get_E_hit
virtual float get_E_hit(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
Get hit energy from layer energy and number of hits.
Definition: TFCSLateralShapeParametrizationHitBase.cxx:31
TFCSLateralShapeParametrizationHitBase::Hit::reset
void reset()
Definition: TFCSLateralShapeParametrizationHitBase.h:78
TFCSLateralShapeParametrizationHitBase::Hit::m_E
float m_E
Definition: TFCSLateralShapeParametrizationHitBase.h:111
TFCSExtrapolationState
Definition: TFCSExtrapolationState.h:13
TFCSLateralShapeParametrizationHitBase::Hit::setCenter_z
void setCenter_z(float z)
Definition: TFCSLateralShapeParametrizationHitBase.h:103
TFCSLateralShapeParametrizationHitBase::Hit
Definition: TFCSLateralShapeParametrizationHitBase.h:42
RunActsMaterialValidation.extrapol
extrapol
Definition: RunActsMaterialValidation.py:91
TFCSLateralShapeParametrizationHitBase::Hit::center_phi
float & center_phi()
Definition: TFCSLateralShapeParametrizationHitBase.h:101
TFCSLateralShapeParametrizationHitBase::get_sigma2_fluctuation
virtual double get_sigma2_fluctuation(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
Give the effective size sigma^2 of the fluctuations that should be generated by the amount of generat...
Definition: TFCSLateralShapeParametrizationHitBase.cxx:19
TFCSLateralShapeParametrizationHitBase::Hit::Hit
Hit(float x, float y, float z, float E)
Definition: TFCSLateralShapeParametrizationHitBase.h:52
TFCSLateralShapeParametrizationHitBase
Definition: TFCSLateralShapeParametrizationHitBase.h:13
CaloGeometry
Definition: CaloGeometry.h:27
TFCSLateralShapeParametrizationHitBase::Hit::setCenter_eta
void setCenter_eta(float eta)
Definition: TFCSLateralShapeParametrizationHitBase.h:104
TFCSLateralShapeParametrizationHitBase::Hit::E
float & E()
Definition: TFCSLateralShapeParametrizationHitBase.h:90
TFCSLateralShapeParametrizationHitBase::Hit::Hit
Hit()
Definition: TFCSLateralShapeParametrizationHitBase.h:44
TFCSLateralShapeParametrizationHitBase::Hit::m_z
float m_z
Definition: TFCSLateralShapeParametrizationHitBase.h:110
TFCSLateralShapeParametrizationHitBase::Hit::Hit
Hit(float eta, float phi, float E)
Definition: TFCSLateralShapeParametrizationHitBase.h:49
covarianceTool.title
title
Definition: covarianceTool.py:542
TFCSLateralShapeParametrizationHitBase::Hit::center_z
float & center_z()
Definition: TFCSLateralShapeParametrizationHitBase.h:99
TFCSLateralShapeParametrizationHitBase::Hit::m_phi_y
float m_phi_y
Definition: TFCSLateralShapeParametrizationHitBase.h:109
TFCSLateralShapeParametrization.h
TFCSLateralShapeParametrizationHitBase::Hit::m_center_phi
float m_center_phi
Definition: TFCSLateralShapeParametrizationHitBase.h:117
TFCSLateralShapeParametrizationHitBase::getMinWeight
virtual float getMinWeight() const
Get minimum and maximum value of weight for hit energy reweighting.
Definition: TFCSLateralShapeParametrizationHitBase.cxx:42
TFCSLateralShapeParametrizationHitBase::TFCSLateralShapeParametrizationHitBase
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)
Definition: TFCSLateralShapeParametrizationHitBase.cxx:15
TFCSLateralShapeParametrizationHitBase::Hit::m_useXYZ
bool m_useXYZ
Definition: TFCSLateralShapeParametrizationHitBase.h:112
TFCSLateralShapeParametrizationHitBase::get_number_of_hits
virtual int get_number_of_hits(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
Call get_number_of_hits() only once per shower simulation, as it could be calculated with random numb...
Definition: TFCSLateralShapeParametrizationHitBase.cxx:25
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TFCSLateralShapeParametrizationHitBase::Hit::z
float & z()
Definition: TFCSLateralShapeParametrizationHitBase.h:91
TFCSLateralShapeParametrizationHitBase::Hit::m_center_eta
float m_center_eta
Definition: TFCSLateralShapeParametrizationHitBase.h:116
TFCSLateralShapeParametrizationHitBase::Hit::m_eta_x
float m_eta_x
Definition: TFCSLateralShapeParametrizationHitBase.h:108
TFCSLateralShapeParametrizationHitBase::Hit::r
float r()
Definition: TFCSLateralShapeParametrizationHitBase.h:92
TFCSLateralShapeParametrizationHitBase::Hit::center_eta
float & center_eta()
Definition: TFCSLateralShapeParametrizationHitBase.h:100
TFCSLateralShapeParametrizationHitBase::Hit::center_r
float & center_r()
Definition: TFCSLateralShapeParametrizationHitBase.h:98
TFCSLateralShapeParametrizationHitBase::Hit::eta
float & eta()
Definition: TFCSLateralShapeParametrizationHitBase.h:86
TFCSLateralShapeParametrizationHitBase::getMaxWeight
virtual float getMaxWeight() const
Definition: TFCSLateralShapeParametrizationHitBase.cxx:46
TFCSLateralShapeParametrizationHitBase::Hit::setEtaPhiZE
void setEtaPhiZE(float eta, float phi, float z, float E)
Definition: TFCSLateralShapeParametrizationHitBase.h:56
TFCSLateralShapeParametrization
Definition: TFCSLateralShapeParametrization.h:10
TFCSLateralShapeParametrizationHitBase::Hit::setCenter_r
void setCenter_r(float r)
Definition: TFCSLateralShapeParametrizationHitBase.h:102
TFCSTruthState
Definition: TFCSTruthState.h:13
TFCSSimulationState
Definition: TFCSSimulationState.h:32
TFCSLateralShapeParametrizationHitBase::Hit::m_center_z
float m_center_z
Definition: TFCSLateralShapeParametrizationHitBase.h:115