]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/TPC/macros/AddTaskPerformanceTPCITSQA.C
Limit print outs
[u/mrichter/AliRoot.git] / PWG1 / TPC / macros / AddTaskPerformanceTPCITSQA.C
CommitLineData
7f7db898 1///////////////////////////////////////////////////////////////////////////////
2// Macro to setup AliPerformanceTask for
3// TPC and TPC+ITS performance QA to run on PWG1 QA train.
4//
5// Input: ESDs, ESDfriends (optional), Kinematics (optional), TrackRefs (optional)
6// ESD and MC input handlers must be attached to AliAnalysisManager
7// to run default configuration.
8//
9// By default 1 performance components are added to
10// the task:
11// 1. AliPerformanceTPC (TPC cluster and track and event information)
12//
13// Usage on the analysis train (default configuration):
14// gSystem->Load("libANALYSIS");
15// gSystem->Load("libANALYSISalice");
16// gSystem->Load("libTPCcalib.so");
17// gSystem->Load("libTENDER.so");
18// gSystem->Load("libPWG1.so");
19//
20// gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceTPCITSQA.C");
21// AliPerformanceTask *tpcQA = AddTaskPerformanceTPC("kFALSE","kTRUE","triggerClass");
22//
23// Output:
24// TPCITS.Performance.root file with TPC and TPCITS performance components is created.
25//
26// Each of the components contains THnSparse generic histograms which
27// have to be analysed (post-analysis) by using Analyse() function.
28// Each component contains such function.
29//
30//14.12.2009 - J.Otwinowski@gsi.de
31///////////////////////////////////////////////////////////////////////////////
32
33//____________________________________________
34AliPerformanceTask* AddTaskPerformanceTPCITSQA(Bool_t bUseMCInfo=kFALSE, Bool_t bUseESDfriend=kTRUE, const char *triggerClass=0)
35{
36 //
37 // Add AliPerformanceTask with TPC performance components
38 //
39 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
40 if(!mgr) {
41 Error("AddTaskPerformanceTPC","AliAnalysisManager not set!");
42 return NULL;
43 }
44
45 TString type = mgr->GetInputEventHandler()->GetDataType();
46 if (!type.Contains("ESD")) {
47 Error("AddTaskPerformanceTPC", "ESD input handler needed!");
48 return NULL;
49 }
50
51 AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
52 if (!mcH && bUseMCInfo) {
53 Error("AddTaskPerformanceTPC", "MC input handler needed!");
54 return NULL;
55 }
56
57 //
58 // Create task
59 //
60 AliPerformanceTask *task = new AliPerformanceTask("PerformanceQA","TPC Performance");
61 if (!task) {
62 Error("AddTaskPerformanceTPC", "TPC performance task cannot be created!");
63 return NULL;
64 }
65 task->SetUseMCInfo(bUseMCInfo);
66 task->SetUseESDfriend(bUseESDfriend);
67
68 //
69 // Add task to analysis manager
70 //
71 mgr->AddTask(task);
72
73 //
74 // Create TPC-ESD track reconstruction cuts
75 // MB tracks
76 //
77 AliRecInfoCuts *pRecInfoCutsTPC = new AliRecInfoCuts();
78 if(pRecInfoCutsTPC) {
79 pRecInfoCutsTPC->SetMaxDCAToVertexXY(3.0);
80 pRecInfoCutsTPC->SetMaxDCAToVertexZ(3.0);
81 pRecInfoCutsTPC->SetRequireSigmaToVertex(kFALSE);
82 pRecInfoCutsTPC->SetRequireTPCRefit(kFALSE);
83 pRecInfoCutsTPC->SetAcceptKinkDaughters(kTRUE);
84 pRecInfoCutsTPC->SetMinNClustersTPC(70);
85 pRecInfoCutsTPC->SetMaxChi2PerClusterTPC(1000000.);
86 pRecInfoCutsTPC->SetDCAToVertex2D(kFALSE);
87
88 pRecInfoCutsTPC->SetHistogramsOn(kFALSE);
89 }
90 else {
91 Error("AddTaskPerformanceTPC", "AliRecInfoCutsTPC cannot be created!");
92 return NULL;
93 }
94
95 //
96 // Create TPC-MC track reconstruction cuts
97 //
98 AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts();
99 if(pMCInfoCuts) {
100 pMCInfoCuts->SetMinTrackLength(70);
101 }
102 else {
103 Error("AddTaskPerformanceTPC", "AliMCInfoCuts cannot be created!");
104 return NULL;
105 }
106
107 //
108 // Create performance objects for TPC and TPCITS set cuts
109 //
110 enum { kTPC = 0, kTPCITS};
111
112 //
113 // TPC performance
114 //
115 AliPerformanceTPC *pCompTPC0 = new AliPerformanceTPC("AliPerformanceTPC","AliPerformanceTPC",kTPC,kFALSE);
116 if(!pCompTPC0) {
117 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceTPC");
118 }
119 pCompTPC0->SetAliRecInfoCuts(pRecInfoCutsTPC);
120 pCompTPC0->SetAliMCInfoCuts(pMCInfoCuts);
121
122 //
123 // TPC+ITS performance
124 //
125 AliPerformanceTPC *pCompTPC1 = new AliPerformanceTPC("AliPerformanceTPCITS","AliPerformanceTPCITS",kTPCITS,kFALSE);
126 if(!pCompTPC1) {
127 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceTPCITS");
128 }
129 pCompTPC1->SetAliRecInfoCuts(pRecInfoCutsTPC);
130 pCompTPC1->SetAliMCInfoCuts(pMCInfoCuts);
131
132 //
133 // Add components to the performance task
134 //
135 if(!bUseMCInfo) {
136 pCompTPC0->SetTriggerClass(triggerClass);
137 pCompTPC1->SetTriggerClass(triggerClass);
138 }
139 task->AddPerformanceObject( pCompTPC0 );
140 task->AddPerformanceObject( pCompTPC1 );
141
142 //
143 // Create containers for input
144 //
145 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
146
147 //
148 // Create containers for output
149 //
150 AliAnalysisDataContainer *coutput_tpc = mgr->CreateContainer("TPCITSQA", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TPCITS_%s", mgr->GetCommonFileName(), task->GetName()));
151 mgr->ConnectOutput(task, 1, coutput_tpc);
152
153return task;
154}