Method for file synchronization (P.Skowronski)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Aug 2003 16:41:51 +0000 (16:41 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Aug 2003 16:41:51 +0000 (16:41 +0000)
STEER/AliDataLoader.cxx
STEER/AliDataLoader.h
STEER/AliLoader.cxx
STEER/AliLoader.h
STEER/AliRun.cxx
STEER/AliRunLoader.cxx
STEER/AliRunLoader.h

index 2ec209cd7683ccf7c6527022b1e0c05599164564..76b0e91846cb0b19a8ee71796014d5497ce29fd3 100644 (file)
@@ -665,6 +665,13 @@ void AliDataLoader::SetBaseQATaskLoader(AliTaskLoader* bl)
   if (GetBaseQATaskLoader()) delete GetBaseQATaskLoader();
   fBaseLoaders->AddAt(bl,kQATask);
 }
+void AliDataLoader::Synchronize()
+{
+  //synchrinizes all writtable files 
+  if ( fFile == 0x0 ) return;
+  if ( fFile->IsWritable() == kFALSE ) return;
+  fFile->Write(0,TObject::kOverwrite);
+}
 
 /*****************************************************************************/ 
 /*****************************************************************************/ 
index e04db605b4a1655c3d6dec7a2e8fbe3798a99f0e..423dc36910b768e5281ff85abd6c8370d7a1ecb8 100644 (file)
@@ -96,6 +96,9 @@ class AliDataLoader: public TNamed
    Bool_t             IsFileWritable() const;
    Bool_t             IsFileOpen() const;
    Bool_t             IsOptionContrary(const TString& option) const;
+   
+   void Synchronize();
+
   protected:
    Int_t              GetDebug() const;
    AliRunLoader*      GetRunLoader();//gets the run-loader from event folder
index fb05bb94adccb52311159efc57a9c54455d70018..c38995bb7320a20e82b650c7602efdd582b47834 100644 (file)
@@ -860,6 +860,19 @@ void AliLoader::SetTAddrInDet()
   det->SetTreeAddress();
 }
 /*****************************************************************************/ 
+
+void AliLoader::Synchronize()
+{
+  //synchrinizes all writtable files 
+ TIter next(fDataLoaders);
+ AliDataLoader* dl;
+ while ((dl = (AliDataLoader*)next()))
+  {
+    dl->Synchronize();
+  }
+  
+}
+/*****************************************************************************/ 
 /*****************************************************************************/ 
 /*****************************************************************************/ 
 
index 517b8a6a59dd9ec483308d8e603264d543f5dde3..374c0479648bfc1298128d19d22c7f2d50a82b16 100644 (file)
@@ -202,6 +202,8 @@ class AliLoader: public TNamed
     void          SetDigitsFileNameSuffix(const TString& suffix);//adds the suffix before ".root", 
                                                           //e.g. TPC.Digits.root -> TPC.DigitsMerged.root
                                                               //made on Jiri Chudoba demand
+    void Synchronize();
+    
    protected:
 
     /*********************************************/
index e543370b762707b36e20ef8239f79e0d1b0d0335..9f39bb9aef97021f5de34e1088f8515bfec864e7 100644 (file)
@@ -429,7 +429,6 @@ void AliRun::FinishRun()
   // Called at the end of the run.
   //
   
-  
   if(fLego) 
    {
     if (GetDebug()) Info("FinishRun"," Finish Lego");
@@ -464,6 +463,8 @@ void AliRun::FinishRun()
   // Clean detector information
   if (GetDebug()) Info("FinishRun"," fGenerator->FinishRun()");
   fGenerator->FinishRun();
+  
+  fRunLoader->Synchronize();
 }
 
 //_______________________________________________________________________
index c1a6facd7519dd8492c85346ec2d729821330433..5c6a81aa57b4bb29b10d2211841a1c031154285a 100644 (file)
@@ -1601,5 +1601,20 @@ void AliRunLoader::SetDetectorAddresses()
    }
 }
 /*****************************************************************************/ 
+
+void AliRunLoader::Synchronize()
+{
+  //synchrinizes all writtable files 
+  TIter next(fLoaders);
+  AliLoader *loader;
+  while((loader = (AliLoader*)next()))
+   {
+     loader->Synchronize();
+   }
+  
+  fKineDataLoader->Synchronize();
+  fTrackRefsDataLoader->Synchronize();
+  
+}
 /*****************************************************************************/ 
 /*****************************************************************************/ 
index ea1634a5e39a6e274cfb93f8b2713b1e4de8a7f0..8ce457296429b2fae4cb6b80537dea1b7ed1b500 100644 (file)
@@ -143,7 +143,8 @@ class AliRunLoader: public TNamed
     const TObjArray* GetArrayOfLoaders() const {return fLoaders;}
     Int_t GetDebug() const {return AliLoader::GetDebug();}
     void cd(){fgRunLoader = this;}
-
+    void Synchronize();
+    
   protected:
     /**********************************************/
     /************    PROTECTED      ***************/