]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/AliKineTrackCuts.cxx
TPCNoiseMapComponent included into build (Kelly)
[u/mrichter/AliRoot.git] / ANALYSIS / AliKineTrackCuts.cxx
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 ClassImp(AliKineTrackCuts)
31
32 //____________________________________________________________________
33 AliKineTrackCuts::AliKineTrackCuts(const Char_t* name, const Char_t* title) : 
34   AliAnalysisCuts(name,title),
35   fPMin(0),
36   fPMax(0),
37   fPtMin(0),
38   fPtMax(0),
39   fPxMin(0),
40   fPxMax(0),
41   fPyMin(0),
42   fPyMax(0),
43   fPzMin(0),
44   fPzMax(0),
45   fEtaMin(0),
46   fEtaMax(0),
47   fRapMin(0),
48   fRapMax(0)
49 {
50   //
51   // constructor
52   //
53   // setting default cuts
54   SetPRange();
55   SetPtRange();
56   SetPxRange();
57   SetPyRange();
58   SetPzRange();
59   SetEtaRange();
60   SetRapRange();
61 }
62
63
64
65 //____________________________________________________________________
66 Bool_t  AliKineTrackCuts::IsSelected(TObject* obj)
67 {
68
69   TParticle * part = (TParticle *)obj;
70   
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();
75
76   //y-eta related calculations
77   Float_t eta = part->Eta();
78   Float_t y   = -100.;
79   if((energy != TMath::Abs(part->Pz()))&&(momentum != 0))
80     y = 0.5*TMath::Log((energy + part->Pz())/(energy - part->Pz()));
81
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;
89
90   return kTRUE;
91 }
92
93
94
95
96
97
98
99
100