ATLAS Offline Software
Loading...
Searching...
No Matches
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
10class CaloGeometry;
11
14public:
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:
45 : m_eta_x(0.), m_phi_y(0.), m_z(0.), m_E(0.), m_useXYZ(false),
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),
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 long unsigned int &idx() { return m_hit_index; };
93 inline float r() {
94 if (m_useXYZ)
95 return sqrt(m_eta_x * m_eta_x + m_phi_y * m_phi_y);
96 else
97 return m_z / sinh(m_eta_x);
98 }
99 inline float &center_r() { return m_center_r; }
100 inline float &center_z() { return m_center_z; }
101 inline float &center_eta() { return m_center_eta; }
102 inline float &center_phi() { return m_center_phi; }
103 inline void setCenter_r(float r) { m_center_r = r; }
104 inline void setCenter_z(float z) { m_center_z = z; }
105 inline void setCenter_eta(float eta) { m_center_eta = eta; }
106 inline void setCenter_phi(float phi) { m_center_phi = phi; }
107
108 private:
109 float m_eta_x; // eta for barrel and end-cap, x for FCal
110 float m_phi_y; // phi for barrel and end-cap, y for FCal
111 float m_z;
112 float m_E;
113 long unsigned int m_hit_index{};
115 // Variables used to store extrapolated position
120 };
121
126 virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate,
127 const TFCSTruthState *truth,
128 const TFCSExtrapolationState *extrapol);
129
130private:
132 1) // TFCSLateralShapeParametrizationHitBase
133};
134
135#endif
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
void setEtaPhiZE(float eta, float phi, float z, float E)
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...
virtual float get_E_hit(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const
Get hit energy from layer energy and number of hits.
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...
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)
virtual float getMinWeight() const
Get minimum and maximum value of weight for hit energy reweighting.
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol)
simulated one hit position with some energy.
TFCSLateralShapeParametrization(const char *name=nullptr, const char *title=nullptr)