]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CORRFW/AliCFV0TopoCuts.cxx
effc++ warnings
[u/mrichter/AliRoot.git] / CORRFW / AliCFV0TopoCuts.cxx
CommitLineData
2fbc0b17 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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// ---- CORRECTION FRAMEWORK ----
19// Class to cut on V0 topology
20// -> support for :
21// DCA between V0 daughters
22// V0 daughter impact parameters wrt primary vertex
23// cosine of V0 pointing angle
24//
25///////////////////////////////////////////////////////////////////////////
26// author : R. Vernet (renaud.vernet@cern.ch)
27///////////////////////////////////////////////////////////////////////////
28
29#include "AliCFV0TopoCuts.h"
30#include "AliESDv0.h"
31#include "AliESDtrack.h"
32#include "AliCFPair.h"
33
34ClassImp(AliCFV0TopoCuts)
35
36//______________________________________________________________
37AliCFV0TopoCuts::AliCFV0TopoCuts() :
38 AliCFCutBase(),
39 fMaxDcaDaughters(1.e99),
40 fMinDcaNeg(0),
41 fMinDcaPos(0),
42 fMinCosP(0)
43{
44 //
45 //default constructor
46 //
47}
48
49//______________________________________________________________
50AliCFV0TopoCuts::AliCFV0TopoCuts(const Char_t* name, const Char_t* title) :
51 AliCFCutBase(name,title),
52 fMaxDcaDaughters(1.e99),
53 fMinDcaNeg(0),
54 fMinDcaPos(0),
55 fMinCosP(0)
56{
57 //
58}
59
60//______________________________________________________________
61AliCFV0TopoCuts::AliCFV0TopoCuts(const AliCFV0TopoCuts& c) :
62 AliCFCutBase(c),
63 fMaxDcaDaughters(c.fMaxDcaDaughters),
64 fMinDcaNeg(c.fMinDcaNeg),
65 fMinDcaPos(c.fMinDcaPos),
66 fMinCosP(c.fMinCosP)
67{
68 //
69 // copy constructor
70 //
71}
72
73//______________________________________________________________
74AliCFV0TopoCuts& AliCFV0TopoCuts::operator=(const AliCFV0TopoCuts& c)
75{
76 //
77 // assignment operator
78 //
79
80 if (this != &c) {
81 AliCFCutBase::operator=(c) ;
82 fMaxDcaDaughters = c.fMaxDcaDaughters ;
83 fMinDcaNeg = c.fMinDcaNeg ;
84 fMinDcaPos = c.fMinDcaPos ;
85 fMinCosP = c.fMinCosP ;
86 }
87 return *this ;
88}
89
90//______________________________________________________________
91Bool_t AliCFV0TopoCuts::IsSelected(TObject *obj) {
92 //
93 // computes V0 topological variables to cut on and return true
94 // in case the V0 is accepted
95 //
96
97 if (!obj) return kFALSE ;
98
99 TString className(obj->ClassName());
100 if (className.CompareTo("AliCFPair") != 0) {
101 Error("IsSelected","obj must point to an AliCFPair !");
102 return kFALSE ;
103 }
104
105 AliCFPair * pair = dynamic_cast<AliCFPair*>(obj);
106 AliESDv0 * v0 = pair->GetV0();
107 AliESDtrack * negDaughter = pair->GetNeg();
108 AliESDtrack * posDaughter = pair->GetPos();
109
110 if (v0->GetDcaV0Daughters() > fMaxDcaDaughters) return kFALSE ;
111 if (v0->GetV0CosineOfPointingAngle() < fMinCosP) return kFALSE ;
112
113
114 Float_t tDca[2];
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]);
121
122 if (negDca < fMinDcaNeg) return kFALSE ;
123 if (posDca < fMinDcaPos) return kFALSE ;
124
125 return kTRUE ;
126}
127