ATLAS Offline Software
CscRDO_Decoder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "CscRDO_Decoder.h"
6 
7 #include "GaudiKernel/TypeNameString.h"
9 #include "MuonRDO/CscRawData.h"
10 
12 Muon::CscRDO_Decoder::CscRDO_Decoder(const std::string& type, const std::string& name, const IInterface* parent) :
13  base_class(type, name, parent) {}
14 
16  ATH_MSG_DEBUG("CscRDO_Decoder::initialize");
17  ATH_CHECK(m_cabling.retrieve());
18  ATH_CHECK(m_cscCalibTool.retrieve());
19  ATH_MSG_DEBUG(" Parameters are from CscCalibTool ");
20  m_samplingTime = m_cscCalibTool->getSamplingTime();
21  m_signalWidth = m_cscCalibTool->getSignalWidth();
22  m_timeOffset = m_cscCalibTool->getTimeOffset();
23  ATH_MSG_DEBUG(" Initialization is done!");
24  return StatusCode::SUCCESS;
25 }
26 
27 void Muon::CscRDO_Decoder::getDigit(const CscRawData* rawData, const CscIdHelper* cscIdHelper, Identifier& moduleId, Identifier& channelId,
28  double& adc, double& time) const {
29  // get the raw data
30  uint32_t address = rawData->address();
31 
32  // initialize some parameters
33  CscRODReadOut rodReadOut;
34  rodReadOut.set(cscIdHelper);
35  rodReadOut.setChamberBitVaue(1);
36  rodReadOut.setParams(m_timeOffset, m_signalWidth);
37 
38  adc = rodReadOut.findCharge(m_samplingTime, rawData->samples(), time);
39 
40  // now decode the encoded fragments
41  // find the Identifier and charge
42  moduleId = rodReadOut.decodeAddress(address);
43  channelId = rodReadOut.decodeAddress(address, moduleId);
44 }
45 
46 Identifier Muon::CscRDO_Decoder::stationIdentifier(const CscRawData* rawData, const CscIdHelper* cscIdHelper) const {
48  uint32_t address = rawData->address();
49 
50  // initialize some parameters
51  CscRODReadOut rodReadOut;
52  rodReadOut.set(cscIdHelper);
53  rodReadOut.setChamberBitVaue(1);
54  rodReadOut.setParams(m_timeOffset, m_signalWidth);
55 
57  return rodReadOut.decodeAddress(address);
58 }
59 
60 Identifier Muon::CscRDO_Decoder::channelIdentifier(const CscRawData* rawData, const CscIdHelper* cscIdHelper, int j) const {
62  uint32_t address = rawData->address();
63 
64  // initialize some parameters
65  CscRODReadOut rodReadOut;
66  rodReadOut.set(cscIdHelper);
67  rodReadOut.setChamberBitVaue(1);
68  rodReadOut.setParams(m_timeOffset, m_signalWidth);
69 
71  Identifier moduleId = rodReadOut.decodeAddress(address);
72 
73  ATH_MSG_DEBUG(" CscRDO_Decoder OUTPUT ::: " << m_timeOffset << " " << m_samplingTime << " " << m_signalWidth << " "
74  << " " << m_detdescr << " " << address << " " << moduleId << " " << j);
75 
76  return rodReadOut.decodeAddress(address, moduleId, j);
77 }
CscIdHelper.h
CscRODReadOut::decodeAddress
Identifier decodeAddress(const uint32_t address) const
Definition: CscRODReadOut.h:161
CscRODReadOut::findCharge
static int findCharge(double samplingTime, const std::vector< uint16_t > &amplitude, double &time)
Definition: CscRODReadOut.cxx:70
CscRODReadOut::setParams
void setParams(double timeOffset, double signalWidth)
Definition: CscRODReadOut.h:110
CscRawData::address
uint32_t address() const
Definition: CscRawData.h:131
Muon::CscRDO_Decoder::CscRDO_Decoder
CscRDO_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition: CscRDO_Decoder.cxx:12
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Muon::CscRDO_Decoder::initialize
virtual StatusCode initialize() override final
Definition: CscRDO_Decoder.cxx:15
Muon::CscRDO_Decoder::stationIdentifier
virtual Identifier stationIdentifier(const CscRawData *rawData, const CscIdHelper *cscIdHelper) const override final
Definition: CscRDO_Decoder.cxx:46
CscRODReadOut::set
void set(const CscIdHelper *cscIdHelper)
Definition: CscRODReadOut.h:50
CscRODReadOut
Definition: CscRODReadOut.h:22
CscRODReadOut::setChamberBitVaue
void setChamberBitVaue(uint32_t value)
Definition: CscRODReadOut.h:51
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
CscRDO_Decoder.h
Muon::CscRDO_Decoder::channelIdentifier
virtual Identifier channelIdentifier(const CscRawData *rawData, const CscIdHelper *cscIdHelper, int j) const override final
Definition: CscRDO_Decoder.cxx:60
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CscRawData::samples
const std::vector< uint16_t > & samples() const
Definition: CscRawData.h:130
CscRawData.h
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
CscRawData
Class to hold the electronic output for a single CSC readout channel: n sampling ADC data + the addre...
Definition: CscRawData.h:21
CscIdHelper
Definition: CscIdHelper.h:52
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::CscRDO_Decoder::getDigit
virtual void getDigit(const CscRawData *rawData, const CscIdHelper *cscIdHelper, Identifier &moduleId, Identifier &channelId, double &adc, double &time) const override final
Definition: CscRDO_Decoder.cxx:27
Identifier
Definition: IdentifierFieldParser.cxx:14