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