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 1 performance components are added to
11 // 1. AliPerformanceTPC (TPC cluster and track and event information)
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");
20 // gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceTPCQA.C");
21 // AliPerformanceTask *tpcQA = AddTaskPerformanceTPC("kFALSE","kTRUE","triggerClass");
24 // TPC.Performance.root file with TPC performance components is created.
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.
30 //14.12.2009 - J.Otwinowski@gsi.de
31 ///////////////////////////////////////////////////////////////////////////////
33 //____________________________________________
34 AliPerformanceTask* AddTaskPerformanceTPCQA(Bool_t bUseMCInfo=kFALSE, Bool_t bUseESDfriend=kTRUE, const char *triggerClass=0)
37 // Add AliPerformanceTask with TPC performance components
39 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
41 Error("AddTaskPerformanceTPC","AliAnalysisManager not set!");
45 TString type = mgr->GetInputEventHandler()->GetDataType();
46 if (!type.Contains("ESD")) {
47 Error("AddTaskPerformanceTPC", "ESD input handler needed!");
51 AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
52 if (!mcH && bUseMCInfo) {
53 Error("AddTaskPerformanceTPC", "MC input handler needed!");
60 AliPerformanceTask *task = new AliPerformanceTask("PerformanceQA","TPC Performance");
62 Error("AddTaskPerformanceTPC", "TPC performance task cannot be created!");
65 task->SetUseMCInfo(bUseMCInfo);
66 task->SetUseESDfriend(bUseESDfriend);
69 // Add task to analysis manager
74 // Create TPC-ESD track reconstruction cuts
77 AliRecInfoCuts *pRecInfoCutsTPC = new AliRecInfoCuts();
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);
88 pRecInfoCutsTPC->SetHistogramsOn(kFALSE);
91 Error("AddTaskPerformanceTPC", "AliRecInfoCutsTPC cannot be created!");
96 // Create TPC-MC track reconstruction cuts
98 AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts();
100 pMCInfoCuts->SetMinTrackLength(70);
103 Error("AddTaskPerformanceTPC", "AliMCInfoCuts cannot be created!");
108 // Create performance objects for TPC and set cuts
115 AliPerformanceTPC *pCompTPC0 = new AliPerformanceTPC("AliPerformanceTPC","AliPerformanceTPC",kTPC,kFALSE);
117 Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceTPC");
119 pCompTPC0->SetAliRecInfoCuts(pRecInfoCutsTPC);
120 pCompTPC0->SetAliMCInfoCuts(pMCInfoCuts);
123 // Add components to the performance task
125 if(!bUseMCInfo) pCompTPC0->SetTriggerClass(triggerClass);
126 task->AddPerformanceObject( pCompTPC0 );
129 // Create containers for input
131 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
134 // Create containers for output
136 AliAnalysisDataContainer *coutput_tpc = mgr->CreateContainer("TPCQA", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TPC_%s", mgr->GetCommonFileName(), task->GetName()));
137 mgr->ConnectOutput(task, 1, coutput_tpc);