ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
12//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
13
14ALFA_SensitiveDetectorTool::ALFA_SensitiveDetectorTool(const std::string& type, const std::string& name, const IInterface* parent)
15 : SensitiveDetectorBase(type,name,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
68G4VSensitiveDetector* ALFA_SensitiveDetectorTool::makeSD() const
69{
70 ATH_MSG_DEBUG( "Initializing SD" );
71 // Create a fresh SD
73}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
ALFA_SensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
StatusCode SetupEvent() override final
Beginning of an athena event.
G4VSensitiveDetector * makeSD() const override final
StatusCode Gather() override final
End of an athena event.
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.