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->SetUseTerminate(kFALSE);
93 task->SetUseHLT(bUseHLT);
95 // Add task to analysis manager ------------------------------------------------------------------
100 //================================================================================================
102 //================================================================================================
105 // Create TPC-ESD track reconstruction cuts ------------------------------------------------------
109 AliRecInfoCuts *pRecInfoCutsTPC = new AliRecInfoCuts();
110 if(pRecInfoCutsTPC) {
111 // pRecInfoCutsTPC->SetMaxDCAToVertexXY(3.0);
112 // pRecInfoCutsTPC->SetMaxDCAToVertexZ(30.0);
113 pRecInfoCutsTPC->SetMaxDCAToVertexXY(150.0);
114 pRecInfoCutsTPC->SetMaxDCAToVertexZ(150.0);
115 pRecInfoCutsTPC->SetRequireSigmaToVertex(kFALSE);
116 pRecInfoCutsTPC->SetRequireTPCRefit(kFALSE);
118 pRecInfoCutsTPC->SetAcceptKinkDaughters(kTRUE);
119 pRecInfoCutsTPC->SetMinNClustersTPC(50);
120 pRecInfoCutsTPC->SetMaxChi2PerClusterTPC(1000000.);
121 pRecInfoCutsTPC->SetDCAToVertex2D(kFALSE);
123 pRecInfoCutsTPC->SetHistogramsOn(kFALSE);
126 Error("AddTaskPerformance", "AliRecInfoCutsTPC cannot be created!");
131 // Create TPC-ESD track reconstruction cuts ------------------------------------------------------
134 AliRecInfoCuts *pRecInfoCuts = new AliRecInfoCuts();
136 pRecInfoCuts->SetMaxDCAToVertexXY(3.0);
137 pRecInfoCuts->SetMaxDCAToVertexZ(3.0);
138 pRecInfoCuts->SetMinNClustersTPC(50);
139 pRecInfoCuts->SetMinNClustersITS(2);
140 pRecInfoCuts->SetHistogramsOn(kFALSE);
141 pRecInfoCuts->SetTPCITSMatchingRadius(70);
142 pRecInfoCuts->SetTPCTRDMatchingRadius(260);
145 Error("AddTaskPerformance", "AliRecInfoCuts cannot be created!");
150 // Create TPC-MC track reconstruction cuts -------------------------------------------------------
152 AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts();
154 pMCInfoCuts->SetMinTrackLength(70);
157 Error("AddTaskPerformance", "AliMCInfoCuts cannot be created!");
161 //================================================================================================
163 //================================================================================================
166 // Create performance objects for TPC and set cuts
168 enum { kTPC = 0, kTPCITS, kConstrained, kTPCInner, kTPCOuter, kTPCSec };
171 // Resolution ------------------------------------------------------------------------------------
174 AliPerformanceRes *pCompRes0 = new AliPerformanceRes("AliPerformanceRes",
175 "AliPerformanceRes",kTPC,kFALSE);
177 Error("AddTaskPerformance", "Cannot create AliPerformanceRes");
179 pCompRes0->SetAliRecInfoCuts(pRecInfoCuts);
180 pCompRes0->SetAliMCInfoCuts(pMCInfoCuts);
181 pCompRes0->SetUseTrackVertex(kTRUE);
184 // Efficiency ------------------------------------------------------------------------------------
187 AliPerformanceEff *pCompEff0 = new AliPerformanceEff("AliPerformanceEff",
188 "AliPerformanceEff",kTPC,kFALSE);
190 Error("AddTaskPerformance", "Cannot create AliPerformanceEff");
192 pCompEff0->SetAliRecInfoCuts(pRecInfoCuts);
193 pCompEff0->SetAliMCInfoCuts(pMCInfoCuts);
194 pCompEff0->SetUseTrackVertex(kTRUE);
197 // dEdx ------------------------------------------------------------------------------------------
200 AliPerformanceDEdx *pCompDEdx3 = new AliPerformanceDEdx("AliPerformanceDEdxTPCInner",
201 "AliPerformanceDEdxTPCInner",kTPCInner,kFALSE);
203 Error("AddTaskPerformance", "Cannot create AliPerformanceDEdxTPCInner");
205 pCompDEdx3->SetAliRecInfoCuts(pRecInfoCuts);
206 pCompDEdx3->SetAliMCInfoCuts(pMCInfoCuts);
207 pCompDEdx3->SetUseTrackVertex(kTRUE);
210 // DCA -------------------------------------------------------------------------------------------
213 AliPerformanceDCA *pCompDCA0 = new AliPerformanceDCA("AliPerformanceDCA",
214 "AliPerformanceDCA",kTPC,kFALSE);
216 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceDCA");
218 pCompDCA0->SetAliRecInfoCuts(pRecInfoCuts);
219 pCompDCA0->SetAliMCInfoCuts(pMCInfoCuts);
220 pCompDCA0->SetUseTrackVertex(kTRUE);
223 // TPC performance -------------------------------------------------------------------------------
226 AliPerformanceTPC *pCompTPC0 = new AliPerformanceTPC("AliPerformanceTPC",
227 "AliPerformanceTPC",kTPC,kFALSE);
229 Error("AddTaskPerformance", "Cannot create AliPerformanceTPC");
231 pCompTPC0->SetAliRecInfoCuts(pRecInfoCutsTPC);
232 pCompTPC0->SetAliMCInfoCuts(pMCInfoCuts);
233 pCompTPC0->SetUseTrackVertex(kTRUE);
234 pCompTPC0->SetUseHLT(bUseHLT);
237 // Add components to the performance task --------------------------------------------------------
240 //01.09.10 At the moment only use pCompTPC0
242 //task->AddPerformanceObject( pCompDEdx3 );
243 //task->AddPerformanceObject( pCompDCA0 );
244 task->AddPerformanceObject( pCompTPC0 );
248 task->AddPerformanceObject( pCompRes0 );
249 task->AddPerformanceObject( pCompEff0 );
252 if(!bUseMCInfo && triggerClass) {
253 pCompDEdx3->SetTriggerClass(triggerClass);
254 pCompDCA0->SetTriggerClass(triggerClass);
255 pCompTPC0->SetTriggerClass(triggerClass);
259 //================================================================================================
261 //================================================================================================
262 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
265 AliAnalysisDataContainer *coutput1 =
266 mgr->CreateContainer("HLTQA", TList::Class(),
267 AliAnalysisManager::kOutputContainer, Form("HLTTPC.%s.root", task->GetName()));
270 AliAnalysisDataContainer *coutput1 =
271 mgr->CreateContainer("TPC", TList::Class(),
272 AliAnalysisManager::kOutputContainer, Form("TPC.%s.root", task->GetName()));
275 // -- connect containers
276 mgr->ConnectInput (task, 0, cinput );
277 mgr->ConnectOutput (task, 1, coutput1);