efd364f74521c7ebb39b11865fc196641a4ab631
[u/mrichter/AliRoot.git] / HLT / exa / Binary.C
1 Binary(char* in,int first, int last,char *path=""){
2   char name[256];
3   AliL3FileHandler *fFileHandler = new AliL3FileHandler(); 
4   fFileHandler->SetAliInput(in);
5   const Int_t npatch = 6;
6   Int_t row[npatch][2] = {{0,31},{32,63},{64,91},{92,119},{120,143},{144,175}};
7   for(int slice=first; slice<=last; slice++){
8     for(int patch=0;patch<npatch;patch++){
9       cerr<<"reading slice: "<<slice<<" patch: "<<patch;
10       fFileHandler->Free();
11       fFileHandler->Init(slice,patch,row[patch]);      
12       sprintf(name,"%sdigits_%d_%d.raw",path,slice,patch);
13       fFileHandler->SetBinaryOutput(name);
14       fFileHandler->AliDigits2CompBinary();
15       fFileHandler->CloseBinaryOutput();      
16       cerr<<" done"<<endl;
17     }      
18   }
19   fFileHandler->CloseAliInput();
20 }
21  
22 void singlepatch(char* in,int first, int last,char *path="",int event=0)
23 {
24   AliL3Logger l;
25   //  l.UnSet(AliL3Logger::kDebug);
26   //  l.UnSet(AliL3Logger::kAll);
27   //  l.Set(AliL3Logger::kInformational);
28   //l.UseStdout();
29   l.UseStream();
30   
31   char fname[100];
32   sprintf(fname,"%sevent_%d/",path,event);
33   char name[256];
34   AliL3FileHandler *fFileHandler = new AliL3FileHandler(); 
35   fFileHandler->SetAliInput(in);
36   Int_t srow[2] = {0,175};
37   int patch=0;
38   for(int slice=first; slice<=last; slice++)
39     {
40       cerr<<"reading slice: "<<slice;
41       fFileHandler->Free();
42       fFileHandler->Init(slice,patch,srow);
43       sprintf(name,"%sdigits_%d_%d.raw",fname,slice,patch);
44       fFileHandler->SetBinaryOutput(name);
45       fFileHandler->AliDigits2CompBinary(event);
46       fFileHandler->CloseBinaryOutput();      
47       cerr<<" done"<<endl;
48     }
49   fFileHandler->CloseAliInput();
50   
51 }
52
53