ATLAS Offline Software
STGC_RDO_Decoder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONBYTESTREAMSTGCRDODECODER_H
6 #define MUONBYTESTREAMSTGCRDODECODER_H
7 
9 
10 #include "MuonRDO/STGC_RawData.h"
13 
16 
17 #include <inttypes.h>
18 #include <vector>
19 
21 
22 namespace 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 Muon::STGC_RawData * data) const override;
37 
38  private:
39 
41  ToolHandle<Muon::INSWCalibTool> m_calibTool{this,"CalibrationTool", ""};
42 
43  };
44 
45 }
46 
48 {
49 
50  const EventContext& ctx = Gaudi::Hive::currentContext();
51  // unit conversion
52  Identifier Id = data->identify();
53  int tdo = data->tdo();
54  int pdo = data->charge();
55  uint16_t bcTag = data->bcTag();
56  bool isDead = data->isDead();
57  // MM_RawData has time and charge in counts, need physical units
58  float charge{0.}, time{0.};
59  m_calibTool->tdoToTime (ctx, data->timeAndChargeInCounts(), tdo, Id, time , bcTag);
60  m_calibTool->pdoToCharge(ctx, data->timeAndChargeInCounts(), pdo, Id, charge );
61 
62  sTgcDigit* stgcDigit = new sTgcDigit(Id,bcTag,time,charge,isDead,true);
63 
64  return stgcDigit;
65 }
66 
67 #endif
Muon::ISTGC_RDO_Decoder
Definition: ISTGC_RDO_Decoder.h:18
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
sTgcIdHelper.h
Muon::STGC_RDO_Decoder::initialize
virtual StatusCode initialize() override
Definition: STGC_RDO_Decoder.cxx:16
INSWCalibTool.h
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::STGC_RDO_Decoder::STGC_RDO_Decoder
STGC_RDO_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
Definition: STGC_RDO_Decoder.cxx:9
STGC_RawData.h
sTgcDigit
Definition: sTgcDigit.h:20
Muon::STGC_RDO_Decoder::m_stgcIdHelper
const sTgcIdHelper * m_stgcIdHelper
Definition: STGC_RDO_Decoder.h:40
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
Muon::STGC_RawData
Definition: STGC_RawData.h:14
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Muon::STGC_RDO_Decoder::m_calibTool
ToolHandle< Muon::INSWCalibTool > m_calibTool
Definition: STGC_RDO_Decoder.h:41
Muon::STGC_RDO_Decoder
Definition: STGC_RDO_Decoder.h:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
charge
double charge(const T &p)
Definition: AtlasPID.h:538
sTgcIdHelper
Definition: sTgcIdHelper.h:55
ISTGC_RDO_Decoder.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
bcTag
unsigned bcTag(unsigned bcBitMap)
Definition: TgcByteStreamData.h:359
Muon::STGC_RDO_Decoder::getDigit
sTgcDigit * getDigit(const Muon::STGC_RawData *data) const override
Definition: STGC_RDO_Decoder.h:47
sTgcDigit.h
NswCalibDbTimeChargeData
Definition: NswCalibDbTimeChargeData.h:19
AthAlgTool
Definition: AthAlgTool.h:26
Identifier
Definition: IdentifierFieldParser.cxx:14