4 Macro for converting AliRoot digits into L3 RawData.
5 Binary creates for each patch its own file.
6 Singlepatch uses one file per slice (sp=kTRUE).
9 binary(char* in,int first, int last,char *path=".",Bool_t sp=kFALSE){
11 AliL3Transform::Init(path);
14 singlepatch(in,first,last,path);
19 const Int_t npatch = 6;
24 AliL3FileHandler *fFileHandler = new AliL3FileHandler();
25 fFileHandler->SetAliInput(in);
27 for(int slice=first; slice<=last; slice++){
28 for(int patch=0;patch<npatch;patch++){
29 cerr<<"reading slice: "<<slice<<" patch: "<<patch<<" and storing to: "<<path<<"/digits_"<<slice<<"_"<<patch<<".raw"<<endl;
30 fFileHandler->Init(slice,patch);
31 sprintf(name,"%s/digits_%d_%d.raw",path,slice,patch);
32 fFileHandler->SetBinaryOutput(name);
33 fFileHandler->AliDigits2CompBinary();
34 fFileHandler->CloseBinaryOutput();
39 fFileHandler->CloseAliInput();
42 void write2rootfile(char *in,int first,int last,char *path)
44 //Write new rootfile, using data from the binary files.
46 AliL3Transform::Init(path);
48 sprintf(filename,"%s/digitfile.root",path);
49 file = TFile::Open(filename,"READ");
52 cout<<"Delete file "<<filename<<endl;
55 for(int slice=first; slice<=last; slice++)
57 for(int patch=0; patch<=5; patch++)
59 c = new AliL3Compress(slice,patch,path);
60 c->WriteRootFile(filename,in);
67 void singlepatch(char* in,int first=0, int last=0,char *path=".",int event=0)
70 //l.UnSet(AliL3Logger::kDebug);
71 //l.UnSet(AliL3Logger::kAll);
72 //l.Set(AliL3Logger::kInformational);
77 AliL3FileHandler *fFileHandler = new AliL3FileHandler();
78 fFileHandler->SetAliInput(in);
80 Int_t srow[2] = {0,175};
82 for(int slice=first; slice<=last; slice++)
84 cerr<<"reading slice: "<<slice;
86 fFileHandler->Init(slice,patch,srow);
87 sprintf(name,"%s/digits_%d_%d.raw",path,slice,patch);
88 fFileHandler->SetBinaryOutput(name);
89 fFileHandler->AliDigits2CompBinary(event);
90 fFileHandler->CloseBinaryOutput();
93 fFileHandler->CloseAliInput();
97 void make_init_file(Char_t *f,Char_t *path="./"){
98 AliL3Transform::MakeInitFile(f,path);