AliPhysics  f05a842 (f05a842)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 //macro to make a .root file which contains an AliRDHFCutsLctoV0 for AliAnalysisTaskSELc2pK0S task
19 
23 
24 // Configuration
25 const Int_t nptbins=6;
31 
32 const Float_t kmInvPipPim_pp7TeV_pass2[nptbins] = {0.00432330, 0.00454560, 0.00481579, 0.00505379, 0.00542286, 0.00602017};
33 const Float_t kmInvPipPim_pp7TeV_pass4[nptbins] = {0.00398116, 0.00412519, 0.00432494, 0.00454682, 0.00486837, 0.00537445};
34 const Float_t kmInvPipPim_pPb[nptbins] = {0.00383156, 0.00394778, 0.00413934, 0.00438431, 0.00480869, 0.00544472};
35 const Float_t kmInvPipPim_LHC10f7a[nptbins] = {0.00398520, 0.00419456, 0.00445022, 0.00462474, 0.00491519, 0.00544176};
36 const Float_t kmInvPipPim_LHC11b2[nptbins] = {0.00385273, 0.00394676, 0.00412335, 0.00420992, 0.00445422, 0.00493645};
37 const Float_t kmInvPipPim_LHC15a2a[nptbins] = {0.00376002, 0.00386896, 0.00399314, 0.00412475, 0.00435170, 0.00466817};
38 const Float_t kmInvPipPim_LHC13d3[nptbins] = {0.00358776, 0.00370684, 0.00383341, 0.00402011, 0.00439230, 0.00489222};
39 
40 const Float_t kmInvPPi_pp7TeV_pass2[nptbins] = {0.00203633, 0.00196967, 0.00196595, 0.00199441, 0.00202691, 0.00211474};
41 const Float_t kmInvPPi_pp7TeV_pass4[nptbins] = {0.00194356, 0.00185442, 0.00184579, 0.00187065, 0.00193578, 0.00210853};
42 const Float_t kmInvPPi_pPb[nptbins] = {0.00214349, 0.00199650, 0.00192680, 0.00192083, 0.00199756, 0.00213533};
43 const Float_t kmInvPPi_LHC10f7a[nptbins] = {0.00190966, 0.00182307, 0.00177527, 0.00183747, 0.00181431, 0.00204811};
44 const Float_t kmInvPPi_LHC11b2[nptbins] = {0.00185630, 0.00180454, 0.00179920, 0.00182468, 0.00189292, 0.00204497};
45 const Float_t kmInvPPi_LHC15a2a[nptbins] = {0.00187642, 0.00175389, 0.00171987, 0.00171276, 0.00180925, 0.00194709};
46 const Float_t kmInvPPi_LHC13d3[nptbins] = {0.00205320, 0.00191146, 0.00179558, 0.00182894, 0.00185072, 0.00208818};
47 
49 
50  AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
51  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
52  //default
53  esdTrackCuts->SetRequireTPCRefit(kTRUE);
54  esdTrackCuts->SetRequireITSRefit(kTRUE);
55  esdTrackCuts->SetMinNClustersITS(0);//(4); // default is 5
56  esdTrackCuts->SetMinNClustersTPC(70);
57  //esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
58  // AliESDtrackCuts::kAny);
59  // default is kBoth, otherwise kAny
60  esdTrackCuts->SetMinDCAToVertexXY(0.);
61  esdTrackCuts->SetPtRange(0.,1.e10);
62  esdTrackCuts->SetEtaRange(-0.8,0.8);
63  esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
64 
65 
66  AliESDtrackCuts* esdTrackCutsV0daughters=new AliESDtrackCuts();
67  esdTrackCutsV0daughters->SetRequireSigmaToVertex(kFALSE);
68  //default
69  esdTrackCutsV0daughters->SetRequireTPCRefit(kTRUE);
70  esdTrackCutsV0daughters->SetRequireITSRefit(kFALSE);//kTRUE);
71  esdTrackCutsV0daughters->SetMinNClustersITS(0);//(4); // default is 5
72  esdTrackCutsV0daughters->SetMinNClustersTPC(70);
73  //esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
74  // AliESDtrackCuts::kAny);
75  // default is kBoth, otherwise kAny
76  esdTrackCutsV0daughters->SetMinDCAToVertexXY(0.);
77  esdTrackCutsV0daughters->SetPtRange(0.,1.e10);
78  esdTrackCutsV0daughters->SetEtaRange(-0.8,0.8);
79  esdTrackCutsV0daughters->SetAcceptKinkDaughters(kFALSE);
80 
81  AliRDHFCutsLctoV0* RDHFLctoV0An=new AliRDHFCutsLctoV0();
82  RDHFLctoV0An->SetName("LctoV0AnalysisCuts");
83  RDHFLctoV0An->SetTitle("Analysis cuts for Lc analysis");
84  RDHFLctoV0An->SetKinkRejection(!esdTrackCuts->GetAcceptKinkDaughters());
85  RDHFLctoV0An->AddTrackCuts(esdTrackCuts);
86  RDHFLctoV0An->AddTrackCutsV0daughters(esdTrackCutsV0daughters);
87  RDHFLctoV0An->SetUseTrackSelectionWithFilterBits(kFALSE);//(kTRUE);
88  if (fCollisionSystem==kpPb) {
89  // //
90  // // Trigger selection
91  // //
92  RDHFLctoV0An->SetTriggerClass("");
93  if (fDataType==kData) {
94  RDHFLctoV0An->SetTriggerMask(AliVEvent::kINT7);
95  } else if (fDataType==kLHC13d3) {
96  RDHFLctoV0An->SetTriggerMask(AliVEvent::kINT7 | AliVEvent::kMB);
97  }
98  // multi vertexer pileup rejection
99  RDHFLctoV0An-> SetOptPileup(AliRDHFCuts::kRejectMVPileupEvent);
100  }
101  RDHFLctoV0An->SetLowPtCut(1.0); // default value 1.0 GeV/c
102  if (fCollisionSystem==kpp7TeV) {
103  RDHFLctoV0An->SetHighPtCut(3.0); // default value 2.5 GeV/c
104  RDHFLctoV0An->SetPidSelectionFlag(4); // 0 -> TOF AND TPC
105  } else if (fCollisionSystem==kpPb) {
106  RDHFLctoV0An->SetHighPtCut(999.); // default value 2.5 GeV/c
107  RDHFLctoV0An->SetPidSelectionFlag(2); // 0 -> TOF AND TPC
108  // 1 -> if (TOF) TOF else TPC w veto
109  // 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}
110  // 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}
111  // 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}
112  // 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}
113  // 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}
114  // 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}
115  // 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}
116  // 9 -> combined: TOF, TPC
117  }
118  RDHFLctoV0An->SetNPtBins(nptbins);
119 
120  Float_t* ptbins;
121  ptbins=new Float_t[nptbins+1];
122  ptbins[0]= 2.;
123  ptbins[1]= 3.;
124  ptbins[2]= 4.;
125  ptbins[3]= 5.;
126  ptbins[4]= 6.;
127  ptbins[5]= 8.;
128  ptbins[6]= 12.;
129  RDHFLctoV0An->SetPtBins(nptbins+1,ptbins);
130 
131  const Int_t nvars=17;
132 
133  Float_t** anacutsval;
134  anacutsval=new Float_t*[nvars];
135  for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
136  for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
137  anacutsval[0][ipt2]=0.25; // inv. mass if K0S [GeV/c2]
138  anacutsval[1][ipt2]=1.00; // inv. mass if Lambda [GeV/c2]
139  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!!!
140  anacutsval[7][ipt2]=1000.; // dca cascade cut [cm]
141  anacutsval[8][ipt2]=1.5; // dca V0 cut [nSigma] // it's 1.5 x offline V0s
142  anacutsval[9][ipt2]=0.99; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
143  anacutsval[12][ipt2]=0.; // mass K0S veto [GeV/c2]
144  anacutsval[13][ipt2]=0.005; // mass Lambda/LambdaBar veto [GeV/c2]
145  anacutsval[16][ipt2]=0.; // V0 type cut
146  }
147 
148  if (fCollisionSystem==kpp7TeV) {
149  if (fPass==kPass2) {
150  anacutsval[2][0]=0.00500; // inv. mass V0 if K0S [GeV/c2]
151  anacutsval[2][1]=0.00812; // inv. mass V0 if K0S [GeV/c2]
152  anacutsval[2][2]=0.00858; // inv. mass V0 if K0S [GeV/c2]
153  anacutsval[2][3]=0.00900; // inv. mass V0 if K0S [GeV/c2]
154  anacutsval[2][4]=0.01000; // inv. mass V0 if K0S [GeV/c2]
155  anacutsval[2][5]=0.01000; // inv. mass V0 if K0S [GeV/c2]
156  if (fDataType==kLHC10f7a) {
157  for (Int_t ii=0; ii<nptbins; ii++) {
158  if (fChangeK0ScutOnMC) {
159  anacutsval[2][ii]=anacutsval[2][ii]/kmInvPipPim_pp7TeV_pass2[ii]*kmInvPipPim_LHC10f7a[ii]; // inv. mass V0 if K0S [GeV/c2]
161  anacutsval[13][ii]=anacutsval[13][ii]/kmInvPPi_pp7TeV_pass2[ii]*kmInvPPi_LHC10f7a[ii]; // inv. mass Lambda/LambdaBar [GeV/c2]
162  }
163  }
164  }
165  } else if (fDataType==kLHC11b2) {
166  for (Int_t ii=0; ii<nptbins; ii++) {
167  if (fChangeK0ScutOnMC) {
168  anacutsval[2][ii]=anacutsval[2][ii]/kmInvPipPim_pp7TeV_pass2[ii]*kmInvPipPim_LHC11b2[ii]; // inv. mass V0 if K0S [GeV/c2]
170  anacutsval[13][ii]=anacutsval[13][ii]/kmInvPPi_pp7TeV_pass2[ii]*kmInvPPi_LHC11b2[ii]; // inv. mass Lambda/LambdaBar [GeV/c2]
171  }
172  }
173  }
174  }
175 
176  } else if (fPass==kPass4) { // as for pass2 -> not optimized for pass4 data!
177  anacutsval[2][0]=0.00500; // inv. mass V0 if K0S [GeV/c2]
178  anacutsval[2][1]=0.00812; // inv. mass V0 if K0S [GeV/c2]
179  anacutsval[2][2]=0.00858; // inv. mass V0 if K0S [GeV/c2]
180  anacutsval[2][3]=0.00900; // inv. mass V0 if K0S [GeV/c2]
181  anacutsval[2][4]=0.01000; // inv. mass V0 if K0S [GeV/c2]
182  anacutsval[2][5]=0.01000; // inv. mass V0 if K0S [GeV/c2]
183  // just to start to see pass4
184  for (Int_t ii=0; ii<nptbins; ii++) {
185  anacutsval[2][ii]=anacutsval[2][ii]/kmInvPipPim_pp7TeV_pass2[ii]*kmInvPipPim_pp7TeV_pass4[ii]; // inv. mass V0 if K0S [GeV/c2]
186  }
187  if (fDataType==kLHC15a2a) {
188  for (Int_t ii=0; ii<nptbins; ii++) {
189  if (fChangeK0ScutOnMC) {
190  anacutsval[2][ii]=anacutsval[2][ii]/kmInvPipPim_pp7TeV_pass4[ii]*kmInvPipPim_LHC15a2a[ii]; // inv. mass V0 if K0S [GeV/c2]
192  anacutsval[13][ii]=anacutsval[13][ii]/kmInvPPi_pp7TeV_pass4[ii]*kmInvPPi_LHC15a2a[ii]; // inv. mass Lambda/LambdaBar [GeV/c2]
193  }
194  }
195  }
196  }
197  }
198 
199  } else if (fCollisionSystem==kpPb) {
200  anacutsval[2][0]=0.006; // inv. mass V0 if K0S [GeV/c2]
201  anacutsval[2][1]=0.007; // inv. mass V0 if K0S [GeV/c2]
202  anacutsval[2][2]=0.008; // inv. mass V0 if K0S [GeV/c2]
203  anacutsval[2][3]=0.009; // inv. mass V0 if K0S [GeV/c2]
204  anacutsval[2][4]=0.010; // inv. mass V0 if K0S [GeV/c2]
205  anacutsval[2][5]=0.011; // inv. mass V0 if K0S [GeV/c2]
206  if (fDataType==kLHC13d3) {
207  for (Int_t ii=0; ii<nptbins; ii++) {
208  if (fChangeK0ScutOnMC) {
209  anacutsval[2][ii]=anacutsval[2][ii]/kmInvPipPim_pPb[ii]*kmInvPipPim_LHC13d3[ii]; // inv. mass V0 if K0S [GeV/c2]
211  anacutsval[13][ii]=anacutsval[13][ii]/kmInvPPi_pPb[ii]*kmInvPPi_LHC13d3[ii]; // inv. mass Lambda/LambdaBar [GeV/c2]
212  }
213  }
214  }
215  }
216  }
217 
218  if (fCollisionSystem==kpp7TeV) {
219 
220  anacutsval[4][0]=0.6; // pT min bachelor track [GeV/c] // AOD by construction
221  anacutsval[4][1]=0.6; // pT min bachelor track [GeV/c] // AOD by construction
222  anacutsval[4][2]=0.7; // pT min bachelor track [GeV/c] // AOD by construction
223  anacutsval[4][3]=0.7; // pT min bachelor track [GeV/c] // AOD by construction
224  anacutsval[4][4]=0.9; // pT min bachelor track [GeV/c] // AOD by construction
225  anacutsval[4][5]=1.1; // pT min bachelor track [GeV/c] // AOD by construction
226 
227  anacutsval[5][0]=0.2; // pT min V0-positive track [GeV/c]
228  anacutsval[5][1]=0.2; // pT min V0-positive track [GeV/c]
229  anacutsval[5][2]=0.2; // pT min V0-positive track [GeV/c]
230  anacutsval[5][3]=0.2; // pT min V0-positive track [GeV/c]
231  anacutsval[5][4]=0.2; // pT min V0-positive track [GeV/c]
232  anacutsval[5][5]=0.3; // pT min V0-positive track [GeV/c]
233 
234  anacutsval[6][0]=0.2; // pT min V0-negative track [GeV/c]
235  anacutsval[6][1]=0.2; // pT min V0-negative track [GeV/c]
236  anacutsval[6][2]=0.2; // pT min V0-negative track [GeV/c]
237  anacutsval[6][3]=0.2; // pT min V0-negative track [GeV/c]
238  anacutsval[6][4]=0.2; // pT min V0-negative track [GeV/c]
239  anacutsval[6][5]=0.3; // pT min V0-negative track [GeV/c]
240 
241  anacutsval[10][0]=0.05; // d0 max bachelor wrt PV [cm]
242  anacutsval[10][1]=0.05; // d0 max bachelor wrt PV [cm]
243  anacutsval[10][2]=0.10; // d0 max bachelor wrt PV [cm]
244  anacutsval[10][3]=0.10; // d0 max bachelor wrt PV [cm]
245  anacutsval[10][4]=0.10; // d0 max bachelor wrt PV [cm]
246  anacutsval[10][5]=0.10; // d0 max bachelor wrt PV [cm]
247 
248  anacutsval[11][0]=0.05; // d0 max V0 wrt PV [cm]
249  anacutsval[11][1]=0.05; // d0 max V0 wrt PV [cm]
250  anacutsval[11][2]=0.09; // d0 max V0 wrt PV [cm]
251  anacutsval[11][3]=0.09; // d0 max V0 wrt PV [cm]
252  anacutsval[11][4]=999.; // d0 max V0 wrt PV [cm]
253  anacutsval[11][5]=999.; // d0 max V0 wrt PV [cm]
254 
255  anacutsval[14][0]=0.100; // mass Gamma veto [GeV/c2]
256  anacutsval[14][1]=0.100; // mass Gamma veto [GeV/c2]
257  anacutsval[14][2]=0.300; // mass Gamma veto [GeV/c2]
258  anacutsval[14][3]=0.300; // mass Gamma veto [GeV/c2]
259  anacutsval[14][4]=0.300; // mass Gamma veto [GeV/c2]
260  anacutsval[14][5]=0.300; // mass Gamma veto [GeV/c2]
261 
262  anacutsval[15][0]=0.5; // pT min V0 track [GeV/c]
263  anacutsval[15][1]=0.6; // pT min V0 track [GeV/c]
264  anacutsval[15][2]=0.7; // pT min V0 track [GeV/c]
265  anacutsval[15][3]=1.0; // pT min V0 track [GeV/c]
266  anacutsval[15][4]=1.1; // pT min V0 track [GeV/c]
267  anacutsval[15][5]=1.2; // pT min V0 track [GeV/c]
268 
269  } else if (fCollisionSystem==kpPb) {
270 
271  anacutsval[4][0]=0.5; // pT min bachelor track [GeV/c] // AOD by construction
272  anacutsval[4][1]=0.6; // pT min bachelor track [GeV/c] // AOD by construction
273  anacutsval[4][2]=0.7; // pT min bachelor track [GeV/c] // AOD by construction
274  anacutsval[4][3]=0.9; // pT min bachelor track [GeV/c] // AOD by construction
275  anacutsval[4][4]=0.9; // pT min bachelor track [GeV/c] // AOD by construction
276  anacutsval[5][5]=0.9; // pT min bachelor track [GeV/c] // AOD by construction
277 
278  anacutsval[5][0]=0.2; // pT min V0-positive track [GeV/c]
279  anacutsval[5][1]=0.2; // pT min V0-positive track [GeV/c]
280  anacutsval[5][2]=0.2; // pT min V0-positive track [GeV/c]
281  anacutsval[5][3]=0.2; // pT min V0-positive track [GeV/c]
282  anacutsval[5][4]=0.2; // pT min V0-positive track [GeV/c]
283  anacutsval[5][5]=0.3; // pT min V0-positive track [GeV/c]
284 
285  anacutsval[6][0]=0.2; // pT min V0-negative track [GeV/c]
286  anacutsval[6][1]=0.2; // pT min V0-negative track [GeV/c]
287  anacutsval[6][2]=0.2; // pT min V0-negative track [GeV/c]
288  anacutsval[6][3]=0.2; // pT min V0-negative track [GeV/c]
289  anacutsval[6][4]=0.2; // pT min V0-negative track [GeV/c]
290  anacutsval[6][5]=0.3; // pT min V0-negative track [GeV/c]
291 
292  anacutsval[10][0]=0.05; // d0 max bachelor wrt PV [cm]
293  anacutsval[10][1]=0.05; // d0 max bachelor wrt PV [cm]
294  anacutsval[10][2]=0.08; // d0 max bachelor wrt PV [cm]
295  anacutsval[10][3]=0.10; // d0 max bachelor wrt PV [cm]
296  anacutsval[10][4]=0.10; // d0 max bachelor wrt PV [cm]
297  anacutsval[10][5]=0.10; // d0 max bachelor wrt PV [cm]
298 
299  for (Int_t ipt2=0; ipt2<nptbins; ipt2++) anacutsval[11][ipt2]=999.; // d0 max V0 wrt PV [cm]
300 
301  anacutsval[14][0]=0.100; // mass Gamma veto [GeV/c2]
302  anacutsval[14][1]=0.100; // mass Gamma veto [GeV/c2]
303  anacutsval[14][2]=0.100; // mass Gamma veto [GeV/c2]
304  anacutsval[14][3]=0.100; // mass Gamma veto [GeV/c2]
305  anacutsval[14][4]=0.100; // mass Gamma veto [GeV/c2]
306  anacutsval[14][5]=0.100; // mass Gamma veto [GeV/c2]
307 
308  anacutsval[15][0]=0.8; // pT min V0 track [GeV/c]
309  anacutsval[15][1]=0.8; // pT min V0 track [GeV/c]
310  anacutsval[15][2]=0.8; // pT min V0 track [GeV/c]
311  anacutsval[15][3]=1.2; // pT min V0 track [GeV/c]
312  anacutsval[15][4]=1.0; // pT min V0 track [GeV/c]
313  anacutsval[15][5]=1.2; // pT min V0 track [GeV/c]
314 
315  }
316 
317  RDHFLctoV0An->SetCuts(nvars,nptbins,anacutsval);
318 
319  if (RDHFLctoV0An->GetPidSelectionFlag()==9) {
320  Float_t minCombProb[nptbins];
321  for (Int_t iBin=0; iBin<nptbins; iBin++) minCombProb[iBin]=0.;
322  RDHFLctoV0An->SetMinCombinedProbability(nptbins,minCombProb);
323  }
324 
325  //pid settings
326  //1. bachelor: default one
327  AliAODPidHF* pidObjBachelor = new AliAODPidHF();
328  Double_t sigmasBac[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
329  pidObjBachelor->SetSigma(sigmasBac);
330  pidObjBachelor->SetAsym(kFALSE);
331  pidObjBachelor->SetMatch(1);
332  pidObjBachelor->SetTPC(kTRUE);
333  pidObjBachelor->SetTOF(kTRUE);
334  pidObjBachelor->SetTOFdecide(kFALSE);
335  if (RDHFLctoV0An->GetPidSelectionFlag()==9) {
336  pidObjBachelor->SetUseCombined();
337  pidObjBachelor->SetUseDefaultPriors(kTRUE);
338  pidObjBachelor->SetCombDetectors(AliAODPidHF::kTPCTOF);
339  }
340 
341  RDHFLctoV0An->SetPidHF(pidObjBachelor);
342 
343  // uncomment these lines for Baysian PID:
344  // Double_t threshold=0.3;
345  // SetupCombinedPID(RDHFLctoV0An ,threshold);
346  // RDHFLctoV0An ->SetPIDStrategy(AliRDHFCutsLctoV0::kCombined);
347  //
348 
349  //RDHFLc->SetRecoKF(); //set this if you want to recompute the secondary vertex with the KF package
350  //uncomment these lines to apply cuts with the KF package
351  //RDHFLctoV0An->SetCutsStrategy(AliRDHFCutsLctoV0::kKF);
352  //for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
353  // anacutsval[0]=1.; //if <0., no topological constraint
354  // anacutsval[1]=2.; //cut on the Chi2/Ndf
355  // }
356 
357  Bool_t pidflag=kTRUE;
358  RDHFLctoV0An->SetUsePID(pidflag);
359  if(pidflag) cout<<"PID is used"<<endl;
360  else cout<<"PID is not used"<<endl;
361 
362  cout<<"This is the (anal) object I'm going to save:"<<endl;
363  RDHFLctoV0An->PrintAll();
364  TFile* fout;
365  if (fDataType==kData) {
366  fout=new TFile("Lc2pK0SCuts.root","RECREATE");
367  } else {
368  fout=new TFile("Lc2pK0SCuts.root","RECREATE");
369  }
370  fout->cd();
371  RDHFLctoV0An->Write();
372  fout->Close();
373  delete fout;
374 
375  delete pidObjBachelor;
376  //delete RDHFLctoV0An;
377 
378 }
379 
380 
381 //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
382 
384 
385  AliRDHFCutsLctoV0* RDHFLctoV0=new AliRDHFCutsLctoV0();
386  RDHFLctoV0->SetName("loosercuts");
387  RDHFLctoV0->SetTitle("Cuts for significance maximization");
388 
389  AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
390  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
391  //default
392  esdTrackCuts->SetRequireTPCRefit(kTRUE);
393  esdTrackCuts->SetMinNClustersTPC(70);
394  esdTrackCuts->SetRequireITSRefit(kFALSE);
395  esdTrackCuts->SetMinNClustersITS(0);
396  //esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
397  esdTrackCuts->SetMinDCAToVertexXY(0.);
398  esdTrackCuts->SetEtaRange(-0.8,0.8);
399  esdTrackCuts->SetPtRange(0.,1.e10);
400 
401  AliESDtrackCuts* esdTrackCutsV0daughters=new AliESDtrackCuts();
402  esdTrackCutsV0daughters->SetRequireSigmaToVertex(kFALSE);
403  //default
404  esdTrackCutsV0daughters->SetRequireTPCRefit(kTRUE);
405  esdTrackCutsV0daughters->SetMinNClustersTPC(70);
406  esdTrackCutsV0daughters->SetRequireITSRefit(kFALSE);
407  esdTrackCutsV0daughters->SetMinNClustersITS(0);
408  //esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny); // default is kBoth, otherwise kAny
409  esdTrackCutsV0daughters->SetMinDCAToVertexXY(0.);
410  esdTrackCutsV0daughters->SetPtRange(0.,1.e10);
411 
412  RDHFLctoV0->AddTrackCuts(esdTrackCuts);
413 
414  RDHFLctoV0->AddTrackCutsV0daughters(esdTrackCutsV0daughters);
415 
416  RDHFLctoV0->SetPidSelectionFlag(2); // 0 -> TOF AND TPC
417  // 1 -> if (TOF) TOF else TPC w veto
418  // 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}
419  // 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}
420 
421  const Int_t nvars=14;//17-3
422 
423  Float_t* ptbins;
424  ptbins=new Float_t[nptbins+1];
425  ptbins[0]=2.;
426  ptbins[1]=3.;
427  ptbins[2]=4.;
428  ptbins[3]=5.;
429  ptbins[4]=6.;
430  ptbins[5]=8.;
431  ptbins[6]=12.;
432  RDHFLctoV0->SetPtBins(nptbins+1,ptbins);
433 
434  Float_t** rdcutsvalmine;
435  rdcutsvalmine=new Float_t*[nvars];
436  for(Int_t iv=0;iv<nvars;iv++){
437  rdcutsvalmine[iv]=new Float_t[nptbins];
438  }
439 
440  //setting my cut values
441  // inv. mass if K0s [GeV]
442  // inv. mass if Lambda [GeV]
443  // inv. mass V0 if K0S [GeV]
444  // inv. mass V0 if Lambda [GeV]
445  // pT min bachelor track [GeV/c]
446  // pT min V0-positive track [GeV/c]
447  // pT min V0-negative track [GeV/c]
448  // dca cascade cut (cm)
449  // dca V0 cut (nSigmas)
450  // cosPA V0 cut
451  // d0 max bachelor wrt PV [cm]
452  // d0 max V0 wrt PV [cm]
453  // mass K0S veto [GeV/c2]
454  // mass Lambda/LambdaBar veto [GeV/c2]
455  // mass Gamma veto [GeV/c2]
456  // pT min V0 track [GeV/c]
457  Float_t **cutsMatrixLctoV0Stand = new Float_t*[nvars];
458  for(Int_t ic=0;ic<nvars;ic++)
459  cutsMatrixLctoV0Stand[ic]=new Float_t[nptbins];
460  for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
461  cutsMatrixLctoV0Stand[ 0][ipt2] =0.0075;
462  cutsMatrixLctoV0Stand[ 1][ipt2] =0.0500;
463  cutsMatrixLctoV0Stand[ 2][ipt2] =0.4;
464  cutsMatrixLctoV0Stand[ 3][ipt2] =0.2;
465  cutsMatrixLctoV0Stand[ 4][ipt2] =0.2;
466  cutsMatrixLctoV0Stand[ 5][ipt2] =1000.;
467  cutsMatrixLctoV0Stand[ 6][ipt2] =1.5;
468  cutsMatrixLctoV0Stand[ 7][ipt2] =0.99;
469  cutsMatrixLctoV0Stand[ 8][ipt2] =0.05;
470  cutsMatrixLctoV0Stand[ 9][ipt2] =0.1;
471  cutsMatrixLctoV0Stand[10][ipt2] =0.0;
472  cutsMatrixLctoV0Stand[11][ipt2] =0.005;
473  cutsMatrixLctoV0Stand[12][ipt2] =0.100;
474  }
475  cutsMatrixLctoV0Stand[13][0]=0.0; // pT min V0 track [GeV/c]
476  cutsMatrixLctoV0Stand[13][1]=0.6; // pT min V0 track [GeV/c]
477  cutsMatrixLctoV0Stand[13][2]=0.8; // pT min V0 track [GeV/c]
478  cutsMatrixLctoV0Stand[13][3]=0.8; // pT min V0 track [GeV/c]
479  cutsMatrixLctoV0Stand[13][4]=0.8; // pT min V0 track [GeV/c]
480  cutsMatrixLctoV0Stand[13][5]=1.0; // pT min V0 track [GeV/c]
481 
482 
483  //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
484  Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
485  for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
486  for (Int_t ibin=0;ibin<nptbins;ibin++){
487  for (Int_t ivar=0; ivar<nvars; ivar++){
488  cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixLctoV0Stand[ibin][ivar];
489  }
490  }
491  RDHFLctoV0->SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
492 
493 
494  Int_t nvarsforopt=RDHFLctoV0->GetNVarsForOpt();
495  Int_t dim=14; //set this!!
496  Bool_t *boolforopt;
497  boolforopt=new Bool_t[nvars];
498  if(dim>nvarsforopt){
499  cout<<"Number of variables for optimization has probably changed, check and edit accordingly"<<endl;
500  return;
501  } else {
502  if(dim==nvarsforopt){
503  boolforopt=RDHFLctoV0->GetVarsForOpt();
504  }else{
505  TString *names;
506  names=new TString[nvars];
507  TString answer="";
508  Int_t checktrue=0;
509  names=RDHFLctoV0->GetVarNames();
510  for(Int_t i=0;i<nvars;i++){
511  cout<<names[i]<<" for opt? (y/n)"<<endl;
512  cin>>answer;
513  if(answer=="y") {
514  boolforopt[i]=kTRUE;
515  checktrue++;
516  }
517  else boolforopt[i]=kFALSE;
518  }
519  if (checktrue!=dim) {
520  cout<<"Error! You set "<<checktrue<<" kTRUE instead of "<<dim<<endl;
521  return;
522  }
523  RDHFLctoV0->SetVarsForOpt(dim,boolforopt);
524  }
525  }
526 
527 
528  Float_t tighterval[dim][nptbins];
529  // 0(2): inv. mass V0 if K0S [GeV]
530  // 1(3): inv. mass V0 if Lambda [GeV]
531  // 2(4): pT min bachelor track [GeV/c]
532  // 3(5): pT min V0-positive track [GeV/c]
533  // 4(6): pT min V0-negative track [GeV/c]
534  // 5(7): dca cascade cut (cm)
535  // 6(8): dca V0 cut (nSigmas)
536  // 7(9): cosPA V0 cut
537  // 8(10): d0 max bachelor wrt PV [cm]
538  // 9(11): d0 max V0 wrt PV [cm]
539  // 10(12): mass K0S veto [GeV/c2]
540  // 11(13): mass Lambda/LambdaBar veto [GeV/c2]
541  // 12(14): mass Gamma veto [GeV/c2]
542  // 13(15): pT min V0 track [GeV/c]
543 
544  // number of steps for each variable is set in the AddTask arguments (default=8)
545  // set this!!
546  for(Int_t ipt=0;ipt<nptbins;ipt++){
547  tighterval[ 0][ipt] =0.075; // inv. mass V0 if K0S [GeV]
548  tighterval[ 1][ipt] =0.040; // inv. mass V0 if Lambda [GeV]
549  tighterval[ 2][ipt] =0.4; // pT min bachelor track [GeV/c]
550  tighterval[ 3][ipt] =0.2; // pT min V0-positive track [GeV/c]
551  tighterval[ 4][ipt] =0.2; // pT min V0-negative track [GeV/c]
552  tighterval[ 5][ipt] =100.; // dca cascade cut (cm)
553  tighterval[ 6][ipt] =1.5; // dca v0 cut
554  tighterval[ 7][ipt] =0.99; // cosPA v0 cut
555  tighterval[ 8][ipt] =0.05; // d0 max bachelor wrt PV [cm]
556  tighterval[ 9][ipt] =0.1; // d0 max V0 wrt PV [cm]
557  tighterval[10][ipt] =0.0; // mass K0S veto [GeV/c2]
558  tighterval[11][ipt] =0.005; // mass Lambda/LambdaBar veto [GeV/c2]
559  tighterval[12][ipt] =0.100; // mass Gamma veto [GeV/c2]
560  }
561  tighterval[13][0]=0.0; // pT min V0 track [GeV/c]
562  tighterval[13][1]=0.6; // pT min V0 track [GeV/c]
563  tighterval[13][2]=0.8; // pT min V0 track [GeV/c]
564  tighterval[13][3]=0.8; // pT min V0 track [GeV/c]
565  tighterval[13][4]=0.8; // pT min V0 track [GeV/c]
566  tighterval[13][5]=0.8; // pT min V0 track [GeV/c]
567 
568  TString name="";
569  Int_t arrdim=dim*nptbins;
570  cout<<"Will save "<<arrdim<<" TParameter<float>"<<endl;
571  TClonesArray max("TParameter<float>",arrdim);
572  for(Int_t ival=0;ival<dim;ival++){
573  for(Int_t jpt=0;jpt<nptbins;jpt++){
574  name=Form("par%dptbin%d",ival,jpt);
575  cout<<"Setting "<<name.Data()<<" to "<<tighterval[ival][jpt]<<endl;
576  new(max[jpt*dim+ival])TParameter<float>(name.Data(),tighterval[ival][jpt]);
577  }
578  }
579 
580  Bool_t flagPID=kFALSE;
581  RDHFLctoV0->SetUsePID(flagPID);
582 
583  RDHFLctoV0->PrintAll();
584  printf("Use PID? %s\n",flagPID ? "yes" : "no");
585 
586  //pid settings
587  //1. bachelor: default one
588  AliAODPidHF* pidObjBachelor = new AliAODPidHF();
589  Double_t sigmasBac[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
590  pidObjBachelor->SetSigma(sigmasBac);
591  pidObjBachelor->SetAsym(kFALSE);
592  pidObjBachelor->SetMatch(1);
593  pidObjBachelor->SetTPC(kTRUE);
594  pidObjBachelor->SetTOF(kTRUE);
595  pidObjBachelor->SetTOFdecide(kFALSE);
596  RDHFLctoV0->SetPidHF(pidObjBachelor);
597 
598  //Do not recalculate the vertex
599  RDHFLctoV0->SetRemoveDaughtersFromPrim(kFALSE); //activate for pp
600 
601  TString cent="";
602  //centrality selection (Pb-Pb)
603  Float_t minc=20,maxc=80;
604  RDHFLctoV0->SetMinCentrality(minc);
605  RDHFLctoV0->SetMaxCentrality(maxc);
606  cent=Form("%.0f%.0f",minc,maxc);
607  //RDHFLctoV0->SetUseCentrality(AliRDHFCuts::kCentV0M); //kCentOff,kCentV0M,kCentTRK,kCentTKL,kCentCL1,kCentInvalid
608  RDHFLctoV0->SetUseCentrality(AliRDHFCuts::kCentOff); //kCentOff,kCentV0M,kCentTRK,kCentTKL,kCentCL1,kCentInvalid
609 
610  //temporary
611  //RDHFLctoV0->SetFixRefs();
612 
613  TFile* fout=new TFile(Form("cuts4SignifMaxim%s%s%sRecVtx%sPileupRej.root",
614  RDHFLctoV0->GetUseCentrality()==0 ? "pp" : "PbPb",
615  cent.Data(),
616  RDHFLctoV0->GetIsPrimaryWithoutDaughters() ? "" : "No",
617  RDHFLctoV0->GetOptPileUp() ? "" : "No"),"recreate"); //set this!!
618 
619  fout->cd();
620  RDHFLctoV0->Write();
621  max.Write();
622  fout->Close();
623 
624 }
void SetNPtBins(Int_t nptBins)
Definition: AliRDHFCuts.h:366
void SetAsym(Bool_t asym)
Definition: AliAODPidHF.h:88
double Double_t
Definition: External.C:58
Bool_t GetOptPileUp() const
Definition: AliRDHFCuts.h:263
const Float_t kmInvPPi_LHC13d3[nptbins]
const Float_t kmInvPPi_LHC10f7a[nptbins]
const Float_t kmInvPipPim_pp7TeV_pass2[nptbins]
void SetUseCentrality(Int_t flag=1)
void makeInputAliAnalysisTaskSELctoV0bachelor()
Int_t fCollisionSystem
TString * GetVarNames() const
Definition: AliRDHFCuts.h:235
const Float_t kmInvPipPim_LHC13d3[nptbins]
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
const Float_t kmInvPPi_LHC15a2a[nptbins]
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
Bool_t fChangeAlsoLambdaVetoOnMC
const Float_t kmInvPPi_LHC11b2[nptbins]
const Float_t kmInvPipPim_pp7TeV_pass4[nptbins]
int Int_t
Definition: External.C:63
void SetCuts(Int_t nVars, Int_t nPtBins, Float_t **cutsRD)
void SetMinCentrality(Float_t minCentrality=0.)
Definition: AliRDHFCuts.h:51
float Float_t
Definition: External.C:68
Bool_t * GetVarsForOpt() const
Definition: AliRDHFCuts.h:236
void AddTrackCutsV0daughters(AliESDtrackCuts *v0daug)
const Float_t kmInvPipPim_LHC11b2[nptbins]
const Float_t kmInvPipPim_LHC15a2a[nptbins]
void makeInputAliAnalysisTaskSESignificanceMaximization()
Int_t GetNVarsForOpt() const
Definition: AliRDHFCuts.h:237
virtual void PrintAll() const
void SetUseTrackSelectionWithFilterBits(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:207
const Float_t kmInvPPi_pp7TeV_pass2[nptbins]
void SetSigma(Double_t *sigma)
Definition: AliAODPidHF.h:39
void SetMaxCentrality(Float_t maxCentrality=100.)
Definition: AliRDHFCuts.h:52
Bool_t fChangeK0ScutOnMC
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
void SetLowPtCut(Float_t lowPtCut)
const Float_t kmInvPipPim_LHC10f7a[nptbins]
Bool_t GetIsPrimaryWithoutDaughters() const
Definition: AliRDHFCuts.h:262
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
const Float_t kmInvPipPim_pPb[nptbins]
void AddTrackCuts(const AliESDtrackCuts *cuts)
Definition: AliRDHFCuts.h:202
void SetTPC(Bool_t tpc)
Definition: AliAODPidHF.h:94
bool Bool_t
Definition: External.C:53
void SetTriggerClass(TString trclass0, TString trclass1="")
Definition: AliRDHFCuts.h:192
Int_t GetUseCentrality() const
Definition: AliRDHFCuts.h:264
void SetPidSelectionFlag(Int_t a)
void SetHighPtCut(Float_t highPtCut)
void SetTriggerMask(ULong64_t mask=0)
Definition: AliRDHFCuts.h:63
const Int_t nptbins
const Float_t kmInvPPi_pp7TeV_pass4[nptbins]
const Float_t kmInvPPi_pPb[nptbins]