ATLAS Offline Software
Loading...
Searching...
No Matches
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
12using namespace MuonGM;
13
14MDT_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
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());
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
59 ATH_CHECK(m_detMgrKey.initialize());
60 return StatusCode::SUCCESS;
61}
62
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Property< bool > m_DoQballGamma
MdtDigiToolOutput digitize(const EventContext &ctx, const MdtDigiToolInput &input, CLHEP::HepRandomEngine *rndmEngine) const
Gaudi::Property< double > m_threshold
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
Gaudi::Property< double > m_attenuationLength
Gaudi::Property< double > m_clusterDensity
MDT_Response_DigiTool(const std::string &type, const std::string &name, const IInterface *parent)
void SetSegment(double r, double x)
void SetAttLength(double len)
double AdcResponse() const
void SetClusterDensity(double dens)
double DriftTime() const
bool GetSignal(CLHEP::HepRandomEngine *rndmEngine)
void SetTubeRadius(double radius)
void SetTriggerElectron(double el)
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27