ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
ISF
ISF_FastCaloSim
ISF_FastCaloSimEvent
src
TFCSHitCellMapping.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
ISF_FastCaloSimEvent/TFCSHitCellMapping.h
"
6
#include "
ISF_FastCaloSimEvent/ICaloGeometry.h
"
7
#include "
ISF_FastCaloSimEvent/TFCSSimulationState.h
"
8
#include "
CxxUtils/as_const_ptr.h
"
9
10
//=============================================
11
//======= TFCSHitCellMapping =========
12
//=============================================
13
14
TFCSHitCellMapping::TFCSHitCellMapping
(
const
char
*name,
const
char
*title,
15
ICaloGeometry
*geo)
16
:
TFCSLateralShapeParametrizationHitBase
(name, title),
m_geo
(geo) {
17
set_match_all_pdgid
();
18
}
19
20
FCSReturnCode
21
TFCSHitCellMapping::simulate_hit
(
Hit
&
hit
,
TFCSSimulationState
&simulstate,
22
const
TFCSTruthState
*
/*truth*/
,
23
const
TFCSExtrapolationState
*
/*extrapol*/
) {
24
int
cs =
calosample
();
25
float
distance;
26
const
CaloDetDescrElement
* cellele=
m_geo
->getDDE(cs,
hit
.eta(),
hit
.phi(),&distance);
27
ATH_MSG_DEBUG
(
"HIT: cellele="
<< cellele <<
" E="
<<
hit
.E() <<
" cs="
<< cs
28
<<
" eta="
<<
hit
.eta()
29
<<
" phi="
<<
hit
.phi());
30
if
(cellele) {
31
// If the distance is positive then we are using the nearest cell rather than are inside a cell
32
// If we are more than 0.005mm from the nearest cell we don't create a hit to avoid the build-up of energy in edge cells
33
// For FCSV2 another hit can be created but with a cutoff to avoid looping,
34
// for FastCaloGAN the rest of the hits in the layer will be scaled up by the energy renormalization step.
35
if
(distance<0.005){
36
simulstate.
deposit
(cellele,
hit
.E());
37
}
else
{
38
hit
.setXYZE(
hit
.x(),
hit
.y(),
hit
.z(),0.0);
39
}
40
return
FCSSuccess
;
41
}
else
{
42
ATH_MSG_ERROR
(
43
"TFCSLateralShapeParametrizationHitCellMapping::simulate_hit: cellele="
44
<< cellele <<
" E="
<<
hit
.E() <<
" cs="
<< cs <<
" eta="
<<
hit
.eta()
45
<<
" phi="
<<
hit
.phi());
46
return
FCSFatal
;
47
}
48
}
49
50
bool
TFCSHitCellMapping::operator==
(
const
TFCSParametrizationBase
&
ref
)
const
{
51
if
(
TFCSParametrizationBase::compare
(
ref
))
52
return
true
;
53
if
(!
TFCSParametrization::compare
(
ref
))
54
return
false
;
55
if
(!
TFCSLateralShapeParametrization::compare
(
ref
))
56
return
false
;
57
58
return
true
;
59
}
60
61
void
TFCSHitCellMapping::Print
(Option_t *option)
const
{
62
TString opt(option);
63
bool
shortprint = opt.Index(
"short"
) >= 0;
64
bool
longprint =
msgLvl
(MSG::DEBUG) || (
msgLvl
(MSG::INFO) && !shortprint);
65
TString optprint = opt;
66
optprint.ReplaceAll(
"short"
,
""
);
67
TFCSLateralShapeParametrizationHitBase::Print
(option);
68
69
if
(longprint)
70
ATH_MSG_INFO
(optprint <<
" geo="
<<
CxxUtils::as_const_ptr
(
m_geo
));
71
}
ref
const std::regex ref(r_ef)
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ICaloGeometry.h
hit
bool hit(const Container &ids, int pdgId)
Definition
JetIRCSafeLabelTool.cxx:64
TFCSHitCellMapping.h
FCSReturnCode
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
Definition
TFCSParametrizationBase.h:41
FCSFatal
@ FCSFatal
Definition
TFCSParametrizationBase.h:41
FCSSuccess
@ FCSSuccess
Definition
TFCSParametrizationBase.h:41
TFCSSimulationState.h
as_const_ptr.h
Helper for getting a const version of a pointer.
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
ICaloGeometry
Definition
ICaloGeometry.h:14
ISF_FCS::MLogging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
Definition
MLogging.h:222
TFCSExtrapolationState
Definition
TFCSExtrapolationState.h:13
TFCSHitCellMapping::simulate_hit
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
fills all hits into calorimeter cells
Definition
TFCSHitCellMapping.cxx:21
TFCSHitCellMapping::Print
void Print(Option_t *option) const override
Definition
TFCSHitCellMapping.cxx:61
TFCSHitCellMapping::operator==
virtual bool operator==(const TFCSParametrizationBase &ref) const override
The == operator compares the content of instances.
Definition
TFCSHitCellMapping.cxx:50
TFCSHitCellMapping::m_geo
ICaloGeometry * m_geo
Definition
TFCSHitCellMapping.h:31
TFCSHitCellMapping::TFCSHitCellMapping
TFCSHitCellMapping(const char *name=nullptr, const char *title=nullptr, ICaloGeometry *geo=nullptr)
Definition
TFCSHitCellMapping.cxx:14
TFCSLateralShapeParametrizationHitBase::Hit
Definition
TFCSLateralShapeParametrizationHitBase.h:42
TFCSLateralShapeParametrizationHitBase::TFCSLateralShapeParametrizationHitBase
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)
Definition
TFCSLateralShapeParametrizationHitBase.cxx:15
TFCSLateralShapeParametrization::Print
void Print(Option_t *option="") const override
Definition
TFCSLateralShapeParametrization.cxx:53
TFCSLateralShapeParametrization::calosample
int calosample() const
Definition
TFCSLateralShapeParametrization.h:34
TFCSLateralShapeParametrization::compare
bool compare(const TFCSParametrizationBase &ref) const
Definition
TFCSLateralShapeParametrization.cxx:32
TFCSParametrizationBase
Definition
TFCSParametrizationBase.h:46
TFCSParametrizationBase::set_match_all_pdgid
virtual void set_match_all_pdgid()
Definition
TFCSParametrizationBase.h:83
TFCSParametrizationBase::compare
bool compare(const TFCSParametrizationBase &ref) const
Do not persistify!
Definition
TFCSParametrizationBase.cxx:42
TFCSParametrization::compare
bool compare(const TFCSParametrizationBase &ref) const
Definition
TFCSParametrization.cxx:78
TFCSSimulationState
Definition
TFCSSimulationState.h:32
TFCSSimulationState::deposit
void deposit(const CaloDetDescrElement *cellele, float E)
Definition
TFCSSimulationState.cxx:31
TFCSTruthState
Definition
TFCSTruthState.h:13
CxxUtils::as_const_ptr
const T * as_const_ptr(const T *p)
Helper for getting a const version of a pointer.
Definition
as_const_ptr.h:32
Generated on
for ATLAS Offline Software by
1.17.0