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