ATLAS Offline Software
MM_RDO_Decoder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MM_RDO_Decoder.h"
6 
7 using namespace Muon;
8 
9 MM_RDO_Decoder::MM_RDO_Decoder(const std::string& type, const std::string& name,const IInterface* parent) :
11  m_mmIdHelper(nullptr)
12 {
13  declareInterface< Muon::IMM_RDO_Decoder >( this );
14 }
15 
17 
18  ATH_CHECK(detStore()->retrieve(m_mmIdHelper, "MMIDHELPER"));
19  ATH_CHECK(m_calibTool.retrieve());
20 
21  return StatusCode::SUCCESS;
22 }
23 
24 
25 std::unique_ptr<MmDigit> Muon::MM_RDO_Decoder::getDigit(const EventContext& ctx,
26  const Muon::MM_RawData* data) const {
27 
28  // unit conversion
29  const Identifier Id = data->identify();
30  int tdo = data->time();
31  int pdo = data->charge();
32  uint16_t relBcid = data->relBcid();
33  // MM_RawData has time and charge in counts, need physical units
34  float charge{0}, time{0.};
35  m_calibTool->tdoToTime (ctx, data->timeAndChargeInCounts(), tdo, Id, time , relBcid);
36  m_calibTool->pdoToCharge(ctx, data->timeAndChargeInCounts(), pdo, Id, charge );
37 
38 
39  // MM_RawData is built using only the first 4 values. The others are now simply filled proper objects.
40  return std::make_unique<MmDigit>(Id, time, charge);
41 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::MM_RDO_Decoder::m_calibTool
ToolHandle< Muon::INSWCalibTool > m_calibTool
Definition: MM_RDO_Decoder.h:41
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::MM_RDO_Decoder::MM_RDO_Decoder
MM_RDO_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MM_RDO_Decoder.cxx:9
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
MM_RDO_Decoder.h
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
Muon::MM_RawData
Temporary class to hold the MM RDO.
Definition: MM_RawData.h:20
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MM_RDO_Decoder::m_mmIdHelper
const MmIdHelper * m_mmIdHelper
Definition: MM_RDO_Decoder.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
charge
double charge(const T &p)
Definition: AtlasPID.h:538
Muon::MM_RDO_Decoder::initialize
virtual StatusCode initialize() override final
Definition: MM_RDO_Decoder.cxx:16
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthAlgTool
Definition: AthAlgTool.h:26
Muon::MM_RDO_Decoder::getDigit
std::unique_ptr< MmDigit > getDigit(const EventContext &ctx, const Muon::MM_RawData *data) const override final
Definition: MM_RDO_Decoder.cxx:25
Identifier
Definition: IdentifierFieldParser.cxx:14