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"
36 ClassImp(AliRDHFCutsJpsitoee)
38 //--------------------------------------------------------------------------
39 AliRDHFCutsJpsitoee::AliRDHFCutsJpsitoee(const char* name) :
43 // Default Constructor
47 TString varNames[9]={"inv. mass [GeV]",
49 "cosThetaStar", // negative electron
56 Bool_t isUpperCut[9]={kTRUE,
65 SetVarNames(nvars,varNames,isUpperCut);
66 Bool_t forOpt[9]={kFALSE,
75 SetVarsForOpt(4,forOpt);
76 Float_t limits[2]={0,999999999.};
79 //--------------------------------------------------------------------------
80 AliRDHFCutsJpsitoee::AliRDHFCutsJpsitoee(const AliRDHFCutsJpsitoee &source) :
88 //--------------------------------------------------------------------------
89 AliRDHFCutsJpsitoee &AliRDHFCutsJpsitoee::operator=(const AliRDHFCutsJpsitoee &source)
92 // assignment operator
94 if(&source == this) return *this;
96 AliRDHFCuts::operator=(source);
102 //---------------------------------------------------------------------------
103 void AliRDHFCutsJpsitoee::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
105 // Fills in vars the values of the variables
108 if(nvars!=fnVarsForOpt) {
109 printf("AliRDHFCutsJpsitoee::GetCutsVarsForOpt: wrong number of variables\n");
113 AliAODRecoDecayHF2Prong *dd = (AliAODRecoDecayHF2Prong*)d;
118 vars[iter]=dd->InvMassJPSIee();
122 vars[iter]=dd->GetDCA();
126 vars[iter] = dd->CosThetaStarJPSI();
130 if(pdgdaughters[0]==11) vars[iter]=dd->PtProng(0);
134 if(pdgdaughters[1]==11) vars[iter]=dd->PtProng(1);
138 vars[iter]=dd->Getd0Prong(0);
142 vars[iter]=dd->Getd0Prong(1);
146 vars[iter]= dd->Prodd0d0();
150 vars[iter]=dd->CosPointingAngle();
155 //---------------------------------------------------------------------------
156 Int_t AliRDHFCutsJpsitoee::IsSelected(TObject* obj,Int_t selectionLevel) {
162 cout<<"Cut matrix not inizialized. Exit..."<<endl;
166 AliAODRecoDecayHF2Prong* d=(AliAODRecoDecayHF2Prong*)obj;
169 cout<<"AliAODRecoDecayHF2Prong null"<<endl;
173 if(fUseTrackSelectionWithFilterBits && d->HasBadDaughters()) return 0;
176 // selection on daughter tracks
177 if(selectionLevel==AliRDHFCuts::kAll ||
178 selectionLevel==AliRDHFCuts::kTracks) {
179 if(!AreDaughtersSelected(d)) return 0;
183 // selection on candidate
184 if(selectionLevel==AliRDHFCuts::kAll ||
185 selectionLevel==AliRDHFCuts::kCandidate) {
188 Double_t mJPsi,ctsJPsi;
190 Double_t mJPSIPDG = TDatabasePDG::Instance()->GetParticle(443)->Mass();
192 Int_t ptbin=PtBin(pt);
194 if(d->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) return 0;
196 if(TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)] ||
197 TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) return 0;
200 if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) return 0;
202 mJPsi=d->InvMassJPSIee();
203 if(TMath::Abs(mJPsi-mJPSIPDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) return 0;
205 ctsJPsi=d->CosThetaStarJPSI();
206 if(TMath::Abs(ctsJPsi) > fCutsRD[GetGlobalIndex(2,ptbin)]) return 0;
208 if(d->Prodd0d0() > fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
210 if(d->CosPointingAngle() < fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
215 //---------------------------------------------------------------------------