/[PAMELA software]/PamelaDigitizer/Write.cxx
ViewVC logotype

Annotation of /PamelaDigitizer/Write.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Tue May 5 14:17:47 2009 UTC (15 years, 6 months ago) by pamelats
Branch: MAIN
CVS Tags: v3r05, HEAD
Changes since 1.2: +0 -8 lines
Version of digitizer compatible with chewbacca

1 pamelats 1.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 pamelats 1.2 int n=1000000;
14 pamelats 1.1 UShort_t temp[1000000];
15 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
16 pamelats 1.1 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 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
20 pamelats 1.1 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 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
24 pamelats 1.1 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 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
34 pamelats 1.1 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 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
38 pamelats 1.1 swab(fDataND,temp,sizeof(UShort_t)*fNDbuffer); // WE MUST SWAP THE BYTES!!!
39     fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fNDbuffer);
40     };

  ViewVC Help
Powered by ViewVC 1.1.23