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 "AliMCEvent.h"
30 ClassImp(AliCFPairAcceptanceCuts)
32 //______________________________
33 AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts() :
36 fCutNeg(new AliCFAcceptanceCuts()),
37 fCutPos(new AliCFAcceptanceCuts()),
45 //______________________________
46 AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts(const Char_t* name, const Char_t* title) :
47 AliCFCutBase(name,title),
49 fCutNeg(new AliCFAcceptanceCuts(name,title)),
50 fCutPos(new AliCFAcceptanceCuts(name,title)),
58 //______________________________
59 AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts(const AliCFPairAcceptanceCuts& c) :
71 //______________________________
72 AliCFPairAcceptanceCuts& AliCFPairAcceptanceCuts::operator=(const AliCFPairAcceptanceCuts& c)
75 // Assignment operator
78 AliCFCutBase::operator=(c) ;
87 //__________________________________________________________
88 Bool_t AliCFPairAcceptanceCuts::IsSelected(TObject* obj) {
90 // checks the number of track references associated to 'obj'
91 // 'obj' must be an AliMCParticle
94 // check if selections on 'obj' are passed
95 // 'obj' must be an AliMCParticle
100 // if (fIsQAOn) FillHistograms(obj,kFALSE);
101 Bool_t isSelected = kTRUE;
103 for (UInt_t icut=0; icut<fBitmap->GetNbits(); icut++) {
104 if (!fBitmap->TestBitNumber(icut)) {
110 if (!isSelected) return kFALSE ;
111 // if (fIsQAOn) FillHistograms(obj,kTRUE);
115 //__________________________________________________________
116 void AliCFPairAcceptanceCuts::SelectionBitMap(TObject* obj)
119 // test if the track passes the single cuts
120 // and store the information in a bitmap
123 for (UInt_t i=0; i<kNCuts; i++) fBitmap->SetBitNumber(i,kFALSE);
125 AliMCParticle* mcpart = dynamic_cast<AliMCParticle*>(obj) ;
128 TString className(mcpart->ClassName());
129 if (className.CompareTo("AliMCParticle") != 0) {
130 AliError("obj must point to an AliMCParticle !");
134 TParticle* part = mcpart->Particle() ;
135 if (!part || part->GetNDaughters() !=2) return ;
137 Int_t lab0 = part->GetDaughter(0);
138 Int_t lab1 = part->GetDaughter(1);
139 AliMCParticle* negDaughter = (AliMCParticle*) fMCInfo->GetTrack(lab0) ;
140 AliMCParticle* posDaughter = (AliMCParticle*) fMCInfo->GetTrack(lab1) ;
144 if (fCutNeg->IsSelected(negDaughter)) fBitmap->SetBitNumber(iCutBit,kTRUE);
147 if (fCutPos->IsSelected(posDaughter)) fBitmap->SetBitNumber(iCutBit,kTRUE);
150 //______________________________
151 void AliCFPairAcceptanceCuts::SetMCEventInfo(const TObject* mcInfo) {
153 // Sets pointer to MC event information (AliMCEvent)
157 Error("SetMCEventInfo","Pointer to MC Event is null !");
161 TString className(mcInfo->ClassName());
162 if (className.CompareTo("AliMCEvent") != 0) {
163 Error("SetMCEventInfo","argument must point to an AliMCEvent !");
167 fMCInfo = (AliMCEvent*) mcInfo ;