#include <SRBlockFormatter.h>
Definition at line 16 of file SRBlockFormatter.h.
SRBlockFormatter::SRBlockFormatter |
( |
| ) |
|
SRBlockFormatter::~SRBlockFormatter |
( |
| ) |
|
void SRBlockFormatter::DigiToRaw |
( |
int |
dccid, |
|
|
int |
dcc_channel, |
|
|
int |
flag, |
|
|
FEDRawData & |
rawdata |
|
) |
| |
Definition at line 25 of file SRBlockFormatter.cc.
References gather_cfg::cout, FEDRawData::data(), TauDecayModes::dec, ntuplemaker::iline, reco::print(), FEDRawData::resize(), and FEDRawData::size().
28 if (
debug_)
cout <<
"enter in SRBlockFormatter::DigiToRaw " << endl;
35 int SRid = (dccid -1) / 3 +1;
41 int icode = 1000 * dccid + SRid;
44 std::map<int, int>::const_iterator it_header =
header_.find(icode);
46 if ( it_header !=
header_.end() ) {
47 SRP_index = rawdata.
size() / 8 - Nrows_SRP;
48 if (
debug_)
cout <<
"This SRid is already there." << endl;
51 if (
debug_)
cout <<
"New SR Block added on Raw data " << endl;
53 SRP_index = rawdata.
size() / 8;
54 rawdata.
resize (rawdata.
size() + 8 + 8*Nrows_SRP);
55 unsigned char* ppData = rawdata.
data();
56 ppData[8*SRP_index] = SRid & 0xFF;
57 ppData[8*SRP_index+2] = bx & 0xFF;
58 ppData[8*SRP_index+3] = (bx & 0xF00)>>8;
59 ppData[8*SRP_index+3] |= 0x80;
60 ppData[8*SRP_index+4] = lv1 & 0xFF;
61 ppData[8*SRP_index+5] = (lv1 & 0xF00)>>8;
63 ppData[8*SRP_index+6] = 0;
64 ppData[8*SRP_index+7] = 0x80;
66 if (
debug_)
cout <<
"Added headers and empty lines : " << endl;
71 unsigned char* Data = rawdata.
data();
73 Data[8*
iline + 7] |= 0x80;
74 Data[8*
iline + 3] |= 0x80;
78 unsigned char* pData = rawdata.
data();
82 int nflags = pData[8*(SRP_index-1) +6] & 0x7F;
84 pData[8*(SRP_index-1) + 6] = nflags & 0x7F;
86 int jTT = (dcc_channel-1);
89 int kval = (jTT % 16) / 4;
92 if (
debug_)
cout <<
"Now add SC to SRBlock " <<
dec << dcc_channel <<
" irow ival " <<
dec << irow <<
" " <<
dec << ival << endl;
93 if (
debug_)
cout <<
"new data will be added at line " <<
dec << SRP_index << endl;
96 unsigned char* buff = &pData[8*SRP_index];
97 Word64* pw =
reinterpret_cast<Word64*
>(
const_cast<unsigned char*
>(buff));
98 int nbits = kval*16 + 3*ival;
size_t size() const
Lenght of the data buffer in bytes.
void resize(size_t newsize)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void SRBlockFormatter::StartEvent |
( |
| ) |
|
std::map<int, int> SRBlockFormatter::header_ |
|
private |