ROOT logo
void runTTreeFilter() {
    // author: Redmer Alexander Bertens, Utrecht University
    // rbertens@cern.ch , rbertens@nikhef.nl , r.a.bertens@uu.nl
    //
    // example which converts input data (in this case local aod's put into a chain)
    // to a tree which holds
    // - AliFlowTTreeEvent : event object
    // - AliFlowTTreeTrack : track objects
    // see source of these classes for more details

    // load libraries
    gSystem->Load("libCore.so");        
    gSystem->Load("libGeom.so");
    gSystem->Load("libVMC.so");
    gSystem->Load("libPhysics.so");
    gSystem->Load("libTree.so");
    gSystem->Load("libSTEERBase.so");
    gSystem->Load("libESD.so");
    gSystem->Load("libAOD.so");
    gSystem->Load("libANALYSIS.so");
    gSystem->Load("libANALYSISalice.so");

    // create the analysis manager
    AliAnalysisManager* mgr = new AliAnalysisManager("MyManager");

    // create a tchain which will point to an aod tree
    TChain* chain = new TChain("aodTree");
    // add a few files to the chain (change this so that your local files are added)
    chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0003/AliAOD.root");
    chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0003/AliAOD.root");
    chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0004/AliAOD.root");
    chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0005/AliAOD.root");
    chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0006/AliAOD.root");
    chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0007/AliAOD.root");
    chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0008/AliAOD.root");
    chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0009/AliAOD.root");
    chain->Add("/home/rbertens/Documents/CERN/ALICE_DATA/data/2010/LHC10h/000139510/ESDs/pass2/AOD086/0010/AliAOD.root");
    // create an input handler
    AliVEventHandler* inputH = new AliAODInputHandler();
    // and connect it to the manager
    mgr->SetInputEventHandler(inputH);

    // compile the relevant classes

    // include paths, necessary for compilation
    gSystem->AddIncludePath("-Wno-deprecated");
    gSystem->AddIncludePath("-I$ALICE_ROOT -I$ALICE_ROOT/include -I$ALICE_ROOT/EMCAL");
    gSystem->AddIncludePath("-I$ALICE_ROOT/PWGDQ/dielectron -I$ALICE_ROOT/PWGHF/hfe");
    gSystem->AddIncludePath("-I$ALICE_ROOT/JETAN -I$ALICE_ROOT/JETAN/fastjet");

    gROOT->LoadMacro("../objects/AliFlowTTreeEvent.cxx+");
    gROOT->LoadMacro("../objects/AliFlowTTreeTrack.cxx+");
    gROOT->LoadMacro("../objects/AliAnalysisTaskTTreeFilter.cxx+");

    // load the addtask
    gROOT->LoadMacro("AddTaskTTreeFilter.C");

    // launch the task
    AddTaskTTreeFilter();

    // check if we can initialize the manager
    if(!mgr->InitAnalysis()) return;   
    // print the status of the manager to screen 
    mgr->PrintStatus();
    // print to screen how the analysis is progressing
    mgr->SetUseProgressBar(1, 25);
    // start the analysis locally, reading the events from the tchain
    mgr->StartAnalysis("local", chain);
}
 runTTreeFilter.C:1
 runTTreeFilter.C:2
 runTTreeFilter.C:3
 runTTreeFilter.C:4
 runTTreeFilter.C:5
 runTTreeFilter.C:6
 runTTreeFilter.C:7
 runTTreeFilter.C:8
 runTTreeFilter.C:9
 runTTreeFilter.C:10
 runTTreeFilter.C:11
 runTTreeFilter.C:12
 runTTreeFilter.C:13
 runTTreeFilter.C:14
 runTTreeFilter.C:15
 runTTreeFilter.C:16
 runTTreeFilter.C:17
 runTTreeFilter.C:18
 runTTreeFilter.C:19
 runTTreeFilter.C:20
 runTTreeFilter.C:21
 runTTreeFilter.C:22
 runTTreeFilter.C:23
 runTTreeFilter.C:24
 runTTreeFilter.C:25
 runTTreeFilter.C:26
 runTTreeFilter.C:27
 runTTreeFilter.C:28
 runTTreeFilter.C:29
 runTTreeFilter.C:30
 runTTreeFilter.C:31
 runTTreeFilter.C:32
 runTTreeFilter.C:33
 runTTreeFilter.C:34
 runTTreeFilter.C:35
 runTTreeFilter.C:36
 runTTreeFilter.C:37
 runTTreeFilter.C:38
 runTTreeFilter.C:39
 runTTreeFilter.C:40
 runTTreeFilter.C:41
 runTTreeFilter.C:42
 runTTreeFilter.C:43
 runTTreeFilter.C:44
 runTTreeFilter.C:45
 runTTreeFilter.C:46
 runTTreeFilter.C:47
 runTTreeFilter.C:48
 runTTreeFilter.C:49
 runTTreeFilter.C:50
 runTTreeFilter.C:51
 runTTreeFilter.C:52
 runTTreeFilter.C:53
 runTTreeFilter.C:54
 runTTreeFilter.C:55
 runTTreeFilter.C:56
 runTTreeFilter.C:57
 runTTreeFilter.C:58
 runTTreeFilter.C:59
 runTTreeFilter.C:60
 runTTreeFilter.C:61
 runTTreeFilter.C:62
 runTTreeFilter.C:63
 runTTreeFilter.C:64
 runTTreeFilter.C:65
 runTTreeFilter.C:66
 runTTreeFilter.C:67
 runTTreeFilter.C:68
 runTTreeFilter.C:69
 runTTreeFilter.C:70