ATLAS Offline Software
Loading...
Searching...
No Matches
TFCSBinnedShowerBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ISF_FASTCALOSIMEVENT_TFCSBinnedShowerBase_h
6#define ISF_FASTCALOSIMEVENT_TFCSBinnedShowerBase_h
7
8// local includes
10#include "ISF_FastCaloSimEvent/FastCaloSim_CaloCell_ID.h"// CaloCell_ID_FCS::CaloSample_FCS enum
11
12#include <tuple>
13
15class ICaloGeometry;
16
18 public:
19 TFCSBinnedShowerBase(const char *name = nullptr, const char *title = nullptr);
20
21 virtual ~TFCSBinnedShowerBase();
22
29
30 bool OnlyScaleEnergy() const { return TestBit(kOnlyScaleEnergy); };
31
33
35
36 // Fill layer energies
37 virtual FCSReturnCode simulate(
38 TFCSSimulationState &simulstate, const TFCSTruthState *truth,
39 const TFCSExtrapolationState *extrapol) const override;
40
41 // Do hit simulation
43 Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth,
44 const TFCSExtrapolationState *extrapol) override;
45
47
48 virtual void set_geometry(ICaloGeometry *geo) override {
49 m_geo = geo;
51 };
52
53 virtual int get_number_of_hits(
54 TFCSSimulationState &simulstate, const TFCSTruthState * /*truth*/,
55 const TFCSExtrapolationState * /*extrapol*/) const override {
56 long unsigned int nhits = get_n_hits(simulstate, calosample());
57 if (nhits == 0)
58 return -1;
59 return static_cast<int>(nhits);
60 }
61
62 protected:
64
65 // Called at the beginning of the simulation to store and or generate the
66 // needed shower data for the current event
67 virtual void get_event(TFCSSimulationState &simulstate, float eta_center,
68 float phi_center, float e_init,
69 long unsigned int reference_layer_index) const = 0;
70
71 // Returns the number of bins that are used in the given layer
72 virtual long unsigned int get_n_hits(TFCSSimulationState &simulstate,
73 long unsigned int layer_index) const = 0;
74
75 // Returns the position and energy of the corresponding hit in the given
76 // event, layer and bin
77 virtual float get_layer_energy(TFCSSimulationState &simulstate,
78 long unsigned int layer_index) const = 0;
79
80 // Returns the position and energy of the corresponding hit in the given
81 // event, layer and bin
82 virtual std::tuple<float, float, float> get_hit_position_and_energy(
83 TFCSSimulationState &simulstate, long unsigned int layer_index,
84 long unsigned int hit_index) const = 0;
85
86 // Delete all pointers that were created in get_event()
87 virtual void delete_event(TFCSSimulationState &simulstate) const = 0;
88
89 private:
90 const long unsigned int m_n_layers =
92 ClassDefOverride(TFCSBinnedShowerBase, 1) // TFCSBinnedShowerBase
93};
94
95#endif
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
virtual int get_number_of_hits(TFCSSimulationState &simulstate, const TFCSTruthState *, const TFCSExtrapolationState *) const override
Call get_number_of_hits() only once per shower simulation, as it could be calculated with random numb...
const long unsigned int m_n_layers
virtual void delete_event(TFCSSimulationState &simulstate) const =0
TFCSBinnedShowerBase(const char *name=nullptr, const char *title=nullptr)
virtual float get_layer_energy(TFCSSimulationState &simulstate, long unsigned int layer_index) const =0
ICaloGeometry * get_geometry()
virtual void set_geometry(ICaloGeometry *geo) override
Method to set the geometry access pointer.
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
simulated one hit position with some energy.
virtual std::tuple< float, float, float > get_hit_position_and_energy(TFCSSimulationState &simulstate, long unsigned int layer_index, long unsigned int hit_index) const =0
virtual void get_event(TFCSSimulationState &simulstate, float eta_center, float phi_center, float e_init, long unsigned int reference_layer_index) const =0
do not persistify
virtual FCSReturnCode simulate(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
Method in all derived classes to do some simulation.
virtual long unsigned int get_n_hits(TFCSSimulationState &simulstate, long unsigned int layer_index) const =0
FCSEnergyInitializationStatusBits
Status bit for energy initialization.
@ kOnlyScaleEnergy
Set this bit in the TObject bit field the simulated energy.
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)
virtual void set_geometry(ICaloGeometry *geo)
Method to set the geometry access pointer.