]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/exa/binary.C
Removed ASV version in AliL3FileHandler by another effective i/o method using index...
[u/mrichter/AliRoot.git] / HLT / exa / binary.C
index 3bf7321a76b6f1ed367a206c770f1923ab5320c9..287fb95d4680eb6ec8b4469ba9cee0cdbd884fb1 100644 (file)
@@ -4,21 +4,23 @@
    Macro for converting AliRoot digits into L3 RawData. 
    Binary creates for each patch its own file. 
    Singlepatch uses one file per slice (sp=kTRUE). 
-   Run with ALIROOT (not root)
+   Use altro=kFALSE if you dont want to 
+   filter out single timebins
+
+   Run with ALIROOT (not ROOT)
 */
 
-binary(Char_t* inpath,Char_t *outpath,Int_t first,Int_t last,Int_t event,Bool_t sp=kFALSE){
+binary(Char_t* inpath,Char_t *outpath,Int_t first,Int_t last,Int_t event,Bool_t sp=kFALSE,Bool_t altro=kTRUE){
 
   AliL3Transform::Init(inpath,kTRUE);
 
   if(sp) {
-    singlepatch(inpath,outpath,first,last,event);
+    singlepatch(inpath,outpath,first,last,event,altro);
     return;
   }
 
   Char_t name[256];
   const Int_t npatch = 6;
-  Bool_t altrodigits=kFALSE;
 
   sprintf(name,"%s/digitfile.root",inpath);
   AliL3FileHandler *fFileHandler = new AliL3FileHandler(); 
@@ -30,7 +32,7 @@ binary(Char_t* inpath,Char_t *outpath,Int_t first,Int_t last,Int_t event,Bool_t
       fFileHandler->Init(slice,patch);      
       sprintf(name,"%s/digits_%d_%d_%d.raw",outpath,event,slice,patch);
       fFileHandler->SetBinaryOutput(name);
-      fFileHandler->AliDigits2CompBinary(event,altrodigits);
+      fFileHandler->AliDigits2CompBinary(event,altro);
       fFileHandler->CloseBinaryOutput();      
       fFileHandler->Free();
       cerr<<" done"<<endl;
@@ -39,6 +41,31 @@ binary(Char_t* inpath,Char_t *outpath,Int_t first,Int_t last,Int_t event,Bool_t
   fFileHandler->CloseAliInput();
 }
 
+void singlepatch(Char_t* inpath,Char_t *outpath,Int_t first=0, Int_t last=0,Int_t event=0,Bool_t altro=kTRUE)
+{
+   
+  Char_t name[256];
+  AliL3FileHandler *fFileHandler = new AliL3FileHandler(); 
+  sprintf(name,"%s/digitfile.root",inpath);
+  fFileHandler->SetAliInput(name);
+  
+  Int_t patch=-1;
+  for(Int_t slice=first; slice<=last; slice++)
+    {
+      cerr<<"reading slice: "<<slice;
+      fFileHandler->Free();
+      fFileHandler->Init(slice,patch);
+      sprintf(name,"%s/digits_%d_%d_%d.raw",outpath,event,slice,patch);
+      fFileHandler->SetBinaryOutput(name);
+      fFileHandler->AliDigits2CompBinary(event,altro);
+      fFileHandler->CloseBinaryOutput();      
+      cerr<<" done"<<endl;
+    }
+  fFileHandler->CloseAliInput();
+  
+}
+
 void write2rootfile(Char_t *in,Int_t first,Int_t last,Char_t *path)
 {
   //Write new rootfile, using data from the binary files. 
@@ -63,31 +90,6 @@ void write2rootfile(Char_t *in,Int_t first,Int_t last,Char_t *path)
     }
   
 }
-void singlepatch(Char_t* inpath,Char_t *outpath,Int_t first=0, Int_t last=0,Int_t event=0)
-{
-   
-  Char_t name[256];
-  AliL3FileHandler *fFileHandler = new AliL3FileHandler(); 
-  sprintf(name,"%s/digitfile.root",inpath);
-  fFileHandler->SetAliInput(name);
-  
-  Bool_t altrodigits=kFALSE;
-  Int_t patch=-1;
-  for(Int_t slice=first; slice<=last; slice++)
-    {
-      cerr<<"reading slice: "<<slice;
-      fFileHandler->Free();
-      fFileHandler->Init(slice,patch);
-      sprintf(name,"%s/digits_%d_%d_%d.raw",outpath,event,slice,patch);
-      fFileHandler->SetBinaryOutput(name);
-      fFileHandler->AliDigits2CompBinary(event,altrodigits);
-      fFileHandler->CloseBinaryOutput();      
-      cerr<<" done"<<endl;
-    }
-  fFileHandler->CloseAliInput();
-  
-}
 
 void make_init_file(Char_t *f,Char_t *path="./"){
   AliL3Transform::MakeInitFile(f,path);