]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliRDHFCutsDplustoKpipi.cxx
foo
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliRDHFCutsDplustoKpipi.cxx
CommitLineData
e3d40058 1/**************************************************************************
2 * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/////////////////////////////////////////////////////////////
17//
18// Class for cuts on AOD reconstructed D+->Kpipi
19//
20// Author: R. Bala, bala@to.infn.it
21// G. Ortona, ortona@to.infn.it
22/////////////////////////////////////////////////////////////
23
24#include <TDatabasePDG.h>
25#include <Riostream.h>
26
27#include "AliRDHFCutsDplustoKpipi.h"
28#include "AliAODRecoDecayHF3Prong.h"
29#include "AliAODTrack.h"
30#include "AliESDtrack.h"
31
32ClassImp(AliRDHFCutsDplustoKpipi)
33
34//--------------------------------------------------------------------------
35AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi() :
36 AliRDHFCuts()
37{
38 //
39 // Default Constructor
40 //
41 Int_t nvars=12;
42 SetNVars(nvars);
43 TString varNames[12]={"inv. mass [GeV]",
44 "pTK [GeV/c]",
45 "pTPi [GeV/c]",
46 "d0K [cm] lower limit!",
47 "d0Pi [cm] lower limit!",
48 "dist12 (cm)",
49 "sigmavert (cm)",
50 "dist prim-sec (cm)",
51 "pM=Max{pT1,pT2,pT3} (GeV/c)",
52 "cosThetaPoint",
53 "Sum d0^2 (cm^2)",
54 "dca cut (cm)"};
55 Bool_t isUpperCut[12]={kTRUE,
56 kFALSE,
57 kFALSE,
58 kFALSE,
59 kFALSE,
60 kFALSE,
61 kTRUE,
62 kFALSE,
63 kFALSE,
64 kFALSE,
65 kFALSE,
66 kTRUE};
67 SetVarNames(nvars,varNames,isUpperCut);
68 Bool_t forOpt[12]={kTRUE,
69 kFALSE,
70 kFALSE,
71 kFALSE,
72 kFALSE,
73 kFALSE,
74 kTRUE,
75 kTRUE,
76 kTRUE,
77 kTRUE,
78 kTRUE,
79 kFALSE};
80 SetVarsForOpt(6,forOpt);
81 Float_t limits[2]={0,999999999.};
82 SetPtBins(2,limits);
83}
84//--------------------------------------------------------------------------
85AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const AliRDHFCutsDplustoKpipi &source) :
86 AliRDHFCuts(source)
87{
88 //
89 // Copy constructor
90 //
91
92}
93//--------------------------------------------------------------------------
94AliRDHFCutsDplustoKpipi &AliRDHFCutsDplustoKpipi::operator=(const AliRDHFCutsDplustoKpipi &source)
95{
96 //
97 // assignment operator
98 //
99 if(&source == this) return *this;
100
101 AliRDHFCuts::operator=(source);
102
103 return *this;
104}
105
106
107//---------------------------------------------------------------------------
108void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
109 //
110 // Fills in vars the values of the variables
111 //
112
113
114 if(nvars!=fnVarsForOpt) {
115 printf("AliRDHFCutsDplustoKpipi::GetCutsVarsForOpt: wrong number of variables\n");
116 return;
117 }
118
119 AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d;
120 /*
121 vars[0] = dd->GetDCA();
122 if(TMath::Abs(pdgdaughters[0])==211) {
123 vars[1] = dd->CosThetaStarD0();
124 } else {
125 vars[1] = dd->CosThetaStarD0bar();
126 }
127 vars[2] = dd->Prodd0d0();
128 vars[3] = dd->CosPointingAngle();
129
130 return;
131*/
132
133 //possibile generalizzazione
134 Int_t iter=-1;
135 if(fVarsForOpt[0]){
136 iter++;
137 vars[iter]=dd->InvMassDplus();
138 }
139 if(fVarsForOpt[1]){
140 iter++;
141 for(Int_t iprong=0;iprong<3;iprong++){
142 if(TMath::Abs(pdgdaughters[iprong])==321) {
143 vars[iter]=dd->PtProng(iprong);
144 }
145 }
146 }
147 if(fVarsForOpt[2]){
148 iter++;
149 for(Int_t iprong=0;iprong<3;iprong++){
150 if(TMath::Abs(pdgdaughters[iprong])==211) {
151 vars[iter]=dd->PtProng(iprong);
152 }
153 }
154 }
155 if(fVarsForOpt[3]){
156 iter++;
157 for(Int_t iprong=0;iprong<3;iprong++){
158 if(TMath::Abs(pdgdaughters[iprong])==321) {
159 vars[iter]=dd->Getd0Prong(iprong);
160 }
161 }
162 }
163 if(fVarsForOpt[4]){
164 iter++;
165 for(Int_t iprong=0;iprong<3;iprong++){
166 if(TMath::Abs(pdgdaughters[iprong])==211) {
167 vars[iter]=dd->Getd0Prong(iprong);
168 }
169 }
170 }
171 if(fVarsForOpt[5]){
172 iter++;
173 vars[iter]=dd->GetDist12toPrim();
174 }
175 if(fVarsForOpt[6]){
176 iter++;
177 vars[iter]=dd->GetSigmaVert();
178 }
179 if(fVarsForOpt[7]){
180 iter++;
181 vars[iter] = dd->DecayLength();
182 }
183 if(fVarsForOpt[8]){
184 iter++;
185 Float_t ptmax=0;
186 for(Int_t i=0;i<3;i++){
187 if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
188 }
189 vars[iter]=ptmax;
190 }
191 if(fVarsForOpt[9]){
192 iter++;
193 vars[iter]=dd->CosPointingAngle();
194 }
195 if(fVarsForOpt[10]){
196 iter++;
197 vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
198 }
199 if(fVarsForOpt[11]){
200 iter++;
201 vars[iter]=dd->GetDCA();
202 }
203 return;
204}
205//---------------------------------------------------------------------------
206Int_t AliRDHFCutsDplustoKpipi::IsSelected(TObject* obj,Int_t selectionLevel) {
207 //
208 // Apply selection
209 //
210
211 if(!fCutsRD){
212 cout<<"Cut matrice not inizialized. Exit..."<<endl;
213 return 0;
214 }
215 //PrintAll();
216 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
217
218
219 if(!d){
220 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
221 return 0;
222 }
223
224
225
226 // selection on daughter tracks
227 if(selectionLevel==AliRDHFCuts::kAll ||
228 selectionLevel==AliRDHFCuts::kTracks) {
229 if(!AreDaughtersSelected(d)) return 0;
230 }
231
232 // selection on candidate
233 if(selectionLevel==AliRDHFCuts::kAll ||
234 selectionLevel==AliRDHFCuts::kCandidate) {
235
236 Double_t pt=d->Pt();
237
238 Int_t ptbin=PtBin(pt);
239
240 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
241 Double_t mDplus=d->InvMassDplus();
242 if(TMath::Abs(mDplus-mDplusPDG)>fCutsRD[GetGlobalIndex(0,ptbin)])return 0;
243 // if(d->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0 = 0;
244 if(TMath::Abs(d->PtProng(1)) < fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)])return 0;//Kaon
245 if(TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(4,ptbin)])return 0;//Pion1
246 if(TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(4,ptbin)])return 0;//Pion2
247
248
249
250 //2track cuts
251 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)])return 0;
252 if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.)return 0;
253
254 //sec vert
255 if(d->GetSigmaVert()>fCutsRD[GetGlobalIndex(6,ptbin)])return 0;
256
257 if(d->DecayLength()<fCutsRD[GetGlobalIndex(7,ptbin)])return 0;
258
259 if(TMath::Abs(d->PtProng(0))<fCutsRD[GetGlobalIndex(8,ptbin)] && TMath::Abs(d->PtProng(1))<fCutsRD[GetGlobalIndex(8,ptbin)] && TMath::Abs(d->PtProng(2))<fCutsRD[GetGlobalIndex(8,ptbin)])return 0;
260 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)])return 0;
261 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
262 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)])return 0;
263
264 //DCA
265 for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0;
266
267 }
268 return 1;
269}
270//---------------------------------------------------------------------------