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 Lc->pKpi
20 // Author: A.Dainese, andrea.dainese@pd.infn.it
21 /////////////////////////////////////////////////////////////
23 #include <TDatabasePDG.h>
24 #include <Riostream.h>
26 #include "AliRDHFCutsLctopKpi.h"
27 #include "AliAODRecoDecayHF3Prong.h"
28 #include "AliAODTrack.h"
29 #include "AliESDtrack.h"
31 ClassImp(AliRDHFCutsLctopKpi)
33 //--------------------------------------------------------------------------
34 AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi(const char* name) :
38 // Default Constructor
42 TString varNames[12]={"inv. mass [GeV]",
45 "d0P [cm] lower limit!",
46 "d0Pi [cm] lower limit!",
50 "pM=Max{pT1,pT2,pT3} (GeV/c)",
54 Bool_t isUpperCut[12]={kTRUE,
66 SetVarNames(nvars,varNames,isUpperCut);
67 Bool_t forOpt[12]={kFALSE,
79 SetVarsForOpt(5,forOpt);
80 Float_t limits[2]={0,999999999.};
83 //--------------------------------------------------------------------------
84 AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi(const AliRDHFCutsLctopKpi &source) :
92 //--------------------------------------------------------------------------
93 AliRDHFCutsLctopKpi &AliRDHFCutsLctopKpi::operator=(const AliRDHFCutsLctopKpi &source)
96 // assignment operator
98 if(&source == this) return *this;
100 AliRDHFCuts::operator=(source);
106 //---------------------------------------------------------------------------
107 void AliRDHFCutsLctopKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
109 // Fills in vars the values of the variables
112 if(nvars!=fnVarsForOpt) {
113 printf("AliRDHFCutsLctopKpi::GetCutsVarsForOpt: wrong number of variables\n");
117 AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d;
122 vars[iter]=dd->InvMassLcpKpi();
126 for(Int_t iprong=0;iprong<3;iprong++){
127 if(TMath::Abs(pdgdaughters[iprong])==2212) {
128 vars[iter]=dd->PtProng(iprong);
134 for(Int_t iprong=0;iprong<3;iprong++){
135 if(TMath::Abs(pdgdaughters[iprong])==211) {
136 vars[iter]=dd->PtProng(iprong);
142 for(Int_t iprong=0;iprong<3;iprong++){
143 if(TMath::Abs(pdgdaughters[iprong])==2212) {
144 vars[iter]=dd->Getd0Prong(iprong);
150 for(Int_t iprong=0;iprong<3;iprong++){
151 if(TMath::Abs(pdgdaughters[iprong])==211) {
152 vars[iter]=dd->Getd0Prong(iprong);
158 vars[iter]=dd->GetDist12toPrim();
162 vars[iter]=dd->GetSigmaVert();
166 vars[iter] = dd->DecayLength();
171 for(Int_t i=0;i<3;i++){
172 if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
178 vars[iter]=dd->CosPointingAngle();
182 vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
186 vars[iter]=dd->GetDCA();
191 //---------------------------------------------------------------------------
192 Int_t AliRDHFCutsLctopKpi::IsSelected(TObject* obj,Int_t selectionLevel) {
198 cout<<"Cut matrice not inizialized. Exit..."<<endl;
202 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
205 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
210 // selection on daughter tracks
211 if(selectionLevel==AliRDHFCuts::kAll ||
212 selectionLevel==AliRDHFCuts::kTracks) {
213 if(!AreDaughtersSelected(d)) return 0;
219 // selection on candidate
220 if(selectionLevel==AliRDHFCuts::kAll ||
221 selectionLevel==AliRDHFCuts::kCandidate) {
225 Int_t ptbin=PtBin(pt);
227 Double_t mLcpKpi,mLcpiKp;
228 Int_t okLcpKpi=1,okLcpiKp=1;
230 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
232 mLcpKpi=d->InvMassLcpKpi();
233 mLcpiKp=d->InvMassLcpiKp();
235 if(TMath::Abs(mLcpKpi-mLcPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okLcpKpi = 0;
236 if(TMath::Abs(mLcpiKp-mLcPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okLcpiKp = 0;
237 if(!okLcpKpi && !okLcpiKp) return 0;
239 if(TMath::Abs(d->PtProng(1)) < fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) return 0;//Kaon
240 if(TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(4,ptbin)]) return 0;//Proton
241 if(TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(4,ptbin)]) return 0;//Pion
246 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) return 0;
247 if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) return 0;
250 if(d->GetSigmaVert()>fCutsRD[GetGlobalIndex(6,ptbin)]) return 0;
252 if(d->DecayLength()<fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
254 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;
255 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) return 0;
256 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
257 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]) return 0;
260 for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0;
263 if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi
264 if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp
265 if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
271 //---------------------------------------------------------------------------