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

Diff of /PamelaDigitizer/Digitizer.cxx

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

revision 1.7 by pamelats, Wed May 21 09:50:43 2008 UTC revision 1.10 by pamelats, Sun Jun 8 06:33:45 2008 UTC
# Line 39  extern "C"{ Line 39  extern "C"{
39  };  };
40  //  //
41    
42  Digitizer::Digitizer(TTree* tree, char* &file_raw){  Digitizer::Digitizer(TTree* tree, char* &file_raw,int nspe,int ntof,int ncat,int ncas,int ncar,int ncal,int nnd,int nstr){
43    fhBookTree = tree;    fhBookTree = tree;
44    fFilename =  file_raw;    fFilename =  file_raw;
45    fCounter = 0;    fCounter = 0;
# Line 80  Digitizer::Digitizer(TTree* tree, char* Line 80  Digitizer::Digitizer(TTree* tree, char*
80        
81    std:: cout << "preparing tree" << endl;    std:: cout << "preparing tree" << endl;
82    
83      ntf=(int*)malloc(1 *sizeof(int));
84      *ntf=ntof;
85      Ipltof=(UChar_t*)malloc(ntof *sizeof(UChar_t));
86      Ipaddle=(UChar_t*)malloc(ntof *sizeof(UChar_t));
87      // Ipartof=(UShort_t*)malloc(ntof *sizeof(UShort_t));
88      Ipartof=(UChar_t*)malloc(ntof *sizeof(UChar_t));
89      Xintof=(Float_t*)malloc(ntof *sizeof(Float_t));
90      Yintof=(Float_t*)malloc(ntof *sizeof(Float_t));
91      Zintof=(Float_t*)malloc(ntof *sizeof(Float_t));
92      Xouttof=(Float_t*)malloc(ntof *sizeof(Float_t));
93      Youttof=(Float_t*)malloc(ntof *sizeof(Float_t));
94      Zouttof=(Float_t*)malloc(ntof *sizeof(Float_t));
95      Ereltof=(Float_t*)malloc(ntof *sizeof(Float_t));
96      Timetof=(Float_t*)malloc(ntof *sizeof(Float_t));
97      Pathtof=(Float_t*)malloc(ntof *sizeof(Float_t));
98      P0tof=(Float_t*)malloc(ntof *sizeof(Float_t));
99      Iparcat=(UChar_t*)malloc(ncat *sizeof(UChar_t));
100      Icat=(UChar_t*)malloc(ncat *sizeof(UChar_t));
101      Xincat=(Float_t*)malloc(ncat *sizeof(Float_t));
102      Yincat=(Float_t*)malloc(ncat *sizeof(Float_t));
103      Zincat=(Float_t*)malloc(ncat *sizeof(Float_t));
104      Xoutcat=(Float_t*)malloc(ncat *sizeof(Float_t));
105      Youtcat=(Float_t*)malloc(ncat *sizeof(Float_t));
106      Zoutcat=(Float_t*)malloc(ncat *sizeof(Float_t));
107      Erelcat=(Float_t*)malloc(ncat *sizeof(Float_t));
108      Timecat=(Float_t*)malloc(ncat *sizeof(Float_t));
109      Pathcat=(Float_t*)malloc(ncat *sizeof(Float_t));
110      P0cat=(Float_t*)malloc(ncat *sizeof(Float_t));
111      Iparcas=(UChar_t*)malloc(ncas *sizeof(UChar_t));
112      Icas=(UChar_t*)malloc(ncas *sizeof(UChar_t));
113      Xincas=(Float_t*)malloc(ncas *sizeof(Float_t));
114      Yincas=(Float_t*)malloc(ncas *sizeof(Float_t));
115      Zincas=(Float_t*)malloc(ncas *sizeof(Float_t));
116      Xoutcas=(Float_t*)malloc(ncas *sizeof(Float_t));
117      Youtcas=(Float_t*)malloc(ncas *sizeof(Float_t));
118      Zoutcas=(Float_t*)malloc(ncas *sizeof(Float_t));
119      Erelcas=(Float_t*)malloc(ncas *sizeof(Float_t));
120      Timecas=(Float_t*)malloc(ncas *sizeof(Float_t));
121      Pathcas=(Float_t*)malloc(ncas *sizeof(Float_t));
122      P0cas=(Float_t*)malloc(ncas *sizeof(Float_t));
123      //  Iparspe=(UShort_t*)malloc(nspe *sizeof(UShort_t));
124      Iparspe=(UChar_t*)malloc(nspe *sizeof(UChar_t));
125      Itrpb=(UChar_t*)malloc(nspe *sizeof(UChar_t));
126      Itrsl=(UChar_t*)malloc(nspe *sizeof(UChar_t));
127      Itspa=(UChar_t*)malloc(nspe *sizeof(UChar_t));
128      Xinspe=(Float_t*)malloc(nspe *sizeof(Float_t));
129      Yinspe=(Float_t*)malloc(nspe *sizeof(Float_t));
130      Zinspe=(Float_t*)malloc(nspe *sizeof(Float_t));
131      Xoutspe=(Float_t*)malloc(nspe *sizeof(Float_t));
132      Youtspe=(Float_t*)malloc(nspe *sizeof(Float_t));
133      Zoutspe=(Float_t*)malloc(nspe *sizeof(Float_t));
134      Xavspe=(Float_t*)malloc(nspe *sizeof(Float_t));
135      Yavspe=(Float_t*)malloc(nspe *sizeof(Float_t));
136      Zavspe=(Float_t*)malloc(nspe *sizeof(Float_t));
137      Erelspe=(Float_t*)malloc(nspe *sizeof(Float_t));
138      Pathspe=(Float_t*)malloc(nspe *sizeof(Float_t));
139      P0spe=(Float_t*)malloc(nspe *sizeof(Float_t));;
140      Nxmult=(UChar_t*)malloc(nspe *sizeof(UChar_t));
141      Nymult=(UChar_t*)malloc(nspe *sizeof(UChar_t));
142      Istripx=(UShort_t*)malloc(nstr *sizeof(UShort_t));
143      Qstripx=(Float_t*)malloc(nstr *sizeof(Float_t));
144      Xstripx=(Float_t*)malloc(nstr *sizeof(Float_t));
145      Npstripx=(UChar_t*)malloc(nstr *sizeof(UChar_t));
146      Ntstripx=(UChar_t*)malloc(nstr *sizeof(UChar_t));
147      Npstripy=(UChar_t*)malloc(nstr *sizeof(UChar_t));
148      Ntstripy=(UChar_t*)malloc(nstr *sizeof(UChar_t));
149      Istripy=(UShort_t*)malloc(nstr *sizeof(UShort_t));
150      Qstripy=(Float_t*)malloc(nstr *sizeof(Float_t));
151      Ystripy=(Float_t*)malloc(nstr *sizeof(Float_t));
152      Icapl=(UChar_t*)malloc(ncal *sizeof(UChar_t));
153      Icasi=(UChar_t*)malloc(ncal *sizeof(UChar_t));
154      Icast=(UChar_t*)malloc(ncal *sizeof(UChar_t));
155      Xincal=(Float_t*)malloc(ncal *sizeof(Float_t));
156      Yincal=(Float_t*)malloc(ncal *sizeof(Float_t));
157      Zincal=(Float_t*)malloc(ncal *sizeof(Float_t));
158      Erelcal=(Float_t*)malloc(ncal *sizeof(Float_t));
159      Itubend=(UChar_t*)malloc(nnd *sizeof(UChar_t));
160      Iparnd=(UChar_t*)malloc(nnd *sizeof(UChar_t));
161      Xinnd=(Float_t*)malloc(nnd *sizeof(Float_t));
162      Yinnd=(Float_t*)malloc(nnd *sizeof(Float_t));
163      Zinnd=(Float_t*)malloc(nnd *sizeof(Float_t));
164      Xoutnd=(Float_t*)malloc(nnd *sizeof(Float_t));
165      Youtnd=(Float_t*)malloc(nnd *sizeof(Float_t));
166      Zoutnd=(Float_t*)malloc(nnd *sizeof(Float_t));
167      Erelnd=(Float_t*)malloc(nnd *sizeof(Float_t));
168      Timend=(Float_t*)malloc(nnd *sizeof(Float_t));
169      Pathnd=(Float_t*)malloc(nnd *sizeof(Float_t));
170      P0nd=(Float_t*)malloc(nnd *sizeof(Float_t));
171      Iparcard=(UChar_t*)malloc(ncar *sizeof(UChar_t));
172      Icard=(UChar_t*)malloc(ncar *sizeof(UChar_t));
173      Xincard=(Float_t*)malloc(ncar *sizeof(Float_t));
174      Yincard=(Float_t*)malloc(ncar *sizeof(Float_t));
175      Zincard=(Float_t*)malloc(ncar *sizeof(Float_t));
176      Xoutcard=(Float_t*)malloc(ncar *sizeof(Float_t));
177      Youtcard=(Float_t*)malloc(ncar *sizeof(Float_t));
178      Zoutcard=(Float_t*)malloc(ncar *sizeof(Float_t));
179      Erelcard=(Float_t*)malloc(ncar *sizeof(Float_t));
180      Timecard=(Float_t*)malloc(ncar *sizeof(Float_t));
181      Pathcard=(Float_t*)malloc(ncar *sizeof(Float_t));
182      P0card=(Float_t*)malloc(ncar *sizeof(Float_t));
183    
184    
185    
186    // prepare tree//modified by E.Vannuccini 03/08    // prepare tree//modified by E.Vannuccini 03/08
187    if(fhBookTree->GetBranch("Irun"))fhBookTree->SetBranchAddress("Irun",&Irun);    if(fhBookTree->GetBranch("Irun"))fhBookTree->SetBranchAddress("Irun",&Irun);
188    if(fhBookTree->GetBranch("Ievnt"))fhBookTree->SetBranchAddress("Ievnt",&Ievnt);    if(fhBookTree->GetBranch("Ievnt"))fhBookTree->SetBranchAddress("Ievnt",&Ievnt);
# Line 91  Digitizer::Digitizer(TTree* tree, char* Line 194  Digitizer::Digitizer(TTree* tree, char*
194    if(fhBookTree->GetBranch("Phi"))fhBookTree->SetBranchAddress("Phi",&Phi);    if(fhBookTree->GetBranch("Phi"))fhBookTree->SetBranchAddress("Phi",&Phi);
195    if(fhBookTree->GetBranch("P0"))fhBookTree->SetBranchAddress("P0",&P0);    if(fhBookTree->GetBranch("P0"))fhBookTree->SetBranchAddress("P0",&P0);
196    if(fhBookTree->GetBranch("Nthtof"))fhBookTree->SetBranchAddress("Nthtof",&Nthtof);    if(fhBookTree->GetBranch("Nthtof"))fhBookTree->SetBranchAddress("Nthtof",&Nthtof);
197    if(fhBookTree->GetBranch("Ipltof"))fhBookTree->SetBranchAddress("Ipltof",Ipltof);    if(fhBookTree->GetBranch("Ipltof"))fhBookTree->SetBranchAddress("Ipltof",Ipltof);///////////////////////////
198    if(fhBookTree->GetBranch("Ipaddle"))fhBookTree->SetBranchAddress("Ipaddle",Ipaddle);    if(fhBookTree->GetBranch("Ipaddle"))fhBookTree->SetBranchAddress("Ipaddle",Ipaddle);
199    if(fhBookTree->GetBranch("Ipartof"))fhBookTree->SetBranchAddress("Ipartof",Ipartof);    if(fhBookTree->GetBranch("Ipartof"))fhBookTree->SetBranchAddress("Ipartof",Ipartof);
200    if(fhBookTree->GetBranch("Xintof"))fhBookTree->SetBranchAddress("Xintof",Xintof);    if(fhBookTree->GetBranch("Xintof"))fhBookTree->SetBranchAddress("Xintof",Xintof);
# Line 119  Digitizer::Digitizer(TTree* tree, char* Line 222  Digitizer::Digitizer(TTree* tree, char*
222    if(fhBookTree->GetBranch("P0cat"))fhBookTree->SetBranchAddress("P0cat",P0cat);    if(fhBookTree->GetBranch("P0cat"))fhBookTree->SetBranchAddress("P0cat",P0cat);
223    if(fhBookTree->GetBranch("Nthcas"))fhBookTree->SetBranchAddress("Nthcas",&Nthcas);    if(fhBookTree->GetBranch("Nthcas"))fhBookTree->SetBranchAddress("Nthcas",&Nthcas);
224    if(fhBookTree->GetBranch("Iparcas"))fhBookTree->SetBranchAddress("Iparcas",Iparcas);    if(fhBookTree->GetBranch("Iparcas"))fhBookTree->SetBranchAddress("Iparcas",Iparcas);
225    if(fhBookTree->GetBranch("Icas"))fhBookTree->SetBranchAddress("Icas",Icas);    if(fhBookTree->GetBranch("Icas"))fhBookTree->SetBranchAddress("Icas",Icas);///////////////////////////////
226    if(fhBookTree->GetBranch("Xincas"))fhBookTree->SetBranchAddress("Xincas",Xincas);    if(fhBookTree->GetBranch("Xincas"))fhBookTree->SetBranchAddress("Xincas",Xincas);
227    if(fhBookTree->GetBranch("Yincas"))fhBookTree->SetBranchAddress("Yincas",Yincas);    if(fhBookTree->GetBranch("Yincas"))fhBookTree->SetBranchAddress("Yincas",Yincas);
228    if(fhBookTree->GetBranch("Zincas"))fhBookTree->SetBranchAddress("Zincas",Zincas);    if(fhBookTree->GetBranch("Zincas"))fhBookTree->SetBranchAddress("Zincas",Zincas);
# Line 159  Digitizer::Digitizer(TTree* tree, char* Line 262  Digitizer::Digitizer(TTree* tree, char*
262    if(fhBookTree->GetBranch("Npstripy"))fhBookTree->SetBranchAddress("Npstripy",Npstripy);    if(fhBookTree->GetBranch("Npstripy"))fhBookTree->SetBranchAddress("Npstripy",Npstripy);
263    if(fhBookTree->GetBranch("Ntstripy"))fhBookTree->SetBranchAddress("Ntstripy",Ntstripy);    if(fhBookTree->GetBranch("Ntstripy"))fhBookTree->SetBranchAddress("Ntstripy",Ntstripy);
264    if(fhBookTree->GetBranch("Istripy"))fhBookTree->SetBranchAddress("Istripy",Istripy);    if(fhBookTree->GetBranch("Istripy"))fhBookTree->SetBranchAddress("Istripy",Istripy);
265    if(fhBookTree->GetBranch("Qstripy"))fhBookTree->SetBranchAddress("Qstripy",Qstripy);    if(fhBookTree->GetBranch("Qstripy"))fhBookTree->SetBranchAddress("Qstripy",Qstripy);///////////////////////
266    if(fhBookTree->GetBranch("Ystripy"))fhBookTree->SetBranchAddress("Ystripy",Ystripy);    if(fhBookTree->GetBranch("Ystripy"))fhBookTree->SetBranchAddress("Ystripy",Ystripy);
267    if(fhBookTree->GetBranch("Nthcali"))fhBookTree->SetBranchAddress("Nthcali",&Nthcali);    if(fhBookTree->GetBranch("Nthcali"))fhBookTree->SetBranchAddress("Nthcali",&Nthcali);
268    if(fhBookTree->GetBranch("Icaplane"))fhBookTree->SetBranchAddress("Icaplane",Icaplane);    if(fhBookTree->GetBranch("Icaplane"))fhBookTree->SetBranchAddress("Icaplane",Icaplane);
# Line 177  Digitizer::Digitizer(TTree* tree, char* Line 280  Digitizer::Digitizer(TTree* tree, char*
280    if(fhBookTree->GetBranch("Nthnd"))fhBookTree->SetBranchAddress("Nthnd",&Nthnd);    if(fhBookTree->GetBranch("Nthnd"))fhBookTree->SetBranchAddress("Nthnd",&Nthnd);
281    if(fhBookTree->GetBranch("Itubend"))fhBookTree->SetBranchAddress("Itubend",Itubend);    if(fhBookTree->GetBranch("Itubend"))fhBookTree->SetBranchAddress("Itubend",Itubend);
282    if(fhBookTree->GetBranch("Iparnd"))fhBookTree->SetBranchAddress("Iparnd",Iparnd);    if(fhBookTree->GetBranch("Iparnd"))fhBookTree->SetBranchAddress("Iparnd",Iparnd);
283    if(fhBookTree->GetBranch("Xinnd"))fhBookTree->SetBranchAddress("Xinnd",Xinnd);    if(fhBookTree->GetBranch("Xinnd"))fhBookTree->SetBranchAddress("Xinnd",Xinnd);/////////////////////////
284    if(fhBookTree->GetBranch("Yinnd"))fhBookTree->SetBranchAddress("Yinnd",Yinnd);    if(fhBookTree->GetBranch("Yinnd"))fhBookTree->SetBranchAddress("Yinnd",Yinnd);
285    if(fhBookTree->GetBranch("Zinnd"))fhBookTree->SetBranchAddress("Zinnd",Zinnd);    if(fhBookTree->GetBranch("Zinnd"))fhBookTree->SetBranchAddress("Zinnd",Zinnd);
286    if(fhBookTree->GetBranch("Xoutnd"))fhBookTree->SetBranchAddress("Xoutnd",Xoutnd);    if(fhBookTree->GetBranch("Xoutnd"))fhBookTree->SetBranchAddress("Xoutnd",Xoutnd);
# Line 187  Digitizer::Digitizer(TTree* tree, char* Line 290  Digitizer::Digitizer(TTree* tree, char*
290    if(fhBookTree->GetBranch("Timend"))fhBookTree->SetBranchAddress("Timend",Timend);    if(fhBookTree->GetBranch("Timend"))fhBookTree->SetBranchAddress("Timend",Timend);
291    if(fhBookTree->GetBranch("Pathnd"))fhBookTree->SetBranchAddress("Pathnd",Pathnd);    if(fhBookTree->GetBranch("Pathnd"))fhBookTree->SetBranchAddress("Pathnd",Pathnd);
292    if(fhBookTree->GetBranch("P0nd"))fhBookTree->SetBranchAddress("P0nd",P0nd);    if(fhBookTree->GetBranch("P0nd"))fhBookTree->SetBranchAddress("P0nd",P0nd);
293    if(fhBookTree->GetBranch("Nthcard"))fhBookTree->SetBranchAddress("Nthcard",&Nthcard);    if(fhBookTree->GetBranch("Nthcard"))fhBookTree->SetBranchAddress("Nthcard",&Nthcard);/////////////////////
294    if(fhBookTree->GetBranch("Iparcard"))fhBookTree->SetBranchAddress("Iparcard",Iparcard);    if(fhBookTree->GetBranch("Iparcard"))fhBookTree->SetBranchAddress("Iparcard",Iparcard);
295    if(fhBookTree->GetBranch("Icard"))fhBookTree->SetBranchAddress("Icard",Icard);    if(fhBookTree->GetBranch("Icard"))fhBookTree->SetBranchAddress("Icard",Icard);
296    if(fhBookTree->GetBranch("Xincard"))fhBookTree->SetBranchAddress("Xincard",Xincard);    if(fhBookTree->GetBranch("Xincard"))fhBookTree->SetBranchAddress("Xincard",Xincard);
297    if(fhBookTree->GetBranch("Yincard"))fhBookTree->SetBranchAddress("Yincard",Yincard);    if(fhBookTree->GetBranch("Yincard"))fhBookTree->SetBranchAddress("Yincard",Yincard);
298    if(fhBookTree->GetBranch("Zincard"))fhBookTree->SetBranchAddress("Zincard",Zincard);    if(fhBookTree->GetBranch("Zincard"))fhBookTree->SetBranchAddress("Zincard",Zincard);
299    if(fhBookTree->GetBranch("Xoutcard"))fhBookTree->SetBranchAddress("Xoutcard",Xoutcard);    if(fhBookTree->GetBranch("Xoutcard"))fhBookTree->SetBranchAddress("Xoutcard",Xoutcard);
300    if(fhBookTree->GetBranch("Youtcard"))fhBookTree->SetBranchAddress("Youtcard",Youtcard);    if(fhBookTree->GetBranch("Youtcard"))fhBookTree->SetBranchAddress("Youtcard",Youtcard);/////////////////
301    if(fhBookTree->GetBranch("Zoutcard"))fhBookTree->SetBranchAddress("Zoutcard",Zoutcard);    if(fhBookTree->GetBranch("Zoutcard"))fhBookTree->SetBranchAddress("Zoutcard",Zoutcard);
302    if(fhBookTree->GetBranch("Erelcard"))fhBookTree->SetBranchAddress("Erelcard",Erelcard);    if(fhBookTree->GetBranch("Erelcard"))fhBookTree->SetBranchAddress("Erelcard",Erelcard);
303    if(fhBookTree->GetBranch("Timecard"))fhBookTree->SetBranchAddress("Timecard",Timecard);    if(fhBookTree->GetBranch("Timecard"))fhBookTree->SetBranchAddress("Timecard",Timecard);
304    if(fhBookTree->GetBranch("Pathcard"))fhBookTree->SetBranchAddress("Pathcard",Pathcard);    if(fhBookTree->GetBranch("Pathcard"))fhBookTree->SetBranchAddress("Pathcard",Pathcard);
305    if(fhBookTree->GetBranch("P0card"))fhBookTree->SetBranchAddress("P0card",P0card);    //  if(fhBookTree->GetBranch("P0card"))fhBookTree->SetBranchAddress("P0card",P0card);
306  //    fhBookTree->SetBranchStatus("*",0); //modified by E.Vannuccini 03/08  //    fhBookTree->SetBranchStatus("*",0); //modified by E.Vannuccini 03/08
307  }  }
308    
# Line 241  void Digitizer::Loop() { Line 344  void Digitizer::Loop() {
344    //  end loading, digitizing and writing tracker calibration    //  end loading, digitizing and writing tracker calibration
345    // TOF ------ read calibration file (get A1, A2, lambda1, lambda2)    // TOF ------ read calibration file (get A1, A2, lambda1, lambda2)
346    const int np=48;    const int np=48;
347    Float_t *atte1,*atte2,*lambda1,*lambda2;    float *atte1,*atte2,*lambda1,*lambda2;
348    atte1=(float *)malloc(np *sizeof(float));    atte1=(float *)malloc(np *sizeof(float));
349    atte2=(float *)malloc(np *sizeof(float));    atte2=(float *)malloc(np *sizeof(float));
350    lambda1=(float *)malloc(np *sizeof(float));    lambda1=(float *)malloc(np *sizeof(float));
351    lambda2=(float *)malloc(np *sizeof(float));    lambda2=(float *)malloc(np *sizeof(float));
352    LoadTOFCalib(np,atte1,atte2,lambda1,lambda2);    LoadTOFCalib(np,atte1,atte2,lambda1,lambda2);
353      TF1 *attenAC = new TF1("fAttAC",".825+.64*atan(9.8/x)",0.,45.);
354    //end tof calib    //end tof calib
355    //    //
356    // loops over the events    // loops over the events
# Line 254  void Digitizer::Loop() { Line 358  void Digitizer::Loop() {
358        
359    Int_t nentries = fhBookTree->GetEntriesFast();    Int_t nentries = fhBookTree->GetEntriesFast();
360    Long64_t nbytes = 0;    Long64_t nbytes = 0;
361    for (Int_t i=0; i<nentries;i++) {      for (Int_t i=0; i<nentries;i++) {
362      //        nbytes += fhBookTree->GetEntry(i);
363      nbytes += fhBookTree->GetEntry(i);        // read detectors sequentially:
364      // read detectors sequentially:        // http://www.ts.infn.it/fileadmin/documents/physics/experiments/wizard/cpu/gen_arch/RM_Acquisition.pdf
365      // http://www.ts.infn.it/fileadmin/documents/physics/experiments/wizard/cpu/gen_arch/RM_Acquisition.pdf        // on pamelatov: /cvs/yoda/techmodel/physics/NeutronDetectorReader.cpp
366      // on pamelatov: /cvs/yoda/techmodel/physics/NeutronDetectorReader.cpp        DigitizeTOF(np,atte1,atte2,lambda1,lambda2);
367      //DigitizeTRIGGER();        DigitizeAC(attenAC);
368      DigitizeTOF(np,atte1,atte2,lambda1,lambda2);        DigitizeCALO();
369      DigitizeAC();        DigitizeTrack();
370      DigitizeCALO();        DigitizeS4();
371      DigitizeTrack();        DigitizeND();
372      DigitizeS4();        //
373      DigitizeND();        // Add padding to 64 bits
374      //        //
375      // Add padding to 64 bits        AddPadding();
376      //        //
377      AddPadding();        // Create CPU header, we need packet type (0x10 = physics data) and packet length.
378      //        //
379      // Create CPU header, we need packet type (0x10 = physics data) and packet length.        UInt_t length=2*(fCALOlength+fACbuffer+fTracklength+fNDbuffer+fS4buffer)+fPadding+fTOFbuffer+fTRIGGERbuffer;
380      //        //UInt_t length=2*(fCALOlength+fACbuffer+fTracklength+fNDbuffer)+fPadding+fTOFbuffer+fTRIGGERbuffer;
381      UInt_t length=2*(fCALOlength+fACbuffer+fTracklength+fNDbuffer+fS4buffer)+fPadding+fTOFbuffer+fTRIGGERbuffer;        DigitizePSCU(length,0x10,fDataPSCU);
382      //UInt_t length=2*(fCALOlength+fACbuffer+fTracklength+fNDbuffer)+fPadding+fTOFbuffer+fTRIGGERbuffer;        if ((i%1000)==0) cout << "writing event " << i << endl;
383      DigitizePSCU(length,0x10,fDataPSCU);        WriteData();
384      if ( !i%100 ) std::cout << "writing event " << i << endl;    }
     WriteData();  
   };  
   
385    DigitizeRunTrailer();    DigitizeRunTrailer();
386    WriteRunTrailer();    WriteRunTrailer();
387      
388    fOutputfile.close();    fOutputfile.close();
389    std::cout << "files closed" << endl << flush;    cout << "files closed" << endl;
   
390  };  };
391    
392    
 //void Digitizer::DigitizeTRIGGER() {  
   //fDataTrigger: 152 bytes  
   // corrected 30/11/'07 SO (was 153)  
   //for (Int_t j=0; j < 152; j++)  
   //  fDataTrigger[j]=0x00;  
 //};  
   
   
   
393  void Digitizer::ReadData(){  void Digitizer::ReadData(){
394    
395    UShort_t InData[64];    UShort_t InData[64];

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.23