Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 : * *
4 : * Author: The ALICE Off-line Project. *
5 : * Contributors are mentioned in the code where appropriate. *
6 : * *
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 : **************************************************************************/
15 :
16 : #include <TObject.h>
17 : #include <TMath.h>
18 : #include <TParticle.h>
19 :
20 : #include "AliKineTrackCuts.h"
21 :
22 : //
23 : // Class for simple Kinematic cuts on
24 : // particles (tracks) from Kinematic stack (TParticle)
25 : // MC Simulation
26 : //
27 :
28 :
29 : //____________________________________________________________________
30 170 : ClassImp(AliKineTrackCuts)
31 :
32 : //____________________________________________________________________
33 : AliKineTrackCuts::AliKineTrackCuts(const Char_t* name, const Char_t* title) :
34 0 : AliAnalysisCuts(name,title),
35 0 : fOnlyFinalParticles(kFALSE),
36 0 : fOnlyPrimary(kFALSE),
37 0 : fPMin(0),
38 0 : fPMax(0),
39 0 : fPtMin(0),
40 0 : fPtMax(0),
41 0 : fPxMin(0),
42 0 : fPxMax(0),
43 0 : fPyMin(0),
44 0 : fPyMax(0),
45 0 : fPzMin(0),
46 0 : fPzMax(0),
47 0 : fEtaMin(0),
48 0 : fEtaMax(0),
49 0 : fRapMin(0),
50 0 : fRapMax(0)
51 0 : {
52 : //
53 : // constructor
54 : //
55 : // setting default cuts
56 0 : SetPRange();
57 0 : SetPtRange();
58 0 : SetPxRange();
59 0 : SetPyRange();
60 0 : SetPzRange();
61 0 : SetEtaRange();
62 0 : SetRapRange();
63 0 : }
64 :
65 :
66 :
67 : //____________________________________________________________________
68 : Bool_t AliKineTrackCuts::IsSelected(TObject* obj)
69 : {
70 :
71 0 : TParticle * part = (TParticle *)obj;
72 :
73 : // only final particles
74 0 : if( fOnlyFinalParticles && part->GetStatusCode() !=1 ) return kFALSE;
75 0 : if( fOnlyPrimary && part->IsPrimary() !=1 ) return kFALSE;
76 :
77 : // getting the kinematic variables of the track
78 0 : Float_t momentum = part->P();
79 0 : Float_t pt = part->Pt();
80 0 : Float_t energy = part->Energy();
81 :
82 : //y-eta related calculations
83 0 : Float_t eta = part->Eta();
84 : Float_t y = -100.;
85 0 : if((energy != TMath::Abs(part->Pz()))&&(momentum != 0))
86 0 : y = 0.5*TMath::Log((energy + part->Pz())/(energy - part->Pz()));
87 :
88 0 : if((momentum < fPMin) || (momentum > fPMax)) return kFALSE;
89 0 : if((pt < fPtMin) || (pt > fPtMax)) return kFALSE;
90 0 : if((part->Px() < fPxMin) || (part->Px() > fPxMax)) return kFALSE;
91 0 : if((part->Py() < fPyMin) || (part->Py() > fPyMax)) return kFALSE;
92 0 : if((part->Pz() < fPzMin) || (part->Pz() > fPzMax)) return kFALSE;
93 0 : if((eta < fEtaMin) || (eta > fEtaMax)) return kFALSE;
94 0 : if((y < fRapMin) || (y > fRapMax)) return kFALSE;
95 :
96 0 : return kTRUE;
97 0 : }
98 :
99 :
100 :
101 :
102 :
103 :
104 :
105 :
106 :
|