]>
Commit | Line | Data |
---|---|---|
fd337011 | 1 | /* $Id$ */ |
2 | ||
3 | /** | |
4 | Macro for converting AliRoot digits into L3 RawData. Binary create for each patch its own file. singlepatch uses one file per slice. | |
5 | */ | |
6 | ||
ddb49e9c | 7 | Binary(char* in,int first, int last,char *path=""){ |
f2793c29 | 8 | char name[256]; |
eb13caca | 9 | const Int_t npatch = 6; |
10 | Int_t row[npatch][2] = {{0,31},{32,63},{64,91},{92,119},{120,143},{144,175}}; | |
fd337011 | 11 | AliL3Logger l; |
12 | //l.UnSet(AliL3Logger::kDebug); | |
13 | //l.UnSet(AliL3Logger::kAll); | |
14 | //l.Set(AliL3Logger::kInformational); | |
15 | l.UseStdout(); | |
16 | //l.UseStream(); | |
17 | ||
18 | AliL3FileHandler *fFileHandler = new AliL3FileHandler(); | |
19 | fFileHandler->SetAliInput(in); | |
4ab9f8f0 | 20 | AliL3Transform::Init(path); |
fd337011 | 21 | |
f2793c29 | 22 | for(int slice=first; slice<=last; slice++){ |
eb13caca | 23 | for(int patch=0;patch<npatch;patch++){ |
fd337011 | 24 | cerr<<"reading slice: "<<slice<<" patch: "<<patch<<" and storing to: "<<path<<"digits_"<<slice<<"_"<<patch<<".raw"<<endl; |
8f25fe14 | 25 | fFileHandler->Free(); |
f2793c29 | 26 | fFileHandler->Init(slice,patch,row[patch]); |
fd337011 | 27 | sprintf(name,"%s/digits_%d_%d.raw",path,slice,patch); |
f2793c29 | 28 | fFileHandler->SetBinaryOutput(name); |
29 | fFileHandler->AliDigits2CompBinary(); | |
30 | fFileHandler->CloseBinaryOutput(); | |
31 | cerr<<" done"<<endl; | |
32 | } | |
33 | } | |
34 | fFileHandler->CloseAliInput(); | |
35 | } | |
8f25fe14 | 36 | |
37 | void singlepatch(char* in,int first, int last,char *path="",int event=0) | |
38 | { | |
39 | AliL3Logger l; | |
fd337011 | 40 | //l.UnSet(AliL3Logger::kDebug); |
41 | //l.UnSet(AliL3Logger::kAll); | |
42 | //l.Set(AliL3Logger::kInformational); | |
8f25fe14 | 43 | //l.UseStdout(); |
44 | l.UseStream(); | |
45 | ||
46 | char fname[100]; | |
47 | sprintf(fname,"%sevent_%d/",path,event); | |
48 | char name[256]; | |
49 | AliL3FileHandler *fFileHandler = new AliL3FileHandler(); | |
50 | fFileHandler->SetAliInput(in); | |
51 | Int_t srow[2] = {0,175}; | |
52 | int patch=0; | |
53 | for(int slice=first; slice<=last; slice++) | |
54 | { | |
55 | cerr<<"reading slice: "<<slice; | |
56 | fFileHandler->Free(); | |
57 | fFileHandler->Init(slice,patch,srow); | |
58 | sprintf(name,"%sdigits_%d_%d.raw",fname,slice,patch); | |
59 | fFileHandler->SetBinaryOutput(name); | |
60 | fFileHandler->AliDigits2CompBinary(event); | |
61 | fFileHandler->CloseBinaryOutput(); | |
62 | cerr<<" done"<<endl; | |
63 | } | |
64 | fFileHandler->CloseAliInput(); | |
65 | ||
66 | } |