ATLAS Offline Software
TFCSHitCellMappingWiggle.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 TFCSHitCellMappingWiggle_h
6 #define TFCSHitCellMappingWiggle_h
7 
9 
11 
12 #ifdef USE_GPU
15 #endif
16 
17 class TFCS1DFunction;
18 class TH1;
19 
21 public:
22  TFCSHitCellMappingWiggle(const char *name = nullptr,
23  const char *title = nullptr,
24  ICaloGeometry *geo = nullptr);
26 
27  void initialize(TFCS1DFunction *func);
28  void initialize(const std::vector<const TFCS1DFunction *> &functions,
29  const std::vector<float> &bin_low_edges);
30 
31  void initialize(TH1 *histogram, float xscale = 1);
32  void initialize(const std::vector<const TH1 *> &histograms,
33  const std::vector<float> &bin_low_edges, float xscale = 1);
34 
35  inline unsigned int get_number_of_bins() const { return m_functions.size(); };
36 
37  inline double get_bin_low_edge(int bin) const { return m_bin_low_edge[bin]; };
38  inline double get_bin_up_edge(int bin) const {
39  return m_bin_low_edge[bin + 1];
40  };
41 
42  inline const TFCS1DFunction *get_function(int bin) const {
43  return m_functions[bin];
44  };
45  const std::vector<const TFCS1DFunction *> get_functions() {
46  return m_functions;
47  };
48  const std::vector<float> get_bin_low_edges() { return m_bin_low_edge; };
49 
52  virtual FCSReturnCode
53  simulate_hit(Hit &hit, TFCSSimulationState &simulstate,
54  const TFCSTruthState *truth,
55  const TFCSExtrapolationState *extrapol) override;
56 
57  virtual bool operator==(const TFCSParametrizationBase &ref) const override;
58 
59  void Print(Option_t *option = "") const override;
60 
61  static void unit_test
63  TFCSTruthState *truth = nullptr,
64  TFCSExtrapolationState *extrapol = nullptr);
65 
66 #ifdef USE_GPU
67  // construct the hist function and copy to GPU
68  // will not compile by default
69  void set_d_HistFuncs(FHs *hf_ptr) { m_d_HistFuncs = hf_ptr; };
70  const FHs *d_HistFuncs() { return m_d_HistFuncs; };
71  void LoadHistFuncs();
72  LoadGpuFuncHist *LdFH() { return m_LdFH; };
73 #endif
74 
75 protected:
76  bool compare(const TFCSParametrizationBase &ref) const;
77 
78 private:
79 #ifdef USE_GPU
80  // hist functions in GPU
81  FHs *m_d_HistFuncs = nullptr;
82  LoadGpuFuncHist *m_LdFH = nullptr;
83 #endif
84 
85  //** Function for the hit-to-cell assignment accordion structure fix (wiggle)
86  //**//
87  //** To be moved to the conditions database at some point **//
88  std::vector<const TFCS1DFunction *> m_functions = {nullptr};
89  std::vector<float> m_bin_low_edge = {0, static_cast<float>(init_eta_max)};
90 
91  ClassDefOverride(TFCSHitCellMappingWiggle, 1) // TFCSHitCellMappingWiggle
92 };
93 
94 #endif
TFCSHitCellMappingWiggle
Definition: TFCSHitCellMappingWiggle.h:20
FCSReturnCode
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
Definition: TFCSParametrizationBase.h:41
TFCSHitCellMappingWiggle::simulate_hit
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
modify one hit position to emulate the LAr accordeon shape and then fills all hits into calorimeter c...
Definition: TFCSHitCellMappingWiggle.cxx:105
TFCSHitCellMappingWiggle::get_bin_low_edge
double get_bin_low_edge(int bin) const
Definition: TFCSHitCellMappingWiggle.h:37
covarianceTool.histograms
dictionary histograms
Definition: covarianceTool.py:53
TFCSHitCellMappingWiggle::get_bin_up_edge
double get_bin_up_edge(int bin) const
Definition: TFCSHitCellMappingWiggle.h:38
TFCSHitCellMappingWiggle::get_number_of_bins
unsigned int get_number_of_bins() const
Definition: TFCSHitCellMappingWiggle.h:35
TFCSHitCellMappingWiggle::TFCSHitCellMappingWiggle
TFCSHitCellMappingWiggle(const char *name=nullptr, const char *title=nullptr, ICaloGeometry *geo=nullptr)
Definition: TFCSHitCellMappingWiggle.cxx:22
TFCSHitCellMappingWiggle::get_bin_low_edges
const std::vector< float > get_bin_low_edges()
Definition: TFCSHitCellMappingWiggle.h:48
TFCSHitCellMappingWiggle::compare
bool compare(const TFCSParametrizationBase &ref) const
Definition: TFCSHitCellMappingWiggle.cxx:171
TFCSHitCellMappingWiggle::get_functions
const std::vector< const TFCS1DFunction * > get_functions()
Definition: TFCSHitCellMappingWiggle.h:45
bin
Definition: BinsDiffFromStripMedian.h:43
TFCSParametrizationBase::init_eta_max
static constexpr double init_eta_max
Do not persistify!
Definition: TFCSParametrizationBase.h:158
TFCSExtrapolationState
Definition: TFCSExtrapolationState.h:13
RunActsMaterialValidation.extrapol
extrapol
Definition: RunActsMaterialValidation.py:90
TFCSHitCellMappingWiggle::initialize
void initialize(TFCS1DFunction *func)
Definition: TFCSHitCellMappingWiggle.cxx:35
TFCSParametrizationBase
Definition: TFCSParametrizationBase.h:46
Hit
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:16
TFCSHitCellMappingWiggle::Print
void Print(Option_t *option="") const override
Definition: TFCSHitCellMappingWiggle.cxx:153
TFCSHitCellMappingWiggle::m_bin_low_edge
std::vector< float > m_bin_low_edge
Definition: TFCSHitCellMappingWiggle.h:89
TFCSHitCellMappingWiggle::~TFCSHitCellMappingWiggle
~TFCSHitCellMappingWiggle()
Definition: TFCSHitCellMappingWiggle.cxx:27
ICaloGeometry
Definition: ICaloGeometry.h:14
covarianceTool.title
title
Definition: covarianceTool.py:542
LoadGpuFuncHist
Definition: LoadGpuFuncHist.h:10
LoadGpuFuncHist.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
TFCSHitCellMappingWiggle::get_function
const TFCS1DFunction * get_function(int bin) const
Definition: TFCSHitCellMappingWiggle.h:42
TFCSHitCellMapping.h
TFCSHitCellMappingWiggle::ATLAS_NOT_THREAD_SAFE
static void unit_test ATLAS_NOT_THREAD_SAFE(TFCSSimulationState *simulstate=nullptr, TFCSTruthState *truth=nullptr, TFCSExtrapolationState *extrapol=nullptr)
ref
const boost::regex ref(r_ef)
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
TH1
Definition: rootspy.cxx:268
TFCSHitCellMappingWiggle::operator==
virtual bool operator==(const TFCSParametrizationBase &ref) const override
The == operator compares the content of instances.
Definition: TFCSHitCellMappingWiggle.cxx:139
TFCS1DFunction
Definition: TFCS1DFunction.h:17
checker_macros.h
Define macros for attributes used to control the static checker.
FH_structs.h
TFCSTruthState
Definition: TFCSTruthState.h:13
TFCSSimulationState
Definition: TFCSSimulationState.h:32
TFCSHitCellMapping
Definition: TFCSHitCellMapping.h:12
FHs
Definition: FH_structs.h:10
histogram
std::string histogram
Definition: chains.cxx:52
TFCSHitCellMappingWiggle::m_functions
std::vector< const TFCS1DFunction * > m_functions
Definition: TFCSHitCellMappingWiggle.h:88