]>
Commit | Line | Data |
---|---|---|
221dc8d3 | 1 | #ifndef __CINT__ |
2 | #endif | |
c87dfd4f | 3 | Int_t AddRsnDaughterCutsLambdaNsigma(AliPID::EParticleType type1,AliPID::EParticleType type2,TString opt,AliRsnInputHandler *rsnIH=0,AliAnalysisTaskSE *task=0) |
221dc8d3 | 4 | { |
5 | ||
6 | if (!rsnIH) return 0; | |
7 | ||
8 | Bool_t valid = kTRUE; | |
c87dfd4f | 9 | // Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid); |
221dc8d3 | 10 | Int_t useCommonQualityCut = AliRsnTrainManager::GetGlobalInt("RsnCommonQualityCut",valid); |
c87dfd4f | 11 | TString rsnQualityCut = AliRsnTrainManager::GetGlobalStr("RsnQualityCut",valid); |
12 | Int_t isMC = AliRsnTrainManager::GetGlobalInt("IsMC",valid); | |
13 | Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid); | |
14 | Int_t isMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid); | |
221dc8d3 | 15 | |
16 | // === USER HAS TO SET CORRECT NUMBER OF CUTS SETS ===== | |
17 | Int_t numberOfCuts = 2; | |
18 | ||
19 | //--------------------------------------------- | |
20 | // Define single cutsP | |
21 | //--------------------------------------------- | |
22 | ||
23 | Printf("AddRsnDaughterCutsLambda Option : %s",opt.Data()); | |
24 | ||
25 | Double_t nSigmaTPC_P=3.0; | |
26 | Double_t nSigmaTPC_K=3.0; | |
27 | Double_t nSigmaTOF_P=3.0; | |
28 | Double_t nSigmaTOF_K=3.0; | |
29 | Double_t etaRange=0.8; | |
3b2f3caf | 30 | Double_t PtMin_P=0.15; |
31 | Double_t PtMax_P=1.e10; | |
32 | Double_t PtMin_K=0.15; | |
33 | Double_t PtMax_K=1.e10; | |
34 | Double_t PMax_P=1.1; | |
35 | Double_t PMax_K=0.6; | |
221dc8d3 | 36 | |
37 | Bool_t useTPC_P=kFALSE; | |
38 | Bool_t useTOF_P=kFALSE; | |
3b2f3caf | 39 | Bool_t rejectUnmatchedTOF_P=kTRUE; |
221dc8d3 | 40 | Bool_t useTPC_K=kFALSE; |
41 | Bool_t useTOF_K=kFALSE; | |
3b2f3caf | 42 | Bool_t rejectUnmatchedTOF_K=kTRUE; |
221dc8d3 | 43 | |
44 | if (opt.Contains("qualityonly")) { | |
45 | useTPC_P=kFALSE; | |
46 | useTOF_P=kFALSE; | |
47 | useTPC_K=kFALSE; | |
48 | useTOF_K=kFALSE; | |
49 | } else if (!opt.Contains("nsig")) { | |
50 | useTPC_P=kTRUE; | |
51 | useTOF_P=kTRUE; | |
52 | useTPC_K=kTRUE; | |
53 | useTOF_K=kTRUE; | |
54 | } | |
55 | ||
c68dec87 | 56 | if (opt.Contains("PTPCnsig")) useTPC_P=kTRUE; |
57 | if (opt.Contains("PTPCnsig10")) nSigmaTPC_P = 1.0; | |
58 | if (opt.Contains("PTPCnsig15")) nSigmaTPC_P = 1.5; | |
59 | if (opt.Contains("PTPCnsig20")) nSigmaTPC_P = 2.0; | |
60 | if (opt.Contains("PTPCnsig25")) nSigmaTPC_P = 2.5; | |
61 | if (opt.Contains("PTPCnsig30")) nSigmaTPC_P = 3.0; | |
62 | if (opt.Contains("PTPCnsig40")) nSigmaTPC_P = 4.0; | |
63 | if (opt.Contains("PTPCnsig50")) nSigmaTPC_P = 5.0; | |
64 | if (opt.Contains("PTPCnsig1000")) nSigmaTPC_P = 100.0; | |
65 | ||
66 | if (opt.Contains("KTPCnsig")) useTPC_K=kTRUE; | |
67 | if (opt.Contains("KTPCnsig10")) nSigmaTPC_K = 1.0; | |
68 | if (opt.Contains("KTPCnsig15")) nSigmaTPC_K = 1.5; | |
69 | if (opt.Contains("KTPCnsig20")) nSigmaTPC_K = 2.0; | |
70 | if (opt.Contains("KTPCnsig25")) nSigmaTPC_K = 2.5; | |
71 | if (opt.Contains("KTPCnsig30")) nSigmaTPC_K = 3.0; | |
72 | if (opt.Contains("KTPCnsig40")) nSigmaTPC_K = 4.0; | |
73 | if (opt.Contains("KTPCnsig50")) nSigmaTPC_K = 5.0; | |
74 | if (opt.Contains("KTPCnsig1000")) nSigmaTPC_K = 100.0; | |
75 | ||
76 | if (opt.Contains("PTOFnsig")) useTOF_P=kTRUE; | |
3b2f3caf | 77 | if (opt.Contains("PTOFacceptUnmatched")) rejectUnmatchedTOF_P=kFALSE; |
c68dec87 | 78 | if (opt.Contains("PTOFnsig10")) nSigmaTOF_P = 1.0; |
79 | if (opt.Contains("PTOFnsig15")) nSigmaTOF_P = 1.5; | |
80 | if (opt.Contains("PTOFnsig20")) nSigmaTOF_P = 2.0; | |
81 | if (opt.Contains("PTOFnsig25")) nSigmaTOF_P = 2.5; | |
82 | if (opt.Contains("PTOFnsig30")) nSigmaTOF_P = 3.0; | |
83 | if (opt.Contains("PTOFnsig40")) nSigmaTOF_P = 4.0; | |
84 | if (opt.Contains("PTOFnsig50")) nSigmaTOF_P = 5.0; | |
85 | if (opt.Contains("PTOFnsig1000")) nSigmaTOF_P = 100.0; | |
86 | ||
87 | if (opt.Contains("KTOFnsig")) useTOF_K=kTRUE; | |
3b2f3caf | 88 | if (opt.Contains("KTOFacceptUnmatched")) rejectUnmatchedTOF_K=kFALSE; |
c68dec87 | 89 | if (opt.Contains("KTOFnsig10")) nSigmaTOF_K = 1.0; |
90 | if (opt.Contains("KTOFnsig15")) nSigmaTOF_K = 1.5; | |
91 | if (opt.Contains("KTOFnsig20")) nSigmaTOF_K = 2.0; | |
92 | if (opt.Contains("KTOFnsig25")) nSigmaTOF_K = 2.5; | |
93 | if (opt.Contains("KTOFnsig30")) nSigmaTOF_K = 3.0; | |
94 | if (opt.Contains("KTOFnsig40")) nSigmaTOF_K = 4.0; | |
95 | if (opt.Contains("KTOFnsig50")) nSigmaTOF_K = 5.0; | |
96 | if (opt.Contains("KTOFnsig1000")) nSigmaTOF_K = 100.0; | |
221dc8d3 | 97 | |
98 | ||
99 | Bool_t usePDG=kFALSE; | |
100 | if (opt.Contains("pdg")) { | |
101 | Printf("Using PDG"); | |
102 | usePDG = kTRUE; | |
103 | } | |
104 | ||
105 | Bool_t useEta = kFALSE; | |
106 | if (opt.Contains("eta")) { | |
3b2f3caf | 107 | for(int j=1;j<=9;j++) if(opt.Contains(Form("eta0%i",j))) etaRange=0.1*j; |
108 | ||
221dc8d3 | 109 | Printf("Using ETA range (%.2f,%.2f)",-etaRange,etaRange); |
110 | useEta = kTRUE; | |
111 | } | |
112 | ||
3b2f3caf | 113 | Bool_t usePPt=kFALSE; |
114 | if(opt.Contains("PPt")){ | |
115 | Printf("Using Proton pT range (%.2f,%.2f)",PtMin_P,PtMax_P); | |
116 | usePPt=kTRUE; | |
117 | } | |
118 | ||
119 | Bool_t useKPt=kFALSE; | |
120 | if(opt.Contains("KPt")){ | |
121 | Printf("Using Kaon pT range (%.2f,%.2f)",PtMin_K,PtMax_K); | |
122 | useKPt=kTRUE; | |
123 | } | |
124 | ||
125 | Bool_t usePMax_P=kFALSE; | |
126 | if(opt.Contains("PPMax")){ | |
127 | for(int j=1;j<=9;j++) if(opt.Contains(Form("PPMax0%i",j))) PMax_P=0.1*j; | |
128 | for(int j=10;j<=30;j++) if(opt.Contains(Form("PPMax%i",j))) PMax_P=0.1*j; | |
129 | Printf("Using Proton momentum range (0,%.2f)",PMax_P); | |
130 | usePMax_P=kTRUE; | |
131 | } | |
132 | ||
133 | Bool_t usePMax_K=kFALSE; | |
134 | if(opt.Contains("KPMax")){ | |
135 | for(int j=1;j<=9;j++) if(opt.Contains(Form("KPMax0%i",j))) PMax_K=0.1*j; | |
136 | for(int j=10;j<=30;j++) if(opt.Contains(Form("KPMax%i",j))) PMax_K=0.1*j; | |
137 | Printf("Using Kaon momentum range (0,%.2f)",PMax_K); | |
138 | usePMax_K=kTRUE; | |
139 | } | |
140 | ||
221dc8d3 | 141 | // PROTON SETTINGS =========================================== |
142 | ||
143 | TString scheme=""; | |
144 | TString cutname = "p_Lambda"; | |
145 | if (!opt.IsNull()) cutname += Form("_%s",opt.Data()); | |
146 | AliRsnCutSet *cutsP = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter); | |
147 | ||
3b2f3caf | 148 | AliRsnCutTrackQuality *qualityCutP = new AliRsnCutTrackQuality("cutQualityP"); |
221dc8d3 | 149 | if (useCommonQualityCut>=0) { |
150 | qualityCutP->SetAODTestFilterBit(useCommonQualityCut); | |
151 | } else { | |
152 | qualityCutP->SetDefaults2010(); | |
153 | } | |
154 | cutsP->AddCut(qualityCutP); | |
155 | if (!scheme.IsNull()) scheme += "&"; | |
156 | scheme += qualityCutP->GetName(); | |
157 | ||
158 | if (useTPC_P) { | |
159 | AliRsnCutPIDNSigma *cutPTPC = new AliRsnCutPIDNSigma("cutNSigmaTPCP",AliPID::kProton,AliRsnCutPIDNSigma::kTPC); | |
160 | cutPTPC->SinglePIDRange(nSigmaTPC_P); | |
161 | cutsP->AddCut(cutPTPC); | |
162 | if (!scheme.IsNull()) scheme += "&"; | |
163 | scheme += cutPTPC->GetName(); | |
164 | } | |
165 | ||
166 | if (useTOF_P) { | |
167 | AliRsnCutPIDNSigma *cutPTOF = new AliRsnCutPIDNSigma("cutNSigmaTOFP",AliPID::kProton,AliRsnCutPIDNSigma::kTOF); | |
168 | cutPTOF->SinglePIDRange(nSigmaTOF_P); | |
169 | cutsP->AddCut(cutPTOF); | |
3b2f3caf | 170 | if(rejectUnmatchedTOF_P){ |
171 | if (!scheme.IsNull()) scheme += "&"; | |
172 | scheme += cutPTOF->GetName(); | |
173 | }else{ | |
174 | AliRsnCutTOFMatch *cutPTOFMatch = new AliRsnCutTOFMatch("cutPTOFMatch"); | |
175 | cutsP->AddCut(cutPTOFMatch); | |
176 | if (!scheme.IsNull()) scheme += "&"; | |
177 | scheme += Form("(%s|(!%s))",cutPTOF->GetName(),cutPTOFMatch->GetName()); | |
178 | } | |
221dc8d3 | 179 | } |
180 | ||
181 | if (useEta) { | |
182 | AliRsnValueDaughter *valEtaP = new AliRsnValueDaughter(Form("val%sETA%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kEta); | |
183 | AliRsnCutValue *cutEtaP = new AliRsnCutValue(Form("cut%sETA%s",AliPID::ParticleName(type1),opt.Data()),-etaRange,etaRange); | |
184 | cutEtaP->SetTargetType(AliRsnTarget::kDaughter); | |
185 | cutEtaP->SetValueObj(valEtaP); | |
186 | cutsP->AddCut(cutEtaP); | |
187 | if (!scheme.IsNull()) scheme += "&"; | |
188 | scheme += cutEtaP->GetName(); | |
189 | } | |
190 | if (usePDG) { | |
191 | AliRsnCutPID *cutPDGP = new AliRsnCutPID(Form("cut%sPDG%s",AliPID::ParticleName(type1),opt.Data()),type1,0.0,kTRUE); | |
192 | cutsP->AddCut(cutPDGP); | |
193 | if (!scheme.IsNull()) scheme += "&"; | |
194 | scheme += cutPDGP->GetName(); | |
195 | } | |
196 | ||
3b2f3caf | 197 | if(usePPt){ |
198 | AliRsnValueDaughter *valPtP = new AliRsnValueDaughter(Form("val%sPt%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kPt); | |
199 | AliRsnCutValue *cutPtP = new AliRsnCutValue(Form("cut%sPt%s",AliPID::ParticleName(type1),opt.Data()),PtMin_P,PtMax_P); | |
200 | cutPtP->SetTargetType(AliRsnTarget::kDaughter); | |
201 | cutPtP->SetValueObj(valPtP); | |
202 | cutsP->AddCut(cutPtP); | |
203 | if (!scheme.IsNull()) scheme += "&"; | |
204 | scheme += cutPtP->GetName(); | |
205 | } | |
206 | ||
207 | if(usePMax_P){ | |
208 | AliRsnValueDaughter *valPP = new AliRsnValueDaughter(Form("val%sP%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kP); | |
209 | AliRsnCutValue *cutPP = new AliRsnCutValue(Form("cut%sP%s",AliPID::ParticleName(type1),opt.Data()),0.,PMax_P); | |
210 | cutPP->SetTargetType(AliRsnTarget::kDaughter); | |
211 | cutPP->SetValueObj(valPP); | |
212 | cutsP->AddCut(cutPP); | |
213 | if (!scheme.IsNull()) scheme += "&"; | |
214 | scheme += cutPP->GetName(); | |
215 | } | |
216 | ||
221dc8d3 | 217 | Printf ("CUT Scheme for PROTON is '%s'",scheme.Data()); |
218 | cutsP->SetCutScheme(scheme.Data()); | |
219 | ||
220 | // END PROTON ======================================= | |
221 | ||
222 | // KAON SETTINGS ======================================= | |
223 | scheme=""; | |
224 | cutname = "K_Lambda"; | |
225 | if (!opt.IsNull()) cutname += Form("_%s",opt.Data()); | |
226 | AliRsnCutSet *cutsK = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter); | |
227 | ||
3b2f3caf | 228 | AliRsnCutTrackQuality *qualityCutK = new AliRsnCutTrackQuality("cutQualityK"); |
221dc8d3 | 229 | if (useCommonQualityCut>=0) { |
230 | qualityCutK->SetAODTestFilterBit(useCommonQualityCut); | |
231 | } else { | |
232 | qualityCutK->SetDefaults2010(); | |
233 | } | |
234 | cutsK->AddCut(qualityCutK); | |
235 | if (!scheme.IsNull()) scheme += "&"; | |
236 | scheme += qualityCutK->GetName(); | |
237 | ||
238 | ||
239 | if (useTPC_K) { | |
240 | AliRsnCutPIDNSigma *cutKTPC = new AliRsnCutPIDNSigma("cutNSigmaTPCK",AliPID::kKaon,AliRsnCutPIDNSigma::kTPC); | |
241 | cutKTPC->SinglePIDRange(nSigmaTPC_K); | |
242 | cutsK->AddCut(cutKTPC); | |
243 | if (!scheme.IsNull()) scheme += "&"; | |
244 | scheme += cutKTPC->GetName(); | |
245 | } | |
246 | ||
247 | if (useTOF_K) { | |
248 | AliRsnCutPIDNSigma *cutKTOF = new AliRsnCutPIDNSigma("cutNSigmaTOFK",AliPID::kKaon,AliRsnCutPIDNSigma::kTOF); | |
249 | cutKTOF->SinglePIDRange(nSigmaTOF_K); | |
250 | cutsK->AddCut(cutKTOF); | |
3b2f3caf | 251 | if(rejectUnmatchedTOF_K){ |
252 | if (!scheme.IsNull()) scheme += "&"; | |
253 | scheme += cutKTOF->GetName(); | |
254 | }else{ | |
255 | AliRsnCutTOFMatch *cutKTOFMatch = new AliRsnCutTOFMatch("cutKTOFMatch"); | |
256 | cutsK->AddCut(cutKTOFMatch); | |
257 | if (!scheme.IsNull()) scheme += "&"; | |
258 | scheme += Form("(%s|(!%s))",cutKTOF->GetName(),cutKTOFMatch->GetName()); | |
259 | } | |
221dc8d3 | 260 | } |
e22320ab | 261 | |
221dc8d3 | 262 | if (useEta) { |
263 | AliRsnValueDaughter *valEtaK = new AliRsnValueDaughter(Form("val%sETA%s",AliPID::ParticleName(type2),opt.Data()),AliRsnValueDaughter::kEta); | |
264 | AliRsnCutValue *cutEtaK = new AliRsnCutValue(Form("cut%sETA%s",AliPID::ParticleName(type2),opt.Data()),-etaRange,etaRange); | |
265 | cutEtaK->SetTargetType(AliRsnTarget::kDaughter); | |
266 | cutEtaK->SetValueObj(valEtaK); | |
267 | cutsK->AddCut(cutEtaK); | |
268 | if (!scheme.IsNull()) scheme += "&"; | |
269 | scheme += cutEtaK->GetName(); | |
270 | } | |
271 | if (usePDG) { | |
272 | AliRsnCutPID *cutPDGK = new AliRsnCutPID(Form("cut%sPDG%s",AliPID::ParticleName(type2),opt.Data()),type2,0.0,kTRUE); | |
273 | cutsK->AddCut(cutPDGK); | |
274 | if (!scheme.IsNull()) scheme += "&"; | |
275 | scheme += cutPDGK->GetName(); | |
276 | } | |
277 | ||
3b2f3caf | 278 | if(useKPt){ |
279 | AliRsnValueDaughter *valPtK = new AliRsnValueDaughter(Form("val%sPt%s",AliPID::ParticleName(type2),opt.Data()),AliRsnValueDaughter::kPt); | |
280 | AliRsnCutValue *cutPtK = new AliRsnCutValue(Form("cut%sPt%s",AliPID::ParticleName(type2),opt.Data()),PtMin_K,PtMax_K); | |
281 | cutPtK->SetTargetType(AliRsnTarget::kDaughter); | |
282 | cutPtK->SetValueObj(valPtK); | |
283 | cutsK->AddCut(cutPtK); | |
284 | if (!scheme.IsNull()) scheme += "&"; | |
285 | scheme += cutPtK->GetName(); | |
286 | } | |
287 | ||
288 | if(usePMax_K){ | |
289 | AliRsnValueDaughter *valPK = new AliRsnValueDaughter(Form("val%sP%s",AliPID::ParticleName(type2),opt.Data()),AliRsnValueDaughter::kP); | |
290 | AliRsnCutValue *cutPK = new AliRsnCutValue(Form("cut%sP%s",AliPID::ParticleName(type2),opt.Data()),0.,PMax_K); | |
291 | cutPK->SetTargetType(AliRsnTarget::kDaughter); | |
292 | cutPK->SetValueObj(valPK); | |
293 | cutsK->AddCut(cutPK); | |
294 | if (!scheme.IsNull()) scheme += "&"; | |
295 | scheme += cutPK->GetName(); | |
296 | } | |
297 | ||
221dc8d3 | 298 | Printf ("CUT Scheme for KAON is '%s'",scheme.Data()); |
299 | cutsK->SetCutScheme(scheme.Data()); | |
300 | ||
301 | // END KAON ======================================= | |
302 | ||
303 | if (opt.Contains("mon")) { | |
304 | AddMonitorOutput(cutsP->GetMonitorOutput(),opt); | |
305 | AddMonitorOutput(cutsK->GetMonitorOutput(),opt); | |
306 | } | |
307 | if (isRsnMini) { | |
308 | AliRsnMiniAnalysisTask *taskRsnMini = dynamic_cast<AliRsnMiniAnalysisTask *>(task); | |
309 | if (taskRsnMini) { | |
310 | taskRsnMini->AddTrackCuts(cutsP); | |
311 | taskRsnMini->AddTrackCuts(cutsK); | |
312 | } | |
313 | } else { | |
314 | AliRsnDaughterSelector *sel = rsnIH->GetSelector(); | |
315 | // sel->SetLabelCheck(kFALSE); | |
316 | sel->Add(cutsP, kTRUE); | |
317 | sel->Add(cutsK, kTRUE); | |
318 | } | |
319 | return numberOfCuts; | |
320 | ||
321 | } |