1 /**************************************************************************
2 * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /////////////////////////////////////////////////////////////
18 // Class for cuts on AOD reconstructed D+->Kpipi
20 // Author: R. Bala, bala@to.infn.it
21 // G. Ortona, ortona@to.infn.it
22 /////////////////////////////////////////////////////////////
24 #include <TDatabasePDG.h>
25 #include <Riostream.h>
27 #include "AliRDHFCutsDplustoKpipi.h"
28 #include "AliAODRecoDecayHF3Prong.h"
29 #include "AliAODTrack.h"
30 #include "AliESDtrack.h"
32 ClassImp(AliRDHFCutsDplustoKpipi)
34 //--------------------------------------------------------------------------
35 AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi() :
39 // Default Constructor
43 TString varNames[12]={"inv. mass [GeV]",
46 "d0K [cm] lower limit!",
47 "d0Pi [cm] lower limit!",
51 "pM=Max{pT1,pT2,pT3} (GeV/c)",
55 Bool_t isUpperCut[12]={kTRUE,
67 SetVarNames(nvars,varNames,isUpperCut);
68 Bool_t forOpt[12]={kTRUE,
80 SetVarsForOpt(6,forOpt);
81 Float_t limits[2]={0,999999999.};
84 //--------------------------------------------------------------------------
85 AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const AliRDHFCutsDplustoKpipi &source) :
93 //--------------------------------------------------------------------------
94 AliRDHFCutsDplustoKpipi &AliRDHFCutsDplustoKpipi::operator=(const AliRDHFCutsDplustoKpipi &source)
97 // assignment operator
99 if(&source == this) return *this;
101 AliRDHFCuts::operator=(source);
107 //---------------------------------------------------------------------------
108 void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
110 // Fills in vars the values of the variables
114 if(nvars!=fnVarsForOpt) {
115 printf("AliRDHFCutsDplustoKpipi::GetCutsVarsForOpt: wrong number of variables\n");
119 AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d;
121 vars[0] = dd->GetDCA();
122 if(TMath::Abs(pdgdaughters[0])==211) {
123 vars[1] = dd->CosThetaStarD0();
125 vars[1] = dd->CosThetaStarD0bar();
127 vars[2] = dd->Prodd0d0();
128 vars[3] = dd->CosPointingAngle();
133 //possibile generalizzazione
137 vars[iter]=dd->InvMassDplus();
141 for(Int_t iprong=0;iprong<3;iprong++){
142 if(TMath::Abs(pdgdaughters[iprong])==321) {
143 vars[iter]=dd->PtProng(iprong);
149 for(Int_t iprong=0;iprong<3;iprong++){
150 if(TMath::Abs(pdgdaughters[iprong])==211) {
151 vars[iter]=dd->PtProng(iprong);
157 for(Int_t iprong=0;iprong<3;iprong++){
158 if(TMath::Abs(pdgdaughters[iprong])==321) {
159 vars[iter]=dd->Getd0Prong(iprong);
165 for(Int_t iprong=0;iprong<3;iprong++){
166 if(TMath::Abs(pdgdaughters[iprong])==211) {
167 vars[iter]=dd->Getd0Prong(iprong);
173 vars[iter]=dd->GetDist12toPrim();
177 vars[iter]=dd->GetSigmaVert();
181 vars[iter] = dd->DecayLength();
186 for(Int_t i=0;i<3;i++){
187 if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
193 vars[iter]=dd->CosPointingAngle();
197 vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
201 vars[iter]=dd->GetDCA();
205 //---------------------------------------------------------------------------
206 Int_t AliRDHFCutsDplustoKpipi::IsSelected(TObject* obj,Int_t selectionLevel) {
212 cout<<"Cut matrice not inizialized. Exit..."<<endl;
216 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
220 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
226 // selection on daughter tracks
227 if(selectionLevel==AliRDHFCuts::kAll ||
228 selectionLevel==AliRDHFCuts::kTracks) {
229 if(!AreDaughtersSelected(d)) return 0;
232 // selection on candidate
233 if(selectionLevel==AliRDHFCuts::kAll ||
234 selectionLevel==AliRDHFCuts::kCandidate) {
238 Int_t ptbin=PtBin(pt);
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
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;
255 if(d->GetSigmaVert()>fCutsRD[GetGlobalIndex(6,ptbin)])return 0;
257 if(d->DecayLength()<fCutsRD[GetGlobalIndex(7,ptbin)])return 0;
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;
265 for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0;
270 //---------------------------------------------------------------------------