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 // ---- CORRECTION FRAMEWORK ----
18 // Class to cut on the number of AliTrackReference's
19 // for each detector. Applies on pair of tracks (AliCFPair)
20 ///////////////////////////////////////////////////////////////////////////
21 // author : R. Vernet (renaud.vernet@cern.ch)
22 ///////////////////////////////////////////////////////////////////////////
24 #include "AliMCParticle.h"
25 #include "AliCFPairAcceptanceCuts.h"
26 #include "AliMCEventHandler.h"
27 #include "AliMCEvent.h"
29 ClassImp(AliCFPairAcceptanceCuts)
31 //______________________________
32 AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts() :
35 fCutNeg(new AliCFAcceptanceCuts()),
36 fCutPos(new AliCFAcceptanceCuts())
43 //______________________________
44 AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts(const Char_t* name, const Char_t* title) :
45 AliCFCutBase(name,title),
47 fCutNeg(new AliCFAcceptanceCuts(name,title)),
48 fCutPos(new AliCFAcceptanceCuts(name,title))
55 //______________________________
56 AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts(const AliCFPairAcceptanceCuts& c) :
67 //______________________________
68 AliCFPairAcceptanceCuts& AliCFPairAcceptanceCuts::operator=(const AliCFPairAcceptanceCuts& c)
71 // Assignment operator
74 AliCFCutBase::operator=(c) ;
82 //______________________________
83 Bool_t AliCFPairAcceptanceCuts::IsSelected(TObject* obj) {
85 // checks the number of track references associated to 'obj'
86 // 'obj' must be an AliMCParticle
89 if (!obj) return kFALSE ;
90 TString className(obj->ClassName());
91 if (className.CompareTo("AliMCParticle") != 0) {
92 Error("IsSelected","obj must point to a AliMCParticle !");
96 TParticle* part = ((AliMCParticle*)obj)->Particle() ;
97 if (!part || part->GetNDaughters()!=2) return kFALSE ;
98 Int_t lab0 = part->GetDaughter(0);
99 Int_t lab1 = part->GetDaughter(1);
101 AliMCParticle* negDaughter = fMCInfo->MCEvent()->GetTrack(lab0) ;
102 AliMCParticle* posDaughter = fMCInfo->MCEvent()->GetTrack(lab1) ;
104 if (!fCutNeg->IsSelected(negDaughter)) return kFALSE;
105 if (!fCutPos->IsSelected(posDaughter)) return kFALSE;
110 //______________________________
111 void AliCFPairAcceptanceCuts::SetEvtInfo(TObject* mcInfo) {
113 // Sets pointer to MC event information (AliMCEventHandler)
117 Error("SetEvtInfo","Pointer to MC Event Handler is null !");
121 TString className(mcInfo->ClassName());
122 if (className.CompareTo("AliMCEventHandler") != 0) {
123 Error("SetEvtInfo","argument must point to an AliMCEventHandler !");
127 fMCInfo = (AliMCEventHandler*) mcInfo ;