1 ///////////////////////////////////////////////////////////////////////////////
2 // Macro to setup AliPerformanceTask for either
3 // HLT or offline 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/HLT/QA/tasks/macros/AddTaskPerformanceTPC.C");
28 // AliPerformanceTask *tpcQA = AddTaskPerformanceTPC("kTRUE","kTRUE", "kTRUE"ΒΈ"triggerClass");
31 // HLTTPC.Performance.root file with HLT TPC performance components
33 // TPC.Performance.root file with TPC performance components
35 // Each of the components contains THnSparse generic histograms which
36 // have to be analysed (post-analysis) by using Analyse() function.
37 // Each component contains such function.
39 //01-09.10 - J.Otwinowski@gsi.de, jochen@thaeder.de, hege.erdal@ift.uib.no
40 ///////////////////////////////////////////////////////////////////////////////
42 //__________________________________________________________________________________________________
43 AliPerformanceTask* AddTaskPerformance(Bool_t bUseMCInfo=kTRUE,
44 Bool_t bUseESDfriend=kTRUE,
45 Bool_t bUseHLT = kFALSE,
46 const char *triggerClass=0) {
47 // const char *triggerClass="CINT1B-ABCE-NOPF-ALL") {
49 // Add AliPerformanceTask with HLT/TPC performance components
51 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
53 Error("AddTaskPerformance","AliAnalysisManager not set!");
57 TString type = mgr->GetInputEventHandler()->GetDataType();
58 if (!type.Contains("ESD")) {
59 Error("AddTaskPerformance", "ESD input handler needed!");
63 AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
64 if (!mcH && bUseMCInfo) {
65 Error("AddTaskPerformance", "MC input handler needed!");
69 //============= Add HLT ESD ================================================================
71 AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*>(mgr->GetInputEventHandler());
74 //==========================================================================================
77 // Create task -----------------------------------------------------------------------------------
80 AliPerformanceTask *task = new AliPerformanceTask("Performance","HLT TPC Performance");
82 AliPerformanceTask *task = new AliPerformanceTask("Performance","TPC Performance");
85 Error("AddTaskPerformance", "Performance task cannot be created!");
89 task->SelectCollisionCandidates();
90 task->SetUseMCInfo(bUseMCInfo);
91 task->SetUseESDfriend(bUseESDfriend);
92 task->SetUseHLT(bUseHLT);
94 // Add task to analysis manager ------------------------------------------------------------------
99 //================================================================================================
101 //================================================================================================
104 // Create TPC-ESD track reconstruction cuts ------------------------------------------------------
108 AliRecInfoCuts *pRecInfoCutsTPC = new AliRecInfoCuts();
109 if(pRecInfoCutsTPC) {
110 // pRecInfoCutsTPC->SetMaxDCAToVertexXY(3.0);
111 // pRecInfoCutsTPC->SetMaxDCAToVertexZ(30.0);
112 pRecInfoCutsTPC->SetMaxDCAToVertexXY(150.0);
113 pRecInfoCutsTPC->SetMaxDCAToVertexZ(150.0);
114 pRecInfoCutsTPC->SetRequireSigmaToVertex(kFALSE);
115 pRecInfoCutsTPC->SetRequireTPCRefit(kFALSE);
117 pRecInfoCutsTPC->SetAcceptKinkDaughters(kTRUE);
118 pRecInfoCutsTPC->SetMinNClustersTPC(50);
119 pRecInfoCutsTPC->SetMaxChi2PerClusterTPC(1000000.);
120 pRecInfoCutsTPC->SetDCAToVertex2D(kFALSE);
122 pRecInfoCutsTPC->SetHistogramsOn(kFALSE);
125 Error("AddTaskPerformance", "AliRecInfoCutsTPC cannot be created!");
130 // Create TPC-ESD track reconstruction cuts ------------------------------------------------------
133 AliRecInfoCuts *pRecInfoCuts = new AliRecInfoCuts();
135 pRecInfoCuts->SetMaxDCAToVertexXY(3.0);
136 pRecInfoCuts->SetMaxDCAToVertexZ(3.0);
137 pRecInfoCuts->SetMinNClustersTPC(50);
138 pRecInfoCuts->SetMinNClustersITS(2);
139 pRecInfoCuts->SetHistogramsOn(kFALSE);
140 pRecInfoCuts->SetTPCITSMatchingRadius(70);
141 pRecInfoCuts->SetTPCTRDMatchingRadius(260);
144 Error("AddTaskPerformance", "AliRecInfoCuts cannot be created!");
149 // Create TPC-MC track reconstruction cuts -------------------------------------------------------
151 AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts();
153 pMCInfoCuts->SetMinTrackLength(70);
156 Error("AddTaskPerformance", "AliMCInfoCuts cannot be created!");
160 //================================================================================================
162 //================================================================================================
165 // Create performance objects for TPC and set cuts
167 enum { kTPC = 0, kTPCITS, kConstrained, kTPCInner, kTPCOuter, kTPCSec };
170 // Resolution ------------------------------------------------------------------------------------
173 AliPerformanceRes *pCompRes0 = new AliPerformanceRes("AliPerformanceRes",
174 "AliPerformanceRes",kTPC,kFALSE);
176 Error("AddTaskPerformance", "Cannot create AliPerformanceRes");
178 pCompRes0->SetAliRecInfoCuts(pRecInfoCuts);
179 pCompRes0->SetAliMCInfoCuts(pMCInfoCuts);
180 pCompRes0->SetUseTrackVertex(kTRUE);
183 // Efficiency ------------------------------------------------------------------------------------
186 AliPerformanceEff *pCompEff0 = new AliPerformanceEff("AliPerformanceEff",
187 "AliPerformanceEff",kTPC,kFALSE);
189 Error("AddTaskPerformance", "Cannot create AliPerformanceEff");
191 pCompEff0->SetAliRecInfoCuts(pRecInfoCuts);
192 pCompEff0->SetAliMCInfoCuts(pMCInfoCuts);
193 pCompEff0->SetUseTrackVertex(kTRUE);
196 // dEdx ------------------------------------------------------------------------------------------
199 AliPerformanceDEdx *pCompDEdx3 = new AliPerformanceDEdx("AliPerformanceDEdxTPCInner",
200 "AliPerformanceDEdxTPCInner",kTPCInner,kFALSE);
202 Error("AddTaskPerformance", "Cannot create AliPerformanceDEdxTPCInner");
204 pCompDEdx3->SetAliRecInfoCuts(pRecInfoCuts);
205 pCompDEdx3->SetAliMCInfoCuts(pMCInfoCuts);
206 pCompDEdx3->SetUseTrackVertex(kTRUE);
209 // DCA -------------------------------------------------------------------------------------------
212 AliPerformanceDCA *pCompDCA0 = new AliPerformanceDCA("AliPerformanceDCA",
213 "AliPerformanceDCA",kTPC,kFALSE);
215 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceDCA");
217 pCompDCA0->SetAliRecInfoCuts(pRecInfoCuts);
218 pCompDCA0->SetAliMCInfoCuts(pMCInfoCuts);
219 pCompDCA0->SetUseTrackVertex(kTRUE);
222 // TPC performance -------------------------------------------------------------------------------
225 AliPerformanceTPC *pCompTPC0 = new AliPerformanceTPC("AliPerformanceTPC",
226 "AliPerformanceTPC",kTPC,kFALSE);
228 Error("AddTaskPerformance", "Cannot create AliPerformanceTPC");
230 pCompTPC0->SetAliRecInfoCuts(pRecInfoCutsTPC);
231 pCompTPC0->SetAliMCInfoCuts(pMCInfoCuts);
232 pCompTPC0->SetUseTrackVertex(kTRUE);
233 pCompTPC0->SetUseHLT(bUseHLT);
236 // Add components to the performance task --------------------------------------------------------
239 //01.09.10 At the moment only use pCompTPC0
241 //task->AddPerformanceObject( pCompDEdx3 );
242 //task->AddPerformanceObject( pCompDCA0 );
243 task->AddPerformanceObject( pCompTPC0 );
247 task->AddPerformanceObject( pCompRes0 );
248 task->AddPerformanceObject( pCompEff0 );
251 if(!bUseMCInfo && triggerClass) {
252 pCompDEdx3->SetTriggerClass(triggerClass);
253 pCompDCA0->SetTriggerClass(triggerClass);
254 pCompTPC0->SetTriggerClass(triggerClass);
258 //================================================================================================
260 //================================================================================================
261 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
264 AliAnalysisDataContainer *coutput1 =
265 mgr->CreateContainer("HLTQA", TList::Class(),
266 AliAnalysisManager::kOutputContainer, Form("HLTTPC.%s.root", task->GetName()));
269 AliAnalysisDataContainer *coutput1 =
270 mgr->CreateContainer("TPC", TList::Class(),
271 AliAnalysisManager::kOutputContainer, Form("TPC.%s.root", task->GetName()));
274 // -- connect containers
275 mgr->ConnectInput (task, 0, cinput );
276 mgr->ConnectOutput (task, 1, coutput1);