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