|
ATLAS Offline Software
|
Go to the documentation of this file.
15 std::vector<float> digits = digi->
samples();
17 w = (
gain << 15) + (digits.size() << 8) + chID;
18 for (
unsigned int i=0;
i+1<digits.size();
i+=2) {
19 w += (
int)digits[
i] << 16;
23 if (digits.size() % 2 != 0) {
24 w += (
int)digits[digits.size()-1] << 16;
29 return digits.size() / 2 + 1;
34 std::array< std::vector<float>, 3 >
37 std::array< std::vector<float>, 3 > digiVec;
39 digiVec[0].reserve(dataWordsPerChip);
40 digiVec[1].reserve(dataWordsPerChip);
41 digiVec[2].reserve(dataWordsPerChip);
43 for(
int sampl=0;sampl<dataWordsPerChip;++sampl) {
44 int word = (*data); ++
data;
45 digiVec[0].push_back((
float)(word & 0x3ff));
46 digiVec[1].push_back((
float)((word>>10) & 0x3ff));
47 digiVec[2].push_back((
float)((word>>20) & 0x3ff));
70 for(
n=0; modeFound<5 &&
n<chipCount;++
n) {
72 BCID = (*wordPtr) & 0xfff;
74 if (((wordPtr[0]>>31) == 1) && ((wordPtr[1]>>31) == 0)) ++modeFound;
76 wordPtr += wordsPerChip;
79 if(0 == modeFound)
BCID = (*
data & 0xfff);
91 bool modeFound =
false;
94 for(
n=0;!modeFound &&
n<chipCount;++
n) {
96 digiMode = ((*wordPtr)>>15) & 0x3;
98 modeFound = ((wordPtr[0]>>31) == 1) && ((wordPtr[1]>>31) == 0);
100 wordPtr += wordsPerChip;
105 for(
n=0;!modeFound &&
n<chipCount;++
n) {
106 digiMode = ((*wordPtr)>>15) & 0x3;
108 modeFound = ((wordPtr[0]>>31) == 1) && ((wordPtr[1]>>31) == 0);
109 wordPtr += wordsPerChip;
114 if(
m_verbose) std::cout<<
"<TileD2B> No valid header found, assuming normal mode!"<<std::endl;
118 if(digiMode > 0)
n <<= 1;
119 if(
checkWordParity(wordPtr)) std::cout<<
"<TileD2B> DigiMode "<<digiMode<<
" found in chip header "<<
n<<std::endl;
120 else std::cout<<
"<TileD2B> DigiMode "<<digiMode<<
" found in chip header "<<
n<<
" with BAD PARITY"<<std::endl;
121 if(digiMode > 0) std::cout<<
"<TileD2B> Calibration mode selected!"<<std::endl;
135 res ^= ((*data) >> 1);
char data[hepevt_bytes_allocation_ATLAS]
int getBCID(const uint32_t *data, int chipCount, int wordsPerChip) const
Get BCID from Chip header, bit 0-11.
bool is_low_gain(const HWIdentifier &id) const
Test ID for low gain.
bool checkStartBit(const uint32_t *data, int length, uint32_t startbit) const
Check that the MSB of <length> words are equal to LSB of <startbit>
HWIdentifier adc_HWID(void) const
int getBytes(const TileDigits *digi, const TileHWID *tileHWID, std::vector< unsigned int > &v)
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
uint32_t calculateParity(const uint32_t *data) const
Calculate parity for one word.
bool checkWordParity(const uint32_t *data) const
Verify ODD parity for one word.
Helper class for TileCal online (hardware) identifiers.
int getGain(const uint32_t *data, int chan) const
Extract gain for <chip> in chip header.
uint32_t checkParity(const uint32_t *data, int length) const
Verify parity for <length> words.
std::pair< std::vector< unsigned int >, bool > res
int getDigiMode(const uint32_t *data, int chipCount, int wordsPerChip) const
Determine digitizer mode for a number of channels.
const std::vector< float > & samples() const
std::array< std::vector< float >, 3 > getDigits(const uint32_t *data, int dataWordsPerChip) const
Extract samples(digits) for 3 channels, stored in 9 words.