]>
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" | |
24 | const char *analysisType = "ESD";//"TPC" | |
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 |
b4691ee7 | 34 | if(trackType==0) trackCuts = trackCuts->GetStandardITSTPCTrackCuts2010(kTRUE);//Primary Track Selection |
71e77a79 | 35 | //Set track cuts for TPConly tracks |
b4691ee7 | 36 | if(trackType==1) { |
37 | trackCuts = trackCuts->GetStandardTPCOnlyTrackCuts(); | |
38 | trackCuts->SetMinNClustersTPC(70); | |
39 | } | |
9b58297c | 40 | trackCuts->SetEtaRange(-0.9,0.9); |
41 | trackCuts->SetPtRange(0.15, 1e10); | |
fdceab34 | 42 | |
43 | AliESDtrackCuts *trackCutsITS = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts with ITSrefit"); | |
9b58297c | 44 | //Standard Cuts |
b4691ee7 | 45 | trackCutsITS=trackCuts->GetStandardITSTPCTrackCuts2010(kTRUE);//Primary Track Selection |
ee4390de | 46 | trackCutsITS->SetEtaRange(-0.9,0.9); |
47 | trackCutsITS->SetPtRange(0.15, 1e10); | |
48 | trackCutsITS->SetRequireITSRefit(kTRUE); | |
fdceab34 | 49 | |
50 | //Create the task | |
71e77a79 | 51 | AliPWG4HighPtQAMC *taskPWG4QAMC = new AliPWG4HighPtQAMC(Form("AliPWG4HighPtQAMC%d",trackType)); |
fdceab34 | 52 | taskPWG4QAMC->SetCuts(trackCuts); |
53 | taskPWG4QAMC->SetCutsITS(trackCutsITS); | |
71e77a79 | 54 | taskPWG4QAMC->SetTrackType(trackType); |
b4691ee7 | 55 | |
b1cd0099 | 56 | if(!strcmp(prodType, "LHC10e14") || !strcmp(prodType, "PbPb")) taskPWG4QAMC->SetPtMax(500.); |
57 | else taskPWG4QAMC->SetPtMax(100.); | |
fdceab34 | 58 | |
59 | // E. Create ONLY the output containers for the data produced by the task. | |
60 | // Get and connect other common input/output containers via the manager as below | |
61 | //============================================================================== | |
62 | ||
63 | //------ input data ------ | |
64 | // AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
65 | printf("Create output containers \n"); | |
66 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
71e77a79 | 67 | outputfile += Form(":PWG4_HighPtQAMC%d",trackType); |
68 | ||
b4691ee7 | 69 | AliAnalysisDataContainer *cout_hist1 = mgr->CreateContainer(Form("qa_histsMC%d",trackType), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile); |
71e77a79 | 70 | AliAnalysisDataContainer *cout_hist2 = mgr->CreateContainer(Form("qa_histsMCITS%d",trackType), TList::Class(), AliAnalysisManager::kOutputContainer,outputfile); |
fdceab34 | 71 | |
72 | mgr->AddTask(taskPWG4QAMC); | |
73 | mgr->ConnectInput(taskPWG4QAMC,0,mgr->GetCommonInputContainer()); | |
b4691ee7 | 74 | mgr->ConnectOutput(taskPWG4QAMC,0,cout_hist1); |
fdceab34 | 75 | mgr->ConnectOutput(taskPWG4QAMC,1,cout_hist2); |
76 | ||
b4691ee7 | 77 | // Return task pointer at the end |
fdceab34 | 78 | return taskPWG4QAMC; |
79 | } |