--- PamelaDigitizer/Pamelagp2Digits.cxx 2008/05/21 09:50:46 1.9 +++ PamelaDigitizer/Pamelagp2Digits.cxx 2008/06/06 15:16:08 1.10 @@ -78,6 +78,8 @@ #include "TMath.h" #include "Digitizer.h" +using namespace std; + int Error; //to be removed soon // Define the names of the Fortran common blocks for the different OSs @@ -275,10 +277,13 @@ Int_t bufsize = 64000; Int_t optcwn = 1; +char *DigitizerInfo(bool print); int main(int argc, char **argv) { + char* cha=DigitizerInfo(1); + if (argc < 2) { printf("Error: Pamelagp2Digits \n"); printf("Pamelagp2Digits file.hbook file.root file.pam [compress] [tolower] [lrecl] [bufsize] [optcwn] \n"); @@ -815,13 +820,63 @@ tree->Write(); - std::cout << "Invoking Digitizer" << endl << flush; + cout << "Invoking Digitizer" << endl << flush; + char *ndl[8],*q,*q1; + q=(char*)malloc(5 *sizeof(char)); + q1=(char*)malloc(5 *sizeof(char)); + ndl[0]="nspe"; + ndl[1]="ntof"; + ndl[2]="ncat"; + ndl[3]="ncas"; + ndl[4]="ncar"; + ndl[5]="ncal"; + ndl[6]="nndd"; + ndl[7]="nstr"; + + int nspe=200,ntof=200,ncat=50,ncas=50,ncar=100,ncal=1000,nnd=200,nstr=1000,par[8],tmp=0,t; + par[0]=nspe; + par[1]=ntof; + par[2]=ncat; + par[3]=ncas; + par[4]=ncar; + par[5]=ncal; + par[6]=nnd; + par[7]=nstr; + + ifstream np("vectpar.dat",ios::in); + if(!np)printf("ATTENTION: Using default vector legths!\n"); + while(!np.eof()){ + np>>q>>tmp; + if(np.eof())break; + if(tmp<=0){ + cout<<"ATTENTION: Length of one vector is negative or equal 0!"<Loop(); dig->Close(); - std::cout << "Finished" << endl << flush; + cout << "Finished" << endl << flush; }