Skip to content

Commit 8071c2c

Browse files
Valerii Paninhapol
authored andcommitted
Modify R3BMosaicReader to read WR timestamps
1 parent 21b46b5 commit 8071c2c

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

r3bsource/alpide/R3BMosaicReader.cxx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "R3BAlpideMappedData.h"
1818
#include "R3BLogger.h"
1919
#include "R3BMosaicReader.h"
20+
#include "R3BWRData.h"
2021

2122
#include <TClonesArray.h>
2223
#include <ext_data_struct_info.hh>
@@ -47,6 +48,7 @@ R3BMosaicReader::R3BMosaicReader(EXT_STR_h101_MOSAIC202506_onion* data, size_t o
4748
, fData2506(data)
4849
, fOffset(offset)
4950
, fArray(new TClonesArray("R3BAlpideMappedData"))
51+
, fArray_TS(new TClonesArray("R3BWRData"))
5052
, fVersion(UnpackerMosaicVersion::v202506)
5153
{
5254
}
@@ -57,6 +59,10 @@ R3BMosaicReader::~R3BMosaicReader()
5759
{
5860
delete fArray;
5961
}
62+
if (fArray_TS)
63+
{
64+
delete fArray_TS;
65+
}
6066
}
6167

6268
Bool_t R3BMosaicReader::Init(ext_data_struct_info* a_struct_info)
@@ -79,6 +85,7 @@ Bool_t R3BMosaicReader::Init(ext_data_struct_info* a_struct_info)
7985

8086
// Register output array in tree
8187
FairRootManager::Instance()->Register("AlpideMappedData", "ALPIDE_Map", fArray, !fOnline);
88+
FairRootManager::Instance()->Register("WRAlpideData", "WRAlpide", fArray_TS, true);
8289
Reset();
8390

8491
return kTRUE;
@@ -152,6 +159,12 @@ bool R3BMosaicReader::R3BRead202506()
152159
R3BAlpideMappedData(fAlpideId, 0, 1, fChipId, fData2506->MOSAIC4ROWv[hits], fData2506->MOSAIC4COLv[hits]);
153160
}
154161

162+
// reading timestamps
163+
uint64_t timestamp_m3 = ((uint64_t)fData2506->MOSAIC3T_HI << 32) | (fData2506->MOSAIC3T_LO);
164+
uint64_t timestamp_m4 = ((uint64_t)fData2506->MOSAIC4T_HI << 32) | (fData2506->MOSAIC4T_LO);
165+
new ((*fArray_TS)[fArray_TS->GetEntriesFast()]) R3BWRData(timestamp_m3, 3);
166+
new ((*fArray_TS)[fArray_TS->GetEntriesFast()]) R3BWRData(timestamp_m4, 4);
167+
155168
return kTRUE;
156169
}
157170

@@ -162,6 +175,11 @@ void R3BMosaicReader::Reset()
162175
{
163176
fArray->Clear();
164177
}
178+
// Reset the output array
179+
if (fArray_TS)
180+
{
181+
fArray_TS->Clear();
182+
}
165183
}
166184

167185
ClassImp(R3BMosaicReader)

r3bsource/alpide/R3BMosaicReader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class R3BMosaicReader : public R3BReader
9090
uint16_t fNb_sensors_flex = 6;
9191
// Output array
9292
TClonesArray* fArray = nullptr;
93+
TClonesArray* fArray_TS = nullptr; // timestamps
9394
// Unpacker version
9495
UnpackerMosaicVersion fVersion = UnpackerMosaicVersion::v202402;
9596

0 commit comments

Comments
 (0)