ATLAS Offline Software
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 
6 
7 #include <iostream>
8 
12 using namespace MuonGM;
13 
14 MDT_Response_DigiTool::MDT_Response_DigiTool(const std::string& type, const std::string& name, const IInterface* parent) :
16  declareInterface<IMDT_DigitizationTool>(this);
17 }
18 
20  const MdtDigiToolInput& input,
21  CLHEP::HepRandomEngine* rndmEngine) const {
22 
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 
60  return StatusCode::SUCCESS;
61 }
62 
MdtReadoutElement.h
MdtDigiToolInput
Definition: MdtDigiToolInput.h:26
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
MDT_Response::SetTubeRadius
void SetTubeRadius(double radius)
Definition: MDT_Response.h:197
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
MDT_Response_DigiTool::m_clusterDensity
Gaudi::Property< double > m_clusterDensity
Definition: MDT_Response_DigiTool.h:42
MDT_Response_DigiTool::initialize
StatusCode initialize()
Definition: MDT_Response_DigiTool.cxx:58
MDT_Response_DigiTool.h
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_attenuationLength
Gaudi::Property< double > m_attenuationLength
Definition: MDT_Response_DigiTool.h:44
ReadCondHandle.h
MdtDigiToolOutput
Definition: MdtDigiToolOutput.h:19
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
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
merge.output
output
Definition: merge.py:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
MDT_Response_DigiTool::m_detMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
Definition: MDT_Response_DigiTool.h:39
MdtDigiToolInput.h
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MDT_Response
Definition: MDT_Response.h:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MDT_Response_DigiTool::m_DoQballGamma
Gaudi::Property< bool > m_DoQballGamma
Definition: MDT_Response_DigiTool.h:45
MDT_Response_DigiTool::m_threshold
Gaudi::Property< double > m_threshold
Definition: MDT_Response_DigiTool.h:43
AthAlgTool
Definition: AthAlgTool.h:26