ATLAS Offline Software
Loading...
Searching...
No Matches
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
9
10//=============================================
11//======= TFCSHitCellMapping =========
12//=============================================
13
14TFCSHitCellMapping::TFCSHitCellMapping(const char *name, const char *title,
15 ICaloGeometry *geo)
18}
19
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 {
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
52 return true;
54 return false;
56 return false;
57
58 return true;
59}
60
61void 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", "");
68
69 if (longprint)
70 ATH_MSG_INFO(optprint << " geo=" << CxxUtils::as_const_ptr(m_geo));
71}
const boost::regex ref(r_ef)
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
Helper for getting a const version of a pointer.
This class groups all DetDescr information related to a CaloCell.
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.
Definition MLogging.h:222
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
fills all hits into calorimeter cells
void Print(Option_t *option) const override
virtual bool operator==(const TFCSParametrizationBase &ref) const override
The == operator compares the content of instances.
ICaloGeometry * m_geo
TFCSHitCellMapping(const char *name=nullptr, const char *title=nullptr, ICaloGeometry *geo=nullptr)
TFCSLateralShapeParametrizationHitBase(const char *name=nullptr, const char *title=nullptr)
void Print(Option_t *option="") const override
bool compare(const TFCSParametrizationBase &ref) const
bool compare(const TFCSParametrizationBase &ref) const
Do not persistify!
bool compare(const TFCSParametrizationBase &ref) const
void deposit(const CaloDetDescrElement *cellele, float E)
const T * as_const_ptr(const T *p)
Helper for getting a const version of a pointer.