]>
Commit | Line | Data |
---|---|---|
5f071dcf | 1 | /* ************************************************************************* |
2 | * AliEbyE Analysis for Particle Ratio Fluctuation * | |
3 | * Deepika Rathee | Satyajit Jena * | |
4 | * drathee@cern.ch | sjena@cern.ch * | |
5 | * Date: Wed Jul 9 18:38:30 CEST 2014 * | |
6 | * New approch to find particle ratio to reduce memory * | |
7 | * (Test Only) * | |
8 | ***************************************************************************/ | |
9 | ||
10 | AliAnalysisTask *AddEbyEPidRatioTaskV2(const Char_t *name = "NuDyn", // 0 | |
11 | Int_t isModeDist = 1, // 1 | |
12 | Int_t isModeEff = 0, // 2 | |
13 | Bool_t isModeDCA = 0, // 3 | |
14 | Bool_t isModeQA = 0, // 4 | |
15 | Int_t isRatio = 3, // 5 | |
16 | Bool_t isModeAOD = 0, // 6 | |
17 | Bool_t isSetExt = 0, // 7 | |
18 | Int_t aodFilterBit = 1024, // 8 | |
19 | Float_t gEta = 0.8, // 9 | |
20 | Int_t modeCuts = 0, // 10 | |
21 | Int_t modePID =-1, // 11 | |
22 | Float_t gMinPt = 0.3, // 12 | |
23 | Float_t gMaxPt = 2.5, // 13 | |
24 | Float_t gMinPtForTof = 0.21, // 14 | |
25 | Float_t gMaxPtForTPClow = 0.69, // 15 | |
26 | Float_t gMinPtEff = 0.3, // 16 | |
27 | Float_t gMaxPtEff = 2.5, // 17 | |
28 | Float_t gSigmaITS = 4.0, // 18 | |
29 | Float_t gSigmaTOF = 4.0, // 19 | |
30 | Float_t gSigmaTPC = 4.0, // 20 | |
31 | Float_t gSigmaTPClow = 3.0, | |
32 | Bool_t isPer = 0, | |
33 | Int_t nSub = 25) { // 21 | |
34 | ||
35 | TString sName(name); | |
36 | ||
37 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
38 | if (!mgr) { | |
39 | Error("AddTaskNetParticle", "No analysis manager found."); | |
40 | return NULL; | |
41 | } | |
42 | ||
43 | Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL); | |
44 | if (isMC) | |
45 | Info("AddTaskNetParticle", "This task has MC."); | |
46 | ||
47 | AliEbyEPidRatioTask *task = new AliEbyEPidRatioTask("EbyEPidRatio"); | |
48 | if (!task) { | |
49 | Error("EbyEPidRatio", "Task could not be created."); | |
50 | return NULL; | |
51 | } | |
52 | ||
53 | if (isMC) | |
54 | task->SetIsMC(); | |
55 | if (isModeEff == 1) { | |
56 | task->SetModeEffCreation(1); // => 1 = on | 0 = off (default) | |
57 | } else if (isModeEff == 2) { | |
58 | task->SetModeEffCreation(1); // => 1 = on | 0 = off (default) | |
59 | task->SetEffExtra(); // => 1 = on | 0 = off (default) | |
60 | } | |
61 | if (isModeDCA) | |
62 | task->SetModeDCACreation(1); // => 1 = on | 0 = off (default) | |
63 | ||
64 | if (isModeAOD) { | |
65 | task->SetIsAOD(1); // => 1 = AOD | 0 = ESD (default) | |
66 | task->SetTrackFilterBit(aodFilterBit); | |
67 | } | |
68 | if (isModeQA) | |
69 | task->SetModeQACreation(1); // => 1 = on | 0 = off (default) | |
70 | ||
71 | task->SetModeDistCreation(isModeDist); // 0 nothing, 1 only dist, 2, with qa | |
72 | task->SetIsRatio(isRatio); | |
73 | ||
74 | Float_t minPt, maxPt, minPtEff, maxPtEff, minPtForTOF; | |
75 | Float_t nSigmaITS, nSigmaTPC, nSigmaTPClow, nSigmaTOF, maxPtForTPClow; | |
76 | Float_t etaMax, etaMaxEff, maxRap; | |
77 | Int_t pidStrategy; | |
78 | ||
79 | minPtForTOF = 0.69; | |
80 | maxPtForTPClow = 0.69; | |
81 | minPt = 0.5; | |
82 | maxPt = 2.0; | |
83 | minPtEff = 0.3; | |
84 | maxPtEff = 2.5; | |
85 | ||
86 | maxRap = 0.5; | |
87 | etaMax = 0.8; | |
88 | ||
89 | etaMaxEff = 0.8; | |
90 | nSigmaITS = 4.0; | |
91 | nSigmaTPC = 4.0; | |
92 | nSigmaTPClow = 3.0; | |
93 | nSigmaTOF = 4.0; | |
94 | ||
95 | if (isSetExt) { | |
96 | minPt = gMinPt; | |
97 | maxPt = gMaxPt; | |
98 | minPtForTOF = gMinPtForTof; | |
99 | maxPtForTPClow = gMaxPtForTPClow; | |
100 | minPtEff = gMinPtEff; | |
101 | maxPtEff = gMaxPtEff; | |
102 | ||
103 | etaMax = gEta; | |
104 | ||
105 | nSigmaITS = gSigmaITS; | |
106 | nSigmaTPC = gSigmaTPC; | |
107 | nSigmaTPClow = gSigmaTPClow; | |
108 | nSigmaTOF = gSigmaTOF; | |
109 | } | |
110 | ||
111 | if (modePID == -1) { // default | |
112 | pidStrategy = 7; // 7: ITS + TPC + TOF (using minPtForTOF) | |
113 | if (modeCuts == 1) | |
114 | pidStrategy = 5; // 5: TPC + TOF (using minPtForTOF) | |
115 | } | |
116 | else | |
117 | pidStrategy = modePID; | |
118 | ||
119 | AliEbyEPidRatioHelper *helper = new AliEbyEPidRatioHelper; | |
120 | if (!helper) { | |
121 | Error("AddTaskNetParticle", "Helper could not be created."); | |
122 | delete task; | |
123 | return NULL; | |
124 | } | |
125 | ||
126 | ||
127 | task->SetESDTrackCutMode(modeCuts); // => 0 = normal | 1 = LF | |
128 | task->SetEtaMax(etaMax); // eta cut | |
129 | task->SetEtaMaxEff(etaMaxEff); // eta cut for efficiency | |
130 | task->SetPtRange(minPt, maxPt); // pt cut range for the analysis | |
131 | task->SetPtRangeEff(minPtEff, maxPtEff); // pt cut range for the correction / efficiency / contamination creation | |
132 | if (isPer) task->SetIsPer(); // | |
133 | ||
134 | helper->SetVertexZMax(10.); | |
135 | helper->SetCentralityBinMax(11); | |
136 | helper->SetRapidityMax(maxRap); | |
137 | helper->SetMinTrackLengthMC(70.); | |
138 | helper->SetNSigmaMaxCdd(0.); // 3. || ->> Turn off sigmaDCA cuts for now | |
139 | helper->SetNSigmaMaxCzz(0.); // 3. || ->> Turn off sigmaDCA cuts for now | |
140 | helper->SetPhiRange(0., 3.88); // Only used if requested in task - default is TwoPi | |
141 | helper->SetPIDStrategy(pidStrategy); | |
142 | helper->SetNSigmaMaxITS(nSigmaITS); | |
143 | helper->SetNSigmaMaxTPC(nSigmaTPC); | |
144 | helper->SetNSigmaMaxTPClow(nSigmaTPClow); | |
145 | helper->SetNSigmaMaxTOF(nSigmaTOF); | |
146 | helper->SetMinPtForTOFRequired(minPtForTOF); | |
147 | helper->SetMaxPtForTPClow(maxPtForTPClow); | |
148 | helper->SetNSubSamples(nSub); | |
149 | ||
150 | task->SetNetParticleHelper(helper); | |
151 | mgr->AddTask(task); | |
152 | ||
153 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
154 | TString outputFileName = Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name); | |
155 | TString outputQAFileName = Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name); | |
156 | ||
157 | AliAnalysisDataContainer *coutput = mgr->CreateContainer(name, TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName); | |
158 | AliAnalysisDataContainer *coutputEff = mgr->CreateContainer(Form("%s_eff", name), TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName); | |
159 | AliAnalysisDataContainer *coutputCont = mgr->CreateContainer(Form("%s_cont", name), TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName); | |
160 | AliAnalysisDataContainer *coutputDca = mgr->CreateContainer(Form("%s_dca", name), TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName); | |
161 | ||
162 | AliAnalysisDataContainer *coutputQA = mgr->CreateContainer(Form("%sQA", name), TList::Class(), AliAnalysisManager::kOutputContainer, outputQAFileName); | |
163 | ||
164 | mgr->ConnectInput (task, 0, cinput ); | |
165 | mgr->ConnectOutput (task, 1, coutput); | |
166 | mgr->ConnectOutput (task, 2, coutputEff); | |
167 | mgr->ConnectOutput (task, 3, coutputCont); | |
168 | mgr->ConnectOutput (task, 4, coutputDca); | |
169 | mgr->ConnectOutput (task, 5, coutputQA); | |
170 | ||
171 | return task; | |
172 | } |