]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added function that writes new rootfile with digits from the
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Oct 2002 09:54:00 +0000 (09:54 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Oct 2002 09:54:00 +0000 (09:54 +0000)
binary files. This is done in order to get the same cuts;
adc saturation, 45 degree cone etc, into the offline chain.

HLT/exa/binary.C

index 6e42b4038040dc5291425193cd3c4daaa72948e7..7dcfcea0aa62992aa88ba01ac8d1e206ae6524c6 100644 (file)
@@ -8,6 +8,8 @@
 
 binary(char* in,int first, int last,char *path=".",Bool_t sp=kFALSE){
 
+  AliL3Transform::Init(path);
+  
   if(sp) {
     singlepatch(in,first,last,path);
     return;
@@ -15,15 +17,9 @@ binary(char* in,int first, int last,char *path=".",Bool_t sp=kFALSE){
 
   char name[256];
   const Int_t npatch = 6;
-  AliL3Logger l;
-  //l.UnSet(AliL3Logger::kDebug);
-  //l.UnSet(AliL3Logger::kAll);
-  //l.Set(AliL3Logger::kInformational);
-  l.UseStderr();
-  //l.UseStream();
-
+  
   //read init file
-  AliL3Transform::Init(path);
+  
 
   AliL3FileHandler *fFileHandler = new AliL3FileHandler(); 
   fFileHandler->SetAliInput(in);
@@ -31,17 +27,42 @@ binary(char* in,int first, int last,char *path=".",Bool_t sp=kFALSE){
   for(int slice=first; slice<=last; slice++){
     for(int patch=0;patch<npatch;patch++){
       cerr<<"reading slice: "<<slice<<" patch: "<<patch<<" and storing to: "<<path<<"/digits_"<<slice<<"_"<<patch<<".raw"<<endl;
-      fFileHandler->Free();
       fFileHandler->Init(slice,patch);      
       sprintf(name,"%s/digits_%d_%d.raw",path,slice,patch);
       fFileHandler->SetBinaryOutput(name);
       fFileHandler->AliDigits2CompBinary();
       fFileHandler->CloseBinaryOutput();      
+      fFileHandler->Free();
       cerr<<" done"<<endl;
     }      
   }
   fFileHandler->CloseAliInput();
 }
+
+void write2rootfile(char *in,int first,int last,char *path)
+{
+  //Write new rootfile, using data from the binary files. 
+
+  AliL3Transform::Init(path);
+  char filename[1024];
+  sprintf(filename,"%s/digitfile.root",path);
+  file = TFile::Open(filename,"READ");
+  if(file->IsOpen())
+    {
+      cout<<"Delete file "<<filename<<endl;
+      return;
+    }
+  for(int slice=first; slice<=last; slice++)
+    {
+      for(int patch=0; patch<=5; patch++)
+       {
+         c = new AliL3Compress(slice,patch,path);
+         c->WriteRootFile(filename,in);
+         delete c;
+       }
+    }
+  
+}
  
 void singlepatch(char* in,int first=0, int last=0,char *path=".",int event=0)
 {
@@ -52,9 +73,6 @@ void singlepatch(char* in,int first=0, int last=0,char *path=".",int event=0)
   l.UseStderr();
   //l.UseStream();
   
-  //read init file
-  AliL3Transform::Init(path);
-
   char name[256];
   AliL3FileHandler *fFileHandler = new AliL3FileHandler(); 
   fFileHandler->SetAliInput(in);