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

Annotation of /PamelaDigitizer/Write.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Wed Oct 15 14:03:23 2008 UTC (16 years, 1 month ago) by pamelats
Branch: MAIN
CVS Tags: v3r04, v3r03
Changes since 1.1: +6 -33 lines
Cambiamenti principali: TOF, AC; cambiamenti di struttura (tutti *h esterni si trovano in Digitizer.h)

1 pamelats 1.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 pamelats 1.2 int n=1000000;
22 pamelats 1.1 UShort_t temp[1000000];
23 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
24 pamelats 1.1 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 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
28 pamelats 1.1 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 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
32 pamelats 1.1 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 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
42 pamelats 1.1 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 pamelats 1.2 memset(temp,0,sizeof(UShort_t)*n);
46 pamelats 1.1 swab(fDataND,temp,sizeof(UShort_t)*fNDbuffer); // WE MUST SWAP THE BYTES!!!
47     fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fNDbuffer);
48     };

  ViewVC Help
Powered by ViewVC 1.1.23