]>
Commit | Line | Data |
---|---|---|
fdceab34 | 1 | //DEFINITION OF A FEW CONSTANTS |
2 | ||
b1cd0099 | 3 | AliPWG4HighPtQATPConly* 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) { |
b4691ee7 | 32 | trackCuts=trackCuts->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Selection |
10295ac3 | 33 | trackCuts->SetEtaRange(-0.9,0.9); |
10295ac3 | 34 | trackCuts->SetPtRange(0.15, 1e10); |
b4691ee7 | 35 | trackCuts->SetRequireITSRefit(kFALSE); |
10295ac3 | 36 | } |
37 | else if(cuts==2) { | |
b4691ee7 | 38 | trackCuts=trackCuts->GetStandardITSTPCTrackCuts2010(kTRUE);//Primary Track Selection |
10295ac3 | 39 | trackCuts->SetEtaRange(-0.9,0.9); |
40 | trackCuts->SetPtRange(0.15, 1e10); | |
10295ac3 | 41 | trackCuts->SetRequireITSRefit(kFALSE); |
42 | } | |
43 | ||
fdceab34 | 44 | AliESDtrackCuts *trackCutsITS = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts with ITSrefit"); |
10295ac3 | 45 | if(cuts==1) { |
b4691ee7 | 46 | trackCutsITS=trackCutsITS->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Selection |
47 | trackCutsITS->SetEtaRange(-0.9,0.9); | |
48 | trackCutsITS->SetPtRange(0.15, 1e10); | |
10295ac3 | 49 | } |
50 | else if(cuts==2) { | |
b4691ee7 | 51 | trackCutsITS=trackCutsITS->GetStandardITSTPCTrackCuts2010(kTRUE);//Primary Track Selection |
10295ac3 | 52 | trackCutsITS->SetEtaRange(-0.9,0.9); |
53 | trackCutsITS->SetPtRange(0.15, 1e10); | |
54 | } | |
fdceab34 | 55 | |
10295ac3 | 56 | //Create the task |
57 | AliPWG4HighPtQATPConly *taskPWG4QA = new AliPWG4HighPtQATPConly(Form("AliPWG4HighPtQATPConly%d",cuts)); | |
fdceab34 | 58 | taskPWG4QA->SetCuts(trackCuts); |
59 | taskPWG4QA->SetCutsITS(trackCutsITS); | |
82ebd295 | 60 | taskPWG4QA->SetCutType(cuts); |
b1cd0099 | 61 | if(!strcmp(prodType, "LHC10e14") || !strcmp(prodType, "PbPb")) taskPWG4QA->SetPtMax(500.); |
62 | else taskPWG4QA->SetPtMax(100.); | |
63 | ||
fdceab34 | 64 | // E. Create ONLY the output containers for the data produced by the task. |
65 | // Get and connect other common input/output containers via the manager as below | |
66 | //============================================================================== | |
67 | ||
68 | //------ input data ------ | |
10295ac3 | 69 | TString outputfile = ""; |
70 | outputfile = AliAnalysisManager::GetCommonFileName(); | |
71 | outputfile += Form(":PWG4_HighPtQATPConly%d",cuts); | |
72 | ||
73 | AliAnalysisDataContainer *cout_hist0; | |
74 | AliAnalysisDataContainer *cout_hist1; | |
75 | AliAnalysisDataContainer *cout_hist2; | |
9b58297c | 76 | |
82ebd295 | 77 | AliAnalysisDataContainer *cout_cuts0; |
78 | AliAnalysisDataContainer *cout_cuts1; | |
10295ac3 | 79 | |
82ebd295 | 80 | cout_hist0 = mgr->CreateContainer(Form("qa_histsCuts%d",cuts), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile); |
81 | cout_hist1 = mgr->CreateContainer(Form("qa_histsTPCCuts%d",cuts), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile); | |
82 | cout_hist2 = mgr->CreateContainer(Form("qa_histsITSCuts%d",cuts), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile); | |
9b58297c | 83 | |
82ebd295 | 84 | cout_cuts0 = mgr->CreateContainer(Form("qa_trackCuts%d",cuts), AliESDtrackCuts::Class(), AliAnalysisManager::kParamContainer,outputfile); |
85 | cout_cuts1 = mgr->CreateContainer(Form("qa_trackCutsITS%d",cuts), AliESDtrackCuts::Class(), AliAnalysisManager::kParamContainer,outputfile); | |
86 | ||
87 | //Add task to manager | |
fdceab34 | 88 | mgr->AddTask(taskPWG4QA); |
89 | ||
82ebd295 | 90 | //Connect input containter to manager |
fdceab34 | 91 | mgr->ConnectInput(taskPWG4QA,0,mgr->GetCommonInputContainer()); |
82ebd295 | 92 | |
93 | //Connect output containers to manager | |
fdceab34 | 94 | mgr->ConnectOutput(taskPWG4QA,0,cout_hist0); |
95 | mgr->ConnectOutput(taskPWG4QA,1,cout_hist1); | |
96 | mgr->ConnectOutput(taskPWG4QA,2,cout_hist2); | |
9b58297c | 97 | mgr->ConnectOutput(taskPWG4QA,3,cout_cuts0); |
98 | mgr->ConnectOutput(taskPWG4QA,4,cout_cuts1); | |
fdceab34 | 99 | |
100 | // Return task pointer at the end | |
101 | return taskPWG4QA; | |
102 | } |