]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/macros/AddTaskCheckV0.C
Removing deprecated linearization and MC rescaling (now part of the centrality framework)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / macros / AddTaskCheckV0.C
CommitLineData
317170cb 1AliAnalysisTaskCheckV0 *AddTaskCheckV0(Short_t lCollidingSystems =0, /*0 = pp, 1 = AA*/
2 Bool_t lDelegateSelection =1) /*1 to AliPhysicsSelection */
cc1236ed 3{
4// Creates, configures and attaches to the train a V0 check task.
5 // Get the pointer to the existing analysis manager via the static access method.
6 //==============================================================================
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8 if (!mgr) {
9 ::Error("AddTaskCheckV0", "No analysis manager to connect to.");
10 return NULL;
11 }
12
13 // Check the analysis type using the event handlers connected to the analysis manager.
14 //==============================================================================
15 if (!mgr->GetInputEventHandler()) {
16 ::Error("AddTaskCheckV0", "This task requires an input event handler");
17 return NULL;
18 }
19 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
20
21 // Create and configure the task
22 AliAnalysisTaskCheckV0 *taskcheckv0 = new AliAnalysisTaskCheckV0("TaskCheckV0");
23 taskcheckv0->SetCollidingSystems(lCollidingSystems);
24 taskcheckv0->SetAnalysisType(type);
317170cb 25 taskcheckv0->SetUsePhysicsSelection(lDelegateSelection); // Delegate event selection or not
26 taskcheckv0->SetMaxPrimaryVtxPosZ(10.); // select |primvtx_z|<10
27 taskcheckv0->SetMaxV0Rapidity(0.75); // select |y|<0.75
28 taskcheckv0->SetMinV0Pt(0.2); // select pt>0.2
9c175578 29 taskcheckv0->SetMaxV0Pt(10.0); // select pt<10.0
317170cb 30 taskcheckv0->SetMinDaughterTpcClusters(80); // select TPC clusters>80
cc1236ed 31 mgr->AddTask(taskcheckv0);
32
33 // Create ONLY the output containers for the data produced by the task.
34 // Get and connect other common input/output containers via the manager as below
35 //==============================================================================
1ba92c7e 36 TString outputFileName = AliAnalysisManager::GetCommonFileName();
162aeefd 37 outputFileName += ":PWG2CheckV0";
1ba92c7e 38 if (lCollidingSystems) outputFileName += "_AA";
39 else outputFileName += "_PP";
40 if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
41
42 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistV0",
43 TList::Class(),
44 AliAnalysisManager::kOutputContainer,
45 outputFileName );
cc1236ed 46
1ba92c7e 47 mgr->ConnectInput(taskcheckv0, 0, mgr->GetCommonInputContainer());
cc1236ed 48 mgr->ConnectOutput(taskcheckv0, 1, coutput1);
49 return taskcheckv0;
50}