]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CORRFW/AliCFPairPidCut.cxx
new classes for resonance and V0 analysis (from R. Vernet)
[u/mrichter/AliRoot.git] / CORRFW / AliCFPairPidCut.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// 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////////////////////////////////////////////////
21
22#include "AliCFPairPidCut.h"
23#include "AliCFPair.h"
24
25ClassImp(AliCFPairPidCut)
26
27//__________________________________________________________________________________
28AliCFPairPidCut::AliCFPairPidCut() :
29 AliCFCutBase()
30{
31 //
32 // Default constructor
33 //
34 fCutNeg = new AliCFTrackCutPid();
35 fCutPos = new AliCFTrackCutPid();
36}
37//__________________________________________________________________________________
38AliCFPairPidCut::AliCFPairPidCut(const Char_t* name, const Char_t* title) :
39 AliCFCutBase(name,title)
40{
41 //
42 // Constructor
43 //
44 fCutNeg = new AliCFTrackCutPid(name,title);
45 fCutPos = new AliCFTrackCutPid(name,title);
46}
47//__________________________________________________________________________________
48AliCFPairPidCut::AliCFPairPidCut(const AliCFPairPidCut& c) :
49 AliCFCutBase(c),
50 fCutNeg(c.fCutNeg),
51 fCutPos(c.fCutPos)
52{
53 //
54 // copy constructor
55 //
56}
57//__________________________________________________________________________________
58AliCFPairPidCut& AliCFPairPidCut::operator=(const AliCFPairPidCut& c)
59{
60 //
61 // Assignment operator
62 //
63 if (this != &c) {
64 AliCFCutBase::operator=(c) ;
65 fCutNeg = c.fCutNeg ;
66 fCutPos = c.fCutPos ;
67 }
68 return *this;
69}
70
71//__________________________________________________________________________________
72Bool_t AliCFPairPidCut::IsSelected(TObject* obj) {
73 //
74 // loops over decisions of single cuts and returns if the track is accepted
75 //
76
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 !");
81 return kFALSE ;
82 }
83
84 AliCFPair* pair = dynamic_cast<AliCFPair*>(obj);
85
86 AliESDtrack* tneg = pair->GetNeg();
87 AliESDtrack* tpos = pair->GetPos();
88
89 if (!tneg || !tpos) return kFALSE ;
90 if ( ! fCutNeg->IsSelected(tneg) || ! fCutPos->IsSelected(tpos) ) return kFALSE ;
91 return kTRUE ;
92}