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