ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
HighGranularityTimingDetector
HGTD_G4
HGTD_G4_SD
src
HGTDSensorSDTool.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
// HGTD Sensitive Detector.
6
// The Hits are processed here. For every hit, the position and information
7
// on the sensor in which the interaction happened are obtained.
8
9
// Class header
10
#include "
HGTDSensorSDTool.h
"
11
12
// For the SD itself
13
#include "
HGTDSensorSD.h
"
14
#include "
HGTDSensorGmxSD.h
"
15
16
#include <GeoModelRead/ReadGeoModel.h>
17
#include "
HitManagement/HitCollectionMap.h
"
18
#include "
InDetSimEvent/SiHitCollection.h
"
19
20
// STL includes
21
#include <exception>
22
23
HGTDSensorSDTool::HGTDSensorSDTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
24
:
SensitiveDetectorBase
(
type
, name , parent )
25
{
26
}
27
28
StatusCode
HGTDSensorSDTool::SetupEvent
(
HitCollectionMap
& hitCollections)
29
{
30
hitCollections.
Emplace
<
SiHitCollection
>(
m_outputCollectionNames
[0],
31
m_outputCollectionNames
[0]);
32
return
StatusCode::SUCCESS;
33
}
34
35
StatusCode
HGTDSensorSDTool::Gather
(
HitCollectionMap
& hitCollections)
36
{
37
CHECK
(hitCollections.
Record
<
SiHitCollection
>(
m_outputCollectionNames
[0]));
38
return
StatusCode::SUCCESS;
39
}
40
41
G4VSensitiveDetector*
HGTDSensorSDTool::makeSD
()
const
42
{
43
// Make sure the job has been set up properly
44
ATH_MSG_DEBUG
(
"Initializing SD"
);
45
GeoModelIO::ReadGeoModel* sqlreader =
nullptr
;
46
StatusCode
sc
=
m_geoDbTagSvc
.retrieve();
47
if
(
sc
.isFailure()) {
48
msg
(MSG::ERROR) <<
"Could not locate GeoDbTagSvc"
<<
endmsg
;
49
}
50
else
{
51
sqlreader =
m_geoDbTagSvc
->getSqliteReader();
52
}
53
// Create a fresh SD
54
if
(!
m_gmxSensor
){
55
return
new
HGTDSensorSD
(name(),
m_outputCollectionNames
[0]);
56
}
else
{
57
return
new
HGTDSensorGmxSD
(name(),
m_outputCollectionNames
[0], sqlreader);
58
}
59
60
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
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
HGTDSensorGmxSD.h
HGTDSensorSDTool.h
HGTDSensorSD.h
HitCollectionMap.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
SiHitCollection.h
SiHitCollection
AtlasHitsVector< SiHit > SiHitCollection
Definition
SiHitCollection.h:14
HGTDSensorGmxSD
Definition
HGTDSensorGmxSD.h:33
HGTDSensorSDTool::makeSD
virtual G4VSensitiveDetector * makeSD() const override final
Definition
HGTDSensorSDTool.cxx:41
HGTDSensorSDTool::SetupEvent
virtual StatusCode SetupEvent(HitCollectionMap &) override final
Beginning of an athena event.
Definition
HGTDSensorSDTool.cxx:28
HGTDSensorSDTool::m_gmxSensor
Gaudi::Property< bool > m_gmxSensor
Definition
HGTDSensorSDTool.h:39
HGTDSensorSDTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition
HGTDSensorSDTool.h:40
HGTDSensorSDTool::HGTDSensorSDTool
HGTDSensorSDTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
HGTDSensorSDTool.cxx:23
HGTDSensorSDTool::Gather
virtual StatusCode Gather(HitCollectionMap &) override final
End of an athena event.
Definition
HGTDSensorSDTool.cxx:35
HGTDSensorSD
Definition
HGTDSensorSD.h:29
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
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0