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 ClassImp(AliCFV0TopoCuts)
36 //______________________________________________________________
37 AliCFV0TopoCuts::AliCFV0TopoCuts() :
39 fMaxDcaDaughters(1.e99),
49 //______________________________________________________________
50 AliCFV0TopoCuts::AliCFV0TopoCuts(const Char_t* name, const Char_t* title) :
51 AliCFCutBase(name,title),
52 fMaxDcaDaughters(1.e99),
60 //______________________________________________________________
61 AliCFV0TopoCuts::AliCFV0TopoCuts(const AliCFV0TopoCuts& c) :
63 fMaxDcaDaughters(c.fMaxDcaDaughters),
64 fMinDcaNeg(c.fMinDcaNeg),
65 fMinDcaPos(c.fMinDcaPos),
73 //______________________________________________________________
74 AliCFV0TopoCuts& AliCFV0TopoCuts::operator=(const AliCFV0TopoCuts& c)
77 // assignment operator
81 AliCFCutBase::operator=(c) ;
82 fMaxDcaDaughters = c.fMaxDcaDaughters ;
83 fMinDcaNeg = c.fMinDcaNeg ;
84 fMinDcaPos = c.fMinDcaPos ;
85 fMinCosP = c.fMinCosP ;
90 //______________________________________________________________
91 Bool_t AliCFV0TopoCuts::IsSelected(TObject *obj) {
93 // computes V0 topological variables to cut on and return true
94 // in case the V0 is accepted
97 if (!obj) return kFALSE ;
99 TString className(obj->ClassName());
100 if (className.CompareTo("AliCFPair") != 0) {
101 Error("IsSelected","obj must point to an AliCFPair !");
105 AliCFPair * pair = dynamic_cast<AliCFPair*>(obj);
106 AliESDv0 * v0 = pair->GetV0();
107 AliESDtrack * negDaughter = pair->GetNeg();
108 AliESDtrack * posDaughter = pair->GetPos();
110 if (v0->GetDcaV0Daughters() > fMaxDcaDaughters) return kFALSE ;
111 if (v0->GetV0CosineOfPointingAngle() < fMinCosP) return kFALSE ;
115 if (negDaughter) negDaughter->GetImpactParameters(tDca[0],tDca[1]);
116 else { tDca[0]=1.e99; tDca[1]=1.e99;}
117 Double32_t negDca = TMath::Sqrt(tDca[0]*tDca[0]+tDca[1]*tDca[1]);
118 if (posDaughter) posDaughter->GetImpactParameters(tDca[0],tDca[1]);
119 else { tDca[0]=1.e99; tDca[1]=1.e99;}
120 Double32_t posDca = TMath::Sqrt(tDca[0]*tDca[0]+tDca[1]*tDca[1]);
122 if (negDca < fMinDcaNeg) return kFALSE ;
123 if (posDca < fMinDcaPos) return kFALSE ;