ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Atlas
G4AtlasTools
G4AtlasTools
SensitiveDetectorBase.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef G4ATLASTOOLS_SENSITIVEDETECTORBASE_H
6
#define G4ATLASTOOLS_SENSITIVEDETECTORBASE_H
7
8
// Base classes
9
#include "
AthenaBaseComps/AthAlgTool.h
"
10
#include "
G4AtlasInterfaces/ISensitiveDetector.h
"
11
12
// Members
13
#include "G4VSensitiveDetector.hh"
14
#include "G4Types.hh"
15
#include <GaudiKernel/StatusCode.h>
16
17
// STL library
18
#include <string>
19
#include <vector>
20
21
// Forward declarations
22
class
G4LogicalVolume;
23
class
G4VSensitiveDetector;
24
25
38
class
SensitiveDetectorBase
:
public
extends<AthAlgTool, ISensitiveDetector>
39
{
40
41
public
:
42
44
SensitiveDetectorBase
(
const
std::string&
type
,
const
std::string& name,
45
const
IInterface *parent);
47
virtual
~SensitiveDetectorBase
() =
default
;
48
54
StatusCode
initializeSD
()
override
;
55
57
59
virtual
StatusCode
SetupEvent
(
HitCollectionMap
&)
override
{
60
return
StatusCode::SUCCESS;
61
}
62
64
66
virtual
StatusCode
Gather
(
HitCollectionMap
&)
override
{
67
return
StatusCode::SUCCESS;
68
};
69
70
protected
:
71
73
74
StatusCode
assignSD
(std::unique_ptr<G4VSensitiveDetector> sd,
75
const
std::vector<std::string>& volumes)
const
;
76
78
Gaudi::Property<std::vector<std::string> >
m_volumeNames
{
this
,
"LogicalVolumeNames"
, {}};
80
Gaudi::Property<std::vector<std::string> >
m_outputCollectionNames
{
this
,
"OutputCollectionNames"
, {}};
81
83
Gaudi::Property<bool>
m_noVolumes
{
this
,
"NoVolumes"
,
false
};
84
86
void
SetSensitiveDetector
(G4LogicalVolume*, G4VSensitiveDetector*)
const
;
87
88
private
:
90
92
static
bool
matchStrings
(
const
char
*first,
const
char
* second);
93
94
};
// class SensitiveDetectorBase
95
96
#endif
AthAlgTool.h
ISensitiveDetector.h
HitCollectionMap
Small wrapper around hit collection map to facilitate accessing the hit collection.
Definition
HitCollectionMap.h:23
SensitiveDetectorBase::assignSD
StatusCode assignSD(std::unique_ptr< G4VSensitiveDetector > sd, const std::vector< std::string > &volumes) const
Assign SD to a list of volumes.
Definition
SensitiveDetectorBase.cxx:56
SensitiveDetectorBase::SetupEvent
virtual StatusCode SetupEvent(HitCollectionMap &) override
Beginning of an athena event.
Definition
SensitiveDetectorBase.h:59
SensitiveDetectorBase::m_volumeNames
Gaudi::Property< std::vector< std::string > > m_volumeNames
All the volumes to which this SD is assigned.
Definition
SensitiveDetectorBase.h:78
SensitiveDetectorBase::initializeSD
StatusCode initializeSD() override
Setup an SD in the current thread.
Definition
SensitiveDetectorBase.cxx:25
SensitiveDetectorBase::~SensitiveDetectorBase
virtual ~SensitiveDetectorBase()=default
Empty virtual destructor.
SensitiveDetectorBase::m_noVolumes
Gaudi::Property< bool > m_noVolumes
This SensitiveDetector has no volumes associated with it.
Definition
SensitiveDetectorBase.h:83
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
SensitiveDetectorBase::matchStrings
static bool matchStrings(const char *first, const char *second)
Match two strings with wildcard support.
Definition
SensitiveDetectorBase.cxx:115
SensitiveDetectorBase::SetSensitiveDetector
void SetSensitiveDetector(G4LogicalVolume *, G4VSensitiveDetector *) const
Method stolen from G4VUserDetectorConstruction in G4 10.2.
Definition
SensitiveDetectorBase.cxx:143
SensitiveDetectorBase::Gather
virtual StatusCode Gather(HitCollectionMap &) override
End of an athena event.
Definition
SensitiveDetectorBase.h:66
type
Generated on
for ATLAS Offline Software by
1.17.0