ATLAS Offline Software
Loading...
Searching...
No Matches
AFP_SiDSensitiveDetectorTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// Class header
8
9// For the SD itself
11
12//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
13
14AFP_SiDSensitiveDetectorTool::AFP_SiDSensitiveDetectorTool(const std::string& type, const std::string& name, const IInterface* parent)
15 : SensitiveDetectorBase(type,name,parent)
16{
17}
18
19//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
20
22{
23 ATH_MSG_VERBOSE( "AFP_SiDSensitiveDetectorTool::SetupEvent()" );
24 if(!getSD())
25 {
26 ATH_MSG_ERROR ("SetupEvent: AFP_SiDSensitiveDetector never created!");
27 return StatusCode::FAILURE;
28 }
29 else
30 {
31 AFP_SiDSensitiveDetector *localSD = dynamic_cast<AFP_SiDSensitiveDetector*>(getSD());
32 if(!localSD)
33 {
34 ATH_MSG_ERROR ("SetupEvent: Failed to cast m_SD into AFP_SiDSensitiveDetector.");
35 return StatusCode::FAILURE;
36 }
37 localSD->StartOfAthenaEvent();
38 }
39 return StatusCode::SUCCESS;
40}
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43
45{
46 ATH_MSG_VERBOSE( "AFP_SiDSensitiveDetectorTool::Gather()" );
47 if(!getSD())
48 {
49 ATH_MSG_ERROR ("Gather: AFP_SiDSensitiveDetector never created!");
50 return StatusCode::FAILURE;
51 }
52 else
53 {
54 AFP_SiDSensitiveDetector *localSD = dynamic_cast<AFP_SiDSensitiveDetector*>(getSD());
55 if(!localSD)
56 {
57 ATH_MSG_ERROR ("Gather: Failed to cast m_SD into AFP_SiDSensitiveDetector.");
58 return StatusCode::FAILURE;
59 }
60 localSD->EndOfAthenaEvent();
61 }
62 return StatusCode::SUCCESS;
63}
64
65//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66
67G4VSensitiveDetector* AFP_SiDSensitiveDetectorTool::makeSD() const
68{
69 ATH_MSG_DEBUG( "Initializing SD" );
70 // Create a fresh SD
72}
73
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
StatusCode Gather() override final
End of an athena event.
StatusCode SetupEvent() override final
Beginning of an athena event.
G4VSensitiveDetector * makeSD() const override final
AFP_SiDSensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
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.