From: jotwinow Date: Mon, 14 Dec 2009 16:57:54 +0000 (+0000) Subject: only TPC performance task X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=b526c47d04f14ecedeb193ab43b1764dff0948d1;p=u%2Fmrichter%2FAliRoot.git only TPC performance task --- diff --git a/PWG1/TPC/macros/AddTaskPerformanceTPCQA.C b/PWG1/TPC/macros/AddTaskPerformanceTPCQA.C new file mode 100644 index 00000000000..8aa7f9b44a4 --- /dev/null +++ b/PWG1/TPC/macros/AddTaskPerformanceTPCQA.C @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////////////////////////////// +// Macro to setup AliPerformanceTask for +// TPC performance QA to run on PWG1 QA train. +// +// Input: ESDs, ESDfriends (optional), Kinematics (optional), TrackRefs (optional) +// ESD and MC input handlers must be attached to AliAnalysisManager +// to run default configuration. +// +// By default 1 performance components are added to +// the task: +// 1. AliPerformanceTPC (TPC cluster and track and event information) +// +// Usage on the analysis train (default configuration): +// gSystem->Load("libANALYSIS"); +// gSystem->Load("libANALYSISalice"); +// gSystem->Load("libTPCcalib.so"); +// gSystem->Load("libTENDER.so"); +// gSystem->Load("libPWG1.so"); +// +// gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceTPCQA.C"); +// AliPerformanceTask *tpcQA = AddTaskPerformanceTPC("kFALSE","kTRUE","triggerClass"); +// +// Output: +// TPC.Performance.root file with TPC performance components is created. +// +// Each of the components contains THnSparse generic histograms which +// have to be analysed (post-analysis) by using Analyse() function. +// Each component contains such function. +// +//14.12.2009 - J.Otwinowski@gsi.de +/////////////////////////////////////////////////////////////////////////////// + +//____________________________________________ +AliPerformanceTask* AddTaskPerformanceTPCQA(Bool_t bUseMCInfo=kFALSE, Bool_t bUseESDfriend=kTRUE, const char *triggerClass="CINT1B-ABCE-NOPF-ALL") +{ + // + // Add AliPerformanceTask with TPC performance components + // + AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); + if(!mgr) { + Error("AddTaskPerformanceTPC","AliAnalysisManager not set!"); + return NULL; + } + + TString type = mgr->GetInputEventHandler()->GetDataType(); + if (!type.Contains("ESD")) { + Error("AddTaskPerformanceTPC", "ESD input handler needed!"); + return NULL; + } + + AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler(); + if (!mcH && bUseMCInfo) { + Error("AddTaskPerformanceTPC", "MC input handler needed!"); + return NULL; + } + + // + // Create task + // + AliPerformanceTask *task = new AliPerformanceTask("Performance","TPC Performance"); + if (!task) { + Error("AddTaskPerformanceTPC", "TPC performance task cannot be created!"); + return NULL; + } + task->SetUseMCInfo(bUseMCInfo); + task->SetUseESDfriend(bUseESDfriend); + + // + // Add task to analysis manager + // + mgr->AddTask(task); + + // + // Create TPC-ESD track reconstruction cuts + // MB tracks + // + AliRecInfoCuts *pRecInfoCutsTPC = new AliRecInfoCuts(); + if(pRecInfoCutsTPC) { + pRecInfoCutsTPC->SetMaxDCAToVertexXY(3.0); + pRecInfoCutsTPC->SetMaxDCAToVertexZ(30.0); + //pRecInfoCutsTPC->SetMaxDCAToVertexZ(3.0); + pRecInfoCutsTPC->SetRequireSigmaToVertex(kFALSE); + pRecInfoCutsTPC->SetRequireTPCRefit(kFALSE); + pRecInfoCutsTPC->SetAcceptKinkDaughters(kTRUE); + pRecInfoCutsTPC->SetMinNClustersTPC(50); + pRecInfoCutsTPC->SetMaxChi2PerClusterTPC(1000000.); + pRecInfoCutsTPC->SetDCAToVertex2D(kFALSE); + + pRecInfoCutsTPC->SetHistogramsOn(kFALSE); + } + else { + Error("AddTaskPerformanceTPC", "AliRecInfoCutsTPC cannot be created!"); + return NULL; + } + + // + // Create TPC-MC track reconstruction cuts + // + AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts(); + if(pMCInfoCuts) { + pMCInfoCuts->SetMinTrackLength(70); + } + else { + Error("AddTaskPerformanceTPC", "AliMCInfoCuts cannot be created!"); + return NULL; + } + + // + // Create performance objects for TPC and set cuts + // + enum { kTPC = 0}; + + // + // TPC performance + // + AliPerformanceTPC *pCompTPC0 = new AliPerformanceTPC("AliPerformanceTPC","AliPerformanceTPC",kTPC,kFALSE); + if(!pCompTPC0) { + Error("AddTaskPerformanceTPC", "Cannot create AliPerformanceTPC"); + } + pCompTPC0->SetAliRecInfoCuts(pRecInfoCutsTPC); + pCompTPC0->SetAliMCInfoCuts(pMCInfoCuts); + + // + // Add components to the performance task + // + if(!bUseMCInfo) pCompTPC0->SetTriggerClass(triggerClass); + task->AddPerformanceObject( pCompTPC0 ); + + // + // Create containers for input + // + mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); + + // + // Create containers for output + // + AliAnalysisDataContainer *coutput_tpc = mgr->CreateContainer("TPC", TList::Class(), AliAnalysisManager::kOutputContainer, Form("TPC.%s.root", task->GetName())); + mgr->ConnectOutput(task, 0, coutput_tpc); + +return task; +}