ATLAS Offline Software
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 }
FCSReturnCode
FCSReturnCode
Base class for all FastCaloSim parametrizations Functionality in derivde classes is provided through ...
Definition: TFCSParametrizationBase.h:41
TFCSLateralShapeParametrizationHitBase::Hit::x
float & x()
Definition: TFCSLateralShapeParametrizationHitBase.h:88
TFCSLateralShapeParametrizationHitBase::Hit::setXYZE
void setXYZE(float x, float y, float z, float E)
Definition: TFCSLateralShapeParametrizationHitBase.h:63
TFCSLateralShapeParametrizationHitBase::Hit::phi
float & phi()
Definition: TFCSLateralShapeParametrizationHitBase.h:87
TFCSLateralShapeParametrizationHitBase::Hit::y
float & y()
Definition: TFCSLateralShapeParametrizationHitBase.h:89
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
TFCSExtrapolationState
Definition: TFCSExtrapolationState.h:13
TFCSLateralShapeParametrizationHitBase::Hit
Definition: TFCSLateralShapeParametrizationHitBase.h:42
FCSRetry
@ FCSRetry
Definition: TFCSParametrizationBase.h:41
TFCSLateralShapeParametrizationHitBase::Hit::E
float & E()
Definition: TFCSLateralShapeParametrizationHitBase.h:90
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TFCSSimulationState::deposit
void deposit(const CaloDetDescrElement *cellele, float E)
Definition: TFCSSimulationState.cxx:31
FCSSuccess
@ FCSSuccess
Definition: TFCSParametrizationBase.h:41
ICaloGeometry::getFCalDDE
virtual const CaloDetDescrElement * getFCalDDE(int sampling, float x, float y, float z, float *distance=0, int *steps=0)=0
TFCSHitCellMapping::m_geo
ICaloGeometry * m_geo
Definition: TFCSHitCellMapping.h:31
TFCSLateralShapeParametrizationHitBase::Hit::z
float & z()
Definition: TFCSLateralShapeParametrizationHitBase.h:91
TFCSHitCellMappingFCal::simulate_hit
virtual FCSReturnCode simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState *truth, const TFCSExtrapolationState *extrapol) override
fills all hits into calorimeter cells
Definition: TFCSHitCellMappingFCal.cxx:13
TFCSLateralShapeParametrization::calosample
int calosample() const
Definition: TFCSLateralShapeParametrization.h:34
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TFCSHitCellMappingFCal.h
TFCSLateralShapeParametrizationHitBase::Hit::eta
float & eta()
Definition: TFCSLateralShapeParametrizationHitBase.h:86
TFCSSimulationState.h
ICaloGeometry.h
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
TFCSTruthState
Definition: TFCSTruthState.h:13
TFCSSimulationState
Definition: TFCSSimulationState.h:32