adding the option for hybrid tracks global+global constrained as well as global+TPC...
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskPWG4HighPtQATPConly.C
CommitLineData
fdceab34 1//DEFINITION OF A FEW CONSTANTS
2
b1cd0099 3AliPWG4HighPtQATPConly* AddTaskPWG4HighPtQATPConly(char *prodType = "LHC10e14",int cuts=2)//1: Standard Cuts 2009 2: GetStandardITSTPCTrackCuts2009
fdceab34 4{
67ebd013 5 // Creates HighPtQATPConly 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) {
67ebd013 11 Error("AddTaskPWG4HighPtQATPConly", "No analysis manager to connect to.");
fdceab34 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()) {
67ebd013 19 ::Error("AddTaskPWG4HighPtQATPConly", "This task requires an input event handler");
fdceab34 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");
10295ac3 31 if(cuts==1) {
36c36a0c 32 trackCuts=trackCuts->GetStandardITSTPCTrackCuts2010(kTRUE);//Primary Track Selection
10295ac3 33 trackCuts->SetEtaRange(-0.9,0.9);
10295ac3 34 trackCuts->SetPtRange(0.15, 1e10);
36c36a0c 35
10295ac3 36 }
37 else if(cuts==2) {
36c36a0c 38 trackCuts=trackCuts->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Selection
10295ac3 39 trackCuts->SetEtaRange(-0.9,0.9);
40 trackCuts->SetPtRange(0.15, 1e10);
10295ac3 41 }
42
fdceab34 43 AliESDtrackCuts *trackCutsITS = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts with ITSrefit");
10295ac3 44 if(cuts==1) {
36c36a0c 45 //Cuts SPD || SDD
46 // TPC
47 trackCutsITS->SetMinNClustersTPC(70);
48 trackCutsITS->SetMaxChi2PerClusterTPC(4);
49 trackCutsITS->SetAcceptKinkDaughters(kFALSE);
50 trackCutsITS->SetRequireTPCRefit(kTRUE);
51 // ITS
52 trackCutsITS->SetRequireITSRefit(kTRUE);
53 trackCutsITS->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);
54 trackCutsITS->SetClusterRequirementITS(AliESDtrackCuts::kSDD, AliESDtrackCuts::kFirst);
55
56 trackCutsITS->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
57 trackCutsITS->SetMaxDCAToVertexZ(2);
58 trackCutsITS->SetDCAToVertex2D(kFALSE);
59 trackCutsITS->SetRequireSigmaToVertex(kFALSE);
60
61 trackCutsITS->SetEtaRange(-0.9,0.9);
62 trackCutsITS->SetPtRange(0.15, 1e10);
63 trackCutsITS->SetRequireITSRefit(kTRUE);
64
10295ac3 65 }
66 else if(cuts==2) {
36c36a0c 67 trackCutsITS=trackCutsITS->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Selection
10295ac3 68 trackCutsITS->SetEtaRange(-0.9,0.9);
69 trackCutsITS->SetPtRange(0.15, 1e10);
70 }
fdceab34 71
10295ac3 72//Create the task
73 AliPWG4HighPtQATPConly *taskPWG4QA = new AliPWG4HighPtQATPConly(Form("AliPWG4HighPtQATPConly%d",cuts));
fdceab34 74 taskPWG4QA->SetCuts(trackCuts);
75 taskPWG4QA->SetCutsITS(trackCutsITS);
82ebd295 76 taskPWG4QA->SetCutType(cuts);
b1cd0099 77 if(!strcmp(prodType, "LHC10e14") || !strcmp(prodType, "PbPb")) taskPWG4QA->SetPtMax(500.);
78 else taskPWG4QA->SetPtMax(100.);
79
fdceab34 80 // E. Create ONLY the output containers for the data produced by the task.
81 // Get and connect other common input/output containers via the manager as below
82 //==============================================================================
83
84 //------ input data ------
10295ac3 85 TString outputfile = "";
86 outputfile = AliAnalysisManager::GetCommonFileName();
87 outputfile += Form(":PWG4_HighPtQATPConly%d",cuts);
88
89 AliAnalysisDataContainer *cout_hist0;
90 AliAnalysisDataContainer *cout_hist1;
91 AliAnalysisDataContainer *cout_hist2;
9b58297c 92
82ebd295 93 AliAnalysisDataContainer *cout_cuts0;
94 AliAnalysisDataContainer *cout_cuts1;
10295ac3 95
82ebd295 96 cout_hist0 = mgr->CreateContainer(Form("qa_histsCuts%d",cuts), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile);
97 cout_hist1 = mgr->CreateContainer(Form("qa_histsTPCCuts%d",cuts), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile);
98 cout_hist2 = mgr->CreateContainer(Form("qa_histsITSCuts%d",cuts), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile);
9b58297c 99
82ebd295 100 cout_cuts0 = mgr->CreateContainer(Form("qa_trackCuts%d",cuts), AliESDtrackCuts::Class(), AliAnalysisManager::kParamContainer,outputfile);
101 cout_cuts1 = mgr->CreateContainer(Form("qa_trackCutsITS%d",cuts), AliESDtrackCuts::Class(), AliAnalysisManager::kParamContainer,outputfile);
102
103 //Add task to manager
fdceab34 104 mgr->AddTask(taskPWG4QA);
105
82ebd295 106 //Connect input containter to manager
fdceab34 107 mgr->ConnectInput(taskPWG4QA,0,mgr->GetCommonInputContainer());
82ebd295 108
109 //Connect output containers to manager
fdceab34 110 mgr->ConnectOutput(taskPWG4QA,0,cout_hist0);
111 mgr->ConnectOutput(taskPWG4QA,1,cout_hist1);
112 mgr->ConnectOutput(taskPWG4QA,2,cout_hist2);
9b58297c 113 mgr->ConnectOutput(taskPWG4QA,3,cout_cuts0);
114 mgr->ConnectOutput(taskPWG4QA,4,cout_cuts1);
fdceab34 115
116 // Return task pointer at the end
117 return taskPWG4QA;
118}