ATLAS Offline Software
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 
16 class TH2;
17 class ICaloGeometry;
18 
21 public:
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 
50  void set_r_scale(float r_scale) { m_r_scale = r_scale; };
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 
94 protected:
97  float m_nhits;
98  float m_r_offset;
99  float m_r_scale;
100 
101 private:
102 #ifdef USE_GPU
103  FH2D *m_d_HistFunc = nullptr;
104  LoadGpuFuncHist *m_LdFH = nullptr;
105 #endif
106 
107  ClassDefOverride(TFCSHistoLateralShapeParametrization,
108  2) // TFCSHistoLateralShapeParametrization
109 };
110 
111 #endif
TFCSHistoLateralShapeParametrization::reset_phi_symmetric
virtual void reset_phi_symmetric()
Definition: TFCSHistoLateralShapeParametrization.h:38
FCSReturnCode
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
Definition: TFCSParametrizationBase.h:41
TFCSHistoLateralShapeParametrization::FCSStatusBits
FCSStatusBits
Status bit for FCS needs.
Definition: TFCSHistoLateralShapeParametrization.h:27
TFCSHistoLateralShapeParametrization
Definition: TFCSHistoLateralShapeParametrization.h:20
TFCSHistoLateralShapeParametrization::simulate_hit
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...
Definition: TFCSHistoLateralShapeParametrization.cxx:102
TFCSHistoLateralShapeParametrization::r_scale
float r_scale() const
Definition: TFCSHistoLateralShapeParametrization.h:51
plotmaker.hist
hist
Definition: plotmaker.py:148
TFCSHistoLateralShapeParametrization::r_offset
float r_offset() const
Definition: TFCSHistoLateralShapeParametrization.h:47
TFCSHistoLateralShapeParametrization::TFCSHistoLateralShapeParametrization
TFCSHistoLateralShapeParametrization(const char *name=nullptr, const char *title=nullptr)
Definition: TFCSHistoLateralShapeParametrization.cxx:26
TFCSHistoLateralShapeParametrization::get_number_of_hits
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
Definition: TFCSHistoLateralShapeParametrization.cxx:88
TFCSExtrapolationState
Definition: TFCSExtrapolationState.h:13
TFCS2DFunctionHistogram
Definition: TFCS2DFunctionHistogram.h:15
RunActsMaterialValidation.extrapol
extrapol
Definition: RunActsMaterialValidation.py:90
TFCSLateralShapeParametrizationHitBase
Definition: TFCSLateralShapeParametrizationHitBase.h:13
TFCSHistoLateralShapeParametrization::Initialize
bool Initialize(TH2 *hist)
Init from histogram.
Definition: TFCSHistoLateralShapeParametrization.cxx:188
TFCSHistoLateralShapeParametrization::~TFCSHistoLateralShapeParametrization
~TFCSHistoLateralShapeParametrization()
Definition: TFCSHistoLateralShapeParametrization.cxx:33
Hit
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:16
TFCSLateralShapeParametrizationHitBase.h
PixelAthClusterMonAlgCfg.histname
histname
Definition: PixelAthClusterMonAlgCfg.py:106
ICaloGeometry
Definition: ICaloGeometry.h:14
covarianceTool.title
title
Definition: covarianceTool.py:542
TFCSHistoLateralShapeParametrization::m_r_offset
float m_r_offset
Definition: TFCSHistoLateralShapeParametrization.h:98
TFCSHistoLateralShapeParametrization::set_r_scale
void set_r_scale(float r_scale)
set an scale factor for r on the simulated histogram
Definition: TFCSHistoLateralShapeParametrization.h:50
TFCSHistoLateralShapeParametrization::set_geometry
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...
Definition: TFCSHistoLateralShapeParametrization.cxx:39
LoadGpuFuncHist
Definition: LoadGpuFuncHist.h:10
TFCSHistoLateralShapeParametrization::set_r_offset
void set_r_offset(float r_offset)
set an offset in r on the simulated histogram
Definition: TFCSHistoLateralShapeParametrization.h:46
TFCSHistoLateralShapeParametrization::set_phi_symmetric
virtual void set_phi_symmetric()
Definition: TFCSHistoLateralShapeParametrization.h:37
LoadGpuFuncHist.h
TFCSHistoLateralShapeParametrization::is_phi_symmetric
bool is_phi_symmetric() const
Definition: TFCSHistoLateralShapeParametrization.h:36
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TFCSHistoLateralShapeParametrization::get_number_of_expected_hits
float get_number_of_expected_hits() const
Definition: TFCSHistoLateralShapeParametrization.h:43
TFCSHistoLateralShapeParametrization::k_phi_symmetric
@ k_phi_symmetric
Set this bit to simulate phi symmetric histograms.
Definition: TFCSHistoLateralShapeParametrization.h:28
TFCSTruthState.h
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
TFCS2DFunctionHistogram.h
TFCSHistoLateralShapeParametrization::m_hist
TFCS2DFunctionHistogram m_hist
Histogram to be used for the shape simulation.
Definition: TFCSHistoLateralShapeParametrization.h:96
TFCSHistoLateralShapeParametrization::get_sigma2_fluctuation
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...
Definition: TFCSHistoLateralShapeParametrization.cxx:79
TFCSHistoLateralShapeParametrization::histogram
TFCS2DFunctionHistogram & histogram()
Definition: TFCSHistoLateralShapeParametrization.h:79
FH_structs.h
TFCSHistoLateralShapeParametrization::m_nhits
float m_nhits
Definition: TFCSHistoLateralShapeParametrization.h:97
TFCSHistoLateralShapeParametrization::Print
void Print(Option_t *option="") const override
Definition: TFCSHistoLateralShapeParametrization.cxx:219
TFCSTruthState
Definition: TFCSTruthState.h:13
FH2D
Definition: FH_structs.h:29
TFCSSimulationState
Definition: TFCSSimulationState.h:32
TFCSHistoLateralShapeParametrization::histogram
const TFCS2DFunctionHistogram & histogram() const
Definition: TFCSHistoLateralShapeParametrization.h:80
TFCSHistoLateralShapeParametrization::set_number_of_hits
void set_number_of_hits(float nhits)
set the integral of the histogram to the desired number of hits
Definition: TFCSHistoLateralShapeParametrization.cxx:98
TFCSHistoLateralShapeParametrization::m_r_scale
float m_r_scale
Definition: TFCSHistoLateralShapeParametrization.h:99