ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellContainerSDTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// Header include
8
9// CaloCellContainer sensitive detector
11
12CaloCellContainerSDTool::CaloCellContainerSDTool(const std::string& type, const std::string& name, const IInterface* parent)
13 : SensitiveDetectorBase( type , name , parent ),
14 m_FastHitConvertTool ("FastHitConvertTool/FastHitConvertTool")
15{
16 declareProperty ("FastHitConvertTool", m_FastHitConvertTool, "FastHitConvertTool");
17}
18
20
21 // Get current event context
22 const EventContext& ctx = Gaudi::Hive::currentContext();
23
24 if( !getSD() ){
25 ATH_MSG_ERROR ("SetupEvent: CaloCellContainerSD never created!");
26 return StatusCode::FAILURE;
27 }
28 else{
29 CaloCellContainerSD *localSD = dynamic_cast<CaloCellContainerSD*>(getSD());
30 if(!localSD){
31 ATH_MSG_ERROR ("SetupEvent: Failed to cast m_SD into CaloCellContainerSD.");
32 return StatusCode::FAILURE;
33 }
34 localSD->StartOfAthenaEvent(ctx);
35 }
36
37 return StatusCode::SUCCESS;
38
39}
40
42
43 // Get current event context
44 const EventContext& ctx = Gaudi::Hive::currentContext();
45
46 if( !getSD() ){
47 ATH_MSG_ERROR ("Gather: CaloCellContainerSD never created!");
48 return StatusCode::FAILURE;
49 }
50 else{
51 CaloCellContainerSD *localSD = dynamic_cast<CaloCellContainerSD*>(getSD());
52 if(!localSD){
53 ATH_MSG_ERROR ("Gather: Failed to cast m_SD into CaloCellContainerSD.");
54 return StatusCode::FAILURE;
55 }
56 localSD->EndOfAthenaEvent(ctx);
57 }
58
59 return StatusCode::SUCCESS;
60
61
62}
63
64G4VSensitiveDetector* CaloCellContainerSDTool::makeSD() const
65{
66 ATH_MSG_DEBUG( "Initializing SD" );
67
68 // Create a fresh SD
70}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
StatusCode SetupEvent() override final
Beginning of an athena event.
G4VSensitiveDetector * makeSD() const override final
StatusCode Gather() override final
End of an athena event.
PublicToolHandle< ICaloCellMakerTool > m_FastHitConvertTool
CaloCellContainerSDTool(const std::string &type, const std::string &name, const IInterface *parent)
void StartOfAthenaEvent(const EventContext &ctx)
void EndOfAthenaEvent(const EventContext &ctx)
Gaudi::Property< std::vector< std::string > > m_outputCollectionNames
Names of all output collections written out by this SD.
SensitiveDetectorBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
G4VSensitiveDetector * getSD()
Retrieve the current SD.