Using TMath::Abs instead of fabs
[u/mrichter/AliRoot.git] / HLT / exa / read.C
CommitLineData
086f41d8 1// $Id$
2
10d756ae 3void read(Char_t *path="./",Int_t min=0,Int_t max=35)
114013a3 4{
5
6 for(int slice=0; slice<35; slice++)
7 {
8 char fname[256];
10d756ae 9 sprintf(fname,"%s/digits_%d_0.raw",path,slice);
114013a3 10 file = new AliL3FileHandler();
11 if(!file->SetBinaryInput(fname))
12 {
13 cerr<<"Error opening file "<<fname<<endl;
14 return;
15 }
10d756ae 16
114013a3 17 int row[2]={0,175};
18 file->Init(slice,0,row);
10d756ae 19
114013a3 20 UInt_t size;
21 char name[256];
22 AliL3DigitRowData *data = file->CompBinary2Memory(size);
23
24 for(Int_t r=0; r<175; r++)
25 {
26 UInt_t padrow=data->fRow;
27 AliL3DigitData *dPt = (AliL3DigitData*)data->fDigitData;
28 cout<<"padrow "<<padrow<<" ndigits "<<data->fNDigit<<endl;
29
30 for(Int_t d=0; d<data->fNDigit; d++)
31 {
32 if(d>0 && dPt[d]->fPad == dPt[d-1]->fPad && dPt[d]->fTime == dPt[d-1]->fTime)
33 cout<<"Slice "<<slice<<" padrow "<<padrow<<" pad "<<(int)dPt[d]->fPad<<" time "
34 <<(int)dPt[d]->fTime<<" charge "<<(int)dPt[d]->fCharge<<endl;
35 }
36
37 file->UpdateRowPointer(data);
38 }
39
40 file->CloseBinaryInput();
41 delete file;
42 }
43}
10d756ae 44
45void read_ali(Char_t *fname, Int_t sl=0, Int_t sh=35)
46{
47 AliL3Logger l;
48 //l.UnSet(AliL3Logger::kDebug);
49 //l.UnSet(AliL3Logger::kAll);
50 //l.Set(AliL3Logger::kInformational);
51 l.UseStderr();
52 //l.UseStream();
53
54#if 0
55 //need galice file or alirunfile.root link
56 if(AliL3Transform::Init(fname,kTRUE))
57 {
58 cout << "created temp init file!" << endl;
59 }
60#endif
61
62 AliL3FileHandler *fileHandler = new AliL3FileHandler();
63
64 if(!fileHandler->SetAliInput(fname))
65 {
66 cerr<<"Error opening file "<<fname<<endl;
67 return;
68 }
69
70 Int_t event=0;
71 UInt_t nrow=0;
72
73 for(Int_t slice=sl; slice<=sl; slice++){
74 for(Int_t patch=0;patch<AliL3Transform::GetNPatches();patch++){
75
76 cerr<<"reading slice: "<<slice<<" patch: "<<patch<<endl;
77
78 fileHandler->Free();
79 fileHandler->Init(slice,patch);
80 AliL3DigitRowData *data=fileHandler->AliDigits2Memory(nrow,event);
81
82 cerr<<" found "<< nrow << " rows" <<endl;
83 }
84 }
85 fileHandler->CloseAliInput();
86}