3 #include <AliRDHFCutsLctoV0.h>
4 #include <AliAODPidHF.h>
5 #include <TClonesArray.h>
6 #include <TParameter.h>
11 //Set hard coded commentet with //set this!!
12 // root[] .L makeInput...C++
13 // root[] makeInputAliAnalysisTaskSE...()
14 //similar macros for D mesons as well as for Lc->3prongs
16 //Author: Annalisa De Caro - decaro@sa.infn.it
19 //macro to make a .root file which contains an AliRDHFCutsLctoV0 for AliAnalysisTaskSELc2pK0S task
21 void makeInputAliAnalysisTaskSELctoV0bachelor(){
23 AliRDHFCutsLctoV0* RDHFLctoV0Prod=new AliRDHFCutsLctoV0();
24 RDHFLctoV0Prod->SetName("LctoV0ProductionCuts");
25 RDHFLctoV0Prod->SetTitle("Production cuts for Lc analysis");
26 AliESDtrackCuts* esdTrackCutsProd=new AliESDtrackCuts();
27 RDHFLctoV0Prod->AddTrackCuts(esdTrackCutsProd);
28 RDHFLctoV0Prod->AddTrackCutsV0daughters(esdTrackCutsProd);
29 RDHFLctoV0Prod->SetPidSelectionFlag(2); // 0 -> TOF AND TPC
30 // 1 -> if (TOF) TOF else TPC w veto
31 // 2 -> if (p<1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else (p>=2.5) {if (TOF) -2s<TOF<3s AND TPC@3s}
32 // 3 -> if (p<1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else if (2.5<=p<3) {if (TOF) -2s<TOF<3s AND TPC@3s} else (p>=3) {if (TOF) -2s<TOF<3s AND -3s<TPC<2s}
34 AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
35 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
37 esdTrackCuts->SetRequireTPCRefit(kTRUE);
38 esdTrackCuts->SetRequireITSRefit(kTRUE);
39 esdTrackCuts->SetMinNClustersITS(0);//(4); // default is 5
40 esdTrackCuts->SetMinNClustersTPC(70);
41 //esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
42 // AliESDtrackCuts::kAny);
43 // default is kBoth, otherwise kAny
44 esdTrackCuts->SetMinDCAToVertexXY(0.);
45 esdTrackCuts->SetPtRange(0.3,1.e10);
46 esdTrackCuts->SetEtaRange(-0.8,0.8);
47 esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
51 AliESDtrackCuts* esdTrackCutsV0daughters=new AliESDtrackCuts();
52 esdTrackCutsV0daughters->SetRequireSigmaToVertex(kFALSE);
54 esdTrackCutsV0daughters->SetRequireTPCRefit(kTRUE);
55 esdTrackCutsV0daughters->SetRequireITSRefit(kFALSE);//kTRUE);
56 esdTrackCutsV0daughters->SetMinNClustersITS(0);//(4); // default is 5
57 esdTrackCutsV0daughters->SetMinNClustersTPC(70);
58 //esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
59 // AliESDtrackCuts::kAny);
60 // default is kBoth, otherwise kAny
61 esdTrackCutsV0daughters->SetMinDCAToVertexXY(0.);
62 esdTrackCutsV0daughters->SetPtRange(0.,1.e10);
63 esdTrackCutsV0daughters->SetEtaRange(-0.8,0.8);
64 esdTrackCutsV0daughters->SetAcceptKinkDaughters(kFALSE);
68 AliRDHFCutsLctoV0* RDHFLctoV0An=new AliRDHFCutsLctoV0();
69 RDHFLctoV0An->SetName("LctoV0AnalysisCuts");
70 RDHFLctoV0An->SetTitle("Analysis cuts for Lc analysis");
71 RDHFLctoV0An->AddTrackCuts(esdTrackCuts);
72 RDHFLctoV0An->AddTrackCutsV0daughters(esdTrackCutsV0daughters);
73 RDHFLctoV0An->SetPidSelectionFlag(2); // 0 -> TOF AND TPC
74 // 1 -> if (TOF) TOF else TPC w veto
75 // 2 -> if (p>1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else (p>=2.5) {if (TOF) -2s<TOF<3s AND TPC@3s}
76 // 3 -> if (p>1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else if (2.5<=p<3) {if (TOF) -2s<TOF<3s AND TPC@3s} else (p>=3) {if (TOF) -2s<TOF<3s AND -3s<TPC<2s}
78 const Int_t nptbins=9;
80 ptbins=new Float_t[nptbins+1];
91 RDHFLctoV0Prod->SetPtBins(nptbins+1,ptbins);
92 RDHFLctoV0An->SetPtBins(nptbins+1,ptbins);
96 Float_t** prodcutsval;
97 prodcutsval=new Float_t*[nvars];
98 for(Int_t ic=0;ic<nvars;ic++){prodcutsval[ic]=new Float_t[nptbins];}
99 for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
100 prodcutsval[0][ipt2]=1.; // inv. mass if K0S [GeV/c2]
101 prodcutsval[1][ipt2]=1.; // inv. mass if Lambda [GeV/c2]
102 prodcutsval[2][ipt2]=0.05; // inv. mass V0 if K0S [GeV/c2]
103 prodcutsval[3][ipt2]=0.05; // inv. mass V0 if Lambda [GeV/c2]
104 prodcutsval[4][ipt2]=0.3; // pT min bachelor track [GeV/c] // AOD by construction
105 prodcutsval[5][ipt2]=0.; // pT min V0-positive track [GeV/c]
106 prodcutsval[6][ipt2]=0.; // pT min V0-negative track [GeV/c]
107 prodcutsval[7][ipt2]=1000.; // dca cascade cut [cm]
108 prodcutsval[8][ipt2]=1000.; // dca V0 cut [nSigma] // it's 1.5 x offline V0s
109 prodcutsval[9][ipt2]=-1.; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
110 prodcutsval[10][ipt2]=3.; // d0 max bachelor wrt PV [cm]
111 prodcutsval[11][ipt2]=1000.;// d0 max V0 wrt PV [cm]
112 prodcutsval[12][ipt2]=0.; // mass K0S veto [GeV/c2]
113 prodcutsval[13][ipt2]=0.; // mass Lambda/LambdaBar veto [GeV/c2]
114 prodcutsval[14][ipt2]=0.; // mass Gamma veto [GeV/c2]
115 prodcutsval[15][ipt2]=0.; // pT min V0 track [GeV/c]
116 prodcutsval[16][ipt2]=0.; // V0 type cut
120 RDHFLctoV0Prod->SetCuts(nvars,nptbins,prodcutsval);
122 Float_t** anacutsval;
123 anacutsval=new Float_t*[nvars];
124 for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
125 for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
126 anacutsval[0][ipt2]=0.25; // inv. mass if K0S [GeV/c2]
127 anacutsval[1][ipt2]=0.25; // inv. mass if Lambda [GeV/c2]
128 anacutsval[2][ipt2]=0.0075; // inv. mass V0 if K0S [GeV/c2]
129 anacutsval[3][ipt2]=0.0030; // inv. mass V0 if Lambda [GeV/c2]
130 anacutsval[4][ipt2]=0.4; // pT min bachelor track [GeV/c] // AOD by construction
131 anacutsval[5][ipt2]=0.2; // pT min V0-positive track [GeV/c]
132 anacutsval[6][ipt2]=0.2; // pT min V0-negative track [GeV/c]
133 anacutsval[7][ipt2]=1000.; // dca cascade cut [cm]
134 anacutsval[8][ipt2]=1.5; // dca V0 cut [nSigma] // it's 1.5 x offline V0s
135 anacutsval[9][ipt2]=0.99; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
136 anacutsval[10][ipt2]=0.05; // d0 max bachelor wrt PV [cm]
137 anacutsval[11][ipt2]=0.1; // d0 max V0 wrt PV [cm]
138 anacutsval[12][ipt2]=0.; // mass K0S veto [GeV/c2]
139 anacutsval[13][ipt2]=0.005; // mass Lambda/LambdaBar veto [GeV/c2]
140 anacutsval[14][ipt2]=0.100; // mass Gamma veto [GeV/c2]
141 anacutsval[16][ipt2]=0.; // V0 type cut
144 anacutsval[15][0]=0.0; // pT min V0 track [GeV/c]
145 anacutsval[15][1]=0.6; // pT min V0 track [GeV/c]
146 anacutsval[15][2]=0.8; // pT min V0 track [GeV/c]
147 anacutsval[15][3]=0.8; // pT min V0 track [GeV/c]
148 anacutsval[15][4]=0.8; // pT min V0 track [GeV/c]
149 anacutsval[15][5]=1.0; // pT min V0 track [GeV/c]
150 anacutsval[15][6]=1.0; // pT min V0 track [GeV/c]
151 anacutsval[15][7]=1.0; // pT min V0 track [GeV/c]
152 anacutsval[15][8]=0.0; // pT min V0 track [GeV/c]
153 anacutsval[15][9]=0.0; // pT min V0 track [GeV/c]
156 RDHFLctoV0An->SetCuts(nvars,nptbins,anacutsval);
159 //RDHFLc->SetRecoKF(); //set this if you want to recompute the secondary vertex with the KF package
162 //1. bachelor: default one
163 AliAODPidHF* pidObjBachelor = new AliAODPidHF();
164 Double_t sigmasBac[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
165 pidObjBachelor->SetSigma(sigmasBac);
166 pidObjBachelor->SetAsym(kFALSE);
167 pidObjBachelor->SetMatch(1);
168 pidObjBachelor->SetTPC(kTRUE);
169 pidObjBachelor->SetTOF(kTRUE);
170 pidObjBachelor->SetTOFdecide(kFALSE);
172 RDHFLctoV0An->SetPidHF(pidObjBachelor);
173 RDHFLctoV0Prod->SetPidHF(pidObjBachelor);
176 AliAODPidHF* pidObjV0pos = new AliAODPidHF();
177 Double_t sigmasV0pos[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
178 pidObjV0pos->SetSigma(sigmasV0pos);
179 pidObjV0pos->SetAsym(kFALSE);
180 pidObjV0pos->SetMatch(1);
181 pidObjV0pos->SetTPC(kTRUE);
182 pidObjV0pos->SetTOF(kTRUE);
183 pidObjV0pos->SetTOFdecide(kFALSE);
185 RDHFLctoV0An->SetPidV0pos(pidObjV0pos);
186 RDHFLctoV0Prod->SetPidV0pos(pidObjV0pos);
189 AliAODPidHF* pidObjV0neg = new AliAODPidHF();
190 Double_t sigmasV0neg[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
191 pidObjV0neg->SetSigma(sigmasV0neg);
192 pidObjV0neg->SetAsym(kFALSE);
193 pidObjV0neg->SetMatch(1);
194 pidObjV0neg->SetTPC(kTRUE);
195 pidObjV0neg->SetTOF(kTRUE);
196 pidObjV0neg->SetTOFdecide(kFALSE);
198 RDHFLctoV0An->SetPidV0neg(pidObjV0neg);
199 RDHFLctoV0Prod->SetPidV0neg(pidObjV0neg);
202 // uncomment these lines for Baysian PID:
203 // Double_t threshold=0.3;
204 // SetupCombinedPID(RDHFLctoV0An ,threshold);
205 // RDHFLctoV0An ->SetPIDStrategy(AliRDHFCutsLctoV0::kCombined);
209 //uncomment these lines to apply cuts with the KF package
210 //RDHFLctoV0An->SetCutsStrategy(AliRDHFCutsLctoV0::kKF);
211 //for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
212 // anacutsval[0]=1.; //if <0., no topological constraint
213 // anacutsval[1]=2.; //cut on the Chi2/Ndf
216 Bool_t pidflag=kTRUE;
217 RDHFLctoV0An->SetUsePID(pidflag);
218 RDHFLctoV0Prod->SetUsePID(kFALSE);
219 if(pidflag) cout<<"PID is used"<<endl;
220 else cout<<"PID is not used"<<endl;
222 cout<<"This is the object I'm going to save:"<<endl;
223 RDHFLctoV0Prod->PrintAll();
224 cout<<"This is the object I'm going to save:"<<endl;
225 RDHFLctoV0An->PrintAll();
226 TFile* fout=new TFile("Lc2pK0SCuts.root","RECREATE");
228 RDHFLctoV0Prod->Write();
229 RDHFLctoV0An->Write();
233 delete pidObjBachelor;
236 delete RDHFLctoV0Prod;
242 //macro to make a .root file (for significance maximization) which contains an AliRDHFCutsLctoV0 with loose set of cuts and TParameter with the tighest value of these cuts
244 void makeInputAliAnalysisTaskSESignificanceMaximization(){
246 AliRDHFCutsLctoV0* RDHFLctoV0=new AliRDHFCutsLctoV0();
247 RDHFLctoV0->SetName("loosercuts");
248 RDHFLctoV0->SetTitle("Cuts for significance maximization");
250 AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
251 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
253 esdTrackCuts->SetRequireTPCRefit(kTRUE);
254 esdTrackCuts->SetMinNClustersTPC(70);
255 esdTrackCuts->SetRequireITSRefit(kFALSE);
256 esdTrackCuts->SetMinNClustersITS(0);
257 //esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
258 esdTrackCuts->SetMinDCAToVertexXY(0.);
259 //esdTrackCuts->SetEtaRange(-0.8,0.8);
260 esdTrackCuts->SetPtRange(0.3,1.e10);
262 AliESDtrackCuts* esdTrackCutsV0daughters=new AliESDtrackCuts();
263 esdTrackCutsV0daughters->SetRequireSigmaToVertex(kFALSE);
265 esdTrackCutsV0daughters->SetRequireTPCRefit(kTRUE);
266 esdTrackCutsV0daughters->SetMinNClustersTPC(70);
267 esdTrackCutsV0daughters->SetRequireITSRefit(kFALSE);
268 esdTrackCutsV0daughters->SetMinNClustersITS(0);
269 //esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny); // default is kBoth, otherwise kAny
270 esdTrackCutsV0daughters->SetMinDCAToVertexXY(0.);
271 esdTrackCutsV0daughters->SetPtRange(0.,1.e10);
273 RDHFLctoV0->AddTrackCuts(esdTrackCuts);
275 RDHFLctoV0->AddTrackCutsV0daughters(esdTrackCutsV0daughters);
277 RDHFLctoV0->SetPidSelectionFlag(2); // 0 -> TOF AND TPC
278 // 1 -> if (TOF) TOF else TPC w veto
279 // 2 -> if (p>1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else (p>=2.5) {if (TOF) -2s<TOF<3s AND TPC@3s}
280 // 3 -> if (p>1) TPC@3s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else if (2.5<=p<3) {if (TOF) -2s<TOF<3s AND TPC@3s} else (p>=3) {if (TOF) -2s<TOF<3s AND -3s<TPC<2s}
282 const Int_t nvars=14;
284 const Int_t nptbins=9;
286 ptbins=new Float_t[nptbins+1];
297 RDHFLctoV0->SetPtBins(nptbins+1,ptbins);
299 Float_t** rdcutsvalmine;
300 rdcutsvalmine=new Float_t*[nvars];
301 for(Int_t iv=0;iv<nvars;iv++){
302 rdcutsvalmine[iv]=new Float_t[nptbins];
305 //setting my cut values
306 // inv. mass if K0s [GeV]
307 // inv. mass if Lambda [GeV]
308 // inv. mass V0 if K0S [GeV]
309 // inv. mass V0 if Lambda [GeV]
310 // pT min bachelor track [GeV/c]
311 // pT min V0-positive track [GeV/c]
312 // pT min V0-negative track [GeV/c]
313 // dca cascade cut (cm)
314 // dca V0 cut (nSigmas)
316 // d0 max bachelor wrt PV [cm]
317 // d0 max V0 wrt PV [cm]
318 // mass K0S veto [GeV/c2]
319 // mass Lambda/LambdaBar veto [GeV/c2]
320 // mass Gamma veto [GeV/c2]
321 // pT min V0 track [GeV/c]
322 Float_t **cutsMatrixLctoV0Stand = new Float_t*[nvars];
323 for(Int_t ic=0;ic<nvars;ic++)
324 cutsMatrixLctoV0Stand[ic]=new Float_t[nptbins];
325 for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
326 cutsMatrixLctoV0Stand[0][ipt2] =0.0075;
327 cutsMatrixLctoV0Stand[1][ipt2] =0.0030;
328 cutsMatrixLctoV0Stand[2][ipt2] =0.4;
329 cutsMatrixLctoV0Stand[3][ipt2] =0.2;
330 cutsMatrixLctoV0Stand[4][ipt2] =0.2;
331 cutsMatrixLctoV0Stand[5][ipt2] =1000.;
332 cutsMatrixLctoV0Stand[6][ipt2] =1.5;
333 cutsMatrixLctoV0Stand[7][ipt2] =0.99;
334 cutsMatrixLctoV0Stand[8][ipt2] =0.05;
335 cutsMatrixLctoV0Stand[9][ipt2] =0.1;
336 cutsMatrixLctoV0Stand[10][ipt2] =0.0;
337 cutsMatrixLctoV0Stand[11][ipt2] =0.005;
338 cutsMatrixLctoV0Stand[12][ipt2] =0.100;
340 cutsMatrixLctoV0Stand[0][13]=0.0; // pT min V0 track [GeV/c]
341 cutsMatrixLctoV0Stand[1][13]=0.6; // pT min V0 track [GeV/c]
342 cutsMatrixLctoV0Stand[2][13]=0.8; // pT min V0 track [GeV/c]
343 cutsMatrixLctoV0Stand[3][13]=0.8; // pT min V0 track [GeV/c]
344 cutsMatrixLctoV0Stand[4][13]=0.8; // pT min V0 track [GeV/c]
345 cutsMatrixLctoV0Stand[5][13]=1.0; // pT min V0 track [GeV/c]
346 cutsMatrixLctoV0Stand[6][13]=1.0; // pT min V0 track [GeV/c]
347 cutsMatrixLctoV0Stand[7][13]=1.0; // pT min V0 track [GeV/c]
348 cutsMatrixLctoV0Stand[8][13]=0.0; // pT min V0 track [GeV/c]
349 cutsMatrixLctoV0Stand[9][13]=0.0; // pT min V0 track [GeV/c]
352 //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
353 Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
354 for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
355 for (Int_t ibin=0;ibin<nptbins;ibin++){
356 for (Int_t ivar=0; ivar<nvars; ivar++){
357 cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixLctoV0Stand[ibin][ivar];
360 RDHFLctoV0->SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
363 Int_t nvarsforopt=RDHFLctoV0->GetNVarsForOpt();
364 Int_t dim=14; //set this!!
366 boolforopt=new Bool_t[nvars];
368 cout<<"Number of variables for optimization has probably changed, check and edit accordingly"<<endl;
371 if(dim==nvarsforopt){
372 boolforopt=RDHFLctoV0->GetVarsForOpt();
375 names=new TString[nvars];
378 names=RDHFLctoV0->GetVarNames();
379 for(Int_t i=0;i<nvars;i++){
380 cout<<names[i]<<" for opt? (y/n)"<<endl;
386 else boolforopt[i]=kFALSE;
388 if (checktrue!=dim) {
389 cout<<"Error! You set "<<checktrue<<" kTRUE instead of "<<dim<<endl;
392 RDHFLctoV0->SetVarsForOpt(dim,boolforopt);
397 Float_t tighterval[dim][nptbins];
398 // 0(2): inv. mass V0 if K0S [GeV]
399 // 1(3): inv. mass V0 if Lambda [GeV]
400 // 2(4): pT min bachelor track [GeV/c]
401 // 3(5): pT min V0-positive track [GeV/c]
402 // 4(6): pT min V0-negative track [GeV/c]
403 // 5(7): dca cascade cut (cm)
404 // 6(8): dca V0 cut (nSigmas)
405 // 7(9): cosPA V0 cut
406 // 8(10): d0 max bachelor wrt PV [cm]
407 // 9(11): d0 max V0 wrt PV [cm]
408 // 10(12): mass K0S veto [GeV/c2]
409 // 11(13): mass Lambda/LambdaBar veto [GeV/c2]
410 // 12(14): mass Gamma veto [GeV/c2]
411 // 13(15): pT min V0 track [GeV/c]
413 // number of steps for each variable is set in the AddTask arguments (default=8)
415 for(Int_t ipt=0;ipt<nptbins;ipt++){
416 tighterval[0][ipt] =0.075; // inv. mass V0 if K0S [GeV]
417 tighterval[1][ipt] =0.040; // inv. mass V0 if Lambda [GeV]
418 tighterval[2][ipt] =0.4; // pT min bachelor track [GeV/c]
419 tighterval[3][ipt] =0.2; // pT min V0-positive track [GeV/c]
420 tighterval[4][ipt] =0.2; // pT min V0-negative track [GeV/c]
421 tighterval[5][ipt] =100.; // dca cascade cut (cm)
422 tighterval[6][ipt] =1.5; // dca v0 cut
423 tighterval[7][ipt] =0.99; // cosPA v0 cut
424 tighterval[8][ipt] =0.05; // d0 max bachelor wrt PV [cm]
425 tighterval[9][ipt] =0.1; // d0 max V0 wrt PV [cm]
426 tighterval[10][ipt] =0.0; // mass K0S veto [GeV/c2]
427 tighterval[11][ipt] =0.005; // mass Lambda/LambdaBar veto [GeV/c2]
428 tighterval[12][ipt] =0.100; // mass Gamma veto [GeV/c2]
430 tighterval[0][13]=0.0; // pT min V0 track [GeV/c]
431 tighterval[1][13]=0.6; // pT min V0 track [GeV/c]
432 tighterval[2][13]=0.8; // pT min V0 track [GeV/c]
433 tighterval[3][13]=0.8; // pT min V0 track [GeV/c]
434 tighterval[4][13]=0.8; // pT min V0 track [GeV/c]
435 tighterval[5][13]=1.0; // pT min V0 track [GeV/c]
436 tighterval[6][13]=1.0; // pT min V0 track [GeV/c]
437 tighterval[7][13]=1.0; // pT min V0 track [GeV/c]
438 tighterval[8][13]=0.0; // pT min V0 track [GeV/c]
439 tighterval[9][13]=0.0; // pT min V0 track [GeV/c]
442 Int_t arrdim=dim*nptbins;
443 cout<<"Will save "<<arrdim<<" TParameter<float>"<<endl;
444 TClonesArray max("TParameter<float>",arrdim);
445 for(Int_t ival=0;ival<dim;ival++){
446 for(Int_t jpt=0;jpt<nptbins;jpt++){
447 name=Form("par%dptbin%d",ival,jpt);
448 cout<<"Setting "<<name.Data()<<" to "<<tighterval[ival][jpt]<<endl;
449 new(max[jpt*dim+ival])TParameter<float>(name.Data(),tighterval[ival][jpt]);
453 Bool_t flagPID=kFALSE;
454 RDHFLctoV0->SetUsePID(flagPID);
456 RDHFLctoV0->PrintAll();
457 printf("Use PID? %s\n",flagPID ? "yes" : "no");
460 //1. bachelor: default one
461 AliAODPidHF* pidObjBachelor = new AliAODPidHF();
462 Double_t sigmasBac[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
463 pidObjBachelor->SetSigma(sigmasBac);
464 pidObjBachelor->SetAsym(kFALSE);
465 pidObjBachelor->SetMatch(1);
466 pidObjBachelor->SetTPC(kTRUE);
467 pidObjBachelor->SetTOF(kTRUE);
468 pidObjBachelor->SetTOFdecide(kFALSE);
469 RDHFLctoV0->SetPidHF(pidObjBachelor);
472 AliAODPidHF* pidObjV0pos = new AliAODPidHF();
473 Double_t sigmasV0pos[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
474 pidObjV0pos->SetSigma(sigmasV0pos);
475 pidObjV0pos->SetAsym(kFALSE);
476 pidObjV0pos->SetMatch(1);
477 pidObjV0pos->SetTPC(kTRUE);
478 pidObjV0pos->SetTOF(kTRUE);
479 pidObjV0pos->SetTOFdecide(kFALSE);
480 RDHFLctoV0->SetPidV0pos(pidObjV0pos);
483 AliAODPidHF* pidObjV0neg = new AliAODPidHF();
484 Double_t sigmasV0neg[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
485 pidObjV0neg->SetSigma(sigmasV0neg);
486 pidObjV0neg->SetAsym(kFALSE);
487 pidObjV0neg->SetMatch(1);
488 pidObjV0neg->SetTPC(kTRUE);
489 pidObjV0neg->SetTOF(kTRUE);
490 pidObjV0neg->SetTOFdecide(kFALSE);
491 RDHFLctoV0->SetPidV0neg(pidObjV0neg);
493 //activate pileup rejection (for pp)
494 //RDHFLctoV0->SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
496 //Do not recalculate the vertex
497 RDHFLctoV0->SetRemoveDaughtersFromPrim(kFALSE); //activate for pp
500 //centrality selection (Pb-Pb)
501 Float_t minc=20,maxc=80;
502 RDHFLctoV0->SetMinCentrality(minc);
503 RDHFLctoV0->SetMaxCentrality(maxc);
504 cent=Form("%.0f%.0f",minc,maxc);
505 //RDHFLctoV0->SetUseCentrality(AliRDHFCuts::kCentV0M); //kCentOff,kCentV0M,kCentTRK,kCentTKL,kCentCL1,kCentInvalid
506 RDHFLctoV0->SetUseCentrality(AliRDHFCuts::kCentOff); //kCentOff,kCentV0M,kCentTRK,kCentTKL,kCentCL1,kCentInvalid
509 //RDHFLctoV0->SetFixRefs();
511 TFile* fout=new TFile(Form("cuts4SignifMaxim%s%s%sRecVtx%sPileupRej.root",
512 RDHFLctoV0->GetUseCentrality()==0 ? "pp" : "PbPb",
514 RDHFLctoV0->GetIsPrimaryWithoutDaughters() ? "" : "No",
515 RDHFLctoV0->GetOptPileUp() ? "" : "No"),"recreate"); //set this!!