]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
guess the run number from the input file path
authormkrzewic <mkrzewic@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Nov 2013 17:59:54 +0000 (17:59 +0000)
committermkrzewic <mkrzewic@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Nov 2013 17:59:54 +0000 (17:59 +0000)
PWGPP/TPC/AliTaskConfigOCDB.cxx

index bc8170a4a7022806b65c6e823802f931c47c463d..542d85b288861cadfc87b170134b9421a8f4a8f6 100644 (file)
@@ -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;