ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonG4
MuonG4SD
src
RPCSensitiveDetectorTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
RPCSensitiveDetectorTool.h
"
6
#include "
RPCSensitiveDetector.h
"
7
8
#include "
HitManagement/HitCollectionMap.h
"
9
#include "
MuonSimEvent/RPCSimHitCollection.h
"
10
#include <TString.h>
// for Form
11
12
RPCSensitiveDetectorTool::RPCSensitiveDetectorTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
13
:
SensitiveDetectorBase
(
type
, name , parent )
14
{
15
}
16
17
StatusCode
RPCSensitiveDetectorTool::SetupEvent
(
HitCollectionMap
& hitCollections)
18
{
19
hitCollections.
Emplace
<
RPCSimHitCollection
>(
m_outputCollectionNames
[0]);
20
return
StatusCode::SUCCESS;
21
}
22
23
StatusCode
RPCSensitiveDetectorTool::Gather
(
HitCollectionMap
& hitCollections)
24
{
25
return
hitCollections.
Record
<
RPCSimHitCollection
>(
m_outputCollectionNames
[0]);
26
}
27
28
G4VSensitiveDetector*
RPCSensitiveDetectorTool::makeSD
()
const
29
{
30
ATH_MSG_DEBUG
(
"Initializing SD"
);
31
StatusCode
sc
=
m_idHelperSvc
.retrieve();
32
if
(
sc
.isFailure())
throw
std::runtime_error(Form(
"File: %s, Line: %d\nRPCSensitiveDetectorCosmicsTool::makeSD() - could not retrieve MuonIdHelperSvc"
, __FILE__, __LINE__));
33
return
new
RPCSensitiveDetector
(name(),
m_outputCollectionNames
[0],
m_idHelperSvc
->rpcIdHelper().gasGapMax());
34
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
HitCollectionMap.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
RPCSensitiveDetectorTool.h
RPCSensitiveDetector.h
RPCSimHitCollection.h
RPCSimHitCollection
AtlasHitsVector< RPCSimHit > RPCSimHitCollection
Definition
RPCSimHitCollection.h:15
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
RPCSensitiveDetectorTool::SetupEvent
virtual StatusCode SetupEvent(HitCollectionMap &hitCollections) override
Beginning of an athena event.
Definition
RPCSensitiveDetectorTool.cxx:17
RPCSensitiveDetectorTool::RPCSensitiveDetectorTool
RPCSensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
construction/destruction
Definition
RPCSensitiveDetectorTool.cxx:12
RPCSensitiveDetectorTool::Gather
virtual StatusCode Gather(HitCollectionMap &hitCollections) override
End of an athena event.
Definition
RPCSensitiveDetectorTool.cxx:23
RPCSensitiveDetectorTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
RPCSensitiveDetectorTool.h:22
RPCSensitiveDetectorTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition
RPCSensitiveDetectorTool.cxx:28
RPCSensitiveDetector
Definition
RPCSensitiveDetector.h:98
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