1 ///////////////////////////////////////////////////////////////////////////////
2 // Macro to setup AliPerformanceTask for
3 // TPC performance QA to run on PWG1 QA train.
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.
9 // By default 7 performance components are added to
11 // 1. AliPerformanceRes (TPC track resolution w.r.t MC at DCA)
12 // 2. AliPerformanceResTPCInner (TPC track resolution w.r.t MC at inner TPC wall)
13 // 3. AliPerformanceResTPCOuter (TPC track resolution w.r.t MC at outer TPC wall)
14 // 4. AliPerformanceEff (TPC track reconstruction efficiency, MC primaries)
15 // 5. AliPerformanceDEdxTPCInner (TPC dEdx response - track parameters at TPC inner wall)
16 // 6. AliPerformanceDCA (TPC impact parameters resolution at DCA)
17 // 7. AliPerformanceTPC (TPC cluster and track and event information)
18 // 8. AliPerformanceMatch (TPC and ITS/TRD matching and TPC eff w.r.t ITS)
20 // Usage on the analysis train (default configuration):
21 // gSystem->Load("libANALYSIS");
22 // gSystem->Load("libANALYSISalice");
23 // gSystem->Load("libTPCcalib.so");
24 // gSystem->Load("libTENDER.so");
25 // gSystem->Load("libPWG1.so");
27 // gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceTPC.C");
28 // AliPerformanceTask *tpcQA = AddTaskPerformanceTPC("kTRUE","kTRUE");
31 // TPC.Performance.root file with TPC performance components is created.
33 // Each of the components contains THnSparse generic histograms which
34 // have to be analysed (post-analysis) by using Analyse() function.
35 // Each component contains such function.
37 //13.10.2009 - J.Otwinowski@gsi.de
38 ///////////////////////////////////////////////////////////////////////////////
40 //____________________________________________
41 AliPerformanceTask* AddTaskPerformanceTPC(Bool_t bUseMCInfo=kTRUE, Bool_t bUseESDfriend=kTRUE)
44 // Add AliPerformanceTask with TPC performance components
46 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
48 Error("AddTaskPerformanceTPC","AliAnalysisManager not set!");
52 TString type = mgr->GetInputEventHandler()->GetDataType();
53 if (!type.Contains("ESD")) {
54 Error("AddTaskPerformanceTPC", "ESD input handler needed!");
58 AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
59 if (!mcH && bUseMCInfo) {
60 Error("AddTaskPerformanceTPC", "MC input handler needed!");
67 AliPerformanceTask *task = new AliPerformanceTask("Performance","TPC Performance");
69 Error("AddTaskPerformanceTPC", "TPC performance task cannot be created!");
72 task->SetUseMCInfo(bUseMCInfo);
73 task->SetUseESDfriend(bUseESDfriend);
76 // Add task to analysis manager
81 // Create TPC-ESD track reconstruction cuts
84 AliRecInfoCuts *pRecInfoCutsTPC = new AliRecInfoCuts();
86 pRecInfoCutsTPC->SetMaxDCAToVertexXY(3.0);
87 pRecInfoCutsTPC->SetMaxDCAToVertexZ(30.0);
88 pRecInfoCutsTPC->SetRequireSigmaToVertex(kFALSE);
89 pRecInfoCutsTPC->SetRequireTPCRefit(kFALSE);
90 pRecInfoCutsTPC->SetAcceptKinkDaughters(kTRUE);
91 pRecInfoCutsTPC->SetMinNClustersTPC(50);
92 pRecInfoCutsTPC->SetMaxChi2PerClusterTPC(1000000.);
93 pRecInfoCutsTPC->SetDCAToVertex2D(kFALSE);
95 pRecInfoCutsTPC->SetHistogramsOn(kFALSE);
98 Error("AddTaskPerformanceTPC", "AliRecInfoCutsTPC cannot be created!");
103 // Create TPC-ESD track reconstruction cuts
106 AliRecInfoCuts *pRecInfoCutsMATCH = new AliRecInfoCuts();
107 if(pRecInfoCutsMATCH) {
108 pRecInfoCutsMATCH->SetMaxDCAToVertexXY(3.0);
109 pRecInfoCutsMATCH->SetMaxDCAToVertexZ(3.0);
110 pRecInfoCutsMATCH->SetRequireSigmaToVertex(kFALSE);
111 pRecInfoCutsMATCH->SetRequireTPCRefit(kFALSE);
112 pRecInfoCutsMATCH->SetAcceptKinkDaughters(kTRUE);
113 pRecInfoCutsMATCH->SetMinNClustersTPC(50);
114 pRecInfoCutsMATCH->SetMaxChi2PerClusterTPC(1000000.);
115 pRecInfoCutsMATCH->SetDCAToVertex2D(kFALSE);
116 pRecInfoCutsMATCH->SetTPCITSMatchingRadius(70);
117 pRecInfoCutsMATCH->SetTPCTRDMatchingRadius(260);
118 pRecInfoCutsMATCH->SetMinNClustersITS(2);
120 pRecInfoCutsMATCH->SetHistogramsOn(kFALSE);
123 Error("AddTaskPerformanceTPC", "AliRecInfoCutsTPC cannot be created!");
128 // Create TPC-ESD track reconstruction cuts
130 AliRecInfoCuts *pRecInfoCuts = new AliRecInfoCuts();
132 pRecInfoCuts->SetMaxDCAToVertexXY(3.0);
133 pRecInfoCuts->SetMaxDCAToVertexZ(3.0);
134 pRecInfoCuts->SetMinNClustersTPC(50);
135 pRecInfoCuts->SetMinNClustersITS(2);
136 pRecInfoCuts->SetHistogramsOn(kFALSE);
137 pRecInfoCuts->SetTPCITSMatchingRadius(70);
138 pRecInfoCuts->SetTPCTRDMatchingRadius(260);
141 Error("AddTaskPerformanceTPC", "AliRecInfoCuts cannot be created!");
145 // Create TPC-MC track reconstruction cuts
147 AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts();
149 pMCInfoCuts->SetMinTrackLength(70);
152 Error("AddTaskPerformanceTPC", "AliMCInfoCuts cannot be created!");
157 // Create performance objects for TPC and set cuts
159 enum { kTPC = 0, kTPCITS, kConstrained, kTPCInner, kTPCOuter, kTPCSec };
164 AliPerformanceRes *pCompRes0 = new AliPerformanceRes("AliPerformanceRes","AliPerformanceRes",kTPC,kFALSE);
166 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceRes");
168 pCompRes0->SetAliRecInfoCuts(pRecInfoCuts);
169 pCompRes0->SetAliMCInfoCuts(pMCInfoCuts);
171 AliPerformanceRes *pCompRes3 = new AliPerformanceRes("AliPerformanceResTPCInner","AliPerformanceResTPCInner",kTPCInner,kFALSE);
173 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceResTPCInner");
175 pCompRes3->SetAliRecInfoCuts(pRecInfoCuts);
176 pCompRes3->SetAliMCInfoCuts(pMCInfoCuts);
178 AliPerformanceRes *pCompRes4 = new AliPerformanceRes("AliPerformanceResTPCOuter","AliPerformanceResTPCOuter",kTPCOuter,kFALSE);
180 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceResTPCOuter");
182 pCompRes4->SetAliRecInfoCuts(pRecInfoCuts);
183 pCompRes4->SetAliMCInfoCuts(pMCInfoCuts);
187 AliPerformanceEff *pCompEff0 = new AliPerformanceEff("AliPerformanceEff","AliPerformanceEff",kTPC,kFALSE);
189 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceEff");
191 pCompEff0->SetAliRecInfoCuts(pRecInfoCuts);
192 pCompEff0->SetAliMCInfoCuts(pMCInfoCuts);
196 AliPerformanceDEdx *pCompDEdx3 = new AliPerformanceDEdx("AliPerformanceDEdxTPCInner","AliPerformanceDEdxTPCInner",kTPCInner,kFALSE);
198 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceDEdxTPCInner");
200 pCompDEdx3->SetAliRecInfoCuts(pRecInfoCuts);
201 pCompDEdx3->SetAliMCInfoCuts(pMCInfoCuts);
205 AliPerformanceDCA *pCompDCA0 = new AliPerformanceDCA("AliPerformanceDCA","AliPerformanceDCA",kTPC,kFALSE);
207 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceDCA");
209 pCompDCA0->SetAliRecInfoCuts(pRecInfoCuts);
210 pCompDCA0->SetAliMCInfoCuts(pMCInfoCuts);
214 AliPerformanceTPC *pCompTPC0 = new AliPerformanceTPC("AliPerformanceTPC","AliPerformanceTPC",kTPC,kFALSE);
216 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceTPC");
218 pCompTPC0->SetAliRecInfoCuts(pRecInfoCutsTPC);
219 pCompTPC0->SetAliMCInfoCuts(pMCInfoCuts);
221 // TPC+ITS matching performance
223 AliPerformanceMatch *pCompMatch0 = new AliPerformanceMatch("AliPerformanceMatchTPCITS","AliPerformanceMatchTPCITS",0,kFALSE);
225 Error("AddTaskPerformanceMatch", "Cannot create AliPerformanceMatchTPCITS");
227 pCompMatch0->SetAliRecInfoCuts(pRecInfoCutsMATCH);
228 pCompMatch0->SetAliMCInfoCuts(pMCInfoCuts);
230 // TPC+TRD matching performance
232 AliPerformanceMatch *pCompMatch1 = new AliPerformanceMatch("AliPerformanceMatchTPCTRD","AliPerformanceMatchTPCTRD",1,kFALSE);
234 Error("AddTaskPerformanceMatch", "Cannot create AliPerformanceMatchTPCTRD");
236 pCompMatch1->SetAliRecInfoCuts(pRecInfoCutsMATCH);
237 pCompMatch1->SetAliMCInfoCuts(pMCInfoCuts);
239 AliPerformanceMatch *pCompMatch2 = new AliPerformanceMatch("AliPerformanceMatchTPCEFF","AliPerformanceMatchTPCEFF",2,kFALSE);
241 Error("AddTaskPerformanceMatch", "Cannot create AliPerformanceMatchTPCEFF");
243 pCompMatch2->SetAliRecInfoCuts(pRecInfoCutsMATCH);
244 pCompMatch2->SetAliMCInfoCuts(pMCInfoCuts);
247 // Add components to the performance task
249 if(bUseMCInfo) task->AddPerformanceObject( pCompRes0 );
250 if(bUseMCInfo) task->AddPerformanceObject( pCompRes3 );
251 if(bUseMCInfo) task->AddPerformanceObject( pCompRes4 );
252 if(bUseMCInfo)task->AddPerformanceObject( pCompEff0 );
253 task->AddPerformanceObject( pCompDEdx3 );
254 task->AddPerformanceObject( pCompDCA0 );
255 task->AddPerformanceObject( pCompTPC0 );
256 task->AddPerformanceObject( pCompMatch0 );
257 task->AddPerformanceObject( pCompMatch1 );
258 task->AddPerformanceObject( pCompMatch2 );
261 // Create containers for input
263 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
266 // Create containers for output
268 AliAnalysisDataContainer *coutput_tpc = mgr->CreateContainer("TPC", TList::Class(), AliAnalysisManager::kOutputContainer, Form("TPC.%s.root", task->GetName()));
269 mgr->ConnectOutput(task, 0, coutput_tpc);