]>
Commit | Line | Data |
---|---|---|
5a0bd31f | 1 | void AddTaskPWG4HighPtQAMCAll(char *prodType = "LHC10e14") { |
71e77a79 | 2 | |
5a0bd31f | 3 | AliPWG4HighPtQAMC *taskQAMC00 = AddTaskPWG4HighPtQAMC(prodType,0,0); |
b43ea0be | 4 | AliPWG4HighPtQAMC *taskQAMC01 = AddTaskPWG4HighPtQAMC(prodType,0,1); |
5 | // AliPWG4HighPtQAMC *taskQAMC02 = AddTaskPWG4HighPtQAMC(prodType,0,2); | |
327d12da | 6 | // AliPWG4HighPtQAMC *taskQAMC10 = AddTaskPWG4HighPtQAMC(prodType,1,0); |
7 | // AliPWG4HighPtQAMC *taskQAMC20 = AddTaskPWG4HighPtQAMC(prodType,2,0); | |
380cff49 | 8 | AliPWG4HighPtQAMC *taskQAMC70 = AddTaskPWG4HighPtQAMC(prodType,7,0); |
b43ea0be | 9 | AliPWG4HighPtQAMC *taskQAMC71 = AddTaskPWG4HighPtQAMC(prodType,7,1); |
10 | AliPWG4HighPtQAMC *taskQAMC72 = AddTaskPWG4HighPtQAMC(prodType,7,2); | |
5a0bd31f | 11 | } |
12 | ||
13 | AliPWG4HighPtQAMC* AddTaskPWG4HighPtQAMC(char *prodType = "LHC10e14", Int_t trackType = 0, Int_t cuts =0) | |
fdceab34 | 14 | { |
8f0faa80 | 15 | // Creates HighPtQAMC analysis task and adds it to the analysis manager. |
b1041e3b | 16 | |
17 | //Track types: | |
18 | //trackType | |
19 | // 0: global tracks | |
20 | // 1: TPConly tracks | |
21 | // 2: TPConly constrained tracks | |
380cff49 | 22 | |
23 | //Load common track cut class | |
24 | gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/CreateTrackCutsPWG4.C"); | |
fdceab34 | 25 | |
26 | // A. Get the pointer to the existing analysis manager via the static access method. | |
27 | //============================================================================== | |
28 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
29 | if (!mgr) { | |
30 | Error("AddTaskPWG4HighPtQMC", "No analysis manager to connect to."); | |
31 | return NULL; | |
32 | } | |
33 | ||
34 | // B. Check the analysis type using the event handlers connected to the analysis | |
35 | // manager. The availability of MC handler can also be checked here. | |
36 | //============================================================================== | |
37 | if (!mgr->GetInputEventHandler()) { | |
38 | ::Error("AddPWG4TaskHighPtQAMC", "This task requires an input event handler"); | |
39 | return NULL; | |
40 | } | |
41 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
57bee263 | 42 | const char *analysisType = "ESD"; |
fdceab34 | 43 | |
44 | // C. Create the task, add it to manager. | |
45 | //=========================================================================== | |
46 | ||
47 | //CREATE THE CUTS ----------------------------------------------- | |
48 | //Use AliESDtrackCuts | |
49 | AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts"); | |
327d12da | 50 | AliESDtrackCuts *trackCutsReject = 0x0; |
fdceab34 | 51 | //Standard Cuts |
71e77a79 | 52 | //Set track cuts for global tracks |
5a0bd31f | 53 | if(trackType==0 && cuts==0) { |
380cff49 | 54 | // tight global tracks - RAA analysis |
55 | trackCuts = CreateTrackCutsPWG4(1000); | |
36c36a0c | 56 | } |
5a0bd31f | 57 | if(trackType==0 && cuts==1) { |
380cff49 | 58 | //Cuts global tracks with ITSrefit requirement and SPDrequirement for jet analysis |
46a305f3 | 59 | trackCuts = CreateTrackCutsPWG4(10001006); |
380cff49 | 60 | } |
5a0bd31f | 61 | if(trackType==0 && cuts==2) { |
62 | //Cuts global tracks with ITSrefit requirement but without SPD | |
46a305f3 | 63 | trackCuts = CreateTrackCutsPWG4(10011006); |
5a0bd31f | 64 | } |
380cff49 | 65 | if(trackType==7 && cuts==0) { |
5a0bd31f | 66 | // tight global tracks |
46a305f3 | 67 | trackCuts = CreateTrackCutsPWG4(10041006); |
68 | trackCutsReject = CreateTrackCutsPWG4(1006); | |
b43ea0be | 69 | trackCutsReject->SetEtaRange(-0.9,0.9); |
70 | trackCutsReject->SetPtRange(0.15, 1e10); | |
380cff49 | 71 | } |
72 | if(trackType==7 && cuts==1) { | |
73 | // tight global tracks | |
46a305f3 | 74 | trackCuts = CreateTrackCutsPWG4(10011006); |
5a0bd31f | 75 | } |
b43ea0be | 76 | if(trackType==7 && cuts==2) { |
77 | // no requirements on SPD and ITSrefit failed | |
46a305f3 | 78 | trackCuts = CreateTrackCutsPWG4(10041006); //no ITSrefit requirement filter 256 |
79 | trackCutsReject = CreateTrackCutsPWG4(10001006); //ITSrefit requirement filter 16 | |
b43ea0be | 80 | trackCutsReject->SetEtaRange(-0.9,0.9); |
81 | trackCutsReject->SetPtRange(0.15, 1e10); | |
82 | } | |
83 | ||
71e77a79 | 84 | //Set track cuts for TPConly tracks |
36c36a0c | 85 | if(trackType==1 || trackType==2) { |
380cff49 | 86 | //Set track cuts for TPConly tracks |
87 | trackCuts = CreateTrackCutsPWG4(2001); | |
b4691ee7 | 88 | } |
9b58297c | 89 | trackCuts->SetEtaRange(-0.9,0.9); |
90 | trackCuts->SetPtRange(0.15, 1e10); | |
fdceab34 | 91 | |
fdceab34 | 92 | //Create the task |
327d12da | 93 | AliPWG4HighPtQAMC *taskPWG4QAMC = new AliPWG4HighPtQAMC(Form("AliPWG4HighPtQAMC%d%d",trackType,cuts)); |
fdceab34 | 94 | taskPWG4QAMC->SetCuts(trackCuts); |
327d12da | 95 | taskPWG4QAMC->SetCutsReject(trackCutsReject); |
71e77a79 | 96 | taskPWG4QAMC->SetTrackType(trackType); |
b4691ee7 | 97 | |
0f76d8ae | 98 | if(!strcmp(prodType, "LHC10e14")) taskPWG4QAMC->SetPtMax(500.); |
b1cd0099 | 99 | else taskPWG4QAMC->SetPtMax(100.); |
aa3ba8d2 | 100 | |
0f76d8ae | 101 | //taskPWG4QAMC->SetSigmaConstrainedMax(5.); |
aa3ba8d2 | 102 | |
fdceab34 | 103 | // E. Create ONLY the output containers for the data produced by the task. |
104 | // Get and connect other common input/output containers via the manager as below | |
105 | //============================================================================== | |
106 | ||
107 | //------ input data ------ | |
108 | // AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
109 | printf("Create output containers \n"); | |
110 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
5a0bd31f | 111 | outputfile += Form(":PWG4_HighPtQAMC%d%d",trackType,cuts); |
71e77a79 | 112 | |
5a0bd31f | 113 | AliAnalysisDataContainer *cout_hist1 = mgr->CreateContainer(Form("qa_histsMC%d%d",trackType,cuts), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile); |
fdceab34 | 114 | |
115 | mgr->AddTask(taskPWG4QAMC); | |
116 | mgr->ConnectInput(taskPWG4QAMC,0,mgr->GetCommonInputContainer()); | |
b4691ee7 | 117 | mgr->ConnectOutput(taskPWG4QAMC,0,cout_hist1); |
fdceab34 | 118 | |
5a0bd31f | 119 | // Return task pointer at the end |
fdceab34 | 120 | return taskPWG4QAMC; |
121 | } |