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),
53 // setting default cuts
65 //____________________________________________________________________
66 Bool_t AliKineTrackCuts::IsSelected(TObject* obj)
69 TParticle * part = (TParticle *)obj;
71 // getting the kinematic variables of the track
72 Float_t momentum = part->P();
73 Float_t pt = part->Pt();
74 Float_t energy = part->Energy();
76 //y-eta related calculations
77 Float_t eta = part->Eta();
79 if((energy != TMath::Abs(part->Pz()))&&(momentum != 0))
80 y = 0.5*TMath::Log((energy + part->Pz())/(energy - part->Pz()));
82 if((momentum < fPMin) || (momentum > fPMax)) return kFALSE;
83 if((pt < fPtMin) || (pt > fPtMax)) return kFALSE;
84 if((part->Px() < fPxMin) || (part->Px() > fPxMax)) return kFALSE;
85 if((part->Py() < fPyMin) || (part->Py() > fPyMax)) return kFALSE;
86 if((part->Pz() < fPzMin) || (part->Pz() > fPzMax)) return kFALSE;
87 if((eta < fEtaMin) || (eta > fEtaMax)) return kFALSE;
88 if((y < fRapMin) || (y > fRapMax)) return kFALSE;