ROOT logo
void runlocal() {
  TStopwatch timer;
  timer.Start();


  gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include"); 
  gSystem->Load("libTree.so");
  gSystem->Load("libGeom.so");
  gSystem->Load("libVMC.so");
  gSystem->Load("libPhysics.so");
  
  //Enable the needed package
  gSystem->Load("libSTEERBase");
  gSystem->Load("libESD");
  gSystem->Load("libAOD");
  gSystem->Load("libANALYSIS");
  gSystem->Load("libANALYSISalice");

 // Create chain of input files
  gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
  TChain* chain = CreateESDChain("file.txt", 3);
 
  //ANALYSIS PART
  gROOT->LoadMacro("AliAnalysisTaskCluster.cxx++g");

    
  //____________________________________________//
  // Make the analysis manager
  AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
  
  //AliVEventHandler* esdH = new AliESDInputHandler;
  AliESDInputHandler* esdH = new AliESDInputHandler;
  esdH->SetReadFriends(0);
  mgr->SetInputEventHandler(esdH);  

  AliMCEventHandler* mcH = new AliMCEventHandler();
  mcH->SetReadTR(kFALSE);
  mgr->SetMCtruthEventHandler(mcH);


 //____________________________________________//
  // event selection 

  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
  AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
  physSelTask->GetPhysicsSelection()->SetAnalyzeMC(); 

  AliPhysicsSelection* physSel = physSelTask->GetPhysicsSelection();
  physSel->AddBackgroundIdentification(new AliBackgroundSelection());

  
  //____________________________________________//
  // analysis task and esd track cuts
  AliAnalysisTaskCluster *task1 = new AliAnalysisTaskCluster("AliAnalysisTaskCluster");

  AliESDtrackCuts* esdTrackCutsL1 = new AliESDtrackCuts("AliESDtrackCuts","test");
  esdTrackCutsL1->SetMaxDCAToVertexXY(3.);
  esdTrackCutsL1->SetMaxDCAToVertexZ(3.);
  esdTrackCutsL1->SetAcceptKinkDaughters(kFALSE);
  

  task1->SetCuts(esdTrackCutsL1);
  task1->SelectCollisionCandidates();


  mgr->AddTask(task1);
  // Create containers for input/output
  AliAnalysisDataContainer *cinput1 = 
    mgr->CreateContainer("cchain",TChain::Class(),AliAnalysisManager::kInputContainer);
  AliAnalysisDataContainer *coutput1 = 
    mgr->CreateContainer("chist1",TList::Class(),AliAnalysisManager::kOutputContainer,
			 "Cluster.local.root");
  
  //____________________________________________//
  mgr->ConnectInput(task1, 0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput(task1,1,coutput1);
  if (!mgr->InitAnalysis()) return;
  mgr->PrintStatus();
  mgr->StartAnalysis("local",chain);
  //mgr->StartAnalysis("local",chain, 100,200);//startevent, nevents

  timer.Stop();
  timer.Print();
}

 runlocal.C:1
 runlocal.C:2
 runlocal.C:3
 runlocal.C:4
 runlocal.C:5
 runlocal.C:6
 runlocal.C:7
 runlocal.C:8
 runlocal.C:9
 runlocal.C:10
 runlocal.C:11
 runlocal.C:12
 runlocal.C:13
 runlocal.C:14
 runlocal.C:15
 runlocal.C:16
 runlocal.C:17
 runlocal.C:18
 runlocal.C:19
 runlocal.C:20
 runlocal.C:21
 runlocal.C:22
 runlocal.C:23
 runlocal.C:24
 runlocal.C:25
 runlocal.C:26
 runlocal.C:27
 runlocal.C:28
 runlocal.C:29
 runlocal.C:30
 runlocal.C:31
 runlocal.C:32
 runlocal.C:33
 runlocal.C:34
 runlocal.C:35
 runlocal.C:36
 runlocal.C:37
 runlocal.C:38
 runlocal.C:39
 runlocal.C:40
 runlocal.C:41
 runlocal.C:42
 runlocal.C:43
 runlocal.C:44
 runlocal.C:45
 runlocal.C:46
 runlocal.C:47
 runlocal.C:48
 runlocal.C:49
 runlocal.C:50
 runlocal.C:51
 runlocal.C:52
 runlocal.C:53
 runlocal.C:54
 runlocal.C:55
 runlocal.C:56
 runlocal.C:57
 runlocal.C:58
 runlocal.C:59
 runlocal.C:60
 runlocal.C:61
 runlocal.C:62
 runlocal.C:63
 runlocal.C:64
 runlocal.C:65
 runlocal.C:66
 runlocal.C:67
 runlocal.C:68
 runlocal.C:69
 runlocal.C:70
 runlocal.C:71
 runlocal.C:72
 runlocal.C:73
 runlocal.C:74
 runlocal.C:75
 runlocal.C:76
 runlocal.C:77
 runlocal.C:78
 runlocal.C:79
 runlocal.C:80
 runlocal.C:81
 runlocal.C:82
 runlocal.C:83
 runlocal.C:84
 runlocal.C:85
 runlocal.C:86