AliPhysics  41af4b0 (41af4b0)
AliAODRecoDecayHF2Prong.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2006, 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 // Base class for AOD reconstructed heavy-flavour 2-prong decay
21 //
22 // Author: A.Dainese, andrea.dainese@lnl.infn.it
24 
25 #include <TDatabasePDG.h>
26 #include "AliAODRecoDecayHF.h"
29 
31 ClassImp(AliAODRecoDecayHF2Prong);
33 
34 //--------------------------------------------------------------------------
37 {
38  //
40  //
41 }
42 //--------------------------------------------------------------------------
44  Double_t *px,Double_t *py,Double_t *pz,
45  Double_t *d0,Double_t *d0err,Float_t dca) :
46  AliAODRecoDecayHF(vtx2,2,0,px,py,pz,d0,d0err)
47 {
48  //
50  //
51  SetDCA(dca);
52 }
53 //--------------------------------------------------------------------------
55  Double_t *d0,Double_t *d0err,Float_t dca) :
56  AliAODRecoDecayHF(vtx2,2,0,d0,d0err)
57 {
58  //
60  //
61  SetDCA(dca);
62 }
63 //--------------------------------------------------------------------------
65  AliAODRecoDecayHF(source)
66 {
67  //
69  //
70 }
71 //--------------------------------------------------------------------------
73 {
74  //
76  //
77  if(&source == this) return *this;
78 
80 
81  return *this;
82 }
83 //--------------------------------------------------------------------------
85  const {
102  Double_t mD0,mD0bar,ctsD0,ctsD0bar;
103  okD0=1; okD0bar=1;
104 
105  Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
106 
107  if(PtProng(1) < cuts[3] || PtProng(0) < cuts[4]) okD0 = 0;
108  if(PtProng(0) < cuts[3] || PtProng(1) < cuts[4]) okD0bar = 0;
109  if(!okD0 && !okD0bar) return kFALSE;
110 
111  if(TMath::Abs(Getd0Prong(1)) > cuts[5] ||
112  TMath::Abs(Getd0Prong(0)) > cuts[6]) okD0 = 0;
113  if(TMath::Abs(Getd0Prong(0)) > cuts[6] ||
114  TMath::Abs(Getd0Prong(1)) > cuts[5]) okD0bar = 0;
115  if(!okD0 && !okD0bar) return kFALSE;
116 
117  if(GetDCA() > cuts[1]) { okD0 = okD0bar = 0; return kFALSE; }
118 
119  InvMassD0(mD0,mD0bar);
120  if(TMath::Abs(mD0-mD0PDG) > cuts[0]) okD0 = 0;
121  if(TMath::Abs(mD0bar-mD0PDG) > cuts[0]) okD0bar = 0;
122  if(!okD0 && !okD0bar) return kFALSE;
123 
124  CosThetaStarD0(ctsD0,ctsD0bar);
125  if(TMath::Abs(ctsD0) > cuts[2]) okD0 = 0;
126  if(TMath::Abs(ctsD0bar) > cuts[2]) okD0bar = 0;
127  if(!okD0 && !okD0bar) return kFALSE;
128 
129  if(Prodd0d0() > cuts[7]) { okD0 = okD0bar = 0; return kFALSE; }
130 
131  if(CosPointingAngle() < cuts[8]) { okD0 = okD0bar = 0; return kFALSE; }
132 
133  return kTRUE;
134 }
135 //-----------------------------------------------------------------------------
137  const {
154  Double_t mJPsi,ctsJPsi;
155  okB=1;
156 
157  Double_t mJPSIPDG = TDatabasePDG::Instance()->GetParticle(443)->Mass();
158 
159  if(PtProng(1) < cuts[3] || PtProng(0) < cuts[4]) okB = 0;
160  if(!okB) return kFALSE;
161 
162  if(TMath::Abs(Getd0Prong(1)) > cuts[5] ||
163  TMath::Abs(Getd0Prong(0)) > cuts[6]) okB = 0;
164  if(!okB) return kFALSE;
165 
166  if(GetDCA() > cuts[1]) { okB = 0; return kFALSE; }
167 
168  mJPsi=InvMassJPSIee();
169  if(TMath::Abs(mJPsi-mJPSIPDG) > cuts[0]) okB = 0;
170  if(!okB) return kFALSE;
171 
172  ctsJPsi=CosThetaStarJPSI();
173  if(TMath::Abs(ctsJPsi) > cuts[2]) okB = 0;
174  if(!okB) return kFALSE;
175 
176  if(Prodd0d0() > cuts[7]) { okB = 0; return kFALSE; }
177 
178  if(CosPointingAngle() < cuts[8]) { okB = 0; return kFALSE; }
179 
180  return kTRUE;
181 }
182 //-----------------------------------------------------------------------------
183 Int_t AliAODRecoDecayHF2Prong::MatchToMCB3Prong(Int_t pdgabs,Int_t pdgabs3prong, Int_t *pdgBDg,Int_t *pdgDg3prong, TClonesArray *mcArray) const
184 {
185  //std::cout<<"MCmatch 1"<<std::endl;
186  //
187  // Check if this candidate is matched to a MC signal
188  // If no, return -1
189  // If yes, return label (>=0) of the AliAODMCParticle
190  //
191  Int_t ndg=GetNDaughters();
192  if(ndg==0) {
193  AliError("No daughters available");
194  return -1;
195  }
196  if(ndg>10){
197  AliError("Only decays with <10 daughters supported");
198  return -1;
199  }
200 
201 
202 
203 
204  AliAODRecoDecayHF3Prong *DDaughter = (AliAODRecoDecayHF3Prong*)GetDaughter(0);
205  if(!DDaughter)return -1;
206  Int_t DLabel = DDaughter->MatchToMC(pdgabs3prong,mcArray,3,pdgDg3prong);
207  if(DLabel<0) return -1;
208 
209  Int_t dgLabels[10]={0};
210 
211 
212  // loop on daughters and write labels
213  for(Int_t i=0; i<ndg; i++) {
214  AliVTrack *trk = (AliVTrack*)GetDaughter(i);
215  Int_t lab = trk->GetLabel();
216  if(lab==-1) { // this daughter is the 3prong
217  lab=DLabel;
218  } else if(lab<-1) {
219  printf("daughter with negative label\n");
220  continue;
221  }
222  dgLabels[i] = lab;
223 
224  }
225 
226 
227  Int_t label = MatchToMC(pdgabs,mcArray,dgLabels,ndg,2,pdgBDg);
228 
229 
230 
231  return label;
232 
233 }
AliAODRecoDecayHF & operator=(const AliAODRecoDecayHF &source)
double Double_t
Definition: External.C:58
Double_t CosThetaStarJPSI() const
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
Bool_t SelectD0(const Double_t *cuts, Int_t &okD0, Int_t &okD0bar) const
AliAODRecoDecayHF2Prong & operator=(const AliAODRecoDecayHF2Prong &source)
Double_t InvMassJPSIee() const
angle of e-
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
Bool_t SelectBtoJPSI(const Double_t *cuts, Int_t &okB) const
Int_t MatchToMCB3Prong(Int_t pdgabs, Int_t pdgabs3prong, Int_t *pdgBDg, Int_t *pdgDg3prong, TClonesArray *mcArray) const