ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
AFP
AFP_G4_SD
src
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
7
#include "
AFP_TDSensitiveDetectorTool.h
"
8
9
// For the SD itself
10
#include "
AFP_HitCollectionBuilders.h
"
11
#include "
AFP_TDSensitiveDetector.h
"
12
#include "
HitManagement/HitCollectionMap.h
"
13
14
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
15
16
AFP_TDSensitiveDetectorTool::AFP_TDSensitiveDetectorTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
17
:
SensitiveDetectorBase
(
type
,name,parent)
18
{
19
}
20
21
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
22
23
StatusCode
AFP_TDSensitiveDetectorTool::SetupEvent
(
HitCollectionMap
& hitCollections)
24
{
25
hitCollections.
Emplace
<
AFP_TDSimHitCollectionBuilder
>(
m_outputCollectionNames
[0],
26
m_outputCollectionNames
[0]);
27
return
StatusCode::SUCCESS;
28
}
29
30
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31
32
StatusCode
AFP_TDSensitiveDetectorTool::Gather
(
HitCollectionMap
& hitCollections)
33
{
34
ATH_MSG_VERBOSE
(
"AFP_TDSensitiveDetectorTool::Gather()"
);
35
CHECK
(hitCollections.
Record
<
AFP_TDSimHitCollection
>(
m_outputCollectionNames
[0]));
36
return
StatusCode::SUCCESS;
37
}
38
39
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40
41
G4VSensitiveDetector*
AFP_TDSensitiveDetectorTool::makeSD
()
const
42
{
43
ATH_MSG_DEBUG
(
"Initializing SD"
);
44
// Create a fresh SD
45
return
new
AFP_TDSensitiveDetector
(name(),
m_outputCollectionNames
[0]);
46
}
AFP_HitCollectionBuilders.h
AFP_TDSensitiveDetectorTool.h
AFP_TDSensitiveDetector.h
AFP_TDSimHitCollection
AtlasHitsVector< AFP_TDSimHit > AFP_TDSimHitCollection
Definition
AFP_TDSimHitCollection.h:14
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
HitCollectionMap.h
AFP_TDSensitiveDetectorTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition
AFP_TDSensitiveDetectorTool.cxx:41
AFP_TDSensitiveDetectorTool::AFP_TDSensitiveDetectorTool
AFP_TDSensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
AFP_TDSensitiveDetectorTool.cxx:16
AFP_TDSensitiveDetectorTool::SetupEvent
StatusCode SetupEvent(HitCollectionMap &) override final
Beginning of an athena event.
Definition
AFP_TDSensitiveDetectorTool.cxx:23
AFP_TDSensitiveDetectorTool::Gather
StatusCode Gather(HitCollectionMap &) override final
End of an athena event.
Definition
AFP_TDSensitiveDetectorTool.cxx:32
AFP_TDSensitiveDetector
Definition
AFP_TDSensitiveDetector.h:23
AFP_TDSimHitCollectionBuilder
Definition
AFP_HitCollectionBuilders.h:14
HitCollectionMap
Small wrapper around hit collection map to facilitate accessing the hit collection.
Definition
HitCollectionMap.h:23
HitCollectionMap::Record
StatusCode Record(std::string const &sgKey, std::string const &hitCollectionName, EventContext const &ctx)
Record the hit collection hitCollectionName to the StoreGate sgKey.
Definition
HitCollectionMap.h:83
HitCollectionMap::Emplace
std::pair< StorageIterator, bool > Emplace(std::string const &hitCollectionName, CollectionArgs &&... args)
Insert a container in the map with in-place construction.
Definition
HitCollectionMap.h:40
SensitiveDetectorBase::m_outputCollectionNames
Gaudi::Property< std::vector< std::string > > m_outputCollectionNames
Names of all output collections written out by this SD.
Definition
SensitiveDetectorBase.h:80
SensitiveDetectorBase::SensitiveDetectorBase
SensitiveDetectorBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition
SensitiveDetectorBase.cxx:17
type
Generated on
for ATLAS Offline Software by
1.17.0