1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////
18 // ---- CORRECTION FRAMEWORK ----
19 // Class to cut on V0 topology
21 // DCA between V0 daughters
22 // V0 daughter impact parameters wrt primary vertex
23 // cosine of V0 pointing angle
25 ///////////////////////////////////////////////////////////////////////////
26 // author : R. Vernet (renaud.vernet@cern.ch)
27 ///////////////////////////////////////////////////////////////////////////
29 #include "AliCFV0TopoCuts.h"
31 #include "AliESDtrack.h"
32 #include "AliCFPair.h"
34 #include "AliVEvent.h"
35 #include "AliAODEvent.h"
37 ClassImp(AliCFV0TopoCuts)
39 //______________________________________________________________
40 AliCFV0TopoCuts::AliCFV0TopoCuts() :
42 fMaxDcaDaughters(1.e99),
53 //______________________________________________________________
54 AliCFV0TopoCuts::AliCFV0TopoCuts(const Char_t* name, const Char_t* title) :
55 AliCFCutBase(name,title),
56 fMaxDcaDaughters(1.e99),
65 //______________________________________________________________
66 AliCFV0TopoCuts::AliCFV0TopoCuts(const AliCFV0TopoCuts& c) :
68 fMaxDcaDaughters(c.fMaxDcaDaughters),
69 fMinDcaNeg(c.fMinDcaNeg),
70 fMinDcaPos(c.fMinDcaPos),
79 //______________________________________________________________
80 AliCFV0TopoCuts& AliCFV0TopoCuts::operator=(const AliCFV0TopoCuts& c)
83 // assignment operator
87 AliCFCutBase::operator=(c) ;
88 fMaxDcaDaughters = c.fMaxDcaDaughters ;
89 fMinDcaNeg = c.fMinDcaNeg ;
90 fMinDcaPos = c.fMinDcaPos ;
91 fMinCosP = c.fMinCosP ;
97 //______________________________________________________________
98 Bool_t AliCFV0TopoCuts::IsSelected(TObject *obj) {
100 // computes V0 topological variables to cut on and return true
101 // in case the V0 is accepted
105 AliCFPair* pair = dynamic_cast<AliCFPair*>(obj);
106 if (!pair) return kFALSE ;
108 TString className(pair->ClassName());
109 if (className.CompareTo("AliCFPair") != 0) {
110 Error("IsSelected","obj must point to an AliCFPair !");
114 AliESDv0 * esdV0 = pair->GetESDV0();
115 AliAODv0 * aodV0 = pair->GetAODV0();
116 AliVParticle * negDaughter = pair->GetNeg();
117 AliVParticle * posDaughter = pair->GetPos();
119 Double32_t dcaDaughters = 0. ;
120 Double32_t cosP = 0. ;
121 Double32_t negDca = 0. ;
122 Double32_t posDca = 0. ;
125 dcaDaughters = esdV0->GetDcaV0Daughters() ;
126 cosP = esdV0->GetV0CosineOfPointingAngle() ;
129 if (negDaughter) ((AliESDtrack*)negDaughter)->GetImpactParameters(tDca[0],tDca[1]);
130 else { tDca[0]=1.e+09; tDca[1]=1.e+09;}
131 negDca = TMath::Sqrt(tDca[0]*tDca[0]+tDca[1]*tDca[1]);
132 if (posDaughter) ((AliESDtrack*)posDaughter)->GetImpactParameters(tDca[0],tDca[1]);
133 else { tDca[0]=1.e+09; tDca[1]=1.e+09;}
134 posDca = TMath::Sqrt(tDca[0]*tDca[0]+tDca[1]*tDca[1]);
137 dcaDaughters = aodV0->DcaV0Daughters() ;
138 negDca = aodV0->DcaNegToPrimVertex() ;
139 posDca = aodV0->DcaPosToPrimVertex() ;
140 cosP = aodV0->CosPointingAngle(((AliAODEvent*)fEvent)->GetPrimaryVertex()) ;
142 else Error("IsSelected","No V0 pointer available");
144 if (dcaDaughters > fMaxDcaDaughters) return kFALSE ;
145 if (cosP < fMinCosP ) return kFALSE ;
146 if (negDca < fMinDcaNeg ) return kFALSE ;
147 if (posDca < fMinDcaPos ) return kFALSE ;