From: mkrzewic Date: Mon, 4 Nov 2013 17:59:54 +0000 (+0000) Subject: guess the run number from the input file path X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=4c0fc8e0f2ecdc0f0d1580a74e1ad8523e85faf0;p=u%2Fmrichter%2FAliRoot.git guess the run number from the input file path --- diff --git a/PWGPP/TPC/AliTaskConfigOCDB.cxx b/PWGPP/TPC/AliTaskConfigOCDB.cxx index bc8170a4a70..542d85b2888 100644 --- a/PWGPP/TPC/AliTaskConfigOCDB.cxx +++ b/PWGPP/TPC/AliTaskConfigOCDB.cxx @@ -120,7 +120,14 @@ void AliTaskConfigOCDB::CreateOutputObjects() } // Try to get event number before the first event is read (this has precedence // over existing fRun) - Int_t run = mgr->GetRunFromPath(); + TTree* inputTree = mgr->GetTree(); + if (!inputTree) { AliError("no input tree"); return; } + TFile* inputFile = inputTree->GetCurrentFile(); + if (!inputFile) { AliError("no input file"); return; } + TString inputFileName(inputFile->GetName()); + Int_t run = guessRunNumber(inputFileName); + mgr->SetRunFromPath(run); + if (!run && !fRun) { AliError("AliTaskConfigOCDB: Run not set - no CDB connection"); return;