]>
Commit | Line | Data |
---|---|---|
0cb187ff | 1 | void runTTreeFilter() { |
2 | // author: Redmer Alexander Bertens, Utrecht University | |
3 | // rbertens@cern.ch , rbertens@nikhef.nl , r.a.bertens@uu.nl | |
4 | // | |
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 | |
10 | ||
11 | // load libraries | |
4070f709 | 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"); | |
0cb187ff | 22 | |
23 | // create the analysis manager | |
24 | AliAnalysisManager* mgr = new AliAnalysisManager("MyManager"); | |
25 | ||
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"); | |
143b45d4 | 37 | chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0010/AliAOD.root"); |
0cb187ff | 38 | // create an input handler |
39 | AliVEventHandler* inputH = new AliAODInputHandler(); | |
40 | // and connect it to the manager | |
41 | mgr->SetInputEventHandler(inputH); | |
42 | ||
0cb187ff | 43 | // compile the relevant classes |
34529787 | 44 | |
45 | // include paths, necessary for compilation | |
0cb187ff | 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"); | |
50 | ||
51 | gROOT->LoadMacro("../objects/AliFlowTTreeEvent.cxx+"); | |
52 | gROOT->LoadMacro("../objects/AliFlowTTreeTrack.cxx+"); | |
53 | gROOT->LoadMacro("../objects/AliAnalysisTaskTTreeFilter.cxx+"); | |
54 | ||
143b45d4 | 55 | // load the addtask |
56 | gROOT->LoadMacro("AddTaskTTreeFilter.C"); | |
0cb187ff | 57 | |
143b45d4 | 58 | // launch the task |
59 | AddTaskTTreeFilter(); | |
0cb187ff | 60 | |
61 | // check if we can initialize the manager | |
62 | if(!mgr->InitAnalysis()) return; | |
63 | // print the status of the manager to screen | |
64 | mgr->PrintStatus(); | |
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); | |
69 | } |