ROOT logo
void run(Int_t runNumber)
{
  gEnv->SetValue("XSec.GSI.DelegProxy","2");
  // Select ROOT version
  TProof::Mgr("XXX@alicecaf")->SetROOTVersion("v5-26-00");
  // Login to CAF
  TProof::Open("XXX@alicecaf");

  // Enable AliRoot
  gProof->UploadPackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-18-Release.rec/AF-v4-18-rec.par");
  gProof->EnablePackage("AF-v4-18-rec.par");

  // Run reconstruction
  gROOT->LoadMacro("rec.C");
  gROOT->ProcessLine(Form("rec(%d);",runNumber));

  TProof::Mgr("XXX@alicecaf")->GetSessionLogs()->Save("*",Form("run%d.log",runNumber));

  // Check the produced dataset
  TFileCollection *coll = gProof->GetDataSet(Form("run%d",runNumber));
  if (coll) {
    Int_t nEvents = coll->GetTotalEntries("/esdTree");
    if (nEvents > 0) {
      cout << "===========================================================================" << endl;
      cout << nEvents << " events reconstructed and stored in the dataset run" << runNumber << endl;
      cout << "===========================================================================" << endl;
      cout << "The dataset is:" << endl;
      coll->Print();
      cout << "===========================================================================" << endl;
    }
  }
}
 run.C:1
 run.C:2
 run.C:3
 run.C:4
 run.C:5
 run.C:6
 run.C:7
 run.C:8
 run.C:9
 run.C:10
 run.C:11
 run.C:12
 run.C:13
 run.C:14
 run.C:15
 run.C:16
 run.C:17
 run.C:18
 run.C:19
 run.C:20
 run.C:21
 run.C:22
 run.C:23
 run.C:24
 run.C:25
 run.C:26
 run.C:27
 run.C:28
 run.C:29
 run.C:30
 run.C:31
 run.C:32
 run.C:33