ATLAS Offline Software
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 
12 CaloCellContainerSDTool::CaloCellContainerSDTool(const std::string& type, const std::string& name, const IInterface* 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 
64 G4VSensitiveDetector* CaloCellContainerSDTool::makeSD() const
65 {
66  ATH_MSG_DEBUG( "Initializing SD" );
67 
68  // Create a fresh SD
70 }
CaloCellContainerSD.h
CaloCellContainerSDTool::Gather
StatusCode Gather() override final
End of an athena event.
Definition: CaloCellContainerSDTool.cxx:41
CaloCellContainerSDTool::SetupEvent
StatusCode SetupEvent() override final
Beginning of an athena event.
Definition: CaloCellContainerSDTool.cxx:19
SensitiveDetectorBase
Common base class for tools that create and manage Geant4 sensitive detectors.
Definition: SensitiveDetectorBase.h:42
CaloCellContainerSDTool.h
SensitiveDetectorBase::getSD
G4VSensitiveDetector * getSD()
Retrieve the current SD.
Definition: SensitiveDetectorBase.cxx:123
CaloCellContainerSD
Definition: CaloCellContainerSD.h:22
CaloCellContainerSDTool::CaloCellContainerSDTool
CaloCellContainerSDTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloCellContainerSDTool.cxx:12
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloCellContainerSDTool::m_FastHitConvertTool
PublicToolHandle< ICaloCellMakerTool > m_FastHitConvertTool
Definition: CaloCellContainerSDTool.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCellContainerSD::EndOfAthenaEvent
void EndOfAthenaEvent(const EventContext &ctx)
Definition: CaloCellContainerSD.cxx:43
SensitiveDetectorBase::m_outputCollectionNames
Gaudi::Property< std::vector< std::string > > m_outputCollectionNames
Names of all output collections written out by this SD.
Definition: SensitiveDetectorBase.h:84
CaloCellContainerSD::StartOfAthenaEvent
void StartOfAthenaEvent(const EventContext &ctx)
Definition: CaloCellContainerSD.cxx:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCellContainerSDTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition: CaloCellContainerSDTool.cxx:64