7#include "GaudiKernel/ConcurrencyFlags.h"
29 const std::string& name,
30 const IInterface* parent )
32 base_class(
type,name,parent)
48 CHECK(detStore()->retrieve(caloIdManager));
51 throw std::runtime_error(
"FastHitConvertTool: Invalid LAr EM ID helper");
54 throw std::runtime_error(
"FastHitConvertTool: Invalid FCAL ID helper");
57 throw std::runtime_error(
"FastHitConvertTool: Invalid HEC ID helper");
60 throw std::runtime_error(
"FastHitConvertTool: Invalid Tile ID helper");
78 return StatusCode::SUCCESS;
95 ATH_MSG_DEBUG(
"ATLFASTIIDigi "<<this->name()<<
" hitConstruction");
96 const double minEnergy=1e-9;
100 double energyConv=0.0;
105 double eLArEMRead=0.0;
106 double eLArHECRead=0.0;
107 double eLArFCALRead=0.0;
108 double eTileRead=0.0;
110 double eLArEMConv=0.0;
111 double eLArHECConv=0.0;
112 double eLArFCALConv=0.0;
113 double eTileConv=0.0;
125 energy=(*it1)->energy();
126 SampFrac=fSampl->
FSAMPL(cellid);
127 energyConv=energy*SampFrac;
130 eLArEMConv+=energyConv;
132 ATH_MSG_DEBUG(
"ReadFastCell id= "<<cellid<<
"E= "<<energy<<
" SampFrac= "<<SampFrac);
133 if(energyConv > minEnergy)
140 embHitContainer->push_back(
new LArHit(cellid,energyConv,
hitTime));
145 emecHitContainer->push_back(
new LArHit(cellid,energyConv,
hitTime));
161 energy=(*it1)->energy();
162 SampFrac=fSampl->
FSAMPL(cellid);
163 energyConv=energy*SampFrac;
166 eLArHECConv+=energyConv;
168 ATH_MSG_DEBUG(
"ReadFastCell id= "<<cellid<<
"E= "<<energy<<
"SampFrac= "<<SampFrac);
170 if(energyConv>minEnergy)
175 hecHitContainer->push_back(
new LArHit(cellid,energyConv,
hitTime));
188 energy=(*it1)->energy();
189 SampFrac=fSampl->
FSAMPL(cellid);
190 energyConv=energy*SampFrac;
193 eLArHECConv+=energyConv;
195 ATH_MSG_DEBUG(
"ReadFastCell id= "<<cellid<<
"E="<<energy<<
"SampFrac="<<SampFrac);
196 if(energyConv>minEnergy)
201 fcalHitContainer->push_back(
new LArHit(cellid,energyConv,
hitTime));
221 energy=(*it1)->energy();
227 int channel =
m_tileHWID->channel(channel_id);
228 int drawerIdx =
m_tileHWID->drawerIdx(channel_id);
229 SampFrac = tileSamplingFraction->getSamplingFraction(drawerIdx, channel);
230 energyConv=energy/SampFrac;
233 eTileConv+=energyConv;
235 ATH_MSG_DEBUG(
"ReadFastCell id= "<<cellid<<
"E="<<energy<<
"SampFrac"<<SampFrac);
237 if(energyConv>minEnergy)
242 if(
m_tileID->is_tile_gapscin(cellid))
248 tileHitVector->push_back(
TileHit(pmt_id0,energyConv/2.0,
hitTime));
249 tileHitVector->push_back(
TileHit(pmt_id1,energyConv/2.0,
hitTime));
255 ATH_MSG_DEBUG(
"eReadTot= "<<eLArEMRead+eLArHECRead+eLArFCALRead+eTileRead);
256 ATH_MSG_DEBUG(
"eLArEMRead= "<<eLArEMRead<<
" eLArHECRead= "<<eLArHECRead<<
" eLArFCALRead= "<<eLArFCALRead<<
" eTileRead= "<<eTileRead);
257 ATH_MSG_DEBUG(
"eConvTot= "<<eLArEMConv+eLArHECConv+eLArFCALConv+eTileConv);
258 ATH_MSG_DEBUG(
"eLArEMConv= "<<eLArEMConv<<
" eLArHECConv= "<<eLArHECConv<<
"eLArFCALConv"<<eLArFCALConv<<
"eTileConv"<<eTileConv);
261 ATH_MSG_DEBUG(embHitContainer.name()<<
" : "<<embHitContainer->size()<<
" hits ");
262 ATH_MSG_DEBUG(emecHitContainer.name()<<
" : "<<emecHitContainer->size()<<
" hits ");
263 ATH_MSG_DEBUG(fcalHitContainer.name()<<
" : "<<fcalHitContainer->size()<<
" hits ");
264 ATH_MSG_DEBUG(hecHitContainer.name()<<
" : "<<hecHitContainer->size()<<
" hits ");
265 ATH_MSG_DEBUG(tileHitVector.name()<<
" : "<<tileHitVector->size()<<
" hits ");
267 return StatusCode::SUCCESS;
float hitTime(const AFP_SIDSimHit &hit)
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Define macros for attributes used to control the static checker.
Container class for CaloCell.
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
This class initializes the Calo (LAr and Tile) offline identifiers.
const TileID * getTileID(void) const
const LArHEC_ID * getHEC_ID(void) const
const LArFCAL_ID * getFCAL_ID(void) const
const LArEM_ID * getEM_ID(void) const
DataModel_detail::const_iterator< DataVector > const_iterator
virtual const float & FSAMPL(const HWIdentifier &id) const =0
Class to store hit energy and time in LAr cell from G4 simulation.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())