]>
Commit | Line | Data |
---|---|---|
f70c8082 | 1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Macro to setup AliPerformanceTask for | |
3 | // TPC 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 component is added to | |
10 | // the task: | |
11 | // 1. AliPerformancePtCalib | |
12 | // or AliPerformancePtCalibMC if bUseMCinfo = kTRUE (use MC info) | |
13 | ||
14 | // Usage on the analysis train (default configuration): | |
15 | // gSystem->Load("libANALYSIS"); | |
16 | // gSystem->Load("libANALYSISalice"); | |
17 | // gSystem->Load("libTPCcalib.so"); | |
18 | // gSystem->Load("libPWG1.so"); | |
19 | // | |
20 | // gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceTPC.C"); | |
21 | // AliPerformanceTask *tpcQA = AddTaskPerformanceTPC("kTRUE","kTRUE"); | |
22 | // | |
23 | // Output: | |
24 | // TPC.Performance.root file with TPC 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 | //13.10.2009 - J.Otwinowski@gsi.de | |
31 | /////////////////////////////////////////////////////////////////////////////// | |
32 | ||
33 | //____________________________________________ | |
34 | AliPerformanceTask* AddTaskPerformanceTPCPtCalib(Bool_t bUseMCInfo=kTRUE, Bool_t bUseESDfriend=kTRUE) | |
35 | { | |
36 | // | |
37 | // Add AliPerformanceTask with TPC performance components | |
38 | // | |
39 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
40 | if(!mgr) { | |
41 | Error("AddTaskPerformanceTPCPtCalib","AliAnalysisManager not set!"); | |
42 | return NULL; | |
43 | } | |
44 | ||
45 | TString type = mgr->GetInputEventHandler()->GetDataType(); | |
46 | if (!type.Contains("ESD")) { | |
47 | Error("AddTaskPerformanceTPCPtCalib", "ESD input handler needed!"); | |
48 | return NULL; | |
49 | } | |
50 | ||
51 | AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler(); | |
52 | if (!mcH && bUseMCInfo) { | |
53 | Error("AddTaskPerformanceTPCPtCalib", "MC input handler needed!"); | |
54 | return NULL; | |
55 | } | |
56 | ||
57 | // | |
58 | // Create task | |
59 | // | |
60 | AliPerformanceTask *task = new AliPerformanceTask("Performance","TPC Performance PtCalib"); | |
61 | if (!task) { | |
62 | Error("AddTaskPerformanceTPCPtCalib", "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 | // | |
76 | AliRecInfoCuts *pRecInfoCuts = new AliRecInfoCuts(); | |
77 | if(pRecInfoCuts) { | |
78 | pRecInfoCuts->SetMaxDCAToVertexXY(3.0); | |
79 | pRecInfoCuts->SetMaxDCAToVertexZ(3.0); | |
80 | pRecInfoCuts->SetMinNClustersTPC(50); | |
81 | pRecInfoCuts->SetMinNClustersITS(2); | |
82 | pRecInfoCuts->SetHistogramsOn(kFALSE); | |
83 | } | |
84 | else { | |
85 | Error("AddTaskPerformanceTPCPtCalib", "AliRecInfoCuts cannot be created!"); | |
86 | return NULL; | |
87 | } | |
88 | // | |
89 | // Create TPC-MC track reconstruction cuts | |
90 | // | |
91 | AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts(); | |
92 | if(pMCInfoCuts) { | |
93 | pMCInfoCuts->SetMinTrackLength(70); | |
94 | } | |
95 | else { | |
96 | Error("AddTaskPerformanceTPCPtCalib", "AliMCInfoCuts cannot be created!"); | |
97 | return NULL; | |
98 | } | |
99 | ||
100 | // | |
101 | // Create performance objects for TPC and set cuts | |
102 | // | |
103 | enum { kTPC = 0, kTPCITS, kConstrained, kTPCInner, kTPCOuter, kTPCSec }; | |
104 | ||
105 | ||
106 | AliPerformancePtCalib *ptCalib = NULL; | |
107 | AliPerformancePtCalibMC *ptCalibMC = NULL; | |
108 | ||
109 | if(bUseMCInfo){ | |
110 | ptCalibMC = new AliPerformancePtCalibMC("AliPerformancePtCalibMC","AliPerformancePtCalibMC");//,kTPC,kTRUE); | |
111 | if(!ptCalibMC) { | |
112 | Error("AddTaskPerformanceTPCPtCalib", "Cannot create AliPerformancePtCalibMC"); | |
113 | } | |
114 | ||
115 | ptCalibMC->SetAliRecInfoCuts(pRecInfoCuts); | |
116 | ptCalibMC->SetReadTPCTracks(kTRUE); | |
117 | ptCalibMC->SetTPCRefit(kFALSE) ; | |
118 | ptCalibMC->SetITSRefit(kFALSE); | |
119 | ptCalibMC->SetESDCuts(kTRUE); | |
120 | ptCalibMC->SetDCACuts(kTRUE); | |
121 | ptCalibMC->SetAcceptKinkDaughters(kFALSE); | |
122 | ptCalibMC->SetRequireSigmaToVertex(kFALSE); | |
123 | ptCalibMC->SetfDCAToVertex2D(kFALSE) ; | |
124 | ||
125 | // const Double_t esdCutvalues[6] ={};//set esd track cut values | |
126 | // ptCalibMC->SetESDcutValues(esdCutvalues); | |
127 | // ptCalibMC->SetEtaRange(0.9); | |
128 | // ptCalibMC->SetAliMCInfoCuts(pMCInfoCut); | |
129 | ||
130 | } | |
131 | else{ | |
132 | ||
133 | ptCalib = new AliPerformancePtCalib("AliPerformancePtCalib","AliPerformancePtCalib");//,kTPC,kFALSE); | |
134 | if(!ptCalib) { | |
135 | Error("AddTaskPerformanceTPCPtCalib", "Cannot create AliPerformancePtCalib"); | |
136 | } | |
137 | ptCalib->SetAliRecInfoCuts(pRecInfoCuts); | |
138 | ptCalib->SetReadTPCTracks(kTRUE); | |
139 | ptCalib->SetTPCRefit(kFALSE) ; | |
140 | ptCalib->SetITSRefit(kFALSE); | |
141 | ptCalib->SetESDCuts(kTRUE); | |
142 | ptCalib->SetDCACuts(kTRUE); | |
143 | ptCalib->SetAcceptKinkDaughters(kFALSE); | |
144 | ptCalib->SetRequireSigmaToVertex(kFALSE); | |
145 | ptCalib->SetfDCAToVertex2D(kFALSE) ; | |
146 | ||
147 | // const Double_t esdCutvalues[6] ={}; | |
148 | // ptCalib->SetESDcutValues(esdCutvalues); | |
149 | // ptCalib->SetEtaRange(0.9); | |
150 | // ptCalib->SetAliMCInfoCuts(pMCInfoCut); | |
151 | } | |
152 | ||
153 | ||
154 | // add components to the performance task | |
155 | ||
156 | if(bUseMCInfo) task->AddPerformanceObject( ptCalibMC); | |
157 | else task->AddPerformanceObject( ptCalib ); | |
158 | ||
159 | // Create containers for input | |
160 | // | |
161 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
162 | ||
163 | // | |
164 | // Create containers for output | |
165 | // | |
166 | AliAnalysisDataContainer *coutput_tpcptcalib = mgr->CreateContainer("TPCPtCalib", TList::Class(), AliAnalysisManager::kOutputContainer, Form("TPCPtCalib.%s.root", task->GetName())); | |
6d1c59c1 | 167 | mgr->ConnectOutput(task, 1, coutput_tpcptcalib); |
f70c8082 | 168 | |
169 | return task; | |
170 | } |