|
#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); |
| 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; |
| 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 |
}; |
}; |