-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunAnalysis.py
executable file
·38 lines (29 loc) · 1.01 KB
/
runAnalysis.py
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
#!/usr/bin/env python3
# Run Analysis script
import ROOT
# Include
ROOT.gInterpreter.ProcessLine(".include $ROOTSYS/include");
ROOT.gInterpreter.ProcessLine(".include $ALICE_ROOT/include");
ROOT.gInterpreter.ProcessLine(".include $ALICE_PHYSICS/include");
# Analysis Manager
mgr = ROOT.AliAnalysisManager("JpsiJetAnalysis");
# Input handler
aodH = ROOT.AliAODInputHandler();
mgr.SetInputEventHandler(aodH);
# Output handler
aodOutputH = ROOT.AliAODHandler();
aodOutputH.SetOutputFileName("AliAOD.root");
mgr.SetOutputEventHandler(aodOutputH);
ROOT.gInterpreter.ExecuteMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C");
ROOT.gInterpreter.ExecuteMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
ROOT.gInterpreter.ExecuteMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C");
# Start analysis
if( not mgr.InitAnalysis()):
exit()
mgr.PrintStatus();
mgr.SetUseProgressBar(1, 25);
# Input data file
chain = ROOT.TChain("aodTree");
chain.Add("AliAOD_input.root");
mgr.StartAnalysis("local", chain);
# End