adding cosmics selection (Marta)
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskPWG4HighPtQAMC.C
CommitLineData
fdceab34 1//DEFINITION OF A FEW CONSTANTS
2
8f0faa80 3AliPWG4HighPtQAMC* AddTaskPWG4HighPtQAMC()
fdceab34 4{
8f0faa80 5 // Creates HighPtQAMC analysis task and adds it to the analysis manager.
fdceab34 6
7 // A. Get the pointer to the existing analysis manager via the static access method.
8 //==============================================================================
9 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
10 if (!mgr) {
11 Error("AddTaskPWG4HighPtQMC", "No analysis manager to connect to.");
12 return NULL;
13 }
14
15 // B. Check the analysis type using the event handlers connected to the analysis
16 // manager. The availability of MC handler can also be checked here.
17 //==============================================================================
18 if (!mgr->GetInputEventHandler()) {
19 ::Error("AddPWG4TaskHighPtQAMC", "This task requires an input event handler");
20 return NULL;
21 }
22 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
23 const char *analysisType = "ESD";//"TPC"
24
25 // C. Create the task, add it to manager.
26 //===========================================================================
27
28 //CREATE THE CUTS -----------------------------------------------
29 //Use AliESDtrackCuts
30 AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts");
31 //Standard Cuts
32 trackCuts->SetAcceptKinkDaughters(kFALSE);//
33 trackCuts->SetRequireTPCRefit(kTRUE);//
34 trackCuts->SetEtaRange(-0.9,0.9);//-0.5,0.5);//
35 trackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);//
36 trackCuts->SetPtRange(0.15, 1e10);//
8f0faa80 37 trackCuts->SetMinNClustersTPC(70);//
fdceab34 38 trackCuts->SetMaxChi2PerClusterTPC(3.5);//
39 //trackCuts->SetRequireITSRefit(kTRUE);
40 trackCuts->SetMaxDCAToVertexXY(2.4);
41 trackCuts->SetMaxDCAToVertexZ(3.2);
42 trackCuts->SetDCAToVertex2D(kTRUE);
43
44 AliESDtrackCuts *trackCutsITS = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts with ITSrefit");
45 trackCutsITS->SetAcceptKinkDaughters(kFALSE);//
46 trackCutsITS->SetRequireTPCRefit(kTRUE);//
47 trackCutsITS->SetEtaRange(-0.9,0.9);//-0.5,0.5);//
48 trackCutsITS->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);//
49 trackCutsITS->SetPtRange(0.15, 1e10);//
8f0faa80 50 trackCutsITS->SetMinNClustersTPC(70);//
fdceab34 51 trackCutsITS->SetMaxChi2PerClusterTPC(3.5);//
52 trackCutsITS->SetRequireITSRefit(kTRUE);
53 trackCutsITS->SetMaxDCAToVertexXY(2.4);
54 trackCutsITS->SetMaxDCAToVertexZ(3.2);
55 trackCutsITS->SetDCAToVertex2D(kTRUE);
56
57 //Create the task
58 AliPWG4HighPtQAMC *taskPWG4QAMC = new AliPWG4HighPtQAMC("AliPWG4HighPtQAMC");
59 taskPWG4QAMC->SetCuts(trackCuts);
60 taskPWG4QAMC->SetCutsITS(trackCutsITS);
61
62
63 // E. Create ONLY the output containers for the data produced by the task.
64 // Get and connect other common input/output containers via the manager as below
65 //==============================================================================
66
67 //------ input data ------
68 // AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
69 printf("Create output containers \n");
70 TString outputfile = AliAnalysisManager::GetCommonFileName();
71 outputfile += ":PWG4_HighPtQAMC";
72 //char *outputfile = "outputAliPWG4HighPtQAMCTestTrain.root";
73 AliAnalysisDataContainer *cout_hist0 = mgr->CreateContainer("qa_histsMC", TList::Class(), AliAnalysisManager::kOutputContainer,outputfile);
74 AliAnalysisDataContainer *cout_hist2 = mgr->CreateContainer("qa_histsMCITS", TList::Class(), AliAnalysisManager::kOutputContainer,outputfile);
75
76 mgr->AddTask(taskPWG4QAMC);
77 mgr->ConnectInput(taskPWG4QAMC,0,mgr->GetCommonInputContainer());
78 mgr->ConnectOutput(taskPWG4QAMC,0,cout_hist0);
79 mgr->ConnectOutput(taskPWG4QAMC,1,cout_hist2);
80
81 // Return task pointer at the end
82 return taskPWG4QAMC;
83}