]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRun.cxx
added merging for QA
[u/mrichter/AliRoot.git] / STEER / AliRun.cxx
index dc63d6e287c5556f9c0fbe12cdc91df35c285c5f..9b91c4e3492f361059b6ec517ee5b70412fb5e10 100644 (file)
@@ -73,7 +73,7 @@ ClassImp(AliRun)
 
 //_______________________________________________________________________
 AliRun::AliRun():
-  fRun(0),
+  fRun(-1),
   fEvent(0),
   fEventNrInRun(0),
   fEventsPerRun(0),
@@ -100,12 +100,13 @@ AliRun::AliRun():
   //
   AliConfig::Instance();//skowron 29 Feb 2002
                         //ensures that the folder structure is build
+
 }
 
 //_______________________________________________________________________
 AliRun::AliRun(const AliRun& arun):
   TNamed(arun),
-  fRun(0),
+  fRun(-1),
   fEvent(0),
   fEventNrInRun(0),
   fEventsPerRun(0),
@@ -136,7 +137,7 @@ AliRun::AliRun(const AliRun& arun):
 //_____________________________________________________________________________
 AliRun::AliRun(const char *name, const char *title):
   TNamed(name,title),
-  fRun(0),
+  fRun(-1),
   fEvent(0),
   fEventNrInRun(0),
   fEventsPerRun(0),
@@ -295,7 +296,8 @@ void AliRun::SetGeometryFromCDB()
 {
   // Set the loading of geometry from cdb instead of creating it
   // A default CDB storage needs to be set before this method is called
-  if(AliCDBManager::Instance()->IsDefaultStorageSet()){
+  if(AliCDBManager::Instance()->IsDefaultStorageSet() &&
+       AliCDBManager::Instance()->GetRun() >= 0){
     SetRootGeometry();
     fGeometryFromCDB = kTRUE;
   }else{
@@ -383,11 +385,6 @@ void AliRun::FinishRun()
   Write(0,TObject::kOverwrite);//write AliRun
   fRunLoader->Write(0,TObject::kOverwrite);//write RunLoader itself
   
-  // Clean tree information
-  AliDebug(1, "fRunLoader->Stack()->FinishRun()");
-  fRunLoader->Stack()->FinishRun();
-
-
   if(fMCApp) fMCApp->FinishRun();  
   fRunLoader->Synchronize();
 }
@@ -406,7 +403,7 @@ void AliRun::Announce() const
   printf("    You are running AliRoot version NewIO\n");
 
   printf("%6s","*");
-  printf("    The cvs tag for the current program is $Name$\n");
+  printf("    The SVN version for the current program is $Id$\n");
 
   printf("%6s","*");printf("%64s","*\n");
   printf("%70s",
@@ -581,9 +578,11 @@ void AliRun::InitMC(const char *setup)
   gROOT->LoadMacro(setup);
   gInterpreter->ProcessLine(fConfigFunction.Data());
 
-  // Set the run number in the CDB manager as assigned from
-  // constructor or from config file 
-  AliCDBManager::Instance()->SetRun(GetRunNumber());
+  if(AliCDBManager::Instance()->GetRun() >= 0) { 
+       SetRunNumber(AliCDBManager::Instance()->GetRun());
+  } else {
+       AliWarning("Run number not initialized!!");
+  }
   
   fRunLoader->CdGAFile();
     
@@ -985,7 +984,6 @@ void AliRun::AddModule(AliModule* mod)
   fNdets++;
 }
 
-// added by Alberto Colla
 //_____________________________________________________________________________
 /*inline*/ Bool_t AliRun::IsFileAccessible(const char* fnam, EAccessMode mode)
 { return !gSystem->AccessPathName(fnam,mode);}