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

Diff of /PamelaDigitizer/Write.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by pamelats, Wed May 21 09:50:48 2008 UTC revision 1.2 by pamelats, Wed Oct 15 14:03:23 2008 UTC
# Line 1  Line 1 
 #include <sstream>  
 #include <fstream>  
 #include <stdlib.h>  
 #include <stdio.h>  
 #include <string.h>  
 #include <ctype.h>  
 #include <time.h>  
 #include "Riostream.h"  
 #include "TFile.h"  
 #include "TDirectory.h"  
 #include "TTree.h"  
 #include "TLeafI.h"  
 #include "TH1.h"  
 #include "TH2.h"  
 #include "TF1.h"  
 #include "TMath.h"  
 #include "TRandom.h"  
 #include "TSQLServer.h"  
 #include "TSystem.h"  
 #include "CalibTrk1Event.h"  
 #include "CalibTrk2Event.h"  
 //  
1  #include "Digitizer.h"  #include "Digitizer.h"
 #include "CRC.h"  
 //  
 #include <PamelaRun.h>  
 #include <physics/calorimeter/CalorimeterEvent.h>  
 #include <CalibCalPedEvent.h>  
 #include "GLTables.h"  
2    
3  void Digitizer::WriteRunHeader(){  void Digitizer::WriteRunHeader(){
4    fOutputfile.write(reinterpret_cast<char*>(fDataRunHeader),sizeof(UShort_t)*fRunHeaderbuffer);    fOutputfile.write(reinterpret_cast<char*>(fDataRunHeader),sizeof(UShort_t)*fRunHeaderbuffer);
# Line 46  void Digitizer::WriteData(){ Line 18  void Digitizer::WriteData(){
18    // TOF    // TOF
19    fOutputfile.write(reinterpret_cast<char*>(fDataTof),sizeof(UChar_t)*fTOFbuffer);    fOutputfile.write(reinterpret_cast<char*>(fDataTof),sizeof(UChar_t)*fTOFbuffer);
20    // AC    // AC
21      int n=1000000;
22    UShort_t temp[1000000];    UShort_t temp[1000000];
23    memset(temp,0,sizeof(UShort_t)*1000000);    memset(temp,0,sizeof(UShort_t)*n);
24    swab(fDataAC,temp,sizeof(UShort_t)*fACbuffer);  // WE MUST SWAP THE BYTES!!!    swab(fDataAC,temp,sizeof(UShort_t)*fACbuffer);  // WE MUST SWAP THE BYTES!!!
25    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fACbuffer);    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fACbuffer);
26    // CALO    // CALO
27    memset(temp,0,sizeof(UShort_t)*1000000);    memset(temp,0,sizeof(UShort_t)*n);
28    swab(fDataCALO,temp,sizeof(UShort_t)*fCALOlength); // WE MUST SWAP THE BYTES!!!    swab(fDataCALO,temp,sizeof(UShort_t)*fCALOlength); // WE MUST SWAP THE BYTES!!!
29    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fCALOlength);    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fCALOlength);
30    // TRK    // TRK
31    memset(temp,0,sizeof(UShort_t)*1000000);    memset(temp,0,sizeof(UShort_t)*n);
32    swab(fDataTrack,temp,sizeof(UShort_t)*fTracklength);  // WE MUST SWAP THE BYTES!!!    swab(fDataTrack,temp,sizeof(UShort_t)*fTracklength);  // WE MUST SWAP THE BYTES!!!
33    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fTracklength);    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fTracklength);
34    fTracklength=0;    fTracklength=0;
# Line 65  void Digitizer::WriteData(){ Line 38  void Digitizer::WriteData(){
38      fOutputfile.write(reinterpret_cast<char*>(fDataPadding),sizeof(UChar_t)*fPadding);      fOutputfile.write(reinterpret_cast<char*>(fDataPadding),sizeof(UChar_t)*fPadding);
39    };    };
40    // S4    // S4
41    memset(temp,0,sizeof(UShort_t)*1000000);    memset(temp,0,sizeof(UShort_t)*n);
42    swab(fDataS4,temp,sizeof(UShort_t)*fS4buffer);  // WE MUST SWAP THE BYTES!!!    swab(fDataS4,temp,sizeof(UShort_t)*fS4buffer);  // WE MUST SWAP THE BYTES!!!
43    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fS4buffer);    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fS4buffer);
44    // ND    // ND
45    memset(temp,0,sizeof(UShort_t)*1000000);    memset(temp,0,sizeof(UShort_t)*n);
46    swab(fDataND,temp,sizeof(UShort_t)*fNDbuffer);  // WE MUST SWAP THE BYTES!!!    swab(fDataND,temp,sizeof(UShort_t)*fNDbuffer);  // WE MUST SWAP THE BYTES!!!
47    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fNDbuffer);    fOutputfile.write(reinterpret_cast<char*>(temp),sizeof(UShort_t)*fNDbuffer);
48  };  };

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.23