ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
AFP
AFP_G4_SD
src
AFP_SensitiveDetectorTool.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_SensitiveDetectorTool.h
"
8
9
// For the SD itself
10
#include "
AFP_HitCollectionBuilders.h
"
11
#include "
AFP_SensitiveDetector.h
"
12
#include "
HitManagement/HitCollectionMap.h
"
13
14
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
15
16
AFP_SensitiveDetectorTool::AFP_SensitiveDetectorTool
(
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_SensitiveDetectorTool::SetupEvent
(
HitCollectionMap
& hitCollections)
24
{
25
ATH_MSG_VERBOSE
(
"AFP_SensitiveDetectorTool::SetupEvent()"
);
26
hitCollections.
Emplace
<
AFP_TDSimHitCollectionBuilder
>(
m_outputCollectionNames
[0],
27
m_outputCollectionNames
[0]);
28
hitCollections.
Emplace
<
AFP_SIDSimHitCollectionBuilder
>(
m_outputCollectionNames
[1],
29
m_outputCollectionNames
[1]);
30
return
StatusCode::SUCCESS;
31
}
32
33
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34
35
StatusCode
AFP_SensitiveDetectorTool::Gather
(
HitCollectionMap
& hitCollections)
36
{
37
ATH_MSG_VERBOSE
(
"AFP_SensitiveDetectorTool::Gather()"
);
38
CHECK
(hitCollections.
Record
<
AFP_TDSimHitCollection
>(
m_outputCollectionNames
[0]));
39
CHECK
(hitCollections.
Record
<
AFP_SIDSimHitCollection
>(
m_outputCollectionNames
[1]));
40
return
StatusCode::SUCCESS;
41
}
42
43
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
45
G4VSensitiveDetector*
AFP_SensitiveDetectorTool::makeSD
()
const
46
{
47
ATH_MSG_DEBUG
(
"Initializing SD"
);
48
// Create a fresh SD
49
return
new
AFP_SensitiveDetector
(name(),
m_outputCollectionNames
[0],
m_outputCollectionNames
[1]);
50
}
AFP_HitCollectionBuilders.h
AFP_SIDSimHitCollection
AtlasHitsVector< AFP_SIDSimHit > AFP_SIDSimHitCollection
Definition
AFP_SIDSimHitCollection.h:13
AFP_SensitiveDetectorTool.h
AFP_SensitiveDetector.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_SIDSimHitCollectionBuilder
Definition
AFP_HitCollectionBuilders.h:55
AFP_SensitiveDetectorTool::SetupEvent
StatusCode SetupEvent(HitCollectionMap &) override final
Beginning of an athena event.
Definition
AFP_SensitiveDetectorTool.cxx:23
AFP_SensitiveDetectorTool::AFP_SensitiveDetectorTool
AFP_SensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
AFP_SensitiveDetectorTool.cxx:16
AFP_SensitiveDetectorTool::Gather
StatusCode Gather(HitCollectionMap &) override final
End of an athena event.
Definition
AFP_SensitiveDetectorTool.cxx:35
AFP_SensitiveDetectorTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition
AFP_SensitiveDetectorTool.cxx:45
AFP_SensitiveDetector
Definition
AFP_SensitiveDetector.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