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 // Class to handle track quality in track pairs
19 // The track pair object to use is AliCFPair
20 // author : renaud.vernet@cern.ch
21 ///////////////////////////////////////////////
23 #include "AliCFPairQualityCuts.h"
24 #include "AliCFPair.h"
26 ClassImp(AliCFPairQualityCuts)
28 //__________________________________________________________________________________
29 AliCFPairQualityCuts::AliCFPairQualityCuts() :
31 fCutNeg(new AliCFTrackQualityCuts()),
32 fCutPos(new AliCFTrackQualityCuts())
35 // Default constructor
38 //__________________________________________________________________________________
39 AliCFPairQualityCuts::AliCFPairQualityCuts(Char_t* name, Char_t* title) :
40 AliCFCutBase(name,title),
41 fCutNeg(new AliCFTrackQualityCuts(name,title)),
42 fCutPos(new AliCFTrackQualityCuts(name,title))
48 //__________________________________________________________________________________
49 AliCFPairQualityCuts::AliCFPairQualityCuts(const AliCFPairQualityCuts& c) :
58 //__________________________________________________________________________________
59 AliCFPairQualityCuts& AliCFPairQualityCuts::operator=(const AliCFPairQualityCuts& c)
62 // Assignment operator
65 AliCFCutBase::operator=(c) ;
72 //__________________________________________________________________________________
73 Bool_t AliCFPairQualityCuts::IsSelected(TObject* obj) {
75 // loops over decisions of single cuts and returns if the track is accepted
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 !");
85 AliCFPair* pair = dynamic_cast<AliCFPair*>(obj);
87 AliVParticle* tneg = pair->GetNeg();
88 AliVParticle* tpos = pair->GetPos();
89 if (!tneg || !tpos) return kFALSE ;
91 if ( ! fCutNeg->IsSelected((TObject*)tneg) || ! fCutPos->IsSelected((TObject*)tpos) ) return kFALSE ;