AliPhysics  ef3b16e (ef3b16e)
AliRDHFCutsJpsitoee.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
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  **************************************************************************/
15 
16 /* $Id$ */
17 
19 //
20 // Class for cuts on AOD reconstructed Jpsi->ee
21 //
22 // Author: A.Dainese, andrea.dainese@pd.infn.it
24 
25 #include <TDatabasePDG.h>
26 #include <Riostream.h>
27 
28 #include "AliRDHFCutsJpsitoee.h"
30 #include "AliAODTrack.h"
31 #include "AliESDtrack.h"
32 
33 using std::cout;
34 using std::endl;
35 
37 ClassImp(AliRDHFCutsJpsitoee);
39 
40 
41 //--------------------------------------------------------------------------
43 AliRDHFCuts(name)
44 {
45  //
46  // Default Constructor
47  //
48  Int_t nvars=9;
49  SetNVars(nvars);
50  TString varNames[9]={"inv. mass [GeV]",
51  "dca [cm]",
52  "cosThetaStar", // negative electron
53  "pTP [GeV/c]",
54  "pTN [GeV/c]",
55  "d0P [cm]",
56  "d0N [cm]",
57  "d0d0 [cm^2]",
58  "cosThetaPoint"};
59  Bool_t isUpperCut[9]={kTRUE,
60  kTRUE,
61  kTRUE,
62  kFALSE,
63  kFALSE,
64  kTRUE,
65  kTRUE,
66  kTRUE,
67  kFALSE};
68  SetVarNames(nvars,varNames,isUpperCut);
69  Bool_t forOpt[9]={kFALSE,
70  kTRUE,
71  kTRUE,
72  kFALSE,
73  kFALSE,
74  kFALSE,
75  kFALSE,
76  kTRUE,
77  kTRUE};
78  SetVarsForOpt(4,forOpt);
79  Float_t limits[2]={0,999999999.};
80  SetPtBins(2,limits);
81 }
82 //--------------------------------------------------------------------------
84  AliRDHFCuts(source)
85 {
86  //
87  // Copy constructor
88  //
89 
90 }
91 //--------------------------------------------------------------------------
93 {
94  //
95  // assignment operator
96  //
97  if(&source == this) return *this;
98 
99  AliRDHFCuts::operator=(source);
100 
101  return *this;
102 }
103 
104 
105 //---------------------------------------------------------------------------
107  //
108  // Fills in vars the values of the variables
109  //
110 
111  if(nvars!=fnVarsForOpt) {
112  printf("AliRDHFCutsJpsitoee::GetCutsVarsForOpt: wrong number of variables\n");
113  return;
114  }
115 
117 
118  Int_t iter=-1;
119  if(fVarsForOpt[0]){
120  iter++;
121  vars[iter]=dd->InvMassJPSIee();
122  }
123  if(fVarsForOpt[1]){
124  iter++;
125  vars[iter]=dd->GetDCA();
126  }
127  if(fVarsForOpt[2]){
128  iter++;
129  vars[iter] = dd->CosThetaStarJPSI();
130  }
131  if(fVarsForOpt[3]){
132  iter++;
133  if(pdgdaughters[0]==11) vars[iter]=dd->PtProng(0);
134  }
135  if(fVarsForOpt[4]){
136  iter++;
137  if(pdgdaughters[1]==11) vars[iter]=dd->PtProng(1);
138  }
139  if(fVarsForOpt[5]){
140  iter++;
141  vars[iter]=dd->Getd0Prong(0);
142  }
143  if(fVarsForOpt[6]){
144  iter++;
145  vars[iter]=dd->Getd0Prong(1);
146  }
147  if(fVarsForOpt[7]){
148  iter++;
149  vars[iter]= dd->Prodd0d0();
150  }
151  if(fVarsForOpt[8]){
152  iter++;
153  vars[iter]=dd->CosPointingAngle();
154  }
155 
156  return;
157 }
158 //---------------------------------------------------------------------------
160  //
161  // Apply selection
162  //
163 
164  if(!fCutsRD){
165  cout<<"Cut matrix not inizialized. Exit..."<<endl;
166  return 0;
167  }
168  //PrintAll();
170 
171  if(!d){
172  cout<<"AliAODRecoDecayHF2Prong null"<<endl;
173  return 0;
174  }
175 
177 
178 
179  // selection on daughter tracks
180  if(selectionLevel==AliRDHFCuts::kAll ||
181  selectionLevel==AliRDHFCuts::kTracks) {
182  if(!AreDaughtersSelected(d,aod)) return 0;
183  }
184 
185 
186  // selection on candidate
187  if(selectionLevel==AliRDHFCuts::kAll ||
188  selectionLevel==AliRDHFCuts::kCandidate) {
189 
190  Double_t pt=d->Pt();
191  Double_t mJPsi,ctsJPsi;
192 
193  Double_t mJPSIPDG = TDatabasePDG::Instance()->GetParticle(443)->Mass();
194 
195  Int_t ptbin=PtBin(pt);
196 
197  if(d->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || d->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) return 0;
198 
199  if(TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)] ||
200  TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) return 0;
201 
202 
203  if(d->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) return 0;
204 
205  mJPsi=d->InvMassJPSIee();
206  if(TMath::Abs(mJPsi-mJPSIPDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) return 0;
207 
208  ctsJPsi=d->CosThetaStarJPSI();
209  if(TMath::Abs(ctsJPsi) > fCutsRD[GetGlobalIndex(2,ptbin)]) return 0;
210 
211  if(d->Prodd0d0() > fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
212 
213  if(d->CosPointingAngle() < fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
214  }
215 
216  return 1;
217 }
218 //---------------------------------------------------------------------------
AliRDHFCutsJpsitoee(const char *name="CutsJpsitoee")
double Double_t
Definition: External.C:58
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:404
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Double_t CosThetaStarJPSI() const
Bool_t HasBadDaughters() const
int Int_t
Definition: External.C:63
Bool_t fUseTrackSelectionWithFilterBits
flag to reject kink daughters
Definition: AliRDHFCuts.h:469
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:429
float Float_t
Definition: External.C:68
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
AliRDHFCutsJpsitoee & operator=(const AliRDHFCutsJpsitoee &source)
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:432
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
Bool_t * fVarsForOpt
number of cut vars to be optimized for candidates
Definition: AliRDHFCuts.h:430
Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd, const AliAODEvent *aod=0x0) const
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Double_t InvMassJPSIee() const
angle of e-
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Int_t PtBin(Double_t pt) const
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const