1 |
#include "Digitizer.h" |
2 |
|
3 |
void Digitizer::WriteData(){ |
4 |
|
5 |
// Routine that writes the data to a binary file |
6 |
// PSCU data are already swapped |
7 |
fOutputfile.write(reinterpret_cast<char*>(fDataPSCU),sizeof(UShort_t)*fPSCUbuffer); |
8 |
// TRG |
9 |
fOutputfile.write(reinterpret_cast<char*>(fDataTrigger),sizeof(UChar_t)*fTRIGGERbuffer); //30/11/07 SO; it was 153 |
10 |
// TOF |
11 |
fOutputfile.write(reinterpret_cast<char*>(fDataTof),sizeof(UChar_t)*fTOFbuffer); |
12 |
// AC |
13 |
int n=1000000; |
14 |
UShort_t temp[1000000]; |
15 |
memset(temp,0,sizeof(UShort_t)*n); |
16 |
swab(fDataAC,temp,sizeof(UShort_t)*fACbuffer); // WE MUST SWAP THE BYTES!!! |
17 |
fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fACbuffer); |
18 |
// CALO |
19 |
memset(temp,0,sizeof(UShort_t)*n); |
20 |
swab(fDataCALO,temp,sizeof(UShort_t)*fCALOlength); // WE MUST SWAP THE BYTES!!! |
21 |
fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fCALOlength); |
22 |
// TRK |
23 |
memset(temp,0,sizeof(UShort_t)*n); |
24 |
swab(fDataTrack,temp,sizeof(UShort_t)*fTracklength); // WE MUST SWAP THE BYTES!!! |
25 |
fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fTracklength); |
26 |
fTracklength=0; |
27 |
// padding to 64 bytes |
28 |
// |
29 |
if ( fPadding ){ |
30 |
fOutputfile.write(reinterpret_cast<char*>(fDataPadding),sizeof(UChar_t)*fPadding); |
31 |
}; |
32 |
// S4 |
33 |
memset(temp,0,sizeof(UShort_t)*n); |
34 |
swab(fDataS4,temp,sizeof(UShort_t)*fS4buffer); // WE MUST SWAP THE BYTES!!! |
35 |
fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fS4buffer); |
36 |
// ND |
37 |
memset(temp,0,sizeof(UShort_t)*n); |
38 |
swab(fDataND,temp,sizeof(UShort_t)*fNDbuffer); // WE MUST SWAP THE BYTES!!! |
39 |
fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fNDbuffer); |
40 |
}; |