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 Jpsi->ee
20 // Author: A.Dainese, andrea.dainese@pd.infn.it
21 /////////////////////////////////////////////////////////////
23 #include <TDatabasePDG.h>
24 #include <Riostream.h>
26 #include "AliRDHFCutsJpsitoee.h"
27 #include "AliAODRecoDecayHF2Prong.h"
28 #include "AliAODTrack.h"
29 #include "AliESDtrack.h"
31 ClassImp(AliRDHFCutsJpsitoee)
33 //--------------------------------------------------------------------------
34 AliRDHFCutsJpsitoee::AliRDHFCutsJpsitoee(const char* name) :
38 // Default Constructor
42 TString varNames[9]={"inv. mass [GeV]",
44 "cosThetaStar", // negative electron
51 Bool_t isUpperCut[9]={kTRUE,
60 SetVarNames(nvars,varNames,isUpperCut);
61 Bool_t forOpt[9]={kFALSE,
70 SetVarsForOpt(4,forOpt);
71 Float_t limits[2]={0,999999999.};
74 //--------------------------------------------------------------------------
75 AliRDHFCutsJpsitoee::AliRDHFCutsJpsitoee(const AliRDHFCutsJpsitoee &source) :
83 //--------------------------------------------------------------------------
84 AliRDHFCutsJpsitoee &AliRDHFCutsJpsitoee::operator=(const AliRDHFCutsJpsitoee &source)
87 // assignment operator
89 if(&source == this) return *this;
91 AliRDHFCuts::operator=(source);
97 //---------------------------------------------------------------------------
98 void AliRDHFCutsJpsitoee::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
100 // Fills in vars the values of the variables
103 if(nvars!=fnVarsForOpt) {
104 printf("AliRDHFCutsJpsitoee::GetCutsVarsForOpt: wrong number of variables\n");
108 AliAODRecoDecayHF2Prong *dd = (AliAODRecoDecayHF2Prong*)d;
113 vars[iter]=dd->InvMassJPSIee();
117 vars[iter]=dd->GetDCA();
121 vars[iter] = dd->CosThetaStarJPSI();
125 if(pdgdaughters[0]==11) vars[iter]=dd->PtProng(0);
129 if(pdgdaughters[1]==11) vars[iter]=dd->PtProng(1);
133 vars[iter]=dd->Getd0Prong(0);
137 vars[iter]=dd->Getd0Prong(1);
141 vars[iter]= dd->Prodd0d0();
145 vars[iter]=dd->CosPointingAngle();
150 //---------------------------------------------------------------------------
151 Int_t AliRDHFCutsJpsitoee::IsSelected(TObject* obj,Int_t selectionLevel) {
157 cout<<"Cut matrix not inizialized. Exit..."<<endl;
161 AliAODRecoDecayHF2Prong* d=(AliAODRecoDecayHF2Prong*)obj;
164 cout<<"AliAODRecoDecayHF2Prong null"<<endl;
169 // selection on daughter tracks
170 if(selectionLevel==AliRDHFCuts::kAll ||
171 selectionLevel==AliRDHFCuts::kTracks) {
172 if(!AreDaughtersSelected(d)) return 0;
176 // selection on candidate
177 if(selectionLevel==AliRDHFCuts::kAll ||
178 selectionLevel==AliRDHFCuts::kCandidate) {
181 Double_t mJPsi,ctsJPsi;
183 Double_t mJPSIPDG = TDatabasePDG::Instance()->GetParticle(443)->Mass();
185 Int_t ptbin=PtBin(pt);
187 if(d->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) return 0;
189 if(TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)] ||
190 TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) return 0;
193 if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) return 0;
195 mJPsi=d->InvMassJPSIee();
196 if(TMath::Abs(mJPsi-mJPSIPDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) return 0;
198 ctsJPsi=d->CosThetaStarJPSI();
199 if(TMath::Abs(ctsJPsi) > fCutsRD[GetGlobalIndex(2,ptbin)]) return 0;
201 if(d->Prodd0d0() > fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
203 if(d->CosPointingAngle() < fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
208 //---------------------------------------------------------------------------