4 |
// |
// |
5 |
// NB: Check length physics packet [packet type (0x10 = physics data)] |
// NB: Check length physics packet [packet type (0x10 = physics data)] |
6 |
// |
// |
|
#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" |
|
|
// |
|
7 |
#include "Digitizer.h" |
#include "Digitizer.h" |
8 |
#include "CRC.h" |
|
|
// |
|
|
#include <PamelaRun.h> |
|
|
#include <physics/calorimeter/CalorimeterEvent.h> |
|
|
#include <CalibCalPedEvent.h> |
|
|
#include "GLTables.h" |
|
|
// |
|
9 |
extern "C"{ |
extern "C"{ |
10 |
short crc(short, short); |
short crc(short, short); |
11 |
}; |
}; |
12 |
// |
// |
13 |
|
|
14 |
Digitizer::Digitizer(TTree* tree, char* &file_raw,int nspe,int ntof,int ncat,int ncas,int ncar,int ncal,int nnd,int nstr){ |
Digitizer::Digitizer(TTree* tree, char* &file_raw, |
15 |
|
int nspe1=200,int ntof1=200,int ncat1=50, |
16 |
|
int ncas1=50,int ncar1=100,int ncal1=1000, |
17 |
|
int nnd1=200,int nstr1=1000, int comprcalomod=0){ |
18 |
|
|
19 |
|
nspe=new int[1]; |
20 |
|
ntof=new int[1]; |
21 |
|
ncat=new int[1]; |
22 |
|
ncas=new int[1]; |
23 |
|
ncar=new int[1]; |
24 |
|
ncal=new int[1]; |
25 |
|
nnd=new int[1]; |
26 |
|
nstr=new int[1]; |
27 |
|
|
28 |
|
*nspe=nspe1; |
29 |
|
*ntof=ntof1; |
30 |
|
*ncat=ncat1; |
31 |
|
*ncas=ncas1; |
32 |
|
*ncar=ncar1; |
33 |
|
*ncal=ncal1; |
34 |
|
*nnd=nnd1; |
35 |
|
*nstr=nstr1; |
36 |
|
|
37 |
fhBookTree = tree; |
fhBookTree = tree; |
38 |
fFilename = file_raw; |
fFilename = file_raw; |
39 |
fCounter = 0; |
fCounter = 0; |
40 |
fCounterPhys = 0; // SO 5/12/'07 |
fCounterPhys = 0; // SO 5/12/'07 |
41 |
fOBT = 0; |
fOBT = 0; |
42 |
|
fModCalo = comprcalomod ; |
43 |
|
|
44 |
// |
// |
45 |
// DB connections |
// DB connections |
75 |
|
|
76 |
std:: cout << "preparing tree" << endl; |
std:: cout << "preparing tree" << endl; |
77 |
|
|
78 |
ntf=(int*)malloc(1 *sizeof(int)); |
Ipltof=(UChar_t*)malloc(*ntof *sizeof(UChar_t)); |
79 |
*ntf=ntof; |
Ipaddle=(UChar_t*)malloc(*ntof *sizeof(UChar_t)); |
80 |
Ipltof=(UChar_t*)malloc(ntof *sizeof(UChar_t)); |
Ipartof=(UShort_t*)malloc(*ntof *sizeof(UShort_t)); |
81 |
Ipaddle=(UChar_t*)malloc(ntof *sizeof(UChar_t)); |
// Ipartof=(UChar_t*)malloc(*ntof *sizeof(UChar_t));//DPMJET |
82 |
// Ipartof=(UShort_t*)malloc(ntof *sizeof(UShort_t)); |
Xintof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
83 |
Ipartof=(UChar_t*)malloc(ntof *sizeof(UChar_t)); |
Yintof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
84 |
Xintof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
Zintof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
85 |
Yintof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
Xouttof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
86 |
Zintof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
Youttof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
87 |
Xouttof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
Zouttof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
88 |
Youttof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
Ereltof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
89 |
Zouttof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
Timetof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
90 |
Ereltof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
Pathtof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
91 |
Timetof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
P0tof=(Float_t*)malloc(*ntof *sizeof(Float_t)); |
92 |
Pathtof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
Iparcat=(UChar_t*)malloc(*ncat *sizeof(UChar_t)); |
93 |
P0tof=(Float_t*)malloc(ntof *sizeof(Float_t)); |
Icat=(UChar_t*)malloc(*ncat *sizeof(UChar_t)); |
94 |
Iparcat=(UChar_t*)malloc(ncat *sizeof(UChar_t)); |
Xincat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
95 |
Icat=(UChar_t*)malloc(ncat *sizeof(UChar_t)); |
Yincat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
96 |
Xincat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
Zincat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
97 |
Yincat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
Xoutcat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
98 |
Zincat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
Youtcat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
99 |
Xoutcat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
Zoutcat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
100 |
Youtcat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
Erelcat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
101 |
Zoutcat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
Timecat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
102 |
Erelcat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
Pathcat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
103 |
Timecat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
P0cat=(Float_t*)malloc(*ncat *sizeof(Float_t)); |
104 |
Pathcat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
Iparcas=(UChar_t*)malloc(*ncas *sizeof(UChar_t)); |
105 |
P0cat=(Float_t*)malloc(ncat *sizeof(Float_t)); |
Icas=(UChar_t*)malloc(*ncas *sizeof(UChar_t)); |
106 |
Iparcas=(UChar_t*)malloc(ncas *sizeof(UChar_t)); |
Xincas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
107 |
Icas=(UChar_t*)malloc(ncas *sizeof(UChar_t)); |
Yincas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
108 |
Xincas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
Zincas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
109 |
Yincas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
Xoutcas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
110 |
Zincas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
Youtcas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
111 |
Xoutcas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
Zoutcas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
112 |
Youtcas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
Erelcas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
113 |
Zoutcas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
Timecas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
114 |
Erelcas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
Pathcas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
115 |
Timecas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
P0cas=(Float_t*)malloc(*ncas *sizeof(Float_t)); |
116 |
Pathcas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
// Iparspe=(UShort_t*)malloc(*nspe *sizeof(UShort_t)); |
117 |
P0cas=(Float_t*)malloc(ncas *sizeof(Float_t)); |
// Iparspe=(UChar_t*)malloc(*nspe *sizeof(UChar_t)); |
118 |
// Iparspe=(UShort_t*)malloc(nspe *sizeof(UShort_t)); |
Itrpb=(UChar_t*)malloc(*nspe *sizeof(UChar_t)); |
119 |
Iparspe=(UChar_t*)malloc(nspe *sizeof(UChar_t)); |
Itrsl=(UChar_t*)malloc(*nspe *sizeof(UChar_t)); |
120 |
Itrpb=(UChar_t*)malloc(nspe *sizeof(UChar_t)); |
Itspa=(UChar_t*)malloc(*nspe *sizeof(UChar_t)); |
121 |
Itrsl=(UChar_t*)malloc(nspe *sizeof(UChar_t)); |
Xinspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
122 |
Itspa=(UChar_t*)malloc(nspe *sizeof(UChar_t)); |
Yinspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
123 |
Xinspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Zinspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
124 |
Yinspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Xoutspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
125 |
Zinspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Youtspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
126 |
Xoutspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Zoutspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
127 |
Youtspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Xavspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
128 |
Zoutspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Yavspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
129 |
Xavspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Zavspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
130 |
Yavspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Erelspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
131 |
Zavspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Pathspe=(Float_t*)malloc(*nspe *sizeof(Float_t)); |
132 |
Erelspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
P0spe=(Float_t*)malloc(*nspe *sizeof(Float_t));; |
133 |
Pathspe=(Float_t*)malloc(nspe *sizeof(Float_t)); |
Nxmult=(UChar_t*)malloc(*nspe *sizeof(UChar_t)); |
134 |
P0spe=(Float_t*)malloc(nspe *sizeof(Float_t));; |
Nymult=(UChar_t*)malloc(*nspe *sizeof(UChar_t)); |
135 |
Nxmult=(UChar_t*)malloc(nspe *sizeof(UChar_t)); |
Istripx=(UShort_t*)malloc(*nstr *sizeof(UShort_t)); |
136 |
Nymult=(UChar_t*)malloc(nspe *sizeof(UChar_t)); |
Qstripx=(Float_t*)malloc(*nstr *sizeof(Float_t)); |
137 |
Istripx=(UShort_t*)malloc(nstr *sizeof(UShort_t)); |
Xstripx=(Float_t*)malloc(*nstr *sizeof(Float_t)); |
138 |
Qstripx=(Float_t*)malloc(nstr *sizeof(Float_t)); |
Npstripx=(UChar_t*)malloc(*nstr *sizeof(UChar_t)); |
139 |
Xstripx=(Float_t*)malloc(nstr *sizeof(Float_t)); |
Ntstripx=(UChar_t*)malloc(*nstr *sizeof(UChar_t)); |
140 |
Npstripx=(UChar_t*)malloc(nstr *sizeof(UChar_t)); |
Npstripy=(UChar_t*)malloc(*nstr *sizeof(UChar_t)); |
141 |
Ntstripx=(UChar_t*)malloc(nstr *sizeof(UChar_t)); |
Ntstripy=(UChar_t*)malloc(*nstr *sizeof(UChar_t)); |
142 |
Npstripy=(UChar_t*)malloc(nstr *sizeof(UChar_t)); |
Istripy=(UShort_t*)malloc(*nstr *sizeof(UShort_t)); |
143 |
Ntstripy=(UChar_t*)malloc(nstr *sizeof(UChar_t)); |
Qstripy=(Float_t*)malloc(*nstr *sizeof(Float_t)); |
144 |
Istripy=(UShort_t*)malloc(nstr *sizeof(UShort_t)); |
Ystripy=(Float_t*)malloc(*nstr *sizeof(Float_t)); |
145 |
Qstripy=(Float_t*)malloc(nstr *sizeof(Float_t)); |
Icapl=(UChar_t*)malloc(*ncal *sizeof(UChar_t)); |
146 |
Ystripy=(Float_t*)malloc(nstr *sizeof(Float_t)); |
Icasi=(UChar_t*)malloc(*ncal *sizeof(UChar_t)); |
147 |
Icapl=(UChar_t*)malloc(ncal *sizeof(UChar_t)); |
Icast=(UChar_t*)malloc(*ncal *sizeof(UChar_t)); |
148 |
Icasi=(UChar_t*)malloc(ncal *sizeof(UChar_t)); |
Xincal=(Float_t*)malloc(*ncal *sizeof(Float_t)); |
149 |
Icast=(UChar_t*)malloc(ncal *sizeof(UChar_t)); |
Yincal=(Float_t*)malloc(*ncal *sizeof(Float_t)); |
150 |
Xincal=(Float_t*)malloc(ncal *sizeof(Float_t)); |
Zincal=(Float_t*)malloc(*ncal *sizeof(Float_t)); |
151 |
Yincal=(Float_t*)malloc(ncal *sizeof(Float_t)); |
Erelcal=(Float_t*)malloc(*ncal *sizeof(Float_t)); |
152 |
Zincal=(Float_t*)malloc(ncal *sizeof(Float_t)); |
Itubend=(UChar_t*)malloc(*nnd *sizeof(UChar_t)); |
153 |
Erelcal=(Float_t*)malloc(ncal *sizeof(Float_t)); |
Iparnd=(UChar_t*)malloc(*nnd *sizeof(UChar_t)); |
154 |
Itubend=(UChar_t*)malloc(nnd *sizeof(UChar_t)); |
Xinnd=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
155 |
Iparnd=(UChar_t*)malloc(nnd *sizeof(UChar_t)); |
Yinnd=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
156 |
Xinnd=(Float_t*)malloc(nnd *sizeof(Float_t)); |
Zinnd=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
157 |
Yinnd=(Float_t*)malloc(nnd *sizeof(Float_t)); |
Xoutnd=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
158 |
Zinnd=(Float_t*)malloc(nnd *sizeof(Float_t)); |
Youtnd=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
159 |
Xoutnd=(Float_t*)malloc(nnd *sizeof(Float_t)); |
Zoutnd=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
160 |
Youtnd=(Float_t*)malloc(nnd *sizeof(Float_t)); |
Erelnd=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
161 |
Zoutnd=(Float_t*)malloc(nnd *sizeof(Float_t)); |
Timend=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
162 |
Erelnd=(Float_t*)malloc(nnd *sizeof(Float_t)); |
Pathnd=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
163 |
Timend=(Float_t*)malloc(nnd *sizeof(Float_t)); |
P0nd=(Float_t*)malloc(*nnd *sizeof(Float_t)); |
164 |
Pathnd=(Float_t*)malloc(nnd *sizeof(Float_t)); |
Iparcard=(UChar_t*)malloc(*ncar *sizeof(UChar_t)); |
165 |
P0nd=(Float_t*)malloc(nnd *sizeof(Float_t)); |
Icard=(UChar_t*)malloc(*ncar *sizeof(UChar_t)); |
166 |
Iparcard=(UChar_t*)malloc(ncar *sizeof(UChar_t)); |
Xincard=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
167 |
Icard=(UChar_t*)malloc(ncar *sizeof(UChar_t)); |
Yincard=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
168 |
Xincard=(Float_t*)malloc(ncar *sizeof(Float_t)); |
Zincard=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
169 |
Yincard=(Float_t*)malloc(ncar *sizeof(Float_t)); |
Xoutcard=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
170 |
Zincard=(Float_t*)malloc(ncar *sizeof(Float_t)); |
Youtcard=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
171 |
Xoutcard=(Float_t*)malloc(ncar *sizeof(Float_t)); |
Zoutcard=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
172 |
Youtcard=(Float_t*)malloc(ncar *sizeof(Float_t)); |
Erelcard=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
173 |
Zoutcard=(Float_t*)malloc(ncar *sizeof(Float_t)); |
Timecard=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
174 |
Erelcard=(Float_t*)malloc(ncar *sizeof(Float_t)); |
Pathcard=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
175 |
Timecard=(Float_t*)malloc(ncar *sizeof(Float_t)); |
P0card=(Float_t*)malloc(*ncar *sizeof(Float_t)); |
|
Pathcard=(Float_t*)malloc(ncar *sizeof(Float_t)); |
|
|
P0card=(Float_t*)malloc(ncar *sizeof(Float_t)); |
|
176 |
|
|
177 |
|
|
178 |
|
|
227 |
if(fhBookTree->GetBranch("Pathcas"))fhBookTree->SetBranchAddress("Pathcas",Pathcas); |
if(fhBookTree->GetBranch("Pathcas"))fhBookTree->SetBranchAddress("Pathcas",Pathcas); |
228 |
if(fhBookTree->GetBranch("P0cas"))fhBookTree->SetBranchAddress("P0cas",P0cas); |
if(fhBookTree->GetBranch("P0cas"))fhBookTree->SetBranchAddress("P0cas",P0cas); |
229 |
if(fhBookTree->GetBranch("Nthspe"))fhBookTree->SetBranchAddress("Nthspe",&Nthspe); |
if(fhBookTree->GetBranch("Nthspe"))fhBookTree->SetBranchAddress("Nthspe",&Nthspe); |
230 |
if(fhBookTree->GetBranch("Iparspe"))fhBookTree->SetBranchAddress("Iparspe",Iparspe); |
// if(fhBookTree->GetBranch("Iparspe"))fhBookTree->SetBranchAddress("Iparspe",Iparspe); |
231 |
if(fhBookTree->GetBranch("Itrpb"))fhBookTree->SetBranchAddress("Itrpb",Itrpb); |
if(fhBookTree->GetBranch("Itrpb"))fhBookTree->SetBranchAddress("Itrpb",Itrpb); |
232 |
if(fhBookTree->GetBranch("Itrsl"))fhBookTree->SetBranchAddress("Itrsl",Itrsl); |
if(fhBookTree->GetBranch("Itrsl"))fhBookTree->SetBranchAddress("Itrsl",Itrsl); |
233 |
if(fhBookTree->GetBranch("Itspa"))fhBookTree->SetBranchAddress("Itspa",Itspa); |
if(fhBookTree->GetBranch("Itspa"))fhBookTree->SetBranchAddress("Itspa",Itspa); |
329 |
DigitizePSCU(length,0x13,fDataPSCU); |
DigitizePSCU(length,0x13,fDataPSCU); |
330 |
AddPadding(); |
AddPadding(); |
331 |
WriteTrackCalib(); |
WriteTrackCalib(); |
|
|
|
|
DigitizeRunHeader(); |
|
|
WriteRunHeader(); |
|
|
|
|
332 |
LoadMipCor(); // some initialization of parameters -not used now- |
LoadMipCor(); // some initialization of parameters -not used now- |
333 |
// end loading, digitizing and writing tracker calibration |
// end loading, digitizing and writing tracker calibration |
334 |
// TOF ------ read calibration file (get A1, A2, lambda1, lambda2) |
// TOF ------ read calibration file (get A1, A2, lambda1, lambda2) |
339 |
lambda1=(float *)malloc(np *sizeof(float)); |
lambda1=(float *)malloc(np *sizeof(float)); |
340 |
lambda2=(float *)malloc(np *sizeof(float)); |
lambda2=(float *)malloc(np *sizeof(float)); |
341 |
LoadTOFCalib(np,atte1,atte2,lambda1,lambda2); |
LoadTOFCalib(np,atte1,atte2,lambda1,lambda2); |
342 |
TF1 *attenAC = new TF1("fAttAC",".825+.64*atan(9.8/x)",0.,45.); |
attenAC = new TF1("fAttAC",".825+.64*atan(9.8/x)",0.,45.); |
343 |
//end tof calib |
//end tof calib |
344 |
// |
// |
345 |
// loops over the events |
// loops over the events |
347 |
|
|
348 |
Int_t nentries = fhBookTree->GetEntriesFast(); |
Int_t nentries = fhBookTree->GetEntriesFast(); |
349 |
Long64_t nbytes = 0; |
Long64_t nbytes = 0; |
350 |
for (Int_t i=0; i<nentries;i++) { |
for (Int_t i=0; i<nentries;i++) { |
351 |
nbytes += fhBookTree->GetEntry(i); |
nbytes += fhBookTree->GetEntry(i); |
352 |
|
fEvent=i; // cecilia for calo compress mode |
353 |
// read detectors sequentially: |
// read detectors sequentially: |
354 |
// http://www.ts.infn.it/fileadmin/documents/physics/experiments/wizard/cpu/gen_arch/RM_Acquisition.pdf |
// http://www.ts.infn.it/fileadmin/documents/physics/experiments/wizard/cpu/gen_arch/RM_Acquisition.pdf |
355 |
// on pamelatov: /cvs/yoda/techmodel/physics/NeutronDetectorReader.cpp |
// on pamelatov: /cvs/yoda/techmodel/physics/NeutronDetectorReader.cpp |
356 |
DigitizeTOF(np,atte1,atte2,lambda1,lambda2); |
DigitizeTOF(np,atte1,atte2,lambda1,lambda2); |
357 |
DigitizeAC(attenAC); |
DigitizeAC(); |
358 |
DigitizeCALO(); |
DigitizeCALO(); |
359 |
DigitizeTrack(); |
DigitizeTrack(); |
360 |
DigitizeS4(); |
DigitizeS4(); |
369 |
UInt_t length=2*(fCALOlength+fACbuffer+fTracklength+fNDbuffer+fS4buffer)+fPadding+fTOFbuffer+fTRIGGERbuffer; |
UInt_t length=2*(fCALOlength+fACbuffer+fTracklength+fNDbuffer+fS4buffer)+fPadding+fTOFbuffer+fTRIGGERbuffer; |
370 |
//UInt_t length=2*(fCALOlength+fACbuffer+fTracklength+fNDbuffer)+fPadding+fTOFbuffer+fTRIGGERbuffer; |
//UInt_t length=2*(fCALOlength+fACbuffer+fTracklength+fNDbuffer)+fPadding+fTOFbuffer+fTRIGGERbuffer; |
371 |
DigitizePSCU(length,0x10,fDataPSCU); |
DigitizePSCU(length,0x10,fDataPSCU); |
372 |
if ((i%1000)==0) cout << "writing event " << i << endl; |
if ((i%1000)==0)cout << "writing event " << i << endl; |
373 |
WriteData(); |
WriteData(); |
374 |
} |
} |
|
DigitizeRunTrailer(); |
|
|
WriteRunTrailer(); |
|
375 |
|
|
376 |
fOutputfile.close(); |
fOutputfile.close(); |
377 |
cout << "files closed" << endl; |
cout << "files closed" << endl; |