ATLAS Offline Software
Loading...
Searching...
No Matches
TFCSHitCellMappingFCal.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9//=============================================
10//======= TFCSHitCellMappingFCal =========
11//=============================================
12
14 Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState * /*truth*/,
15 const TFCSExtrapolationState * /*extrapol*/) {
16 int cs = calosample();
17 float distance;
18 const CaloDetDescrElement* cellele=m_geo->getFCalDDE(cs,hit.x(),hit.y(),hit.z(),&distance);
19 ATH_MSG_DEBUG("HIT: cellele=" << cellele << " E=" << hit.E() << " cs=" << cs
20 << " x=" << hit.x() << " y=" << hit.y()
21 << " z=" << hit.z());
22
24 if ((hit.x() == 0 && hit.y() == 0) || cellele == nullptr) {
26 "TFCSLateralShapeParametrizationHitCellMapping::simulate_hit: cellele="
27 << cellele << " E=" << hit.E() << " cs=" << cs << " eta=" << hit.eta()
28 << " phi=" << hit.phi());
29 return (FCSReturnCode)(FCSRetry + 5); // retry simulation up to 5 times
30 }
31
32 // If the distance is positive then we are using the nearest cell rather than are inside a cell
33 // If we are more than 2.25mm from the nearest cell we don't create a hit to avoid the build-up of energy in edge cells
34 // For FCSV2 another hit can be created but with a cutoff to avoid looping,
35 // for FastCaloGAN the rest of the hits in the layer will be scaled up by the energy renormalization step.
36 if (distance<2.25){
37 simulstate.deposit(cellele,hit.E());
38 }else{
39 hit.setXYZE(hit.x(),hit.y(),hit.z(),0.0);
40 }
41
42 return FCSSuccess;
43}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
This class groups all DetDescr information related to a CaloCell.
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
fills all hits into calorimeter cells
ICaloGeometry * m_geo
void deposit(const CaloDetDescrElement *cellele, float E)