Skip to content

Commit

Permalink
Merge pull request #1 from aphecetche/preclustering-test
Browse files Browse the repository at this point in the history
[MCH] From vector to span in dataDecoderSpec
  • Loading branch information
alice-mch authored Mar 25, 2020
2 parents 6b1049e + d846a68 commit 61ce931
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Detectors/MUON/MCH/Raw/Tools/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DisableFormat: true
SortIncludes: false

3 changes: 2 additions & 1 deletion Detectors/MUON/MCH/Raw/Tools/DataDecoderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ class DataDecoderTask
//std::cout<<"raw: "<<(void*)raw<<std::endl;
//std::cout<<"payload: "<<(void*)payload<<std::endl;

std::vector<uint8_t> buffer((uint8_t*)raw, ((uint8_t*)raw)+payloadSize+sizeof(o2::header::RAWDataHeaderV4));
// std::vector<uint8_t> buffer((uint8_t*)raw, ((uint8_t*)raw)+payloadSize+sizeof(o2::header::RAWDataHeaderV4));
gsl::span<uint8_t> buffer(const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(raw)), payloadSize+sizeof(o2::header::RAWDataHeaderV4));
decoder.decodeBuffer(buffer, digits);
}

Expand Down
3 changes: 1 addition & 2 deletions Detectors/MUON/MCH/Raw/Tools/RawBufferDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ class RawBufferDecoder
cruLink2solar = o2::mch::raw::createCruLink2SolarMapper<ElectronicMapperGenerated>();
}

void decodeBuffer(std::vector<uint8_t> &buffer, std::vector<o2::mch::Digit> &digits)
void decodeBuffer(gsl::span<uint8_t> sbuffer, std::vector<o2::mch::Digit> &digits)
{
//bool verbose = false;
gsl::span<uint8_t> sbuffer(buffer);

size_t ndigits{0};

Expand Down

0 comments on commit 61ce931

Please sign in to comment.