ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonDigitization
MDT_Digitization
src
MDT_Response_DigiTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MDT_Response_DigiTool.h
"
6
7
#include <iostream>
8
9
#include "
MDT_Digitization/MdtDigiToolInput.h
"
10
#include "
MuonReadoutGeometry/MdtReadoutElement.h
"
11
#include "
StoreGate/ReadCondHandle.h
"
12
using namespace
MuonGM
;
13
14
MDT_Response_DigiTool::MDT_Response_DigiTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) :
15
AthAlgTool
(
type
, name, parent) {
16
declareInterface<IMDT_DigitizationTool>(
this
);
17
}
18
19
MdtDigiToolOutput
MDT_Response_DigiTool::digitize
(
const
EventContext& ctx,
20
const
MdtDigiToolInput
& input,
21
CLHEP::HepRandomEngine* rndmEngine)
const
{
22
23
SG::ReadCondHandle<MuonGM::MuonDetectorManager>
detMgr{
m_detMgrKey
, ctx};
24
MDT_Response
responseTube{};
25
// initialize MDT_Response
26
responseTube.
SetTubeRadius
(detMgr->getMdtReadoutElement(input.getHitID())->innerTubeRadius());
27
responseTube.
SetClusterDensity
(
m_clusterDensity
);
28
responseTube.
SetAttLength
(
m_attenuationLength
);
29
responseTube.
SetTriggerElectron
(
m_threshold
);
30
31
responseTube.
SetSegment
(input.radius(), input.positionAlongWire());
32
ATH_MSG_DEBUG
(
"Digitizing input "
);
33
if
(
m_DoQballGamma
) {
34
double
ParticleCharge = input.electriccharge();
35
double
ParticleGamma = input.gamma();
36
if
(ParticleGamma > 0.) {
37
if
(responseTube.
GetSignal
(ParticleCharge, ParticleGamma, rndmEngine)) {
38
MdtDigiToolOutput
output(
true
, responseTube.
DriftTime
(), responseTube.
AdcResponse
());
39
return
output;
40
}
41
}
else
{
42
if
(responseTube.
GetSignal
(rndmEngine)) {
43
MdtDigiToolOutput
output(
true
, responseTube.
DriftTime
(), responseTube.
AdcResponse
());
44
return
output;
45
}
46
}
47
48
}
else
{
49
if
(responseTube.
GetSignal
(rndmEngine)) {
50
MdtDigiToolOutput
output(
true
, responseTube.
DriftTime
(), responseTube.
AdcResponse
());
51
return
output;
52
}
53
}
54
MdtDigiToolOutput
output(
false
, 0., 0.);
55
return
output;
56
}
57
58
StatusCode
MDT_Response_DigiTool::initialize
() {
59
ATH_CHECK
(
m_detMgrKey
.initialize());
60
return
StatusCode::SUCCESS;
61
}
62
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
MDT_Response_DigiTool.h
MdtDigiToolInput.h
MdtReadoutElement.h
ReadCondHandle.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
MDT_Response_DigiTool::m_DoQballGamma
Gaudi::Property< bool > m_DoQballGamma
Definition
MDT_Response_DigiTool.h:45
MDT_Response_DigiTool::digitize
MdtDigiToolOutput digitize(const EventContext &ctx, const MdtDigiToolInput &input, CLHEP::HepRandomEngine *rndmEngine) const
Definition
MDT_Response_DigiTool.cxx:19
MDT_Response_DigiTool::m_threshold
Gaudi::Property< double > m_threshold
Definition
MDT_Response_DigiTool.h:43
MDT_Response_DigiTool::initialize
StatusCode initialize()
Definition
MDT_Response_DigiTool.cxx:58
MDT_Response_DigiTool::m_detMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
Definition
MDT_Response_DigiTool.h:39
MDT_Response_DigiTool::m_attenuationLength
Gaudi::Property< double > m_attenuationLength
Definition
MDT_Response_DigiTool.h:44
MDT_Response_DigiTool::m_clusterDensity
Gaudi::Property< double > m_clusterDensity
Definition
MDT_Response_DigiTool.h:42
MDT_Response_DigiTool::MDT_Response_DigiTool
MDT_Response_DigiTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
MDT_Response_DigiTool.cxx:14
MDT_Response
Definition
MDT_Response.h:20
MDT_Response::SetSegment
void SetSegment(double r, double x)
Definition
MDT_Response.h:105
MDT_Response::SetAttLength
void SetAttLength(double len)
Definition
MDT_Response.h:204
MDT_Response::AdcResponse
double AdcResponse() const
Definition
MDT_Response.h:191
MDT_Response::SetClusterDensity
void SetClusterDensity(double dens)
Definition
MDT_Response.h:201
MDT_Response::DriftTime
double DriftTime() const
Definition
MDT_Response.h:179
MDT_Response::GetSignal
bool GetSignal(CLHEP::HepRandomEngine *rndmEngine)
Definition
MDT_Response.cxx:253
MDT_Response::SetTubeRadius
void SetTubeRadius(double radius)
Definition
MDT_Response.h:197
MDT_Response::SetTriggerElectron
void SetTriggerElectron(double el)
Definition
MDT_Response.h:213
MdtDigiToolInput
Definition
MdtDigiToolInput.h:26
MdtDigiToolOutput
Definition
MdtDigiToolOutput.h:19
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition
GeoMuonHits.h:27
type
Generated on
for ATLAS Offline Software by
1.17.0