5#ifndef MUONCSC_CNVTOOL_CSCRODREADOUTV0_H
6#define MUONCSC_CNVTOOL_CSCRODREADOUTV0_H
42 bool isBody(
const uint32_t fragment)
const;
44 bool isAddress(
const uint32_t fragment)
const;
98 void set32bits(
const uint16_t* v16, uint32_t& v32)
const;
103 uint32_t sourceIdentifier = 0;
105 return sourceIdentifier;
116 uint32_t p = 0, v = 0;
118 uint16_t pos[] = {0, 16};
119 for (uint16_t i = 0; i < n; i++) {
120 v = (uint32_t)(*(v16 + i));
121 p = (uint32_t)(*(pos + i));
122 v32 = v32 | (v << p);
135 amp1 = 0x0000FFFF & fragment;
136 amp2 = (0xFFFF0000 & fragment) >> 16;
149 int stationName = ((
m_address & 0x00020000) >> 17) + 50;
150 int stationEta = (((
m_address & 0x00010000) >> 16) == 0x0) ? -1 : 1;
151 int stationPhi = ((
m_address & 0x0000E000) >> 13) + 1;
153 return m_cscHelper->elementID(stationName, stationEta, stationPhi);
157 int chamberLayer = ((
m_address & 0x00001000) >> 12) + 1;
158 int wireLayer = ((
m_address & 0x00000E00) >> 9) + 1;
159 int measuresPhi = ((
m_address & 0x00000100) >> 8);
161 return m_cscHelper->channelID(moduleId, chamberLayer, wireLayer, measuresPhi,
strip);
183 int chamberLayer =
m_cscHelper->chamberLayer(channelId);
185 int orientation =
m_cscHelper->measuresPhi(channelId);
189 uint32_t nameIndex = uint32_t(name - 50);
190 uint32_t etaIndex = (
eta == -1) ? 0 : 1;
191 uint32_t phiIndex = uint32_t(
phi - 1);
192 uint32_t chamberIndex = uint32_t(chamberLayer - 1);
193 uint32_t layerIndex = uint32_t(wireLayer - 1);
194 uint32_t stripType = uint32_t(orientation);
195 uint32_t stripNumber = uint32_t(
strip);
199 nameIndex << 17 | etaIndex << 16 | phiIndex << 13 | chamberIndex << 12 | layerIndex << 9 | stripType << 8 | stripNumber;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
void decodeAmplitude(const uint32_t fragment, int index)
uint16_t sourceID() const
static const uint32_t ROD_VERSION
uint16_t subDetectorId() const
static const uint16_t BODY_AMPLITUDE
void encodeFragments(const uint16_t *amplitude, const uint32_t &address, std::vector< uint32_t > &v) const
static const uint32_t ROD_FOOTER_SIZE
uint32_t getHeaderMarker()
static const uint32_t BODY_ADDRESS
double signal(double z) const
static const uint32_t ROD_HEADER_SIZE
double signal_amplitude(double samplingTime) const
bool isBody(const uint32_t fragment) const
static const uint16_t SOURCE_ID
Identifier decodeAddress()
uint32_t getFormatVersion()
bool isAddress(const uint32_t fragment) const
uint16_t moduleType() const
uint32_t address(const Identifier &channelId, int &eta, int &phi) const
void set(const CscIdHelper *cscHelper)
void decodeSourceID(uint32_t sourceId)
const CscIdHelper * m_cscHelper
static const uint32_t ROD_HEADER
~CscRODReadOutV0()=default
static const uint16_t MODULE_TYPE
void set32bits(const uint16_t *v16, uint32_t &v32) const
int m_NUMBER_OF_INTEGRATION
uint32_t getSourceID(uint16_t side, uint16_t rodId)
bool isAmplitude(const uint16_t fragment) const
double m_CHARGE_TO_ADC_COUNT