ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
ISF
ISF_FastCaloSim
ISF_FastCaloSimEvent
ISF_FastCaloSimEvent
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
9
#include "
ISF_FastCaloSimEvent/TFCSLateralShapeParametrizationHitBase.h
"
10
#include "
ISF_FastCaloSimEvent/FastCaloSim_CaloCell_ID.h
"
// CaloCell_ID_FCS::CaloSample_FCS enum
11
12
#include <tuple>
13
14
class
TFCSSimulationState
;
15
class
ICaloGeometry
;
16
17
class
TFCSBinnedShowerBase
:
public
TFCSLateralShapeParametrizationHitBase
{
18
public
:
19
TFCSBinnedShowerBase
(
const
char
*name =
nullptr
,
const
char
*title =
nullptr
);
20
21
virtual
~TFCSBinnedShowerBase
();
22
24
enum
FCSEnergyInitializationStatusBits
{
25
kOnlyScaleEnergy
=
26
BIT(18)
28
};
29
30
bool
OnlyScaleEnergy
()
const
{
return
TestBit(
kOnlyScaleEnergy
); };
31
32
void
set_OnlyScaleEnergy
() { SetBit(
kOnlyScaleEnergy
); };
33
34
void
reset_OnlyScaleEnergy
() { ResetBit(
kOnlyScaleEnergy
); };
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
42
virtual
FCSReturnCode
simulate_hit
(
43
Hit
&
hit
,
TFCSSimulationState
&simulstate,
const
TFCSTruthState
*truth,
44
const
TFCSExtrapolationState
*extrapol)
override
;
45
46
ICaloGeometry
*
get_geometry
() {
return
m_geo
; };
47
48
virtual
void
set_geometry
(
ICaloGeometry
*geo)
override
{
49
m_geo
= geo;
50
TFCSParametrizationBase::set_geometry
(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
:
63
ICaloGeometry
*
m_geo
{};
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
=
91
CaloCell_ID_FCS::CaloSample_FCS::MaxSample
;
92
ClassDefOverride(
TFCSBinnedShowerBase
, 1)
// TFCSBinnedShowerBase
93
};
94
95
#endif
FastCaloSim_CaloCell_ID.h
hit
bool hit(const Container &ids, int pdgId)
Definition
JetIRCSafeLabelTool.cxx:64
TFCSLateralShapeParametrizationHitBase.h
FCSReturnCode
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
Definition
TFCSParametrizationBase.h:41
Hit
Definition
Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.h:16
ICaloGeometry
Definition
ICaloGeometry.h:14
TFCSBinnedShowerBase::get_number_of_hits
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...
Definition
TFCSBinnedShowerBase.h:53
TFCSBinnedShowerBase::m_geo
ICaloGeometry * m_geo
Definition
TFCSBinnedShowerBase.h:63
TFCSBinnedShowerBase::m_n_layers
const long unsigned int m_n_layers
Definition
TFCSBinnedShowerBase.h:90
TFCSBinnedShowerBase::reset_OnlyScaleEnergy
void reset_OnlyScaleEnergy()
Definition
TFCSBinnedShowerBase.h:34
TFCSBinnedShowerBase::delete_event
virtual void delete_event(TFCSSimulationState &simulstate) const =0
TFCSBinnedShowerBase::TFCSBinnedShowerBase
TFCSBinnedShowerBase(const char *name=nullptr, const char *title=nullptr)
Definition
TFCSBinnedShowerBase.cxx:22
TFCSBinnedShowerBase::get_layer_energy
virtual float get_layer_energy(TFCSSimulationState &simulstate, long unsigned int layer_index) const =0
TFCSBinnedShowerBase::get_geometry
ICaloGeometry * get_geometry()
Definition
TFCSBinnedShowerBase.h:46
TFCSBinnedShowerBase::set_geometry
virtual void set_geometry(ICaloGeometry *geo) override
Method to set the geometry access pointer.
Definition
TFCSBinnedShowerBase.h:48
TFCSBinnedShowerBase::simulate_hit
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
simulated one hit position with some energy.
Definition
TFCSBinnedShowerBase.cxx:79
TFCSBinnedShowerBase::get_hit_position_and_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
TFCSBinnedShowerBase::set_OnlyScaleEnergy
void set_OnlyScaleEnergy()
Definition
TFCSBinnedShowerBase.h:32
TFCSBinnedShowerBase::OnlyScaleEnergy
bool OnlyScaleEnergy() const
Definition
TFCSBinnedShowerBase.h:30
TFCSBinnedShowerBase::get_event
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
TFCSBinnedShowerBase::~TFCSBinnedShowerBase
virtual ~TFCSBinnedShowerBase()
Definition
TFCSBinnedShowerBase.cxx:27
TFCSBinnedShowerBase::simulate
virtual FCSReturnCode simulate(TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) const override
Method in all derived classes to do some simulation.
Definition
TFCSBinnedShowerBase.cxx:29
TFCSBinnedShowerBase::get_n_hits
virtual long unsigned int get_n_hits(TFCSSimulationState &simulstate, long unsigned int layer_index) const =0
TFCSBinnedShowerBase::FCSEnergyInitializationStatusBits
FCSEnergyInitializationStatusBits
Status bit for energy initialization.
Definition
TFCSBinnedShowerBase.h:24
TFCSBinnedShowerBase::kOnlyScaleEnergy
@ kOnlyScaleEnergy
Set this bit in the TObject bit field the simulated energy.
Definition
TFCSBinnedShowerBase.h:25
TFCSExtrapolationState
Definition
TFCSExtrapolationState.h:13
TFCSLateralShapeParametrizationHitBase::TFCSLateralShapeParametrizationHitBase
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)
Definition
TFCSLateralShapeParametrizationHitBase.cxx:15
TFCSLateralShapeParametrization::calosample
int calosample() const
Definition
TFCSLateralShapeParametrization.h:34
TFCSParametrizationBase::set_geometry
virtual void set_geometry(ICaloGeometry *geo)
Method to set the geometry access pointer.
Definition
TFCSParametrizationBase.cxx:24
TFCSSimulationState
Definition
TFCSSimulationState.h:32
TFCSTruthState
Definition
TFCSTruthState.h:13
CaloCell_ID_FCS::MaxSample
@ MaxSample
Definition
FastCaloSim_CaloCell_ID.h:47
Generated on
for ATLAS Offline Software by
1.17.0