1 void runTTreeFilter() {
2 // author: Redmer Alexander Bertens, Utrecht University
3 // rbertens@cern.ch , rbertens@nikhef.nl , r.a.bertens@uu.nl
5 // example which converts input data (in this case local aod's put into a chain)
6 // to a tree which holds
7 // - AliFlowTTreeEvent : event object
8 // - AliFlowTTreeTrack : track objects
9 // see source of these classes for more details
12 gSystem->Load("libCore");
13 gSystem->Load("libGeom");
14 gSystem->Load("libVMC");
15 gSystem->Load("libPhysics");
16 gSystem->Load("libTree");
17 gSystem->Load("libSTEERBase");
18 gSystem->Load("libESD");
19 gSystem->Load("libAOD");
20 gSystem->Load("libANALYSIS");
21 gSystem->Load("libANALYSISalice");
23 // create the analysis manager
24 AliAnalysisManager* mgr = new AliAnalysisManager("MyManager");
26 // create a tchain which will point to an aod tree
27 TChain* chain = new TChain("aodTree");
28 // add a few files to the chain (change this so that your local files are added)
29 chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0003/AliAOD.root");
30 chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0003/AliAOD.root");
31 chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0004/AliAOD.root");
32 chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0005/AliAOD.root");
33 chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0006/AliAOD.root");
34 chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0007/AliAOD.root");
35 chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0008/AliAOD.root");
36 chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0009/AliAOD.root");
37 chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0010/AliAOD.root");
38 // create an input handler
39 AliVEventHandler* inputH = new AliAODInputHandler();
40 // and connect it to the manager
41 mgr->SetInputEventHandler(inputH);
43 // compile the relevant classes
45 // include paths, necessary for compilation
46 gSystem->AddIncludePath("-Wno-deprecated");
47 gSystem->AddIncludePath("-I$ALICE_ROOT -I$ALICE_ROOT/include -I$ALICE_ROOT/EMCAL");
48 gSystem->AddIncludePath("-I$ALICE_ROOT/PWGDQ/dielectron -I$ALICE_ROOT/PWGHF/hfe");
49 gSystem->AddIncludePath("-I$ALICE_ROOT/JETAN -I$ALICE_ROOT/JETAN/fastjet");
51 gROOT->LoadMacro("../objects/AliFlowTTreeEvent.cxx+");
52 gROOT->LoadMacro("../objects/AliFlowTTreeTrack.cxx+");
53 gROOT->LoadMacro("../objects/AliAnalysisTaskTTreeFilter.cxx+");
56 gROOT->LoadMacro("AddTaskTTreeFilter.C");
61 // check if we can initialize the manager
62 if(!mgr->InitAnalysis()) return;
63 // print the status of the manager to screen
65 // print to screen how the analysis is progressing
66 mgr->SetUseProgressBar(1, 25);
67 // start the analysis locally, reading the events from the tchain
68 mgr->StartAnalysis("local", chain);