]>
Commit | Line | Data |
---|---|---|
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 primariness criteria in track pairs | |
19 | // The track pair object to use is AliCFPair | |
20 | // author : renaud.vernet@cern.ch | |
21 | /////////////////////////////////////////////////////// | |
22 | ||
23 | ||
24 | #include "AliCFPairIsPrimaryCuts.h" | |
25 | #include "AliCFPair.h" | |
26 | ||
27 | ClassImp(AliCFPairIsPrimaryCuts) | |
28 | ||
29 | //__________________________________________________________________________________ | |
30 | AliCFPairIsPrimaryCuts::AliCFPairIsPrimaryCuts() : | |
29a4c1fe | 31 | AliCFCutBase(), |
32 | fCutNeg(new AliCFTrackIsPrimaryCuts()), | |
33 | fCutPos(new AliCFTrackIsPrimaryCuts()) | |
2fbc0b17 | 34 | { |
35 | // | |
36 | // Default constructor | |
37 | // | |
2fbc0b17 | 38 | } |
39 | //__________________________________________________________________________________ | |
40 | AliCFPairIsPrimaryCuts::AliCFPairIsPrimaryCuts(Char_t* name, Char_t* title) : | |
29a4c1fe | 41 | AliCFCutBase(name,title), |
42 | fCutNeg(new AliCFTrackIsPrimaryCuts(name,title)), | |
43 | fCutPos(new AliCFTrackIsPrimaryCuts(name,title)) | |
2fbc0b17 | 44 | { |
45 | // | |
29a4c1fe | 46 | // Named Constructor |
2fbc0b17 | 47 | // |
2fbc0b17 | 48 | } |
49 | //__________________________________________________________________________________ | |
50 | AliCFPairIsPrimaryCuts::AliCFPairIsPrimaryCuts(const AliCFPairIsPrimaryCuts& c) : | |
51 | AliCFCutBase(c), | |
52 | fCutNeg(c.fCutNeg), | |
53 | fCutPos(c.fCutPos) | |
54 | { | |
55 | // | |
56 | // copy constructor | |
57 | // | |
58 | } | |
59 | //__________________________________________________________________________________ | |
60 | AliCFPairIsPrimaryCuts& AliCFPairIsPrimaryCuts::operator=(const AliCFPairIsPrimaryCuts& c) | |
61 | { | |
62 | // | |
63 | // Assignment operator | |
64 | // | |
65 | if (this != &c) { | |
66 | AliCFCutBase::operator=(c) ; | |
67 | fCutNeg = c.fCutNeg ; | |
68 | fCutPos = c.fCutPos ; | |
69 | } | |
70 | return *this; | |
71 | } | |
72 | ||
73 | //__________________________________________________________________________________ | |
9eeae5d5 | 74 | Bool_t AliCFPairIsPrimaryCuts::IsSelected(TObject* obj) { |
2fbc0b17 | 75 | // |
76 | // loops over decisions of single cuts and returns if the track is accepted | |
77 | // | |
78 | ||
4bc0c5f9 | 79 | AliCFPair* pair = dynamic_cast<AliCFPair*>(obj); |
80 | if (!pair) return kFALSE ; | |
81 | TString className(pair->ClassName()); | |
2fbc0b17 | 82 | if (className.CompareTo("AliCFPair") != 0) { |
83 | Error("IsSelected","obj must point to a AliCFPair !"); | |
84 | return kFALSE ; | |
85 | } | |
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 | } |