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 **************************************************************************/
18 /////////////////////////////////////////////////////////////
20 // Class for cuts on AOD reconstructed Jpsi->ee
22 // Author: A.Dainese, andrea.dainese@pd.infn.it
23 /////////////////////////////////////////////////////////////
25 #include <TDatabasePDG.h>
26 #include <Riostream.h>
28 #include "AliRDHFCutsJpsitoee.h"
29 #include "AliAODRecoDecayHF2Prong.h"
30 #include "AliAODTrack.h"
31 #include "AliESDtrack.h"
33 ClassImp(AliRDHFCutsJpsitoee)
35 //--------------------------------------------------------------------------
36 AliRDHFCutsJpsitoee::AliRDHFCutsJpsitoee(const char* name) :
40 // Default Constructor
44 TString varNames[9]={"inv. mass [GeV]",
46 "cosThetaStar", // negative electron
53 Bool_t isUpperCut[9]={kTRUE,
62 SetVarNames(nvars,varNames,isUpperCut);
63 Bool_t forOpt[9]={kFALSE,
72 SetVarsForOpt(4,forOpt);
73 Float_t limits[2]={0,999999999.};
76 //--------------------------------------------------------------------------
77 AliRDHFCutsJpsitoee::AliRDHFCutsJpsitoee(const AliRDHFCutsJpsitoee &source) :
85 //--------------------------------------------------------------------------
86 AliRDHFCutsJpsitoee &AliRDHFCutsJpsitoee::operator=(const AliRDHFCutsJpsitoee &source)
89 // assignment operator
91 if(&source == this) return *this;
93 AliRDHFCuts::operator=(source);
99 //---------------------------------------------------------------------------
100 void AliRDHFCutsJpsitoee::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
102 // Fills in vars the values of the variables
105 if(nvars!=fnVarsForOpt) {
106 printf("AliRDHFCutsJpsitoee::GetCutsVarsForOpt: wrong number of variables\n");
110 AliAODRecoDecayHF2Prong *dd = (AliAODRecoDecayHF2Prong*)d;
115 vars[iter]=dd->InvMassJPSIee();
119 vars[iter]=dd->GetDCA();
123 vars[iter] = dd->CosThetaStarJPSI();
127 if(pdgdaughters[0]==11) vars[iter]=dd->PtProng(0);
131 if(pdgdaughters[1]==11) vars[iter]=dd->PtProng(1);
135 vars[iter]=dd->Getd0Prong(0);
139 vars[iter]=dd->Getd0Prong(1);
143 vars[iter]= dd->Prodd0d0();
147 vars[iter]=dd->CosPointingAngle();
152 //---------------------------------------------------------------------------
153 Int_t AliRDHFCutsJpsitoee::IsSelected(TObject* obj,Int_t selectionLevel) {
159 cout<<"Cut matrix not inizialized. Exit..."<<endl;
163 AliAODRecoDecayHF2Prong* d=(AliAODRecoDecayHF2Prong*)obj;
166 cout<<"AliAODRecoDecayHF2Prong null"<<endl;
171 // selection on daughter tracks
172 if(selectionLevel==AliRDHFCuts::kAll ||
173 selectionLevel==AliRDHFCuts::kTracks) {
174 if(!AreDaughtersSelected(d)) return 0;
178 // selection on candidate
179 if(selectionLevel==AliRDHFCuts::kAll ||
180 selectionLevel==AliRDHFCuts::kCandidate) {
183 Double_t mJPsi,ctsJPsi;
185 Double_t mJPSIPDG = TDatabasePDG::Instance()->GetParticle(443)->Mass();
187 Int_t ptbin=PtBin(pt);
189 if(d->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) return 0;
191 if(TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)] ||
192 TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) return 0;
195 if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) return 0;
197 mJPsi=d->InvMassJPSIee();
198 if(TMath::Abs(mJPsi-mJPSIPDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) return 0;
200 ctsJPsi=d->CosThetaStarJPSI();
201 if(TMath::Abs(ctsJPsi) > fCutsRD[GetGlobalIndex(2,ptbin)]) return 0;
203 if(d->Prodd0d0() > fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
205 if(d->CosPointingAngle() < fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
210 //---------------------------------------------------------------------------