ATLAS Offline Software
Loading...
Searching...
No Matches
TFCSHitCellMappingWiggle.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 TFCSHitCellMappingWiggle_h
6#define TFCSHitCellMappingWiggle_h
7
10
11#ifdef USE_GPU
14#endif
15
16class TFCS1DFunction;
17class TH1;
18
20 public:
21 TFCSHitCellMappingWiggle(const char *name = nullptr,
22 const char *title = nullptr,
23 ICaloGeometry *geo = nullptr);
25
26 void initialize(TFCS1DFunction *func);
27 void initialize(const std::vector<const TFCS1DFunction *> &functions,
28 const std::vector<float> &bin_low_edges);
29
30 void initialize(TH1 *histogram, float xscale = 1);
31 void initialize(const std::vector<const TH1 *> &histograms,
32 const std::vector<float> &bin_low_edges, float xscale = 1);
33
34 void clear();
35
36 inline unsigned int get_number_of_bins() const { return m_functions.size(); };
37
38 inline double get_bin_low_edge(int bin) const { return m_bin_low_edge[bin]; };
39 inline double get_bin_up_edge(int bin) const {
40 return m_bin_low_edge[bin + 1];
41 };
42
43 inline const TFCS1DFunction *get_function(int bin) const {
44 return m_functions[bin];
45 };
46 const std::vector<const TFCS1DFunction *>& get_functions() {
47 return m_functions;
48 };
49 const std::vector<float>& get_bin_low_edges() { return m_bin_low_edge; };
50
54 Hit &hit, TFCSSimulationState &simulstate, 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
const boost::regex ref(r_ef)
struct FHs FHs
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
std::string histogram
Definition chains.cxx:52
Define macros for attributes used to control the static checker.
const TFCS1DFunction * get_function(int bin) const
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...
bool compare(const TFCSParametrizationBase &ref) const
const std::vector< float > & get_bin_low_edges()
void Print(Option_t *option="") const override
double get_bin_low_edge(int bin) const
double get_bin_up_edge(int bin) const
std::vector< const TFCS1DFunction * > m_functions
unsigned int get_number_of_bins() const
std::vector< float > m_bin_low_edge
TFCSHitCellMappingWiggle(const char *name=nullptr, const char *title=nullptr, ICaloGeometry *geo=nullptr)
static void unit_test ATLAS_NOT_THREAD_SAFE(TFCSSimulationState *simulstate=nullptr, TFCSTruthState *truth=nullptr, TFCSExtrapolationState *extrapol=nullptr)
const std::vector< const TFCS1DFunction * > & get_functions()
virtual bool operator==(const TFCSParametrizationBase &ref) const override
The == operator compares the content of instances.
TFCSHitCellMapping(const char *name=nullptr, const char *title=nullptr, ICaloGeometry *geo=nullptr)
static constexpr double init_eta_max
Do not persistify!
TFCSParametrizationBase(const char *name=nullptr, const char *title=nullptr)
void initialize()