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
104 if (!obj) return kFALSE ;
106 TString className(obj->ClassName());
107 if (className.CompareTo("AliCFPair") != 0) {
108 Error("IsSelected","obj must point to an AliCFPair !");
112 AliCFPair * pair = dynamic_cast<AliCFPair*>(obj);
113 AliESDv0 * esdV0 = pair->GetESDV0();
114 AliAODv0 * aodV0 = pair->GetAODV0();
115 AliVParticle * negDaughter = pair->GetNeg();
116 AliVParticle * posDaughter = pair->GetPos();
118 Double32_t dcaDaughters = 0. ;
119 Double32_t cosP = 0. ;
120 Double32_t negDca = 0. ;
121 Double32_t posDca = 0. ;
124 dcaDaughters = esdV0->GetDcaV0Daughters() ;
125 cosP = esdV0->GetV0CosineOfPointingAngle() ;
128 if (negDaughter) ((AliESDtrack*)negDaughter)->GetImpactParameters(tDca[0],tDca[1]);
129 else { tDca[0]=1.e99; tDca[1]=1.e99;}
130 negDca = TMath::Sqrt(tDca[0]*tDca[0]+tDca[1]*tDca[1]);
131 if (posDaughter) ((AliESDtrack*)posDaughter)->GetImpactParameters(tDca[0],tDca[1]);
132 else { tDca[0]=1.e99; tDca[1]=1.e99;}
133 posDca = TMath::Sqrt(tDca[0]*tDca[0]+tDca[1]*tDca[1]);
136 dcaDaughters = aodV0->DcaV0Daughters() ;
137 negDca = aodV0->DcaNegToPrimVertex() ;
138 posDca = aodV0->DcaPosToPrimVertex() ;
139 cosP = aodV0->CosPointingAngle(((AliAODEvent*)fEvent)->GetPrimaryVertex()) ;
141 else Error("IsSelected","No V0 pointer available");
143 if (dcaDaughters > fMaxDcaDaughters) return kFALSE ;
144 if (cosP < fMinCosP ) return kFALSE ;
145 if (negDca < fMinDcaNeg ) return kFALSE ;
146 if (posDca < fMinDcaPos ) return kFALSE ;