]>
Commit | Line | Data |
---|---|---|
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 | ||
18 | void 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+"); | |
42 | ||
43 | ||
44 | AliTagAnalysis *TagAna = new AliTagAnalysis("ESD"); | |
45 | //TagAna->ChainLocalTags("../Tags"); | |
46 | ||
47 | // AliRunTagCuts *runCuts = new AliRunTagCuts(); | |
48 | // AliLHCTagCuts *lhcCuts = new AliLHCTagCuts(); | |
49 | // AliDetectorTagCuts *detCuts = new AliDetectorTagCuts(); | |
50 | // AliEventTagCuts *evCuts = new AliEventTagCuts(); | |
51 | // evCuts->SetMultiplicityRange(11,12); | |
52 | ||
53 | ||
54 | TChain *chain = 0x0; | |
55 | //chain = TagAna->QueryTags(runCuts,lhcCuts,detCuts,evCuts); | |
56 | chain = new TChain("esdTree"); | |
57 | ||
58 | //gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); | |
59 | //chain = CreateESDChain("esd_run84254.txt", 2); | |
60 | ||
61 | //chain->Add("/afs/.alihlt.cern.ch/public/rec/79876/AliESDs.root"); | |
62 | //chain->Add("/opt/HLT-public/rec/83683/rec/09000083683000.10/AliESDs.root"); | |
63 | ||
64 | //chain->Add("/opt/HLT-public/rec/82762/ESDs/pass1/09000082762002.10/AliESDs.root"); | |
65 | //chain->Add("/opt/HLT-public/rec/82762/ESDs/pass1/09000082762004.10/AliESDs.root"); | |
66 | //chain->Add("/opt/HLT-public/rec/82762/ESDs/pass1/09000082762005.10/AliESDs.root"); | |
67 | //chain->Add("/opt/HLT-public/rec/82762/ESDs/pass1/09000082762006.10/AliESDs.root"); | |
68 | ||
69 | //chain->Add("/opt/HLT-public/rec/84254/alien/09000084254009.200/AliESDs.root"); | |
70 | //chain->Add("/opt/HLT-public/rec/84254/alien/09000084254009.40/AliESDs.root"); | |
71 | //chain->Add("/opt/HLT-public/rec/84254/alien/09000084254009.10/AliESDs.root"); | |
72 | ||
73 | chain->Add("~/7TeV/115322/10000115322040.110/AliESDs.root"); | |
74 | //chain->SetBranchStatus("*Calo*",0); | |
75 | ||
76 | ||
77 | //-------- Make the analysis manager ---------------// | |
78 | ||
79 | AliAnalysisManager *mgr = new AliAnalysisManager("TestManager"); | |
80 | AliESDInputHandler *esdH = new AliESDInputHandler; | |
81 | esdH->SetReadHLT(); | |
82 | mgr->SetInputEventHandler(esdH); | |
83 | mgr->SetNSysInfo(1000); | |
84 | ||
85 | //-------------- define the tasks ------------// | |
86 | ||
a63c69d8 | 87 | AliAnalysisTaskHLTTPC *task1 = new AliAnalysisTaskHLTTPC("offhlt_comparison_TPC"); |
be1fa04a | 88 | mgr->AddTask(task1); |
89 | ||
a63c69d8 | 90 | AliAnalysisTaskHLTPHOS *taskPHOS = new AliAnalysisTaskHLTPHOS("offhlt_comparison_PHOS"); |
91 | mgr->AddTask(taskPHOS); | |
92 | ||
93 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tpc_histograms", TList::Class(), AliAnalysisManager::kOutputContainer, "HLT-OFFLINE-TPC-comparison.root"); | |
94 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("phos_histograms",TList::Class(), AliAnalysisManager::kOutputContainer, "HLT-OFFLINE-PHOS-comparison.root"); | |
be1fa04a | 95 | |
96 | mgr->ConnectInput(task1,0,mgr->GetCommonInputContainer()); | |
97 | //mgr->ConnectOutput (task1, 0, mgr->GetCommonOutputContainer()); | |
98 | mgr->ConnectOutput(task1,1,coutput1); | |
a63c69d8 | 99 | |
100 | mgr->ConnectInput(taskPHOS,0,mgr->GetCommonInputContainer()); | |
101 | mgr->ConnectOutput(taskPHOS,1,coutput2); | |
102 | ||
103 | ||
be1fa04a | 104 | if (!mgr->InitAnalysis()) return; |
105 | mgr->PrintStatus(); | |
106 | mgr->StartAnalysis("local",chain); | |
107 | ||
108 | timer.Stop(); | |
109 | timer.Print(); | |
110 | } |