ATLAS Offline Software
Loading...
Searching...
No Matches
ZDC_FiberSDTool.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// Class header
7#include "ZDC_FiberSDTool.h"
8
9// For the SD itself
10#include "ZDC_FiberSD.h"
11
12//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
13
14ZDC_FiberSDTool::ZDC_FiberSDTool(const std::string& type, const std::string& name, const IInterface* parent)
15 : SensitiveDetectorBase(type,name,parent)
16{
17 declareProperty("readoutPos",m_readoutPos = 511.8);
18}
19
20//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
21
23{
24 ATH_MSG_VERBOSE( "ZDC_FiberSDTool::Gather()" );
25 if(!getSD())
26 {
27 ATH_MSG_ERROR ("Gather: ZDC_FiberSD never created!");
28 return StatusCode::FAILURE;
29 }
30 else
31 {
32 ZDC_FiberSD *localSD = dynamic_cast<ZDC_FiberSD*>(getSD());
33 if(!localSD)
34 {
35 ATH_MSG_ERROR ("Gather: Failed to cast m_SD into ZDC_FiberSD.");
36 return StatusCode::FAILURE;
37 }
38 localSD->EndOfAthenaEvent();
39 }
40 return StatusCode::SUCCESS;
41}
42
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
45G4VSensitiveDetector* ZDC_FiberSDTool::makeSD() const
46{
47 ATH_MSG_DEBUG( "Initializing ZDC_FiberSD" );
48
49 return new ZDC_FiberSD(name(), m_outputCollectionNames[0], m_readoutPos);
50}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
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.
G4VSensitiveDetector * makeSD() const override final
ZDC_FiberSDTool(const std::string &type, const std::string &name, const IInterface *parent)
StatusCode Gather() override final
End of an athena event.
void EndOfAthenaEvent()