ATLAS Offline Software
Loading...
Searching...
No Matches
TFCSHistoLateralShapeParametrization.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TFCSHistoLateralShapeParametrization_h
6#define TFCSHistoLateralShapeParametrization_h
7
11#ifdef USE_GPU
14#endif
15
16class TH2;
17class ICaloGeometry;
18
21public:
22 TFCSHistoLateralShapeParametrization(const char *name = nullptr,
23 const char *title = nullptr);
25
29 BIT(15)
30 };
31
34 virtual void set_geometry(ICaloGeometry *geo) override;
35
36 bool is_phi_symmetric() const { return TestBit(k_phi_symmetric); };
37 virtual void set_phi_symmetric() { SetBit(k_phi_symmetric); };
38 virtual void reset_phi_symmetric() { ResetBit(k_phi_symmetric); };
39
41 void set_number_of_hits(float nhits);
42
43 float get_number_of_expected_hits() const { return m_nhits; };
44
47 float r_offset() const { return m_r_offset; };
48
51 float r_scale() const { return m_r_scale; };
52
55 virtual double
57 const TFCSTruthState *truth,
58 const TFCSExtrapolationState *extrapol) const override;
59
61 virtual int
63 const TFCSTruthState *truth,
64 const TFCSExtrapolationState *extrapol) const override;
65
69 virtual FCSReturnCode
70 simulate_hit(Hit &hit, TFCSSimulationState &simulstate,
71 const TFCSTruthState *truth,
72 const TFCSExtrapolationState *extrapol) override;
73
76 bool Initialize(TH2 *hist);
77 bool Initialize(const char *filepath, const char *histname);
78
80 const TFCS2DFunctionHistogram &histogram() const { return m_hist; };
81
82 void Print(Option_t *option = "") const override;
83
84#ifdef USE_GPU
85 // for FCS-GPU
86 // construct the hist function and copy to GPU
87 // will not compile by default
88 void set_d_HistFunc(FH2D *hf_ptr) { m_d_HistFunc = hf_ptr; };
89 const FH2D *d_HistFunc() { return m_d_HistFunc; };
90 LoadGpuFuncHist *LdFH() { return m_LdFH; };
91 void LoadHistFuncs();
92#endif
93
94protected:
97 float m_nhits;
99 float m_r_scale;
100
101private:
102#ifdef USE_GPU
103 FH2D *m_d_HistFunc = nullptr;
104 LoadGpuFuncHist *m_LdFH = nullptr;
105#endif
106
108 2) // TFCSHistoLateralShapeParametrization
109};
110
111#endif
struct FH2D FH2D
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
virtual void set_geometry(ICaloGeometry *geo) override
will actually not store the geometry information, but rather used to check the validity of the 2D sha...
virtual int get_number_of_hits(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
default for this class is to simulate get_number_of_expected_hits() hits
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
simulated one hit position with weight that should be put into simulstate sometime later all hit weig...
void set_r_scale(float r_scale)
set an scale factor for r on the simulated histogram
void set_r_offset(float r_offset)
set an offset in r on the simulated histogram
TFCS2DFunctionHistogram m_hist
Histogram to be used for the shape simulation.
TFCSHistoLateralShapeParametrization(const char *name=nullptr, const char *title=nullptr)
@ k_phi_symmetric
Set this bit to simulate phi symmetric histograms.
void set_number_of_hits(float nhits)
set the integral of the histogram to the desired number of hits
const TFCS2DFunctionHistogram & histogram() const
virtual double get_sigma2_fluctuation(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
default for this class is to simulate get_number_of_expected_hits() hits, which gives fluctuations si...
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)