X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=CORRFW%2FAliCFPairAcceptanceCuts.cxx;fp=CORRFW%2FAliCFPairAcceptanceCuts.cxx;h=0000000000000000000000000000000000000000;hp=80b01fe98642a8171d1bad5842e1fb2bd9cb7d47;hb=99d6db94795bfa9d990a0f3c04b3bb379784ef4a;hpb=34952a41308592ffb1194deaf05348780277deee diff --git a/CORRFW/AliCFPairAcceptanceCuts.cxx b/CORRFW/AliCFPairAcceptanceCuts.cxx deleted file mode 100755 index 80b01fe9864..00000000000 --- a/CORRFW/AliCFPairAcceptanceCuts.cxx +++ /dev/null @@ -1,168 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - -/////////////////////////////////////////////////////////////////////////// -// ---- CORRECTION FRAMEWORK ---- -// Class to cut on the number of AliTrackReference's -// for each detector. Applies on pair of tracks (AliCFPair) -/////////////////////////////////////////////////////////////////////////// -// author : R. Vernet (renaud.vernet@cern.ch) -/////////////////////////////////////////////////////////////////////////// - -#include "AliMCParticle.h" -#include "AliCFPairAcceptanceCuts.h" -#include "AliMCEvent.h" -#include "TBits.h" -#include "AliLog.h" - -ClassImp(AliCFPairAcceptanceCuts) - -//______________________________ -AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts() : - AliCFCutBase(), - fMCInfo(0x0), - fCutNeg(new AliCFAcceptanceCuts()), - fCutPos(new AliCFAcceptanceCuts()), - fBitmap(new TBits(0)) -{ - // - //Default Constructor - // -} - -//______________________________ -AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts(const Char_t* name, const Char_t* title) : - AliCFCutBase(name,title), - fMCInfo(0x0), - fCutNeg(new AliCFAcceptanceCuts(name,title)), - fCutPos(new AliCFAcceptanceCuts(name,title)), - fBitmap(new TBits(0)) -{ - // - //Named Constructor - // -} - -//______________________________ -AliCFPairAcceptanceCuts::AliCFPairAcceptanceCuts(const AliCFPairAcceptanceCuts& c) : - AliCFCutBase(c), - fMCInfo(c.fMCInfo), - fCutNeg(c.fCutNeg), - fCutPos(c.fCutPos), - fBitmap(c.fBitmap) -{ - // - //Copy Constructor - // -} - -//______________________________ -AliCFPairAcceptanceCuts& AliCFPairAcceptanceCuts::operator=(const AliCFPairAcceptanceCuts& c) -{ - // - // Assignment operator - // - if (this != &c) { - AliCFCutBase::operator=(c) ; - fMCInfo = c.fMCInfo ; - fCutNeg = c.fCutNeg ; - fCutPos = c.fCutPos ; - fBitmap = c.fBitmap ; - } - return *this ; -} - -//__________________________________________________________ -Bool_t AliCFPairAcceptanceCuts::IsSelected(TObject* obj) { - // - // checks the number of track references associated to 'obj' - // 'obj' must be an AliMCParticle - // - // - // check if selections on 'obj' are passed - // 'obj' must be an AliMCParticle - // - - SelectionBitMap(obj); - - // if (fIsQAOn) FillHistograms(obj,kFALSE); - Bool_t isSelected = kTRUE; - - for (UInt_t icut=0; icutGetNbits(); icut++) { - if (!fBitmap->TestBitNumber(icut)) { - isSelected = kFALSE; - break; - } - } - - if (!isSelected) return kFALSE ; - // if (fIsQAOn) FillHistograms(obj,kTRUE); - return kTRUE; -} - -//__________________________________________________________ -void AliCFPairAcceptanceCuts::SelectionBitMap(TObject* obj) -{ - // - // test if the track passes the single cuts - // and store the information in a bitmap - // - - for (UInt_t i=0; iSetBitNumber(i,kFALSE); - - AliMCParticle* mcpart = dynamic_cast(obj) ; - - if (!mcpart) return; - TString className(mcpart->ClassName()); - if (className.CompareTo("AliMCParticle") != 0) { - AliError("obj must point to an AliMCParticle !"); - return ; - } - - TParticle* part = mcpart->Particle() ; - if (!part || part->GetNDaughters() !=2) return ; - - Int_t lab0 = part->GetDaughter(0); - Int_t lab1 = part->GetDaughter(1); - AliMCParticle* negDaughter = (AliMCParticle*) fMCInfo->GetTrack(lab0) ; - AliMCParticle* posDaughter = (AliMCParticle*) fMCInfo->GetTrack(lab1) ; - - Int_t iCutBit = 0; - - if (fCutNeg->IsSelected(negDaughter)) fBitmap->SetBitNumber(iCutBit,kTRUE); - iCutBit++; - - if (fCutPos->IsSelected(posDaughter)) fBitmap->SetBitNumber(iCutBit,kTRUE); -} - -//______________________________ -void AliCFPairAcceptanceCuts::SetMCEventInfo(const TObject* mcInfo) { - // - // Sets pointer to MC event information (AliMCEvent) - // - - if (!mcInfo) { - Error("SetMCEventInfo","Pointer to MC Event is null !"); - return; - } - - TString className(mcInfo->ClassName()); - if (className.CompareTo("AliMCEvent") != 0) { - Error("SetMCEventInfo","argument must point to an AliMCEvent !"); - return ; - } - - fMCInfo = (AliMCEvent*) mcInfo ; -}