Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Jérémie Dudouet
gammaware
Commits
dc1e3071
Commit
dc1e3071
authored
Oct 27, 2021
by
Jérémie Dudouet
Browse files
correct an error on the cdat type compression (gain a factor 2 in compression :) )
parent
50a0faf8
Pipeline
#144252
passed with stage
in 14 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
src/adf/CrystalFrame.icpp
src/adf/CrystalFrame.icpp
+27
-12
No files found.
src/adf/CrystalFrame.icpp
View file @
dc1e3071
...
...
@@ -223,20 +223,19 @@ UInt_t CompressedCrystalFrame_::ReadImp()
fCompressedSignal->Import(fBuffer);
unsigned char* CompTrace = ( unsigned char*)fCompressedSignal->Address(&dummy);
unsigned int
ll
= uncompress_trace(CompTrace,length,seg->GetSignal()->Address(&dummy));
unsigned int
nsamp
= uncompress_trace(CompTrace,length
*2
,seg->GetSignal()->Address(&dummy));
seg->GetSignal()->Resize(
ll
,'n');
seg->GetSignal()->Resize(
nsamp
,'n');
if(
ll
!= CrystalInterface::kDefaultLength) {
std::cout<<"Error in CrystalFrame.icpp => CrystalInterface::kDefaultLength differ from the uncompressed
value
" << std::endl;
std::cout<<"CrystalInterface::kDefaultLength = " << CrystalInterface::kDefaultLength << " ; uncompressed trace
size
: " <<
ll
<< std::endl;
if(
nsamp
!= CrystalInterface::kDefaultLength) {
std::cout<<"Error in CrystalFrame.icpp => CrystalInterface::kDefaultLength differ from the uncompressed
trace length
" << std::endl;
std::cout<<"CrystalInterface::kDefaultLength = " << CrystalInterface::kDefaultLength << " ; uncompressed trace
length
: " <<
nsamp
<< std::endl;
seg->GetSignal()->Reset();
}
}
for (UShort_t i = 0u; i < kNbCores; i++ ) {
GeCore *core = fCore.At(i); (*fBuffer) >> length >> status >> id >> energy >> t;
core->SetStatus(status);
core->SetID(id);
core->SetE(energy);
...
...
@@ -248,16 +247,15 @@ UInt_t CompressedCrystalFrame_::ReadImp()
fCompressedSignal->Import(fBuffer);
unsigned char* CompTrace = ( unsigned char*)fCompressedSignal->Address(&dummy);
unsigned int
ll
= uncompress_trace(CompTrace,length,core->GetSignal()->Address(&dummy));
unsigned int
nsamp
= uncompress_trace(CompTrace,length
*2
,core->GetSignal()->Address(&dummy));
core->GetSignal()->Resize(
ll
,'n');
core->GetSignal()->Resize(
nsamp
,'n');
if(
ll
!= CrystalInterface::kDefaultLength) {
std::cout<<"Error in CrystalFrame.icpp => CrystalInterface::kDefaultLength differ from the uncompressed
value
" << std::endl;
std::cout<<"CrystalInterface::kDefaultLength = " << CrystalInterface::kDefaultLength << " ; uncompressed trace
size
: " <<
ll
<< std::endl;
if(
nsamp
!= CrystalInterface::kDefaultLength) {
std::cout<<"Error in CrystalFrame.icpp => CrystalInterface::kDefaultLength differ from the uncompressed
trace length
" << std::endl;
std::cout<<"CrystalInterface::kDefaultLength = " << CrystalInterface::kDefaultLength << " ; uncompressed trace
length
: " <<
nsamp
<< std::endl;
core->GetSignal()->Reset();
}
}
return fBuffer->Offset();
}
...
...
@@ -283,7 +281,15 @@ UInt_t CompressedCrystalFrame_::WriteImp()
energy = (Float_t)seg->GetE();
unsigned char* fCompTrace = ( unsigned char*)fCompressedSignal->Address(&dummy);
// as we don't know the compressed size, make sure to have enough space
fCompressedSignal->Resize(CrystalInterface::kDefaultLength,'-');
length = compress_trace(seg->GetSignal()->Address(&dummy),fCompTrace);
// To allow a simplified inspection of the compressed data each trace is aligned to an an even number of bytes
// The possible extra byte has been zeroed by the compression routine;
// The decompression is not influenced by the possible extra byte.
length = (length+1)/2;
fCompressedSignal->Resize(length,'-');
...
...
@@ -299,7 +305,16 @@ UInt_t CompressedCrystalFrame_::WriteImp()
t = (Float_t)core->GetT();
unsigned char* fCompTrace = ( unsigned char*)fCompressedSignal->Address(&dummy);
// as we don't know the compressed size, make sure to have enough space
fCompressedSignal->Resize(CrystalInterface::kDefaultLength,'-');
length = compress_trace(core->GetSignal()->Address(&dummy),fCompTrace);
// To allow a simplified inspection of the compressed data each trace is aligned to an an even number of bytes
// The possible extra byte has been zeroed by the compression routine;
// The decompression is not influenced by the possible extra byte.
length = (length+1)/2;
fCompressedSignal->Resize(length,'-');
(*fBuffer) << length << core->GetStatus() << core->GetID() << energy << t;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment