]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
only access ocdb if really requested
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Mar 2011 10:16:23 +0000 (10:16 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Mar 2011 10:16:23 +0000 (10:16 +0000)
PWG4/CaloCalib/AliAnalysisTaskEMCALClusterizeFast.cxx

index e47bfc88facc7a2210d2b835e2500437d3f710df..95a978a57ba6061be466e9109a0b7f5adc3178bc 100644 (file)
@@ -98,7 +98,7 @@ AliAnalysisTaskEMCALClusterizeFast::AliAnalysisTaskEMCALClusterizeFast(const cha
 { 
   // Constructor
 
-  fBranchNames     = "ESD:AliESDHeader.,EMCALCells. AOD:header,emcalCells";
+  fBranchNames     = "ESD:AliESDHeader.,AliESDRun.,EMCALCells. AOD:header,emcalCells";
   for(Int_t i = 0; i < 12; ++i) 
     fGeomMatrix[i] = 0;
 }
@@ -396,7 +396,7 @@ void AliAnalysisTaskEMCALClusterizeFast::UpdateClusters()
 void AliAnalysisTaskEMCALClusterizeFast::Init()
 {
   //Select clusterization/unfolding algorithm and set all the needed parameters
-  
+
   AliVEvent * event = InputEvent();
   if (!event) {
     AliWarning("Event not available!!!");
@@ -414,12 +414,6 @@ void AliAnalysisTaskEMCALClusterizeFast::Init()
     return;
   }
 
-  AliCDBManager *cdb = AliCDBManager::Instance();
-  if (!cdb->IsDefaultStorageSet() && !fOCDBpath.IsNull())
-    cdb->SetDefaultStorage(fOCDBpath);
-  if (fRun!=cdb->GetRun())
-    cdb->SetRun(fRun);
-
   AliEMCALGeometry *geometry = AliEMCALGeometry::GetInstance(fGeomName);
   if (!geometry) {
     AliFatal("Geometry not available!!!");
@@ -478,6 +472,15 @@ void AliAnalysisTaskEMCALClusterizeFast::Init()
     AliFatal(Form("Clusterizer < %d > not available", fRecParam->GetClusterizerFlag()));
   }
   fClusterizer->InitParameters(fRecParam);
+
+  if ((!fCalibData&&fLoadCalib) || (!fPedestalData&&fLoadPed)) {
+    AliCDBManager *cdb = AliCDBManager::Instance();
+    if (!cdb->IsDefaultStorageSet() && !fOCDBpath.IsNull())
+      cdb->SetDefaultStorage(fOCDBpath);
+    if (fRun!=cdb->GetRun())
+      cdb->SetRun(fRun);
+  }
+
   if (!fCalibData&&fLoadCalib) {
     AliCDBEntry *entry = static_cast<AliCDBEntry*>(AliCDBManager::Instance()->Get("EMCAL/Calib/Data"));
     if (entry)