/* $Id$ Author: Constantin Loizides #include #include "AliL3MemHandler.h" #include "AliL3AltroMemHandler.h" #include "AliL3DigitData.h" #include "AliL3Transform.h" /** Example program how to open and read a raw datafile. In addition it shows, how to store results in an Altro like data format. */ int main(int argc,char **argv) { UInt_t nrows=175; Bool_t altroout=kFALSE; FILE *afile=0; if(argc<2) { cout<<"Usage: read datafile [padrows] [altrodatfile]"<2) { nrows=atoi(argv[2]); } if (argc>3) { altroout=kTRUE; afile=fopen(argv[3],"w"); } //Filehandler object: AliL3MemHandler file; //Open the data file: if(!file.SetBinaryInput(argv[1])) { cerr<<"Error opening file "<fDigitData; //Loop over all digits on this padrow: for(UInt_t ndig=0; ndigfNDigit; ndig++) { pad = dataPt[ndig].fPad; time = dataPt[ndig].fTime; charge = dataPt[ndig].fCharge; cout << "Padrow " << row << " pad " << (int)pad << " time " <<(int) time << " charge " << (int)charge << endl; if(altroout) altromem.Write(row,pad,charge,time); } //Move the pointer to the next padrow: file.UpdateRowPointer(digits); } if(afile) { altromem.WriteFinal(); fclose(afile); } return 0; }