ATLAS Offline Software
Loading...
Searching...
No Matches
AFP_TDSensitiveDetectorTool.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_TDSensitiveDetectorTool::AFP_TDSensitiveDetectorTool(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 if(!getSD())
24 {
25 ATH_MSG_ERROR ("SetupEvent: AFP_TDSensitiveDetector never created!");
26 return StatusCode::FAILURE;
27 }
28 else
29 {
30 AFP_TDSensitiveDetector *localSD = dynamic_cast<AFP_TDSensitiveDetector*>(getSD());
31 if(!localSD)
32 {
33 ATH_MSG_ERROR ("SetupEvent: Failed to cast m_SD into AFP_TDSensitiveDetector.");
34 return StatusCode::FAILURE;
35 }
36 localSD->StartOfAthenaEvent();
37 }
38 return StatusCode::SUCCESS;
39}
40
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
44{
45 ATH_MSG_VERBOSE( "AFP_TDSensitiveDetectorTool::Gather()" );
46 if(!getSD())
47 {
48 ATH_MSG_ERROR ("Gather: AFP_TDSensitiveDetector never created!");
49 return StatusCode::FAILURE;
50 }
51 else
52 {
53 AFP_TDSensitiveDetector *localSD = dynamic_cast<AFP_TDSensitiveDetector*>(getSD());
54 if(!localSD)
55 {
56 ATH_MSG_ERROR ("Gather: Failed to cast m_SD into AFP_TDSensitiveDetector.");
57 return StatusCode::FAILURE;
58 }
59 localSD->EndOfAthenaEvent();
60 }
61 return StatusCode::SUCCESS;
62}
63
64//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65
66G4VSensitiveDetector* AFP_TDSensitiveDetectorTool::makeSD() const
67{
68 ATH_MSG_DEBUG( "Initializing SD" );
69 // Create a fresh SD
71}
72
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
StatusCode SetupEvent() override final
Beginning of an athena event.
G4VSensitiveDetector * makeSD() const override final
AFP_TDSensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
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.