ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
ALFA
ALFA_G4_SD
src
ALFA_SensitiveDetectorTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
// Class header
7
#include "
ALFA_SensitiveDetectorTool.h
"
8
9
// Package includes
10
#include "
ALFA_SensitiveDetector.h
"
11
12
#include "
ALFA_SimEv/ALFA_HitCollection.h
"
13
#include "
ALFA_SimEv/ALFA_ODHitCollection.h
"
14
#include "
HitManagement/HitCollectionMap.h
"
15
16
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
17
18
ALFA_SensitiveDetectorTool::ALFA_SensitiveDetectorTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
19
:
SensitiveDetectorBase
(
type
,name,parent)
20
{
21
22
}
23
24
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
25
26
StatusCode
ALFA_SensitiveDetectorTool::SetupEvent
(
HitCollectionMap
& hitCollections)
27
{
28
ATH_MSG_VERBOSE
(
"ALFA_SensitiveDetectorTool::SetupEvent()"
);
29
hitCollections.
Emplace
<
ALFA_HitCollection
>(
m_outputCollectionNames
[0],
30
m_outputCollectionNames
[0]);
31
hitCollections.
Emplace
<
ALFA_ODHitCollection
>(
m_outputCollectionNames
[1],
32
m_outputCollectionNames
[1]);
33
return
StatusCode::SUCCESS;
34
}
35
36
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37
38
StatusCode
ALFA_SensitiveDetectorTool::Gather
(
HitCollectionMap
& hitCollections)
39
{
40
ATH_MSG_VERBOSE
(
"ALFA_SensitiveDetectorTool::Gather()"
);
41
CHECK
(hitCollections.
Record
<
ALFA_HitCollection
>(
m_outputCollectionNames
[0]));
42
CHECK
(hitCollections.
Record
<
ALFA_ODHitCollection
>(
m_outputCollectionNames
[1]));
43
return
StatusCode::SUCCESS;
44
}
45
46
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47
48
G4VSensitiveDetector*
ALFA_SensitiveDetectorTool::makeSD
()
const
49
{
50
ATH_MSG_DEBUG
(
"Initializing SD"
);
51
// Create a fresh SD
52
return
new
ALFA_SensitiveDetector
(name(),
m_outputCollectionNames
[0],
m_outputCollectionNames
[1]);
53
}
ALFA_HitCollection.h
ALFA_HitCollection
AtlasHitsVector< ALFA_Hit > ALFA_HitCollection
Definition
ALFA_HitCollection.h:13
ALFA_ODHitCollection.h
ALFA_ODHitCollection
AtlasHitsVector< ALFA_ODHit > ALFA_ODHitCollection
Definition
ALFA_ODHitCollection.h:13
ALFA_SensitiveDetectorTool.h
ALFA_SensitiveDetector.h
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
ALFA_SensitiveDetectorTool::ALFA_SensitiveDetectorTool
ALFA_SensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
ALFA_SensitiveDetectorTool.cxx:18
ALFA_SensitiveDetectorTool::Gather
StatusCode Gather(HitCollectionMap &) override final
End of an athena event.
Definition
ALFA_SensitiveDetectorTool.cxx:38
ALFA_SensitiveDetectorTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition
ALFA_SensitiveDetectorTool.cxx:48
ALFA_SensitiveDetectorTool::SetupEvent
StatusCode SetupEvent(HitCollectionMap &) override final
Beginning of an athena event.
Definition
ALFA_SensitiveDetectorTool.cxx:26
ALFA_SensitiveDetector
Definition
ALFA_SensitiveDetector.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