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 primariness criteria in track pairs
19 // The track pair object to use is AliCFPair
20 // author : renaud.vernet@cern.ch
21 ///////////////////////////////////////////////////////
24 #include "AliCFPairIsPrimaryCuts.h"
25 #include "AliCFPair.h"
27 ClassImp(AliCFPairIsPrimaryCuts)
29 //__________________________________________________________________________________
30 AliCFPairIsPrimaryCuts::AliCFPairIsPrimaryCuts() :
32 fCutNeg(new AliCFTrackIsPrimaryCuts()),
33 fCutPos(new AliCFTrackIsPrimaryCuts())
36 // Default constructor
39 //__________________________________________________________________________________
40 AliCFPairIsPrimaryCuts::AliCFPairIsPrimaryCuts(Char_t* name, Char_t* title) :
41 AliCFCutBase(name,title),
42 fCutNeg(new AliCFTrackIsPrimaryCuts(name,title)),
43 fCutPos(new AliCFTrackIsPrimaryCuts(name,title))
49 //__________________________________________________________________________________
50 AliCFPairIsPrimaryCuts::AliCFPairIsPrimaryCuts(const AliCFPairIsPrimaryCuts& c) :
59 //__________________________________________________________________________________
60 AliCFPairIsPrimaryCuts& AliCFPairIsPrimaryCuts::operator=(const AliCFPairIsPrimaryCuts& c)
63 // Assignment operator
66 AliCFCutBase::operator=(c) ;
73 //__________________________________________________________________________________
74 Bool_t AliCFPairIsPrimaryCuts::IsSelected(TObject* obj) {
76 // loops over decisions of single cuts and returns if the track is accepted
79 if (!obj) return kFALSE ;
80 TString className(obj->ClassName());
81 if (className.CompareTo("AliCFPair") != 0) {
82 Error("IsSelected","obj must point to a AliCFPair !");
86 AliCFPair* pair = dynamic_cast<AliCFPair*>(obj);
88 AliVParticle* tneg = pair->GetNeg();
89 AliVParticle* tpos = pair->GetPos();
90 if (!tneg || !tpos) return kFALSE ;
92 if ( ! fCutNeg->IsSelected((TObject*)tneg) || ! fCutPos->IsSelected((TObject*)tpos) ) return kFALSE ;