// $Id$ /* Different small routines for reading and testing the data.*/ #ifndef __CINT__ #include "AliHLTFileHandler.h" #include "AliHLTDigitData.h" #include "AliHLTTransform.h" #include "AliHLTLogger.h" #include #include #endif void read(Char_t *path="./",Int_t min=0,Int_t max=35) { AliHLTTransform::Init(path); for(Int_t slice=0; slice<35; slice++) { Char_t fname[256]; sprintf(fname,"%s/digits_%d_0.raw",path,slice); AliHLTFileHandler *file = new AliHLTFileHandler(); if(!file->SetBinaryInput(fname)) { cerr<<"Error opening file "<Init(slice,0,row); UInt_t size; AliHLTDigitRowData *data = file->CompBinary2Memory(size); for(Int_t r=0; r<175; r++) { UInt_t padrow=data->fRow; AliHLTDigitData *dPt = (AliHLTDigitData*)data->fDigitData; cout<<"padrow "<fNDigit<fNDigit; d++) { if(d>0 && dPt[d].fPad == dPt[d-1].fPad && dPt[d].fTime == dPt[d-1].fTime) cout<<"Slice "<UpdateRowPointer(data); } file->CloseBinaryInput(); delete file; } } void read_ali(Char_t *fname, Int_t sl=0, Int_t sh=35) { //need galice file or alirunfile.root link if(AliHLTTransform::Init(fname,kTRUE)) { cout << "created temp init file!" << endl; } AliHLTFileHandler *fileHandler = new AliHLTFileHandler(); if(!fileHandler->SetAliInput(fname)) { cerr<<"Error opening file "<Free(); fileHandler->Init(slice,patch); AliHLTDigitRowData *data=fileHandler->AliDigits2Memory(nrow,event); if(!data) cerr << "Obscure error while reading data." << endl; cerr<<" found "<< nrow << " rows" <CloseAliInput(); } void read_pp(Char_t *path="./",Int_t min=0,Int_t max=35,Int_t ev=0) { AliHLTTransform::Init(path); for(Int_t slice=min; sliceSetBinaryInput(fname)) { cerr<<"Error opening file "<Init(slice,-1); UInt_t size; AliHLTDigitRowData *data; data=(AliHLTDigitRowData*)file->Allocate(); //size from binary input file->Binary2Memory(size,data); for(Int_t r=AliHLTTransform::GetFirstRow(-1); rfRow; AliHLTDigitData *dPt = (AliHLTDigitData*)data->fDigitData; cout<fNDigit<fNDigit; d++) { //if((int)dPt[d]->fTime>1023) cout<<"Slice "<UpdateRowPointer(data); } file->CloseBinaryInput(); delete file; } } void read_event_tree(Char_t *rootfile,Int_t startev=0) { AliHLTFileHandler *handler = new AliHLTFileHandler(); if(!handler->SetAliInput(rootfile)){ cerr<<" Error opening file: "<Init(slice,-1); if(!handler->AliAltroDigits2Memory(size,ev)){ cout << " not a valid event, breaking!!!" <Free(); handler->FreeDigitsTree(); cout<<" done"<