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() :
38 fCutNeg = new AliCFAcceptanceCuts();
39 fCutPos = new AliCFAcceptanceCuts();
42 //______________________________
43 AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts(const Char_t* name, const Char_t* title) :
44 AliCFCutBase(name,title)
49 fCutNeg = new AliCFAcceptanceCuts(name,title);
50 fCutPos = new AliCFAcceptanceCuts(name,title);
53 //______________________________
54 AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts(const AliCFPairAcceptanceCuts& c) :
64 //______________________________
65 AliCFPairAcceptanceCuts& AliCFPairAcceptanceCuts::operator=(const AliCFPairAcceptanceCuts& c)
68 // Assignment operator
71 AliCFCutBase::operator=(c) ;
78 //______________________________
79 Bool_t AliCFPairAcceptanceCuts::IsSelected(TObject* obj) {
81 // checks the number of track references associated to 'obj'
82 // 'obj' must be an AliMCParticle
85 if (!obj) return kFALSE ;
86 TString className(obj->ClassName());
87 if (className.CompareTo("AliMCParticle") != 0) {
88 Error("IsSelected","obj must point to a AliMCParticle !");
92 TParticle* part = ((AliMCParticle*)obj)->Particle() ;
93 if (!part || part->GetNDaughters()!=2) return kFALSE ;
94 Int_t lab0 = part->GetDaughter(0);
95 Int_t lab1 = part->GetDaughter(1);
97 AliMCParticle* negDaughter = fMCInfo->MCEvent()->GetTrack(lab0) ;
98 AliMCParticle* posDaughter = fMCInfo->MCEvent()->GetTrack(lab1) ;
100 if (!fCutNeg->IsSelected(negDaughter)) return kFALSE;
101 if (!fCutPos->IsSelected(posDaughter)) return kFALSE;
106 //______________________________
107 void AliCFPairAcceptanceCuts::SetEvtInfo(TObject* mcInfo) {
109 // Sets pointer to MC event information (AliMCEventHandler)
113 Error("SetEvtInfo","Pointer to MC Event Handler is null !");
117 TString className(mcInfo->ClassName());
118 if (className.CompareTo("AliMCEventHandler") != 0) {
119 Error("SetEvtInfo","argument must point to an AliMCEventHandler !");
123 fMCInfo = (AliMCEventHandler*) mcInfo ;