]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/STEER/AliReconstruction.cxx
more consistent naming for SetCDBSnapshotMode and definition moved in the source...
[u/mrichter/AliRoot.git] / STEER / STEER / AliReconstruction.cxx
index be0719957b96bdf6131cfffbb6a270006d27b0a4..f325296673e9e2d1a4a97de89fa67f74a4c0f1c5 100644 (file)
@@ -779,6 +779,11 @@ void AliReconstruction::InitCDB()
   AliSysInfo::AddStamp("InitCDB");
 }
 
+//_____________________________________________________________________________
+void AliReconstruction::SetCDBSnapshotMode(const char* snapshotFileName) {
+    AliCDBManager::Instance()->SetSnapshotMode(snapshotFileName);
+}
+
 //_____________________________________________________________________________
 void AliReconstruction::SetDefaultStorage(const char* uri) {
 // Store the desired default CDB storage location
@@ -1492,6 +1497,11 @@ void AliReconstruction::InitRun(const char* input)
     return;
   }
 
+  if(fFromCDBSnapshot){
+      AliDebug(2,"Initializing from a CDB snapshot");
+      if(!AliCDBManager::Instance()->InitFromSnapshot(fSnapshotFileName.Data()))
+         AliFatal("Was not able to initialize from the snapshot!");
+  }
   // Set CDB lock: from now on it is forbidden to reset the run number
   // or the default storage or to activate any further storage!
   SetCDBLock();
@@ -1533,7 +1543,6 @@ void AliReconstruction::Begin(TTree *)
     AliSysInfo::AddStamp("CheckGeom");
   }
 
-  Bool_t loadedFromSnapshot=kFALSE;
   Bool_t toCDBSnapshot=kFALSE;
   TString snapshotFileOut(""); // we could use fSnapshotFileName if we are not interested
   // in reading from and writing to a snapshot file at the same time
@@ -1546,10 +1555,6 @@ void AliReconstruction::Begin(TTree *)
       else
          snapshotFileOut="OCDB.root";
   }
-  if(fFromCDBSnapshot){
-      AliDebug(2,"Initializing from a CDB snapshot");
-      loadedFromSnapshot = AliCDBManager::Instance()->InitFromSnapshot(fSnapshotFileName.Data());
-  }
 
   if (!MisalignGeometry(fLoadAlignData)) {
     Abort("MisalignGeometry", TSelector::kAbortProcess);
@@ -1566,7 +1571,7 @@ void AliReconstruction::Begin(TTree *)
   AliSysInfo::AddStamp("InitGRP");
   if(!toCDBSnapshot) AliCDBManager::Instance()->UnloadFromCache("GRP/Calib/CosmicTriggers");
 
-  if(!loadedFromSnapshot){
+  if(!fFromCDBSnapshot){
       if (!LoadCDB()) {
          Abort("LoadCDB", TSelector::kAbortProcess);
          return;
@@ -1599,7 +1604,7 @@ void AliReconstruction::Begin(TTree *)
   AliSysInfo::AddStamp("InitRecoParams");
 
   if(toCDBSnapshot)
-      AliCDBManager::Instance()->DumpToSnapshotFile(snapshotFileOut.Data());
+      AliCDBManager::Instance()->DumpToSnapshotFile(snapshotFileOut.Data(),kFALSE);
   AliCDBManager::Instance()->UnloadFromCache("*/Align/*");
   AliCDBManager::Instance()->UnloadFromCache("GRP/Calib/CosmicTriggers");
 
@@ -3182,9 +3187,11 @@ Bool_t AliReconstruction::FillTriggerESD(AliESDEvent*& esd)
        esdheader->AddTriggerIR(input.GetIR(i));
       }
        AliCentralTrigger* rlCTP = fRunLoader->GetTrigger();
-       rlCTP->SetL0TriggerInputs(input.GetL0Inputs());
-       rlCTP->SetL1TriggerInputs(input.GetL1Inputs());
-       rlCTP->SetL2TriggerInputs(input.GetL2Inputs());
+       if (rlCTP) {
+        rlCTP->SetL0TriggerInputs(input.GetL0Inputs());
+        rlCTP->SetL1TriggerInputs(input.GetL1Inputs());
+        rlCTP->SetL2TriggerInputs(input.GetL2Inputs());
+       }
     }
     if (fIsNewRunLoader) fRunLoader->TreeCT()->Fill();
   }
@@ -3963,8 +3970,10 @@ Bool_t AliReconstruction::GetEventInfo()
     aCTP->SetClusterMask(clmask);
 
     AliCentralTrigger* rlCTP = fRunLoader->GetTrigger();
-    rlCTP->SetClassMask(mask);
-    rlCTP->SetClusterMask(clmask);
+    if (rlCTP) {
+      rlCTP->SetClassMask(mask);
+      rlCTP->SetClusterMask(clmask);
+    }
   }
   else {
     fEventInfo.SetEventType(AliRawEventHeaderBase::kPhysicsEvent);