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"
13
14//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
15
16ZDC_FiberSDTool::ZDC_FiberSDTool(const std::string& type, const std::string& name, const IInterface* parent)
17 : SensitiveDetectorBase(type,name,parent)
18{
19 declareProperty("readoutPos",m_readoutPos = 511.8);
20}
21
22//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
23
25{
28 return StatusCode::SUCCESS;
29}
30
31StatusCode ZDC_FiberSDTool::Gather(HitCollectionMap& hitCollections)
32{
33 ATH_MSG_VERBOSE( "ZDC_FiberSDTool::Gather()" );
34 auto* hitCollection = hitCollections.Find<ZDC_SimFiberHitCollectionBuilder>(m_outputCollectionNames[0]);
35 if (!hitCollection) {
36 return StatusCode::FAILURE;
37 }
38 hitCollection->Finalize();
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_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
Small wrapper around hit collection map to facilitate accessing the hit collection.
StatusCode Record(std::string const &sgKey, std::string const &hitCollectionName, EventContext const &ctx)
Record the hit collection hitCollectionName to the StoreGate sgKey.
T * Find(std::string const &hitCollectionName)
Get the hit collection for a given SDs.
std::pair< StorageIterator, bool > Emplace(std::string const &hitCollectionName, CollectionArgs &&... args)
Insert a container in the map with in-place construction.
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 * makeSD() const override final
StatusCode SetupEvent(HitCollectionMap &) override final
Beginning of an athena event.
ZDC_FiberSDTool(const std::string &type, const std::string &name, const IInterface *parent)
StatusCode Gather(HitCollectionMap &) override final
End of an athena event.