@@ -164,23 +164,23 @@ std::vector<char> Digits2Raw::digits2HBTPayload(const gsl::span<gbtword80_t> dig
164164 }
165165 // add what is left: maybe never left anything - tbc
166166 // std::cout << "left:" << gbtword.count() << std::endl;
167- if (gbtword.count ()> 0 ) {
167+ if (gbtword.count () > 0 ) {
168168 LOG (INFO ) << " Adding left over." ;
169169 gbtword80_t gbtsend = gbtword;
170170 for (uint32_t i = 0 ; i < NGBT ; i += 8 ) {
171- uint32_t w = 0 ;
172- for (uint32_t j = 0 ; j < 8 ; j++) {
173- w += (1 << j) * gbtsend[i + j];
174- }
175- char c = w;
176- toAdd.push_back (c);
177- }
178- // Pad zeros up to 128 bits
179- uint32_t NZeros = (o2::raw::RDHUtils::GBTWord * 8 - NGBT ) / 8 ;
180- for (uint32_t i = 0 ; i < NZeros; i++) {
181- char c = 0 ;
182- toAdd.push_back (c);
171+ uint32_t w = 0 ;
172+ for (uint32_t j = 0 ; j < 8 ; j++) {
173+ w += (1 << j) * gbtsend[i + j];
183174 }
175+ char c = w;
176+ toAdd.push_back (c);
177+ }
178+ // Pad zeros up to 128 bits
179+ uint32_t NZeros = (o2::raw::RDHUtils::GBTWord * 8 - NGBT ) / 8 ;
180+ for (uint32_t i = 0 ; i < NZeros; i++) {
181+ char c = 0 ;
182+ toAdd.push_back (c);
183+ }
184184 }
185185 return std::move (toAdd);
186186}
@@ -227,12 +227,12 @@ int Digits2Raw::digit2GBTdigit(gbtword80_t& gbtdigitIR, gbtword80_t& gbtdigitTR,
227227std::vector<gbtword80_t > Digits2Raw::addEmptyBC (std::vector<gbtword80_t >& hbfIRZS)
228228{
229229 std::vector<gbtword80_t > hbfIRnonZS;
230- if (hbfIRZS.size () == 0 ) {
230+ if (hbfIRZS.size () == 0 ) {
231231 LOG (ERROR ) << " Int record with zero size not expected here." ;
232232 return hbfIRnonZS;
233233 }
234234 uint32_t bcnonzero = 0 ;
235- if (hbfIRZS[0 ] != 0 ) {
235+ if (hbfIRZS[0 ] != 0 ) {
236236 gbtword80_t bs = 0 ;
237237 hbfIRnonZS.push_back (bs);
238238 }
@@ -251,25 +251,27 @@ std::vector<gbtword80_t> Digits2Raw::addEmptyBC(std::vector<gbtword80_t>& hbfIRZ
251251 }
252252 return hbfIRnonZS;
253253}
254- void Digits2Raw::printDigit (std::string text, const gbtword80_t & dig) const {
255- int bcid = 0 ;
254+ void Digits2Raw::printDigit (std::string text, const gbtword80_t & dig) const
255+ {
256+ int bcid = 0 ;
256257 uint64_t payload1 = 0 ;
257258 uint64_t payload2 = 0 ;
258259 std::cout << text;
259- for (int i = 0 ; i< 12 ; i++) {
260+ for (int i = 0 ; i < 12 ; i++) {
260261 bcid += dig[i] << i;
261262 }
262- for (uint64_t i = 0 ; i < 64 ; i++) {
263+ for (uint64_t i = 0 ; i < 64 ; i++) {
263264 payload1 += uint64_t (dig[i]) << i;
264265 }
265- for (uint64_t i = 64 ; i < NGBT ; i++) {
266- payload2 += uint64_t (dig[i]) << (i- 64ull );
266+ for (uint64_t i = 64 ; i < NGBT ; i++) {
267+ payload2 += uint64_t (dig[i]) << (i - 64ull );
267268 }
268- std::cout << " BCID:" << std::hex << bcid << " " << payload2 << payload1 << std::endl;
269+ std::cout << " BCID:" << std::hex << bcid << " " << payload2 << payload1 << std::endl;
269270}
270- void Digits2Raw::dumpRawData (std::string filename) {
271- std::ifstream input ( filename, std::ios::binary );
272- std::vector<unsigned char > buffer (std::istreambuf_iterator<char >(input),{});
273- for (auto const &cc: buffer) {
271+ void Digits2Raw::dumpRawData (std::string filename)
272+ {
273+ std::ifstream input (filename, std::ios::binary);
274+ std::vector<unsigned char > buffer (std::istreambuf_iterator<char >(input), {});
275+ for (auto const & cc : buffer) {
274276 }
275277}
0 commit comments