]>
Commit | Line | Data |
---|---|---|
71e77a79 | 1 | |
fdceab34 | 2 | //DEFINITION OF A FEW CONSTANTS |
3 | ||
71e77a79 | 4 | AliPWG4HighPtQAMC* AddTaskPWG4HighPtQAMC(char *prodType = "LHC10e14", int trackType = 0) |
fdceab34 | 5 | { |
8f0faa80 | 6 | // Creates HighPtQAMC analysis task and adds it to the analysis manager. |
fdceab34 | 7 | |
8 | // A. Get the pointer to the existing analysis manager via the static access method. | |
9 | //============================================================================== | |
10 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
11 | if (!mgr) { | |
12 | Error("AddTaskPWG4HighPtQMC", "No analysis manager to connect to."); | |
13 | return NULL; | |
14 | } | |
15 | ||
16 | // B. Check the analysis type using the event handlers connected to the analysis | |
17 | // manager. The availability of MC handler can also be checked here. | |
18 | //============================================================================== | |
19 | if (!mgr->GetInputEventHandler()) { | |
20 | ::Error("AddPWG4TaskHighPtQAMC", "This task requires an input event handler"); | |
21 | return NULL; | |
22 | } | |
23 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
57bee263 | 24 | const char *analysisType = "ESD"; |
fdceab34 | 25 | |
26 | // C. Create the task, add it to manager. | |
27 | //=========================================================================== | |
28 | ||
29 | //CREATE THE CUTS ----------------------------------------------- | |
30 | //Use AliESDtrackCuts | |
31 | AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts"); | |
32 | //Standard Cuts | |
71e77a79 | 33 | //Set track cuts for global tracks |
36c36a0c | 34 | if(trackType==0) { |
35 | trackCuts = trackCuts->GetStandardITSTPCTrackCuts2010(kTRUE);//Primary Track Selection | |
36 | trackCuts->SetRequireITSRefit(kTRUE); | |
37 | } | |
34fc6450 | 38 | if(trackType==3) { |
39 | //Cuts global tracks with ITSrefit requirement | |
40 | // TPC | |
41 | trackCuts->SetMinNClustersTPC(70); | |
42 | trackCuts->SetMaxChi2PerClusterTPC(4); | |
43 | trackCuts->SetAcceptKinkDaughters(kFALSE); | |
44 | trackCuts->SetRequireTPCRefit(kTRUE); | |
45 | // ITS | |
46 | trackCuts->SetRequireITSRefit(kTRUE); | |
47 | ||
48 | trackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01"); | |
49 | trackCuts->SetMaxDCAToVertexZ(2); | |
50 | trackCuts->SetDCAToVertex2D(kFALSE); | |
51 | trackCuts->SetRequireSigmaToVertex(kFALSE); | |
52 | ||
53 | trackCuts->SetEtaRange(-0.9,0.9); | |
54 | trackCuts->SetPtRange(0.15, 1e10); | |
55 | } | |
71e77a79 | 56 | //Set track cuts for TPConly tracks |
36c36a0c | 57 | if(trackType==1 || trackType==2) { |
b4691ee7 | 58 | trackCuts = trackCuts->GetStandardTPCOnlyTrackCuts(); |
59 | trackCuts->SetMinNClustersTPC(70); | |
60 | } | |
9b58297c | 61 | trackCuts->SetEtaRange(-0.9,0.9); |
62 | trackCuts->SetPtRange(0.15, 1e10); | |
fdceab34 | 63 | |
34fc6450 | 64 | AliESDtrackCuts *trackCutsITS = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts with SPD or SDD"); |
36c36a0c | 65 | //Cuts SPD || SDD |
66 | // TPC | |
67 | trackCutsITS->SetMinNClustersTPC(70); | |
68 | trackCutsITS->SetMaxChi2PerClusterTPC(4); | |
69 | trackCutsITS->SetAcceptKinkDaughters(kFALSE); | |
70 | trackCutsITS->SetRequireTPCRefit(kTRUE); | |
71 | // ITS | |
72 | trackCutsITS->SetRequireITSRefit(kTRUE); | |
73 | trackCutsITS->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone); | |
74 | trackCutsITS->SetClusterRequirementITS(AliESDtrackCuts::kSDD, AliESDtrackCuts::kFirst); | |
75 | ||
76 | trackCutsITS->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01"); | |
77 | trackCutsITS->SetMaxDCAToVertexZ(2); | |
78 | trackCutsITS->SetDCAToVertex2D(kFALSE); | |
79 | trackCutsITS->SetRequireSigmaToVertex(kFALSE); | |
80 | ||
ee4390de | 81 | trackCutsITS->SetEtaRange(-0.9,0.9); |
82 | trackCutsITS->SetPtRange(0.15, 1e10); | |
83 | trackCutsITS->SetRequireITSRefit(kTRUE); | |
fdceab34 | 84 | |
85 | //Create the task | |
71e77a79 | 86 | AliPWG4HighPtQAMC *taskPWG4QAMC = new AliPWG4HighPtQAMC(Form("AliPWG4HighPtQAMC%d",trackType)); |
fdceab34 | 87 | taskPWG4QAMC->SetCuts(trackCuts); |
88 | taskPWG4QAMC->SetCutsITS(trackCutsITS); | |
71e77a79 | 89 | taskPWG4QAMC->SetTrackType(trackType); |
b4691ee7 | 90 | |
b1cd0099 | 91 | if(!strcmp(prodType, "LHC10e14") || !strcmp(prodType, "PbPb")) taskPWG4QAMC->SetPtMax(500.); |
92 | else taskPWG4QAMC->SetPtMax(100.); | |
fdceab34 | 93 | |
94 | // E. Create ONLY the output containers for the data produced by the task. | |
95 | // Get and connect other common input/output containers via the manager as below | |
96 | //============================================================================== | |
97 | ||
98 | //------ input data ------ | |
99 | // AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
100 | printf("Create output containers \n"); | |
101 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
71e77a79 | 102 | outputfile += Form(":PWG4_HighPtQAMC%d",trackType); |
103 | ||
b4691ee7 | 104 | AliAnalysisDataContainer *cout_hist1 = mgr->CreateContainer(Form("qa_histsMC%d",trackType), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile); |
71e77a79 | 105 | AliAnalysisDataContainer *cout_hist2 = mgr->CreateContainer(Form("qa_histsMCITS%d",trackType), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile); |
fdceab34 | 106 | |
107 | mgr->AddTask(taskPWG4QAMC); | |
108 | mgr->ConnectInput(taskPWG4QAMC,0,mgr->GetCommonInputContainer()); | |
b4691ee7 | 109 | mgr->ConnectOutput(taskPWG4QAMC,0,cout_hist1); |
fdceab34 | 110 | mgr->ConnectOutput(taskPWG4QAMC,1,cout_hist2); |
111 | ||
b4691ee7 | 112 | // Return task pointer at the end |
fdceab34 | 113 | return taskPWG4QAMC; |
114 | } |