Implementation of a function to parse the LHC data file only for a specific
[u/mrichter/AliRoot.git] / HLT / QA / tasks / macros / compare-HLT-offline-local.C
CommitLineData
be1fa04a 1// $Id$
2/*
3 * Example macro to run locally an analysis task for comparing the offline
4 * with the HLT esd tree.
5 *
6 * Its output is a root file containing the histograms defined in the
7 * analysis task.
8 *
9 * Usage:
10 * <pre>
11 * aliroot -b -q -l compare_HLT_offline_local.C 2>&1 | tee task.log
12 * </pre>
13 *
14 * @ingroup alihlt_tpc
15 * @author zbyin@mail.ccnu.edu.cn, Kalliopi.Kanaki@ift.uib.no
16 */
17
18void compare_HLT_offline_local(){
19
20 TStopwatch timer;
21 timer.Start();
22
23 gSystem->Load("libTree.so");
24 gSystem->Load("libGeom.so");
25 gSystem->Load("libVMC.so");
26 gSystem->Load("libPhysics.so");
27
28 //----------- Loading the required libraries ---------//
29
30 gSystem->Load("libSTEERBase.so");
31 gSystem->Load("libESD.so");
32 gSystem->Load("libAOD.so");
33 gSystem->Load("libANALYSIS.so");
34 gSystem->Load("libANALYSISalice.so");
35 gSystem->Load("libHLTbase.so");
36 gROOT->ProcessLine(".include $ALICE_ROOT/include");
37
38
39 //-------------- Compile the analysis task ---------- //
40
41 gROOT->LoadMacro("AliAnalysisTaskHLTTPC.cxx+");
f503c6b0 42 gROOT->LoadMacro("AliAnalysisTaskHLTPHOS.cxx+");
be1fa04a 43
44
45 AliTagAnalysis *TagAna = new AliTagAnalysis("ESD");
46 //TagAna->ChainLocalTags("../Tags");
47
48// AliRunTagCuts *runCuts = new AliRunTagCuts();
49// AliLHCTagCuts *lhcCuts = new AliLHCTagCuts();
50// AliDetectorTagCuts *detCuts = new AliDetectorTagCuts();
51// AliEventTagCuts *evCuts = new AliEventTagCuts();
52// evCuts->SetMultiplicityRange(11,12);
53
54
55 TChain *chain = 0x0;
56 //chain = TagAna->QueryTags(runCuts,lhcCuts,detCuts,evCuts);
57 chain = new TChain("esdTree");
58
59 //gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
60 //chain = CreateESDChain("esd_run84254.txt", 2);
61
62 //chain->Add("/afs/.alihlt.cern.ch/public/rec/79876/AliESDs.root");
63 //chain->Add("/opt/HLT-public/rec/83683/rec/09000083683000.10/AliESDs.root");
64
65 //chain->Add("/opt/HLT-public/rec/82762/ESDs/pass1/09000082762002.10/AliESDs.root");
66 //chain->Add("/opt/HLT-public/rec/82762/ESDs/pass1/09000082762004.10/AliESDs.root");
67 //chain->Add("/opt/HLT-public/rec/82762/ESDs/pass1/09000082762005.10/AliESDs.root");
68 //chain->Add("/opt/HLT-public/rec/82762/ESDs/pass1/09000082762006.10/AliESDs.root");
69
70 //chain->Add("/opt/HLT-public/rec/84254/alien/09000084254009.200/AliESDs.root");
71 //chain->Add("/opt/HLT-public/rec/84254/alien/09000084254009.40/AliESDs.root");
72 //chain->Add("/opt/HLT-public/rec/84254/alien/09000084254009.10/AliESDs.root");
73
74 chain->Add("~/7TeV/115322/10000115322040.110/AliESDs.root");
75 //chain->SetBranchStatus("*Calo*",0);
76
77
78 //-------- Make the analysis manager ---------------//
79
80 AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
81 AliESDInputHandler *esdH = new AliESDInputHandler;
82 esdH->SetReadHLT();
83 mgr->SetInputEventHandler(esdH);
84 mgr->SetNSysInfo(1000);
85
86 //-------------- define the tasks ------------//
87
a63c69d8 88 AliAnalysisTaskHLTTPC *task1 = new AliAnalysisTaskHLTTPC("offhlt_comparison_TPC");
be1fa04a 89 mgr->AddTask(task1);
90
a63c69d8 91 AliAnalysisTaskHLTPHOS *taskPHOS = new AliAnalysisTaskHLTPHOS("offhlt_comparison_PHOS");
92 mgr->AddTask(taskPHOS);
93
94 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tpc_histograms", TList::Class(), AliAnalysisManager::kOutputContainer, "HLT-OFFLINE-TPC-comparison.root");
95 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("phos_histograms",TList::Class(), AliAnalysisManager::kOutputContainer, "HLT-OFFLINE-PHOS-comparison.root");
be1fa04a 96
97 mgr->ConnectInput(task1,0,mgr->GetCommonInputContainer());
98 //mgr->ConnectOutput (task1, 0, mgr->GetCommonOutputContainer());
99 mgr->ConnectOutput(task1,1,coutput1);
a63c69d8 100
101 mgr->ConnectInput(taskPHOS,0,mgr->GetCommonInputContainer());
102 mgr->ConnectOutput(taskPHOS,1,coutput2);
103
104
be1fa04a 105 if (!mgr->InitAnalysis()) return;
106 mgr->PrintStatus();
107 mgr->StartAnalysis("local",chain);
108
109 timer.Stop();
110 timer.Print();
111}