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 **************************************************************************/
18 #include <TParticle.h>
20 #include "AliKineTrackCuts.h"
23 // Class for simple Kinematic cuts on
24 // particles (tracks) from Kinematic stack (TParticle)
29 //____________________________________________________________________
30 ClassImp(AliKineTrackCuts)
32 //____________________________________________________________________
33 AliKineTrackCuts::AliKineTrackCuts(const Char_t* name, const Char_t* title) :
34 AliAnalysisCuts(name,title),
35 fOnlyFinalParticles(kFALSE),
55 // setting default cuts
67 //____________________________________________________________________
68 Bool_t AliKineTrackCuts::IsSelected(TObject* obj)
71 TParticle * part = (TParticle *)obj;
73 // only final particles
74 if( fOnlyFinalParticles && part->GetStatusCode() !=1 ) return kFALSE;
75 if( fOnlyPrimary && part->IsPrimary() !=1 ) return kFALSE;
77 // getting the kinematic variables of the track
78 Float_t momentum = part->P();
79 Float_t pt = part->Pt();
80 Float_t energy = part->Energy();
82 //y-eta related calculations
83 Float_t eta = part->Eta();
85 if((energy != TMath::Abs(part->Pz()))&&(momentum != 0))
86 y = 0.5*TMath::Log((energy + part->Pz())/(energy - part->Pz()));
88 if((momentum < fPMin) || (momentum > fPMax)) return kFALSE;
89 if((pt < fPtMin) || (pt > fPtMax)) return kFALSE;
90 if((part->Px() < fPxMin) || (part->Px() > fPxMax)) return kFALSE;
91 if((part->Py() < fPyMin) || (part->Py() > fPyMax)) return kFALSE;
92 if((part->Pz() < fPzMin) || (part->Pz() > fPzMax)) return kFALSE;
93 if((eta < fEtaMin) || (eta > fEtaMax)) return kFALSE;
94 if((y < fRapMin) || (y > fRapMax)) return kFALSE;