17#include "GaudiKernel/MsgStream.h"
111 return(StatusCode::FAILURE);
125 StatusCode
sc =
detStore()->retrieve(caloIdMgr);
126 if (
sc.isFailure()) {
127 ATH_MSG_ERROR(
"Unable to retrieve CaloIdManager from DetectoreStore");
128 return StatusCode::FAILURE;
134 return StatusCode::SUCCESS;
141 std::vector<double> eCells_EM;
142 std::vector<double> eCells_HEC;
143 std::vector<double> eCells_FCAL;
145 unsigned int ncells_em =
m_larem_id->channel_hash_max();
146 unsigned int ncells_hec =
m_larhec_id->channel_hash_max();
147 unsigned int ncells_fcal =
m_larfcal_id->channel_hash_max();
149 ATH_MSG_INFO(
" ncells " << ncells_em <<
" " << ncells_hec <<
" " << ncells_fcal);
152 eCells_EM.resize(ncells_em,0.);
154 eCells_HEC.resize(ncells_hec,0.);
156 eCells_FCAL.resize(ncells_fcal,0.);
171 if (
sc.isFailure()) {
179 if (
sc.isFailure()) {
188 if (
sc.isFailure()) {
196 if (
sc.isFailure()) {
207 for (
unsigned int iHitContainer=0;iHitContainer<
m_HitContainer.size();iHitContainer++)
229 return StatusCode::FAILURE;
233 TimedHitContList hitContList;
238 ,hitContList).isSuccess()) && hitContList.empty()) {
240 return StatusCode::FAILURE;
244 TimedHitContList::iterator iFirstCont(hitContList.begin());
245 TimedHitContList::iterator iEndCont(hitContList.end());
246 while (iFirstCont != iEndCont) {
253 while (f_cell != l_cell) {
254 double energy = (*f_cell)->energy();
261 if (idHash<ncells_em) eCells_EM[idHash] += energy;
265 if (idHash<ncells_hec) eCells_HEC[idHash] += energy;
269 if (idHash<ncells_fcal) eCells_FCAL[idHash] += energy;
277 ATH_MSG_INFO(
" total number of hits found " << nhit_tot);
284 for (
unsigned int i=0;i<ncells_em;i++) {
287 double energy = eCells_EM[i];
303 ATH_MSG_INFO(
" Number of hits filled in LArHitEM containers " << nhit);
308 for (
unsigned int i=0;i<ncells_hec;i++) {
311 double energy = eCells_HEC[i];
319 ATH_MSG_INFO(
" Number of hits filled in LArHitHEC container " << nhit);
324 for (
unsigned int i=0;i<ncells_fcal;i++) {
327 double energy = eCells_FCAL[i];
335 ATH_MSG_INFO(
" Number of hits filled in LArHitFCAL container " << nhit);
343 if (
sc.isFailure()) {
345 return(StatusCode::FAILURE);
351 if (
sc.isFailure()) {
353 return(StatusCode::FAILURE);
359 if (
sc.isFailure()) {
361 return(StatusCode::FAILURE);
367 if (
sc.isFailure()) {
369 return(StatusCode::FAILURE);
374 return StatusCode::SUCCESS;
381 ATH_MSG_DEBUG(
" LArHitMerger finalize completed successfully");
384 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
const_iterator end() const
const_iterator begin() const
boost::transform_iterator< make_const, typename CONT::const_iterator > const_iterator
This class initializes the Calo (LAr and Tile) offline identifiers.
const LArHEC_ID * getHEC_ID(void) const
const LArFCAL_ID * getFCAL_ID(void) const
const LArEM_ID * getEM_ID(void) const
This is a "hash" representation of an Identifier.
virtual StatusCode initialize()
std::vector< std::string > m_HitContainer
StringProperty m_ForWardHitContainerName
virtual StatusCode finalize()
StringProperty m_EmEndCapHitContainerName
StringProperty m_EmBarrelHitContainerName
const LArEM_ID * m_larem_id
std::vector< bool > m_SubDetFlag
const LArFCAL_ID * m_larfcal_id
StringProperty m_HecHitContainerName
StringProperty m_SubDetectors
ServiceHandle< PileUpMergeSvc > m_mergeSvc
virtual StatusCode execute(const EventContext &ctx)
Execute method.
LArHitMerger(const std::string &name, ISvcLocator *pSvcLocator)
const LArHEC_ID * m_larhec_id
std::vector< int > m_CaloType
Class to store hit energy and time in LAr cell from G4 simulation.
void finalize()
The method to be called at the end of event by SD.
std::list< value_t > type
type of the collection of timed data object