ATLAS Offline Software
Loading...
Searching...
No Matches
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
7using namespace Muon;
8
9MM_RDO_Decoder::MM_RDO_Decoder(const std::string& type, const std::string& name,const IInterface* parent) :
10 AthAlgTool(type,name,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
25std::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}
#define ATH_CHECK
Evaluate an expression and check for errors.
double charge(const T &p)
Definition AtlasPID.h:997
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
const ServiceHandle< StoreGateSvc > & detStore() const
std::unique_ptr< MmDigit > getDigit(const EventContext &ctx, const Muon::MM_RawData *data) const override final
const MmIdHelper * m_mmIdHelper
MM_RDO_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize() override final
ToolHandle< Muon::INSWCalibTool > m_calibTool
Temporary class to hold the MM RDO.
Definition MM_RawData.h:20
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.