-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunTTreeFilterROOT6.C
More file actions
65 lines (54 loc) · 2.76 KB
/
runTTreeFilterROOT6.C
File metadata and controls
65 lines (54 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "AliAnalysisTaskTTreeFilter.h"
#include "AliGMFEventCuts.h"
void runTTreeFilterROOT6() {
// author: Redmer Alexander Bertens
// rbertens@cern.ch
//
// example which converts input data (in this case local aod's put into a chain)
// to a tree which holds
// - AliGMFTTreeHeader : event object
// - AliGMFTTreeTrack : track objects
// see source of these classes for more details
// load libraries
gSystem->Load("libANALYSISalice");
// create the analysis manager
AliAnalysisManager* mgr = new AliAnalysisManager("MyManager");
// create a tchain which will point to an aod tree
TChain* chain = new TChain("aodTree");
chain->Add("/home/rbertens/Documents/CERN/data/ALICE_DATA/data/2015/LHC15o/000246757/pass1/AOD/001/AliAOD.root");
chain->Add("/home/rbertens/Documents/CERN/data/ALICE_DATA/data/2015/LHC15o/000246757/pass1/AOD/002/AliAOD.root");
chain->Add("/home/rbertens/Documents/CERN/data/ALICE_DATA/data/2015/LHC15o/000246757/pass1/AOD/003/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
gInterpreter->ProcessLine(".include $ROOTSYS/include");
gInterpreter->ProcessLine(".include $ALICE_ROOT/include");
gInterpreter->LoadMacro("AliGMFEventCuts.cxx++g");
gInterpreter->LoadMacro("AliGMFTrackCuts.cxx++g");
gInterpreter->LoadMacro("AliGMFTTreeHeader.cxx++g");
gInterpreter->LoadMacro("AliGMFTTreeTrack.cxx++g");
gInterpreter->LoadMacro("AliGMFHistogramManager.cxx++g");
gInterpreter->LoadMacro("AliAnalysisTaskTTreeFilter.cxx++g");
// load the addtask
TMacro filter(gSystem->ExpandPathName("add_task_macros/AddTaskTTreeFilter.C"));
AliAnalysisTaskTTreeFilter* task = reinterpret_cast<AliAnalysisTaskTTreeFilter*>(filter.Exec());
// add mult selection task for run II
TMacro multSelection(gSystem->ExpandPathName("$ALICE_PHYSICS/OADB/COMMON/MULTIPLICITY/macros/AddTaskMultSelection.C"));
AliMultSelectionTask* multSelectionTask = reinterpret_cast<AliMultSelectionTask*>(multSelection.Exec());
// launch the task
task->SelectCollisionCandidates(AliVEvent::kINT7);
AliGMFEventCuts* eventcuts = task->GetEventCuts();
eventcuts->Set2010PileUpRejection(kFALSE);
task->SetDoQA(kTRUE);
// 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);
}