ATLAS Offline Software
ALFA_SensitiveDetectorTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // Class header
8 
9 // Package includes
10 #include "ALFA_SensitiveDetector.h"
11 
12 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
13 
14 ALFA_SensitiveDetectorTool::ALFA_SensitiveDetectorTool(const std::string& type, const std::string& name, const IInterface* parent)
16 {
17 
18 }
19 
20 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
21 
23 {
24  ATH_MSG_VERBOSE( "ALFA_SensitiveDetectorTool::SetupEvent()" );
25  if(!getSD())
26  {
27  ATH_MSG_ERROR ("SetupEvent: ALFA_SensitiveDetector never created!");
28  return StatusCode::FAILURE;
29  }
30  else
31  {
32  ALFA_SensitiveDetector *localSD = dynamic_cast<ALFA_SensitiveDetector*>(getSD());
33  if(!localSD)
34  {
35  ATH_MSG_ERROR ("SetupEvent: Failed to cast m_SD into ALFA_SensitiveDetector.");
36  return StatusCode::FAILURE;
37  }
38  localSD->StartOfAthenaEvent();
39  }
40  return StatusCode::SUCCESS;
41 }
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
46 {
47  ATH_MSG_VERBOSE( "ALFA_SensitiveDetectorTool::Gather()" );
48  if(!getSD())
49  {
50  ATH_MSG_ERROR ("Gather: ALFA_SensitiveDetector never created!");
51  return StatusCode::FAILURE;
52  }
53  else
54  {
55  ALFA_SensitiveDetector *localSD = dynamic_cast<ALFA_SensitiveDetector*>(getSD());
56  if(!localSD)
57  {
58  ATH_MSG_ERROR ("Gather: Failed to cast m_SD into ALFA_SensitiveDetector.");
59  return StatusCode::FAILURE;
60  }
61  localSD->EndOfAthenaEvent();
62  }
63  return StatusCode::SUCCESS;
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
68 G4VSensitiveDetector* ALFA_SensitiveDetectorTool::makeSD() const
69 {
70  ATH_MSG_DEBUG( "Initializing SD" );
71  // Create a fresh SD
73 }
ALFA_SensitiveDetectorTool::SetupEvent
StatusCode SetupEvent() override final
Beginning of an athena event.
Definition: ALFA_SensitiveDetectorTool.cxx:22
ALFA_SensitiveDetectorTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition: ALFA_SensitiveDetectorTool.cxx:68
ALFA_SensitiveDetector.h
SensitiveDetectorBase
Common base class for tools that create and manage Geant4 sensitive detectors.
Definition: SensitiveDetectorBase.h:50
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SensitiveDetectorBase::getSD
G4VSensitiveDetector * getSD()
Retrieve the current SD.
Definition: SensitiveDetectorBase.cxx:118
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
ALFA_SensitiveDetectorTool::ALFA_SensitiveDetectorTool
ALFA_SensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ALFA_SensitiveDetectorTool.cxx:14
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
SensitiveDetectorBase::m_outputCollectionNames
Gaudi::Property< std::vector< std::string > > m_outputCollectionNames
Names of all output collections written out by this SD.
Definition: SensitiveDetectorBase.h:98
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ALFA_SensitiveDetectorTool.h
ALFA_SensitiveDetector::EndOfAthenaEvent
void EndOfAthenaEvent()
Definition: ALFA_SensitiveDetector.cxx:259
ALFA_SensitiveDetector::StartOfAthenaEvent
void StartOfAthenaEvent()
Definition: ALFA_SensitiveDetector.cxx:44
ALFA_SensitiveDetector
Definition: ALFA_SensitiveDetector.h:24
ALFA_SensitiveDetectorTool::Gather
StatusCode Gather() override final
End of an athena event.
Definition: ALFA_SensitiveDetectorTool.cxx:45