4 Macro for converting AliRoot digits into HLT RawData.
5 Binary creates for each patch its own file.
6 Singlepatch uses one file per slice (sp=kTRUE).
7 Use altro=kFALSE if you dont want to
8 filter out single timebins
10 Run with ALIROOT (not ROOT)
13 binary(Char_t* inpath,Char_t *outpath,Int_t first,Int_t last,Int_t event,Bool_t sp=kFALSE,Bool_t altro=kTRUE){
15 AliL3Transform::Init(inpath,kTRUE);
18 singlepatch(inpath,outpath,first,last,event,altro);
23 const Int_t npatch = 6;
25 sprintf(name,"%s/digitfile.root",inpath);
26 AliL3FileHandler *fFileHandler = new AliL3FileHandler();
27 fFileHandler->SetAliInput(name);
29 for(Int_t slice=first; slice<=last; slice++){
30 for(Int_t patch=0;patch<npatch;patch++){
31 cerr<<"reading slice: "<<slice<<" patch: "<<patch<<" and storing to: "<<outpath<<"/digits_"<<slice<<"_"<<patch<<".raw"<<endl;
32 fFileHandler->Init(slice,patch);
33 sprintf(name,"%s/digits_%d_%d_%d.raw",outpath,event,slice,patch);
34 fFileHandler->SetBinaryOutput(name);
35 fFileHandler->AliDigits2CompBinary(event,altro);
36 fFileHandler->CloseBinaryOutput();
41 fFileHandler->CloseAliInput();
44 void singlepatch(Char_t* inpath,Char_t *outpath,Int_t first=0, Int_t last=0,Int_t event=0,Bool_t altro=kTRUE)
48 AliL3FileHandler *fFileHandler = new AliL3FileHandler();
49 sprintf(name,"%s/digitfile.root",inpath);
50 fFileHandler->SetAliInput(name);
53 for(Int_t slice=first; slice<=last; slice++)
55 cerr<<"reading slice: "<<slice;
57 fFileHandler->Init(slice,patch);
58 sprintf(name,"%s/digits_%d_%d_%d.raw",outpath,event,slice,patch);
59 fFileHandler->SetBinaryOutput(name);
60 fFileHandler->AliDigits2CompBinary(event,altro);
61 fFileHandler->CloseBinaryOutput();
64 fFileHandler->CloseAliInput();
68 void write2rootfile(Char_t *in,Int_t first,Int_t last,Char_t *path)
70 //Write new rootfile, using data from the binary files.
72 AliL3Transform::Init(path);
74 sprintf(filename,"%s/digitfile.root",path);
75 file = TFile::Open(filename,"READ");
78 cout<<"Delete file "<<filename<<endl;
81 for(Int_t slice=first; slice<=last; slice++)
83 for(Int_t patch=0; patch<=5; patch++)
85 c = new AliL3Compress(slice,patch,path);
86 c->WriteRootFile(filename,in);
93 void make_init_file(Char_t *f,Char_t *path="./"){
94 AliL3Transform::MakeInitFile(f,path);