]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/EveBase/AliEveEventManager.cxx
Remove default OCDB location and exit with fatal error if OCDB URI is
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveEventManager.cxx
index 4baa2bad853b3e19bc0f7da86b08625a8599a805..bdf73c7cc790a7ca8549e3d70d3a513c6a924f5c 100644 (file)
@@ -32,6 +32,7 @@
 #include <AliHeader.h>
 #include <AliGeomManager.h>
 #include <AliGRPManager.h>
+#include <AliSysInfo.h>
 
 #include <TFile.h>
 #include <TTree.h>
@@ -82,7 +83,7 @@ Bool_t AliEveEventManager::fgAssertRaw       = kFALSE;
 TString  AliEveEventManager::fgESDFileName("AliESDs.root");
 TString  AliEveEventManager::fgAODFileName("AliAOD.root");
 TString  AliEveEventManager::fgRawFileName("raw.root");
-TString  AliEveEventManager::fgCdbUri("local://$ALICE_ROOT/OCDB");
+TString  AliEveEventManager::fgCdbUri;
 
 TList*   AliEveEventManager::fgAODfriends = 0;
 
@@ -233,7 +234,7 @@ void AliEveEventManager::SetRawFileName(const TString& raw)
 
 void AliEveEventManager::SetCdbUri(const TString& cdb)
 {
-  // Set path to CDB, default "local://$ALICE_ROOT/OCDB".
+  // Set path to CDB, there is no default.
 
   if ( ! cdb.IsNull()) fgCdbUri = cdb;
 }
@@ -521,14 +522,29 @@ void AliEveEventManager::Open()
     }
     else
     {
-      cdb->SetDefaultStorage(fgCdbUri);
+      if (fgCdbUri.IsNull())
+      {
+       gEnv->SetValue("Root.Stacktrace", "no");
+       Fatal("Open()", "OCDB path was not specified.");
+      }
+
+      // Handle some special cases for MC (should be in OCDBManager).
+      if (fgCdbUri == "mcideal://")
+       cdb->SetDefaultStorage("MC", "Ideal");
+      else if (fgCdbUri == "mcresidual://")
+       cdb->SetDefaultStorage("MC", "Residual");
+      else if (fgCdbUri == "mcfull://")
+       cdb->SetDefaultStorage("MC", "Full");
+      else if (fgCdbUri == "local://") {
+       fgCdbUri = "local://$ALICE_ROOT/OCDB";
+       cdb->SetDefaultStorage(fgCdbUri);
+      } else
+       cdb->SetDefaultStorage(fgCdbUri);
       if (cdb->IsDefaultStorageSet() == kFALSE)
-       throw (kEH + "CDB initialization failed.");
+       throw kEH + "CDB initialization failed.";
     }
     
-    TString expCDB(fgCdbUri);
-    gSystem->ExpandPathName(expCDB);
-    if (cdb->GetDefaultStorage()->GetURI() == expCDB)
+    if (fgCdbUri.BeginsWith("local://"))
     {
       TString grp     = "GRP/GRP/Data";
       TString grppath = fPath + "/" + grp;
@@ -713,6 +729,10 @@ void AliEveEventManager::GotoEvent(Int_t event)
                       event, 0, maxEvent));
   }
 
+  TString sysInfoHeader;
+  sysInfoHeader.Form("AliEveEventManager::GotoEvent(%d) - ", event);
+  AliSysInfo::AddStamp(sysInfoHeader + "Start");
+
   TEveManager::TRedrawDisabler rd(gEve);
   gEve->Redraw3D(kFALSE, kTRUE); // Enforce drop of all logicals.
 
@@ -728,6 +748,8 @@ void AliEveEventManager::GotoEvent(Int_t event)
   }
   DestroyElements();
 
+  AliSysInfo::AddStamp(sysInfoHeader + "PostDestroy");
+
   if (fESDTree) {
     if (fESDTree->GetEntry(event) <= 0)
       throw (kEH + "failed getting required event from ESD.");
@@ -781,7 +803,11 @@ void AliEveEventManager::GotoEvent(Int_t event)
     ElementChanged();
   }
 
+  AliSysInfo::AddStamp(sysInfoHeader + "PostLoadEvent");
+
   AfterNewEventLoaded();
+
+  AliSysInfo::AddStamp(sysInfoHeader + "PostUserActions");
 }
 
 void AliEveEventManager::NextEvent()