]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CORRFW/AliCFPairQualityCuts.cxx
fix memory leak and funny multiplicity
[u/mrichter/AliRoot.git] / CORRFW / AliCFPairQualityCuts.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// Class to handle track quality in track pairs
19// The track pair object to use is AliCFPair
20// author : renaud.vernet@cern.ch
21///////////////////////////////////////////////
22
23#include "AliCFPairQualityCuts.h"
24#include "AliCFPair.h"
25
26ClassImp(AliCFPairQualityCuts)
27
28//__________________________________________________________________________________
29AliCFPairQualityCuts::AliCFPairQualityCuts() :
29a4c1fe 30 AliCFCutBase(),
31 fCutNeg(new AliCFTrackQualityCuts()),
32 fCutPos(new AliCFTrackQualityCuts())
2fbc0b17 33{
34 //
35 // Default constructor
36 //
2fbc0b17 37}
38//__________________________________________________________________________________
39AliCFPairQualityCuts::AliCFPairQualityCuts(Char_t* name, Char_t* title) :
29a4c1fe 40 AliCFCutBase(name,title),
41 fCutNeg(new AliCFTrackQualityCuts(name,title)),
42 fCutPos(new AliCFTrackQualityCuts(name,title))
2fbc0b17 43{
44 //
29a4c1fe 45 // Named Constructor
2fbc0b17 46 //
2fbc0b17 47}
48//__________________________________________________________________________________
49AliCFPairQualityCuts::AliCFPairQualityCuts(const AliCFPairQualityCuts& c) :
50 AliCFCutBase(c),
51 fCutNeg(c.fCutNeg),
52 fCutPos(c.fCutPos)
53{
54 //
55 // copy constructor
56 //
57}
58//__________________________________________________________________________________
59AliCFPairQualityCuts& AliCFPairQualityCuts::operator=(const AliCFPairQualityCuts& c)
60{
61 //
62 // Assignment operator
63 //
64 if (this != &c) {
65 AliCFCutBase::operator=(c) ;
66 fCutNeg = c.fCutNeg ;
67 fCutPos = c.fCutPos ;
68 }
69 return *this;
70}
71
72//__________________________________________________________________________________
73Bool_t AliCFPairQualityCuts::IsSelected(TObject* obj) {
74 //
75 // loops over decisions of single cuts and returns if the track is accepted
76 //
77
78 if (!obj) return kFALSE ;
79 TString className(obj->ClassName());
80 if (className.CompareTo("AliCFPair") != 0) {
81 Error("IsSelected","obj must point to a AliCFPair !");
82 return kFALSE ;
83 }
84
85 AliCFPair* pair = dynamic_cast<AliCFPair*>(obj);
86
10d9a8a6 87 AliVParticle* tneg = pair->GetNeg();
88 AliVParticle* tpos = pair->GetPos();
2fbc0b17 89 if (!tneg || !tpos) return kFALSE ;
90
91 if ( ! fCutNeg->IsSelected((TObject*)tneg) || ! fCutPos->IsSelected((TObject*)tpos) ) return kFALSE ;
92
93 return kTRUE ;
94}