AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
makeTFile4CutsLctoV0bachelor.C
Go to the documentation of this file.
1 #include <Riostream.h>
2 #include <TFile.h>
3 #include <AliRDHFCutsLctoV0.h>
4 #include <AliAODPidHF.h>
5 #include <TClonesArray.h>
6 #include <TParameter.h>
7 #include <TF1.h>
8 
9 
10 //Use:
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
15 
16 //Author: Annalisa De Caro - decaro@sa.infn.it
17 
18 
19 //macro to make a .root file which contains an AliRDHFCutsLctoV0 for AliAnalysisTaskSELc2pK0S task
20 
22 
23  AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
24  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
25  //default
26  esdTrackCuts->SetRequireTPCRefit(kTRUE);
27  esdTrackCuts->SetRequireITSRefit(kTRUE);
28  esdTrackCuts->SetMinNClustersITS(0);//(4); // default is 5
29  esdTrackCuts->SetMinNClustersTPC(70);
30  //esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
31  // AliESDtrackCuts::kAny);
32  // default is kBoth, otherwise kAny
33  esdTrackCuts->SetMinDCAToVertexXY(0.);
34  esdTrackCuts->SetPtRange(0.,1.e10);
35  esdTrackCuts->SetEtaRange(-0.8,0.8);
36  esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
37 
38 
39  AliESDtrackCuts* esdTrackCutsV0daughters=new AliESDtrackCuts();
40  esdTrackCutsV0daughters->SetRequireSigmaToVertex(kFALSE);
41  //default
42  esdTrackCutsV0daughters->SetRequireTPCRefit(kTRUE);
43  esdTrackCutsV0daughters->SetRequireITSRefit(kFALSE);//kTRUE);
44  esdTrackCutsV0daughters->SetMinNClustersITS(0);//(4); // default is 5
45  esdTrackCutsV0daughters->SetMinNClustersTPC(70);
46  //esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
47  // AliESDtrackCuts::kAny);
48  // default is kBoth, otherwise kAny
49  esdTrackCutsV0daughters->SetMinDCAToVertexXY(0.);
50  esdTrackCutsV0daughters->SetPtRange(0.,1.e10);
51  esdTrackCutsV0daughters->SetEtaRange(-0.8,0.8);
52  esdTrackCutsV0daughters->SetAcceptKinkDaughters(kFALSE);
53 
54  AliRDHFCutsLctoV0* RDHFLctoV0An=new AliRDHFCutsLctoV0();
55  RDHFLctoV0An->SetName("LctoV0AnalysisCuts");
56  RDHFLctoV0An->SetTitle("Analysis cuts for Lc analysis");
57  RDHFLctoV0An->SetKinkRejection(!esdTrackCuts->GetAcceptKinkDaughters());
58  RDHFLctoV0An->AddTrackCuts(esdTrackCuts);
59  RDHFLctoV0An->AddTrackCutsV0daughters(esdTrackCutsV0daughters);
60  RDHFLctoV0An->SetUseTrackSelectionWithFilterBits(kFALSE);//(kTRUE);
61  RDHFLctoV0An->SetLowPtCut(1.0); // default value 1.0 GeV/c
62  RDHFLctoV0An->SetHighPtCut(3.0); // default value 2.5 GeV/c
63  RDHFLctoV0An->SetPidSelectionFlag(4); // 0 -> TOF AND TPC
64  // 1 -> if (TOF) TOF else TPC w veto
65  // 2 -> if (p<1) TPC@2s 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}
66  // 3 -> if (p<1) TPC@2s else if (1<=p<2.5) {if (TOF) TOF@3s AND TPC@3s} else (p>=2.5) {if (TOF) -2s<TOF<3s AND -3s<TPC<2s}
67  // 4 -> if (p<1) TPC@2s else if (1<=p<2.5) {if (TOF) TOF@3s} else if (p>=2.5) {if (TOF) -2s<TOF<3s}
68  // 5 -> if (p<1) TPC@2s else if (1<=p<2.5) {if (TOF) TOF@3s} else if (p>=2.5) {if (TOF) -2s<TOF<3s else TPC@3s}
69  // 6 -> if (p<1) TPC@2s else if (1<=p<2.5) {if (TOF) TOF@3s} else if (p>=2.5) {if (TOF) -2s<TOF<3s else -3s<TPC<2s}
70  // 7 -> if (p<1) TPC@2s else if (1<=p<2.5) {if (TOF) TOF@3s else TPC@3s} else (p>=2.5) {if (TOF) -2s<TOF<3s else TPC@3s}
71  // 8 -> if (p<1) TPC@2s else if (1<=p<2.5) {if (TOF) TOF@3s else TPC@3s} else (p>=2.5) {if (TOF) -2s<TOF<3s else -2<TPC<3s}
72  // 9 -> combined: TOF, TPC
73  const Int_t nptbins=14;
74  RDHFLctoV0An->SetNPtBins(nptbins);
75 
76  Float_t* ptbins;
77  ptbins=new Float_t[nptbins+1];
78  ptbins[0]= 0.;
79  ptbins[1]= 1.;
80  ptbins[2]= 2.;
81  ptbins[3]= 3.;
82  ptbins[4]= 4.;
83  ptbins[5]= 5.;
84  ptbins[6]= 6.;
85  ptbins[7]= 7.;
86  ptbins[8]= 8.;
87  ptbins[9]= 9.;
88  ptbins[10]=10.;
89  ptbins[11]=12.;
90  ptbins[12]=17.;
91  ptbins[13]=25.;
92  ptbins[14]=35.;
93  RDHFLctoV0An->SetPtBins(nptbins+1,ptbins);
94 
95  const Int_t nvars=17;
96 
97  Float_t** anacutsval;
98  anacutsval=new Float_t*[nvars];
99  for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
100  for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
101  anacutsval[0][ipt2]=0.25; // inv. mass if K0S [GeV/c2]
102  anacutsval[1][ipt2]=0.25; // inv. mass if Lambda [GeV/c2]
103  anacutsval[3][ipt2]=0.05; // inv. mass V0 if Lambda [GeV/c2] ---> WE ARE SEARCHING Lc -> p+K0S, so cut on m(Lambda) has to be leave as it was at filtering level!!!
104  anacutsval[5][ipt2]=0.2; // pT min V0-positive track [GeV/c]
105  anacutsval[6][ipt2]=0.2; // pT min V0-negative track [GeV/c]
106  anacutsval[7][ipt2]=1000.; // dca cascade cut [cm]
107  anacutsval[8][ipt2]=1.5; // dca V0 cut [nSigma] // it's 1.5 x offline V0s
108  anacutsval[11][ipt2]=0.09; // d0 max V0 wrt PV [cm]
109  anacutsval[12][ipt2]=0.; // mass K0S veto [GeV/c2]
110  anacutsval[13][ipt2]=0.005; // mass Lambda/LambdaBar veto [GeV/c2]
111  anacutsval[14][ipt2]=0.300; // mass Gamma veto [GeV/c2]
112  anacutsval[16][ipt2]=0.; // V0 type cut
113  }
114 
115  anacutsval[2][0]=0.00346*2.; // inv. mass V0 if K0S [GeV/c2]
116  anacutsval[2][1]=0.00360*2.; // inv. mass V0 if K0S [GeV/c2]
117  anacutsval[2][2]=0.00385*2.; // inv. mass V0 if K0S [GeV/c2]
118  anacutsval[2][3]=0.00406*2.; // inv. mass V0 if K0S [GeV/c2]
119  anacutsval[2][4]=0.00429*2.; // inv. mass V0 if K0S [GeV/c2]
120  anacutsval[2][5]=0.00450*2.; // inv. mass V0 if K0S [GeV/c2]
121  anacutsval[2][6]=0.00450*2.; // inv. mass V0 if K0S [GeV/c2]
122  anacutsval[2][7]=0.00450*2.; // inv. mass V0 if K0S [GeV/c2]
123  anacutsval[2][8]=0.00520*2.; // inv. mass V0 if K0S [GeV/c2]
124  anacutsval[2][9]=0.00520*2.; // inv. mass V0 if K0S [GeV/c2]
125  anacutsval[2][10]=0.00520*2.;// inv. mass V0 if K0S [GeV/c2]
126  anacutsval[2][11]=0.00520*2.;// inv. mass V0 if K0S [GeV/c2]
127  anacutsval[2][12]=0.00520*2.;// inv. mass V0 if K0S [GeV/c2]
128  anacutsval[2][13]=0.00520*2.;// inv. mass V0 if K0S [GeV/c2]
129 
130  anacutsval[4][0]=0.6; // pT min bachelor track [GeV/c] // AOD by construction
131  anacutsval[4][1]=0.5; // pT min bachelor track [GeV/c] // AOD by construction
132  anacutsval[4][2]=0.6; // pT min bachelor track [GeV/c] // AOD by construction
133  anacutsval[4][3]=0.7; // pT min bachelor track [GeV/c] // AOD by construction
134  anacutsval[4][4]=0.8; // pT min bachelor track [GeV/c] // AOD by construction
135  anacutsval[4][5]=0.9; // pT min bachelor track [GeV/c] // AOD by construction
136  anacutsval[4][6]=1.0; // pT min bachelor track [GeV/c] // AOD by construction
137  anacutsval[4][7]=1.2; // pT min bachelor track [GeV/c] // AOD by construction
138  anacutsval[4][8]=1.4; // pT min bachelor track [GeV/c] // AOD by construction
139  anacutsval[4][9]=1.7; // pT min bachelor track [GeV/c] // AOD by construction
140  anacutsval[4][10]=2.0; // pT min bachelor track [GeV/c] // AOD by construction
141  anacutsval[4][11]=2.0; // pT min bachelor track [GeV/c] // AOD by construction
142  anacutsval[4][12]=2.0; // pT min bachelor track [GeV/c] // AOD by construction
143  anacutsval[4][13]=2.0; // pT min bachelor track [GeV/c] // AOD by construction
144 
145  anacutsval[9][0]=0.994; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
146  anacutsval[9][1]=0.994; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
147  anacutsval[9][2]=0.998; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
148  anacutsval[9][3]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
149  anacutsval[9][4]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
150  anacutsval[9][5]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
151  anacutsval[9][6]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
152  anacutsval[9][7]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
153  anacutsval[9][8]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
154  anacutsval[9][9]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
155  anacutsval[9][10]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
156  anacutsval[9][11]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
157  anacutsval[9][12]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
158  anacutsval[9][13]=0.999; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
159 
160  anacutsval[10][0]=0.05; // d0 max bachelor wrt PV [cm]
161  anacutsval[10][1]=0.04; // d0 max bachelor wrt PV [cm]
162  anacutsval[10][2]=0.03; // d0 max bachelor wrt PV [cm]
163  anacutsval[10][3]=0.05; // d0 max bachelor wrt PV [cm]
164  anacutsval[10][4]=0.05; // d0 max bachelor wrt PV [cm]
165  anacutsval[10][5]=0.02; // d0 max bachelor wrt PV [cm]
166  anacutsval[10][6]=0.02; // d0 max bachelor wrt PV [cm]
167  anacutsval[10][7]=0.02; // d0 max bachelor wrt PV [cm]
168  anacutsval[10][8]=0.02; // d0 max bachelor wrt PV [cm]
169  anacutsval[10][9]=0.02; // d0 max bachelor wrt PV [cm]
170  anacutsval[10][10]=0.02; // d0 max bachelor wrt PV [cm]
171  anacutsval[10][11]=0.02; // d0 max bachelor wrt PV [cm]
172  anacutsval[10][12]=0.02; // d0 max bachelor wrt PV [cm]
173  anacutsval[10][13]=0.02; // d0 max bachelor wrt PV [cm]
174 
175 
176  anacutsval[15][0]=0.5; // pT min V0 track [GeV/c]
177  anacutsval[15][1]=0.6; // pT min V0 track [GeV/c]
178  anacutsval[15][2]=0.7; // pT min V0 track [GeV/c]
179  anacutsval[15][3]=0.7; // pT min V0 track [GeV/c]
180  anacutsval[15][4]=0.8; // pT min V0 track [GeV/c]
181  anacutsval[15][5]=0.9; // pT min V0 track [GeV/c]
182  anacutsval[15][6]=1.0; // pT min V0 track [GeV/c]
183  anacutsval[15][7]=1.0; // pT min V0 track [GeV/c]
184  anacutsval[15][8]=1.2; // pT min V0 track [GeV/c]
185  anacutsval[15][9]=1.2; // pT min V0 track [GeV/c]
186  anacutsval[15][10]=1.2; // pT min V0 track [GeV/c]
187  anacutsval[15][11]=1.2; // pT min V0 track [GeV/c]
188  anacutsval[15][12]=1.2; // pT min V0 track [GeV/c]
189  anacutsval[15][13]=1.2; // pT min V0 track [GeV/c]
190 
191  RDHFLctoV0An->SetCuts(nvars,nptbins,anacutsval);
192 
193  if (RDHFLctoV0An->GetPidSelectionFlag()==9) {
194  Float_t minCombProb[nptbins];
195  for (Int_t iBin=0; iBin<nptbins; iBin++) minCombProb[iBin]=0.;
196  RDHFLctoV0An->SetMinCombinedProbability(nptbins,minCombProb);
197  }
198 
199  //pid settings
200  //1. bachelor: default one
201  AliAODPidHF* pidObjBachelor = new AliAODPidHF();
202  Double_t sigmasBac[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
203  pidObjBachelor->SetSigma(sigmasBac);
204  pidObjBachelor->SetAsym(kFALSE);
205  pidObjBachelor->SetMatch(1);
206  pidObjBachelor->SetTPC(kTRUE);
207  pidObjBachelor->SetTOF(kTRUE);
208  pidObjBachelor->SetTOFdecide(kFALSE);
209  if (RDHFLctoV0An->GetPidSelectionFlag()==9) {
210  pidObjBachelor->SetUseCombined();
211  pidObjBachelor->SetUseDefaultPriors(kTRUE);
212  pidObjBachelor->SetCombDetectors(AliAODPidHF::kTPCTOF);
213  }
214 
215  RDHFLctoV0An->SetPidHF(pidObjBachelor);
216 
217  // uncomment these lines for Baysian PID:
218  // Double_t threshold=0.3;
219  // SetupCombinedPID(RDHFLctoV0An ,threshold);
220  // RDHFLctoV0An ->SetPIDStrategy(AliRDHFCutsLctoV0::kCombined);
221  //
222 
223  //RDHFLc->SetRecoKF(); //set this if you want to recompute the secondary vertex with the KF package
224  //uncomment these lines to apply cuts with the KF package
225  //RDHFLctoV0An->SetCutsStrategy(AliRDHFCutsLctoV0::kKF);
226  //for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
227  // anacutsval[0]=1.; //if <0., no topological constraint
228  // anacutsval[1]=2.; //cut on the Chi2/Ndf
229  // }
230 
231  Bool_t pidflag=kTRUE;
232  RDHFLctoV0An->SetUsePID(pidflag);
233  if(pidflag) cout<<"PID is used"<<endl;
234  else cout<<"PID is not used"<<endl;
235 
236  cout<<"This is the (anal) object I'm going to save:"<<endl;
237  RDHFLctoV0An->PrintAll();
238  TFile* fout=new TFile("Lc2pK0SCuts.root","RECREATE");
239  fout->cd();
240  RDHFLctoV0An->Write();
241  fout->Close();
242  delete fout;
243 
244  delete pidObjBachelor;
245  //delete RDHFLctoV0An;
246 
247 }
248 
249 
250 //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
251 
253 
254  AliRDHFCutsLctoV0* RDHFLctoV0=new AliRDHFCutsLctoV0();
255  RDHFLctoV0->SetName("loosercuts");
256  RDHFLctoV0->SetTitle("Cuts for significance maximization");
257 
258  AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
259  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
260  //default
261  esdTrackCuts->SetRequireTPCRefit(kTRUE);
262  esdTrackCuts->SetMinNClustersTPC(70);
263  esdTrackCuts->SetRequireITSRefit(kFALSE);
264  esdTrackCuts->SetMinNClustersITS(0);
265  //esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
266  esdTrackCuts->SetMinDCAToVertexXY(0.);
267  esdTrackCuts->SetEtaRange(-0.8,0.8);
268  esdTrackCuts->SetPtRange(0.,1.e10);
269 
270  AliESDtrackCuts* esdTrackCutsV0daughters=new AliESDtrackCuts();
271  esdTrackCutsV0daughters->SetRequireSigmaToVertex(kFALSE);
272  //default
273  esdTrackCutsV0daughters->SetRequireTPCRefit(kTRUE);
274  esdTrackCutsV0daughters->SetMinNClustersTPC(70);
275  esdTrackCutsV0daughters->SetRequireITSRefit(kFALSE);
276  esdTrackCutsV0daughters->SetMinNClustersITS(0);
277  //esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny); // default is kBoth, otherwise kAny
278  esdTrackCutsV0daughters->SetMinDCAToVertexXY(0.);
279  esdTrackCutsV0daughters->SetPtRange(0.,1.e10);
280 
281  RDHFLctoV0->AddTrackCuts(esdTrackCuts);
282 
283  RDHFLctoV0->AddTrackCutsV0daughters(esdTrackCutsV0daughters);
284 
285  RDHFLctoV0->SetPidSelectionFlag(2); // 0 -> TOF AND TPC
286  // 1 -> if (TOF) TOF else TPC w veto
287  // 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}
288  // 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}
289 
290  const Int_t nvars=14;//17-3
291 
292  const Int_t nptbins=9;
293  Float_t* ptbins;
294  ptbins=new Float_t[nptbins+1];
295  ptbins[0]= 0.;
296  ptbins[1]= 1.;
297  ptbins[2]= 2.;
298  ptbins[3]= 3.;
299  ptbins[4]= 4.;
300  ptbins[5]= 5.;
301  ptbins[6]= 6.;
302  ptbins[7]= 8.;
303  ptbins[8]=12.;
304  ptbins[9]=99999999.;
305  RDHFLctoV0->SetPtBins(nptbins+1,ptbins);
306 
307  Float_t** rdcutsvalmine;
308  rdcutsvalmine=new Float_t*[nvars];
309  for(Int_t iv=0;iv<nvars;iv++){
310  rdcutsvalmine[iv]=new Float_t[nptbins];
311  }
312 
313  //setting my cut values
314  // inv. mass if K0s [GeV]
315  // inv. mass if Lambda [GeV]
316  // inv. mass V0 if K0S [GeV]
317  // inv. mass V0 if Lambda [GeV]
318  // pT min bachelor track [GeV/c]
319  // pT min V0-positive track [GeV/c]
320  // pT min V0-negative track [GeV/c]
321  // dca cascade cut (cm)
322  // dca V0 cut (nSigmas)
323  // cosPA V0 cut
324  // d0 max bachelor wrt PV [cm]
325  // d0 max V0 wrt PV [cm]
326  // mass K0S veto [GeV/c2]
327  // mass Lambda/LambdaBar veto [GeV/c2]
328  // mass Gamma veto [GeV/c2]
329  // pT min V0 track [GeV/c]
330  Float_t **cutsMatrixLctoV0Stand = new Float_t*[nvars];
331  for(Int_t ic=0;ic<nvars;ic++)
332  cutsMatrixLctoV0Stand[ic]=new Float_t[nptbins];
333  for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
334  cutsMatrixLctoV0Stand[0][ipt2] =0.0075;
335  cutsMatrixLctoV0Stand[1][ipt2] =0.0500;
336  cutsMatrixLctoV0Stand[2][ipt2] =0.4;
337  cutsMatrixLctoV0Stand[3][ipt2] =0.2;
338  cutsMatrixLctoV0Stand[4][ipt2] =0.2;
339  cutsMatrixLctoV0Stand[5][ipt2] =1000.;
340  cutsMatrixLctoV0Stand[6][ipt2] =1.5;
341  cutsMatrixLctoV0Stand[7][ipt2] =0.99;
342  cutsMatrixLctoV0Stand[8][ipt2] =0.05;
343  cutsMatrixLctoV0Stand[9][ipt2] =0.1;
344  cutsMatrixLctoV0Stand[10][ipt2] =0.0;
345  cutsMatrixLctoV0Stand[11][ipt2] =0.005;
346  cutsMatrixLctoV0Stand[12][ipt2] =0.100;
347  }
348  cutsMatrixLctoV0Stand[13][0]=0.0; // pT min V0 track [GeV/c]
349  cutsMatrixLctoV0Stand[13][1]=0.6; // pT min V0 track [GeV/c]
350  cutsMatrixLctoV0Stand[13][2]=0.8; // pT min V0 track [GeV/c]
351  cutsMatrixLctoV0Stand[13][3]=0.8; // pT min V0 track [GeV/c]
352  cutsMatrixLctoV0Stand[13][4]=0.8; // pT min V0 track [GeV/c]
353  cutsMatrixLctoV0Stand[13][5]=1.0; // pT min V0 track [GeV/c]
354  cutsMatrixLctoV0Stand[13][6]=1.0; // pT min V0 track [GeV/c]
355  cutsMatrixLctoV0Stand[13][7]=1.0; // pT min V0 track [GeV/c]
356  cutsMatrixLctoV0Stand[13][8]=0.0; // pT min V0 track [GeV/c]
357 
358 
359  //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
360  Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
361  for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
362  for (Int_t ibin=0;ibin<nptbins;ibin++){
363  for (Int_t ivar=0; ivar<nvars; ivar++){
364  cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixLctoV0Stand[ibin][ivar];
365  }
366  }
367  RDHFLctoV0->SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
368 
369 
370  Int_t nvarsforopt=RDHFLctoV0->GetNVarsForOpt();
371  Int_t dim=14; //set this!!
372  Bool_t *boolforopt;
373  boolforopt=new Bool_t[nvars];
374  if(dim>nvarsforopt){
375  cout<<"Number of variables for optimization has probably changed, check and edit accordingly"<<endl;
376  return;
377  } else {
378  if(dim==nvarsforopt){
379  boolforopt=RDHFLctoV0->GetVarsForOpt();
380  }else{
381  TString *names;
382  names=new TString[nvars];
383  TString answer="";
384  Int_t checktrue=0;
385  names=RDHFLctoV0->GetVarNames();
386  for(Int_t i=0;i<nvars;i++){
387  cout<<names[i]<<" for opt? (y/n)"<<endl;
388  cin>>answer;
389  if(answer=="y") {
390  boolforopt[i]=kTRUE;
391  checktrue++;
392  }
393  else boolforopt[i]=kFALSE;
394  }
395  if (checktrue!=dim) {
396  cout<<"Error! You set "<<checktrue<<" kTRUE instead of "<<dim<<endl;
397  return;
398  }
399  RDHFLctoV0->SetVarsForOpt(dim,boolforopt);
400  }
401  }
402 
403 
404  Float_t tighterval[dim][nptbins];
405  // 0(2): inv. mass V0 if K0S [GeV]
406  // 1(3): inv. mass V0 if Lambda [GeV]
407  // 2(4): pT min bachelor track [GeV/c]
408  // 3(5): pT min V0-positive track [GeV/c]
409  // 4(6): pT min V0-negative track [GeV/c]
410  // 5(7): dca cascade cut (cm)
411  // 6(8): dca V0 cut (nSigmas)
412  // 7(9): cosPA V0 cut
413  // 8(10): d0 max bachelor wrt PV [cm]
414  // 9(11): d0 max V0 wrt PV [cm]
415  // 10(12): mass K0S veto [GeV/c2]
416  // 11(13): mass Lambda/LambdaBar veto [GeV/c2]
417  // 12(14): mass Gamma veto [GeV/c2]
418  // 13(15): pT min V0 track [GeV/c]
419 
420  // number of steps for each variable is set in the AddTask arguments (default=8)
421  // set this!!
422  for(Int_t ipt=0;ipt<nptbins;ipt++){
423  tighterval[0][ipt] =0.075; // inv. mass V0 if K0S [GeV]
424  tighterval[1][ipt] =0.040; // inv. mass V0 if Lambda [GeV]
425  tighterval[2][ipt] =0.4; // pT min bachelor track [GeV/c]
426  tighterval[3][ipt] =0.2; // pT min V0-positive track [GeV/c]
427  tighterval[4][ipt] =0.2; // pT min V0-negative track [GeV/c]
428  tighterval[5][ipt] =100.; // dca cascade cut (cm)
429  tighterval[6][ipt] =1.5; // dca v0 cut
430  tighterval[7][ipt] =0.99; // cosPA v0 cut
431  tighterval[8][ipt] =0.05; // d0 max bachelor wrt PV [cm]
432  tighterval[9][ipt] =0.1; // d0 max V0 wrt PV [cm]
433  tighterval[10][ipt] =0.0; // mass K0S veto [GeV/c2]
434  tighterval[11][ipt] =0.005; // mass Lambda/LambdaBar veto [GeV/c2]
435  tighterval[12][ipt] =0.100; // mass Gamma veto [GeV/c2]
436  }
437  tighterval[0][13]=0.0; // pT min V0 track [GeV/c]
438  tighterval[1][13]=0.6; // pT min V0 track [GeV/c]
439  tighterval[2][13]=0.8; // pT min V0 track [GeV/c]
440  tighterval[3][13]=0.8; // pT min V0 track [GeV/c]
441  tighterval[4][13]=0.8; // pT min V0 track [GeV/c]
442  tighterval[5][13]=1.0; // pT min V0 track [GeV/c]
443  tighterval[6][13]=1.0; // pT min V0 track [GeV/c]
444  tighterval[7][13]=1.0; // pT min V0 track [GeV/c]
445  tighterval[8][13]=0.0; // pT min V0 track [GeV/c]
446 
447  TString name="";
448  Int_t arrdim=dim*nptbins;
449  cout<<"Will save "<<arrdim<<" TParameter<float>"<<endl;
450  TClonesArray max("TParameter<float>",arrdim);
451  for(Int_t ival=0;ival<dim;ival++){
452  for(Int_t jpt=0;jpt<nptbins;jpt++){
453  name=Form("par%dptbin%d",ival,jpt);
454  cout<<"Setting "<<name.Data()<<" to "<<tighterval[ival][jpt]<<endl;
455  new(max[jpt*dim+ival])TParameter<float>(name.Data(),tighterval[ival][jpt]);
456  }
457  }
458 
459  Bool_t flagPID=kFALSE;
460  RDHFLctoV0->SetUsePID(flagPID);
461 
462  RDHFLctoV0->PrintAll();
463  printf("Use PID? %s\n",flagPID ? "yes" : "no");
464 
465  //pid settings
466  //1. bachelor: default one
467  AliAODPidHF* pidObjBachelor = new AliAODPidHF();
468  Double_t sigmasBac[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
469  pidObjBachelor->SetSigma(sigmasBac);
470  pidObjBachelor->SetAsym(kFALSE);
471  pidObjBachelor->SetMatch(1);
472  pidObjBachelor->SetTPC(kTRUE);
473  pidObjBachelor->SetTOF(kTRUE);
474  pidObjBachelor->SetTOFdecide(kFALSE);
475  RDHFLctoV0->SetPidHF(pidObjBachelor);
476 
477  //activate pileup rejection (for pp)
478  //RDHFLctoV0->SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
479 
480  //Do not recalculate the vertex
481  RDHFLctoV0->SetRemoveDaughtersFromPrim(kFALSE); //activate for pp
482 
483  TString cent="";
484  //centrality selection (Pb-Pb)
485  Float_t minc=20,maxc=80;
486  RDHFLctoV0->SetMinCentrality(minc);
487  RDHFLctoV0->SetMaxCentrality(maxc);
488  cent=Form("%.0f%.0f",minc,maxc);
489  //RDHFLctoV0->SetUseCentrality(AliRDHFCuts::kCentV0M); //kCentOff,kCentV0M,kCentTRK,kCentTKL,kCentCL1,kCentInvalid
490  RDHFLctoV0->SetUseCentrality(AliRDHFCuts::kCentOff); //kCentOff,kCentV0M,kCentTRK,kCentTKL,kCentCL1,kCentInvalid
491 
492  //temporary
493  //RDHFLctoV0->SetFixRefs();
494 
495  TFile* fout=new TFile(Form("cuts4SignifMaxim%s%s%sRecVtx%sPileupRej.root",
496  RDHFLctoV0->GetUseCentrality()==0 ? "pp" : "PbPb",
497  cent.Data(),
498  RDHFLctoV0->GetIsPrimaryWithoutDaughters() ? "" : "No",
499  RDHFLctoV0->GetOptPileUp() ? "" : "No"),"recreate"); //set this!!
500 
501  fout->cd();
502  RDHFLctoV0->Write();
503  max.Write();
504  fout->Close();
505 
506 }
void SetNPtBins(Int_t nptBins)
Definition: AliRDHFCuts.h:360
void SetAsym(Bool_t asym)
Definition: AliAODPidHF.h:88
Bool_t GetOptPileUp() const
Definition: AliRDHFCuts.h:262
void SetUseCentrality(Int_t flag=1)
void makeInputAliAnalysisTaskSELctoV0bachelor()
TString * GetVarNames() const
Definition: AliRDHFCuts.h:235
void SetPidHF(AliAODPidHF *pidObj)
see enum below
Definition: AliRDHFCuts.h:210
void SetKinkRejection(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:206
void SetTOF(Bool_t tof)
Definition: AliAODPidHF.h:95
void SetUseCombined(Bool_t useCombined=kTRUE)
Definition: AliAODPidHF.h:200
void SetUseDefaultPriors(Bool_t defaultP)
Definition: AliAODPidHF.h:201
void SetCombDetectors(ECombDetectors pidComb)
Definition: AliAODPidHF.h:112
void SetCuts(Int_t nVars, Int_t nPtBins, Float_t **cutsRD)
void SetMinCentrality(Float_t minCentrality=0.)
Definition: AliRDHFCuts.h:51
Bool_t * GetVarsForOpt() const
Definition: AliRDHFCuts.h:236
void AddTrackCutsV0daughters(AliESDtrackCuts *v0daug)
void makeInputAliAnalysisTaskSESignificanceMaximization()
Int_t GetNVarsForOpt() const
Definition: AliRDHFCuts.h:237
virtual void PrintAll() const
void SetUseTrackSelectionWithFilterBits(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:207
void SetSigma(Double_t *sigma)
Definition: AliAODPidHF.h:39
void SetMaxCentrality(Float_t maxCentrality=100.)
Definition: AliRDHFCuts.h:52
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
void SetLowPtCut(Float_t lowPtCut)
Bool_t GetIsPrimaryWithoutDaughters() const
Definition: AliRDHFCuts.h:261
void SetMinCombinedProbability(Int_t ptBins, Float_t *ptMin)
void SetUsePID(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:204
void SetRemoveDaughtersFromPrim(Bool_t removeDaughtersPrim)
Definition: AliRDHFCuts.h:214
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
void SetTOFdecide(Bool_t tOFdecide)
Definition: AliAODPidHF.h:107
void SetMatch(Int_t match)
Definition: AliAODPidHF.h:98
void AddTrackCuts(const AliESDtrackCuts *cuts)
Definition: AliRDHFCuts.h:202
void SetTPC(Bool_t tpc)
Definition: AliAODPidHF.h:94
Int_t GetUseCentrality() const
Definition: AliRDHFCuts.h:263
void SetPidSelectionFlag(Int_t a)
Int_t nptbins
void SetHighPtCut(Float_t highPtCut)