ATLAS Offline Software
Loading...
Searching...
No Matches
STGC_RDO_Decoder.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONBYTESTREAMSTGCRDODECODER_H
6#define MUONBYTESTREAMSTGCRDODECODER_H
7
9
13
16
17#include <inttypes.h>
18#include <vector>
19
21
22namespace Muon {
23 // Decoder class for conversion from STGC RDOs to STGC digits
24 // Stefano Rosati - CERN Jan 2004
25 // Adapted for STGCs from Alexandre Laurier - June 2019
26
27 class STGC_RDO_Decoder: public AthAlgTool, virtual public ISTGC_RDO_Decoder {
28
29 public:
30
31 STGC_RDO_Decoder( const std::string& type, const std::string& name,
32 const IInterface* parent ) ;
33
34 virtual StatusCode initialize() override;
35
36 sTgcDigit * getDigit(const EventContext& ctx, const Muon::STGC_RawData * data) const override;
37
38 private:
39
41 ToolHandle<Muon::INSWCalibTool> m_calibTool{this,"CalibrationTool", ""};
42
43 };
44
45}
46
47inline sTgcDigit * Muon::STGC_RDO_Decoder::getDigit(const EventContext& ctx, const Muon::STGC_RawData* data) const
48{
49 // unit conversion
50 Identifier Id = data->identify();
51 int tdo = data->tdo();
52 int pdo = data->charge();
53 uint16_t bcTag = data->bcTag();
54 bool isDead = data->isDead();
55 // MM_RawData has time and charge in counts, need physical units
56 float charge{0.}, time{0.};
57 m_calibTool->tdoToTime (ctx, data->timeAndChargeInCounts(), tdo, Id, time , bcTag);
58 m_calibTool->pdoToCharge(ctx, data->timeAndChargeInCounts(), pdo, Id, charge );
59
60 sTgcDigit* stgcDigit = new sTgcDigit(Id,bcTag,time,charge,isDead,true);
61
62 return stgcDigit;
63}
64
65#endif
double charge(const T &p)
Definition AtlasPID.h:997
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
unsigned bcTag(unsigned bcBitMap)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual StatusCode initialize() override
STGC_RDO_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
ToolHandle< Muon::INSWCalibTool > m_calibTool
sTgcDigit * getDigit(const EventContext &ctx, const Muon::STGC_RawData *data) const override
const sTgcIdHelper * m_stgcIdHelper
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.