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 **************************************************************************/
16 ////////////////////////////////////////////////
17 // Class to define PID cuts on a pair of tracks
18 // The track pair object to use is AliCFPair
19 // author : renaud.vernet@cern.ch
20 ////////////////////////////////////////////////
22 #include "AliCFPairPidCut.h"
23 #include "AliCFPair.h"
25 ClassImp(AliCFPairPidCut)
27 //__________________________________________________________________________________
28 AliCFPairPidCut::AliCFPairPidCut() :
30 fCutNeg(new AliCFTrackCutPid()),
31 fCutPos(new AliCFTrackCutPid())
34 // Default constructor
37 //__________________________________________________________________________________
38 AliCFPairPidCut::AliCFPairPidCut(const Char_t* name, const Char_t* title) :
39 AliCFCutBase(name,title),
40 fCutNeg(new AliCFTrackCutPid(name,title)),
41 fCutPos(new AliCFTrackCutPid(name,title))
47 //__________________________________________________________________________________
48 AliCFPairPidCut::AliCFPairPidCut(const AliCFPairPidCut& c) :
57 //__________________________________________________________________________________
58 AliCFPairPidCut& AliCFPairPidCut::operator=(const AliCFPairPidCut& c)
61 // Assignment operator
64 AliCFCutBase::operator=(c) ;
71 //__________________________________________________________________________________
72 Bool_t AliCFPairPidCut::IsSelected(TObject* obj) {
74 // loops over decisions of single cuts and returns if the track is accepted
77 if (!obj) return kFALSE ;
78 TString className(obj->ClassName());
79 if (className.CompareTo("AliCFPair") != 0) {
80 Error("IsSelected","obj must point to a AliCFPair !");
84 AliCFPair* pair = dynamic_cast<AliCFPair*>(obj);
86 AliVParticle* tneg = pair->GetNeg();
87 AliVParticle* tpos = pair->GetPos();
89 if (!tneg || !tpos) return kFALSE ;
90 if ( ! fCutNeg->IsSelected(tneg) || ! fCutPos->IsSelected(tpos) ) return kFALSE ;