]>
Commit | Line | Data |
---|---|---|
fdceab34 | 1 | //DEFINITION OF A FEW CONSTANTS |
2 | const Double_t ptmin = 2.0 ; | |
3 | const Double_t ptmax = 100.0 ; | |
4 | ||
5 | const Int_t mintrackrefsTPC = 1; | |
6 | const Int_t mintrackrefsITS = 1; | |
7 | const Int_t charge = 1 ; | |
8 | ||
9 | AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra()//<some_parameters>) | |
10 | { | |
11 | // Creates a proton analysis task and adds it to the analysis manager. | |
12 | ||
13 | // A. Get the pointer to the existing analysis manager via the static access method. | |
14 | //============================================================================== | |
15 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
16 | if (!mgr) { | |
17 | Error("AddTaskPWG4HighPtSpectra", "No analysis manager to connect to."); | |
18 | return NULL; | |
19 | } | |
20 | ||
21 | // B. Check the analysis type using the event handlers connected to the analysis | |
22 | // manager. The availability of MC handler can also be checked here. | |
23 | //============================================================================== | |
24 | if (!mgr->GetInputEventHandler()) { | |
25 | ::Error("AddTaskHighPtSpectra", "This task requires an input event handler"); | |
26 | return NULL; | |
27 | } | |
28 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
29 | const char *analysisType = "ESD";//"TPC" | |
30 | ||
31 | // C. Create the task, add it to manager. | |
32 | //=========================================================================== | |
33 | //CONTAINER DEFINITION | |
34 | Info("AliPWG4HighPtSpectra","SETUP CONTAINER"); | |
35 | //the sensitive variables, their indices | |
36 | UInt_t ipt = 0; | |
37 | //Setting up the container grid... | |
38 | UInt_t nstep = 5 ; //Steps/Modes for containers | |
39 | Int_t kStepReconstructed = 0; | |
40 | Int_t kStepReconstructedTPCOnly = 1; | |
41 | Int_t kStepSecondaries = 2; | |
42 | Int_t kStepMCtrackable = 3; | |
43 | Int_t kStepReconstructedMC = 4; | |
44 | ||
45 | const Int_t nvar = 1; //number of variables on the grid:pt | |
46 | const Int_t nbin1 = 98; //bins in pt 98 | |
47 | ||
48 | //arrays for the number of bins in each dimension | |
49 | Int_t iBin[nvar]; | |
50 | iBin[0]=nbin1; | |
51 | ||
52 | //arrays for lower bounds : | |
53 | Double_t *binLim1=new Double_t[nbin1+1]; | |
54 | ||
55 | //values for bin lower bounds | |
56 | for(Int_t i=0; i<=nbin1; i++) binLim1[i]=(Double_t)ptmin + (ptmax-ptmin)/nbin1*(Double_t)i ; | |
57 | ||
58 | //one "container" for MC | |
59 | AliCFContainer* container = new AliCFContainer("container","container for tracks",nstep,nvar,iBin); | |
60 | //setting the bin limits | |
61 | container -> SetBinLimits(ipt,binLim1); | |
62 | ||
63 | //CREATE THE CUTS ----------------------------------------------- | |
64 | //Use AliESDtrackCuts | |
65 | AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts"); | |
66 | //Standard Cuts | |
67 | trackCuts->SetAcceptKinkDaughters(kFALSE);// | |
68 | trackCuts->SetRequireTPCRefit(kTRUE);// | |
69 | trackCuts->SetEtaRange(-0.9,0.9);//-0.5,0.5);// | |
70 | trackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);// | |
71 | trackCuts->SetPtRange(0.15, 1e10);// | |
72 | trackCuts->SetMinNClustersTPC(50);// | |
73 | trackCuts->SetMaxChi2PerClusterTPC(3.5);// | |
74 | trackCuts->SetRequireITSRefit(kTRUE); | |
75 | trackCuts->SetMaxDCAToVertexXY(2.4); | |
76 | trackCuts->SetMaxDCAToVertexZ(3.2); | |
77 | trackCuts->SetDCAToVertex2D(kTRUE); | |
78 | ||
79 | // Gen-Level kinematic cuts | |
80 | AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts"); | |
81 | mcKineCuts->SetPtRange(0.15,1e10); | |
82 | mcKineCuts->SetRapidityRange(-0.9,0.9);//-0.5,0.5); | |
83 | mcKineCuts->SetRequireIsCharged(kTRUE); | |
84 | ||
85 | //Acceptance Cuts | |
86 | AliCFAcceptanceCuts *mcAccCuts = new AliCFAcceptanceCuts("mcAccCuts","MC acceptance cuts"); | |
87 | // mcAccCuts->SetMinNHitITS(mintrackrefsITS); | |
88 | mcAccCuts->SetMinNHitTPC(mintrackrefsTPC); | |
89 | ||
90 | TObjArray* recList = new TObjArray(0); | |
91 | TObjArray* recMCList = new TObjArray(0); | |
92 | TObjArray* recTPConlyList = new TObjArray(0); | |
93 | TObjArray* secList = new TObjArray(0) ; | |
94 | ||
95 | printf("CREATE MC KINE CUTS\n"); | |
96 | TObjArray* mcList = new TObjArray(0) ; | |
97 | mcList->AddLast(mcKineCuts); | |
98 | mcList->AddLast(mcAccCuts); | |
99 | ||
100 | //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK | |
101 | printf("CREATE INTERFACE AND CUTS\n"); | |
102 | AliCFManager* man = new AliCFManager() ; | |
103 | man->SetParticleContainer(container); | |
104 | man->SetParticleCutsList(0,recList); | |
105 | man->SetParticleCutsList(1,recTPConlyList); | |
106 | man->SetParticleCutsList(2,secList); | |
107 | man->SetParticleCutsList(3,mcList); | |
108 | man->SetParticleCutsList(4,recMCList); | |
109 | ||
110 | ||
111 | AliPWG4HighPtSpectra *taskPWG4HighPtSpectra = new AliPWG4HighPtSpectra("taskPWG4HighPtSpectra"); | |
112 | taskPWG4HighPtSpectra->SetCuts(trackCuts); | |
113 | taskPWG4HighPtSpectra->SetCFManager(man); //here is set the CF manager | |
114 | ||
115 | // E. Create ONLY the output containers for the data produced by the task. | |
116 | // Get and connect other common input/output containers via the manager as below | |
117 | //============================================================================== | |
118 | ||
119 | //------ input data ------ | |
120 | // AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
121 | // char *outputfile = "outputAliPWG4HighPtSpectraTestTrain.root"; | |
122 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
123 | outputfile += ":PWG4_HighPtSpectra"; | |
124 | AliAnalysisDataContainer *coutput0 = mgr->CreateContainer("chist0", TList::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
125 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("ccontainer0", AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
126 | ||
127 | mgr->AddTask(taskPWG4HighPtSpectra); | |
128 | ||
129 | mgr->ConnectInput(taskPWG4HighPtSpectra,0,mgr->GetCommonInputContainer()); | |
130 | mgr->ConnectOutput(taskPWG4HighPtSpectra,0,coutput0); | |
131 | mgr->ConnectOutput(taskPWG4HighPtSpectra,1,coutput1); | |
132 | ||
133 | // Return task pointer at the end | |
134 | return taskPWG4HighPtSpectra; | |
135 | } |