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
6268Bool_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
167185ClassImp (R3BMosaicReader)
0 commit comments