ATLAS Offline Software
CaloCell_IDDetDescrCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
13 #include "StoreGate/StoreGateSvc.h"
14 #include "CaloIdentifier/CaloID.h"
17 
18 
27 StatusCode make_CaloIDHelper (ISvcLocator* svcloc,
28  const std::string& /*helperKey*/,
29  CaloCell_ID* & idhelper)
30 {
31  const char* ctx = "CaloCell_IDDetDescrCnv";
32  // get DetectorStore service
33  SmartIF<StoreGateSvc> detStore{svcloc->service("DetectorStore")};
34  CHECK_WITH_CONTEXT( detStore.isValid(), ctx );
35 
36  // retrieve LAr and Tile helpers
37 #define GET_HELPER(TYPE, HELPER) \
38  const TYPE* HELPER=0; \
39  CHECK_WITH_CONTEXT( detStore->retrieve (HELPER, #TYPE), ctx )
40 
41  GET_HELPER (LArEM_ID, em_id);
42  GET_HELPER (LArHEC_ID, hec_id);
43  GET_HELPER (LArFCAL_ID, fcal_id);
44  GET_HELPER (LArMiniFCAL_ID, minifcal_id);
45  GET_HELPER (TileID, tile_id);
46 
47  // create the helper
48  idhelper = new CaloCell_ID (em_id,
49  hec_id,
50  fcal_id,
51  minifcal_id,
52  tile_id);
53  return StatusCode::SUCCESS;
54 }
55 
56 
CHECK_WITH_CONTEXT
#define CHECK_WITH_CONTEXT(...)
Evaluate an expression and check for errors, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:396
GET_HELPER
#define GET_HELPER(TYPE, HELPER)
CaloID.h
LArHEC_ID
Helper class for LArHEC offline identifiers.
Definition: LArHEC_ID.h:85
CaloCell_ID.h
make_CaloIDHelper
StatusCode make_CaloIDHelper(ISvcLocator *svcloc, const std::string &, CaloCell_ID *&idhelper)
Helper function to actually create a new helper.
Definition: CaloCell_IDDetDescrCnv.cxx:27
TileID
Helper class for TileCal offline identifiers.
Definition: TileID.h:68
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
CaloCell_IDDetDescrCnv.h
CaloCell_ID helper converter class.
errorcheck.h
Helpers for checking error return status codes and reporting errors.
LArMiniFCAL_ID
Helper class for LArMiniFCAL offline identifiers.
Definition: LArMiniFCAL_ID.h:57
LArEM_ID
Helper class for LArEM offline identifiers.
Definition: LArEM_ID.h:118
LArFCAL_ID
Helper class for LArFCAL offline identifiers.
Definition: LArFCAL_ID.h:60
StoreGateSvc.h