ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonG4
MuonG4SD
src
MDTSensitiveDetectorCosmicsTool.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 "
MDTSensitiveDetectorCosmicsTool.h
"
6
#include "
MDTSensitiveDetectorCosmics.h
"
7
8
#include "
HitManagement/HitCollectionMap.h
"
9
#include "
MuonSimEvent/MDTSimHitCollection.h
"
10
#include <TString.h>
// for Form
11
12
MDTSensitiveDetectorCosmicsTool::MDTSensitiveDetectorCosmicsTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
13
:
SensitiveDetectorBase
(
type
, name , parent )
14
{
15
}
16
17
StatusCode
MDTSensitiveDetectorCosmicsTool::SetupEvent
(
HitCollectionMap
& hitCollections)
18
{
19
hitCollections.
Emplace
<
MDTSimHitCollection
>(
m_outputCollectionNames
[0]);
20
return
StatusCode::SUCCESS;
21
}
22
23
StatusCode
MDTSensitiveDetectorCosmicsTool::Gather
(
HitCollectionMap
& hitCollections)
24
{
25
return
hitCollections.
Record
<
MDTSimHitCollection
>(
m_outputCollectionNames
[0]);
26
}
27
28
G4VSensitiveDetector*
MDTSensitiveDetectorCosmicsTool::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\nMDTSensitiveDetectorCosmicsTool::makeSD() - could not retrieve MuonIdHelperSvc"
, __FILE__, __LINE__));
33
return
new
MDTSensitiveDetectorCosmics
(name(),
m_outputCollectionNames
[0],
m_idHelperSvc
->mdtIdHelper().tubeMax());
34
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
HitCollectionMap.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
MDTSensitiveDetectorCosmicsTool.h
MDTSensitiveDetectorCosmics.h
MDTSimHitCollection.h
MDTSimHitCollection
AtlasHitsVector< MDTSimHit > MDTSimHitCollection
Definition
MDTSimHitCollection.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
MDTSensitiveDetectorCosmicsTool::MDTSensitiveDetectorCosmicsTool
MDTSensitiveDetectorCosmicsTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
MDTSensitiveDetectorCosmicsTool.cxx:12
MDTSensitiveDetectorCosmicsTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition
MDTSensitiveDetectorCosmicsTool.cxx:28
MDTSensitiveDetectorCosmicsTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
MDTSensitiveDetectorCosmicsTool.h:21
MDTSensitiveDetectorCosmicsTool::SetupEvent
virtual StatusCode SetupEvent(HitCollectionMap &hitCollections) override
Beginning of an athena event.
Definition
MDTSensitiveDetectorCosmicsTool.cxx:17
MDTSensitiveDetectorCosmicsTool::Gather
virtual StatusCode Gather(HitCollectionMap &hitCollections) override
End of an athena event.
Definition
MDTSensitiveDetectorCosmicsTool.cxx:23
MDTSensitiveDetectorCosmics
Definition
MDTSensitiveDetectorCosmics.h:90
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