1 ///////////////////////////////////////////////////////////////////////////////
2 // Macro to setup AliAnalysisTaskV0QA for
3 // V0 performance QA to run on PWG1 QA train.
4 // ESD and MC input handlers must be attached to AliAnalysisManager
7 // V0QA.root file with V0QA for gammas,K0s,Lambdas, antilambdas is created.
9 // The file contains 4 THnSparse generic histograms which
10 // have to be analysed using the macros
11 // PWG1/macros/plotSparseK0.C
12 // PWG1/macros/plotSparseGamma.C
13 // PWG1/macros/plotSparseL.C
14 // PWG1/macros/plotSparseAL.C
16 // 14.10.09 A. Marin a.marin@gsi.de
17 ///////////////////////////////////////
19 AliAnalysisTaskV0QA *AddTaskV0QA(Bool_t bUseMCInfo=kTRUE)
21 // Creates a filter task and adds it to the analysis manager.
23 // Get the pointer to the existing analysis manager via the static access method.
24 //==============================================================================
25 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
27 ::Error("AddTaskV0QA", "No analysis manager to connect to.");
31 // This task requires an ESD input handler and an AOD output handler.
32 // Check this using the analysis manager.
33 //===============================================================================
34 TString type = mgr->GetInputEventHandler()->GetDataType();
35 if (!type.Contains("ESD")) {
36 ::Error("AddTaskV0QA", "V0QA task needs the manager to have an ESD input handler.");
40 // Check if MC handler is connected in case kine filter requested
41 AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
42 if (!mcH && bUseMCInfo)) {
43 ::Error("AddTaskV0QA", "No MC handler connected");
47 // Create the task, add it to the manager and configure it.
48 //===========================================================================
49 // Barrel tracks filter
50 AliAnalysisTaskV0QA * v0QA = new AliAnalysisTaskV0QA("V0QA");
54 // Create ONLY the output containers for the data produced by the task.
55 // Get and connect other common input/output containers via the manager as below
56 //==============================================================================
57 mgr->ConnectInput (v0QA, 0, mgr->GetCommonInputContainer());
59 // Create containers for output
61 AliAnalysisDataContainer *coutput_v0QA =
62 mgr->CreateContainer("V0QA", TList::Class(),
63 AliAnalysisManager::kOutputContainer, Form("%s:%s", mgr->GetCommonFileName(),v0QA->GetName()));
64 mgr->ConnectOutput(v0QA, 1, coutput_v0QA);