New classes for the cuts on charm candidates
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliRDHFCutsD0toKpipipi.cxx
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 /////////////////////////////////////////////////////////////
17 //
18 // Class for cuts on AOD reconstructed D0->Kpi
19 //
20 // Author: A.Dainese, andrea.dainese@pd.infn.it
21 /////////////////////////////////////////////////////////////
22
23 #include <TDatabasePDG.h>
24 #include <Riostream.h>
25
26 #include "AliRDHFCutsD0toKpipipi.h"
27 #include "AliAODRecoDecayHF4Prong.h"
28 #include "AliAODTrack.h"
29 #include "AliESDtrack.h"
30
31 ClassImp(AliRDHFCutsD0toKpipipi)
32
33 //--------------------------------------------------------------------------
34 AliRDHFCutsD0toKpipipi::AliRDHFCutsD0toKpipipi() : 
35 AliRDHFCuts()
36 {
37   //
38   // Default Constructor
39   //
40   Int_t nvars=9;
41   SetNVars(nvars);
42   TString varNames[9]={"inv. mass [GeV]",   
43                        "dca [cm]",
44                        "cosThetaStar", 
45                        "pTK [GeV/c]",
46                        "pTPi [GeV/c]",
47                        "d0K [cm]",
48                        "d0Pi [cm]",
49                        "d0d0 [cm^2]",
50                        "cosThetaPoint"};
51   Bool_t isUpperCut[9]={kTRUE,
52                         kTRUE,
53                         kTRUE,
54                         kFALSE,
55                         kFALSE,
56                         kTRUE,
57                         kTRUE,
58                         kTRUE,
59                         kFALSE};
60   SetVarNames(nvars,varNames,isUpperCut);
61   Bool_t forOpt[9]={kFALSE,
62                     kTRUE,
63                     kTRUE,
64                     kFALSE,
65                     kFALSE,
66                     kFALSE,
67                     kFALSE,
68                     kTRUE,
69                     kTRUE};
70   SetVarsForOpt(4,forOpt);
71   Float_t limits[2]={0,999999999.};
72   SetPtBins(2,limits);
73 }
74 //--------------------------------------------------------------------------
75 AliRDHFCutsD0toKpipipi::AliRDHFCutsD0toKpipipi(const AliRDHFCutsD0toKpipipi &source) :
76   AliRDHFCuts(source)
77 {
78   //
79   // Copy constructor
80   //
81
82 }
83 //--------------------------------------------------------------------------
84 AliRDHFCutsD0toKpipipi &AliRDHFCutsD0toKpipipi::operator=(const AliRDHFCutsD0toKpipipi &source)
85 {
86   //
87   // assignment operator
88   //
89   if(&source == this) return *this;
90
91   AliRDHFCuts::operator=(source);
92
93   return *this;
94 }
95
96
97 //---------------------------------------------------------------------------
98 void AliRDHFCutsD0toKpipipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
99   // 
100   // Fills in vars the values of the variables 
101   //
102
103   if(nvars!=fnVarsForOpt) {
104     printf("AliRDHFCutsD0toKpipipi::GetCutsVarsForOpt: wrong number of variables\n");
105     return;
106   }
107
108   AliAODRecoDecayHF4Prong *dd = (AliAODRecoDecayHF4Prong*)d;
109  
110   
111   return;
112 }
113 //---------------------------------------------------------------------------
114 Int_t AliRDHFCutsD0toKpipipi::IsSelected(TObject* obj,Int_t selectionLevel) {
115   //
116   // Apply selection
117   //
118
119   if(!fCutsRD){
120     cout<<"Cut matrice not inizialized. Exit..."<<endl;
121     return 0;
122   }
123   //PrintAll();
124   AliAODRecoDecayHF4Prong* d=(AliAODRecoDecayHF4Prong*)obj;
125
126   if(!d){
127     cout<<"AliAODRecoDecayHF4Prong null"<<endl;
128     return 0;
129   }
130
131
132   // selection on daughter tracks 
133   if(selectionLevel==AliRDHFCuts::kAll || 
134      selectionLevel==AliRDHFCuts::kTracks) {
135     if(!AreDaughtersSelected(d)) return 0;
136   }
137
138
139   Int_t returnvalue=1;
140
141   // selection on candidate
142   if(selectionLevel==AliRDHFCuts::kAll || 
143      selectionLevel==AliRDHFCuts::kCandidate) {
144     
145   }
146
147
148   return returnvalue;
149
150 }
151 //---------------------------------------------------------------------------