]>
Commit | Line | Data |
---|---|---|
0734d112 | 1 | //-*- Mode: C++ -*- |
2 | // $Id: AliHLTJETTrackCuts.cxx $ | |
3 | /************************************************************************** | |
4 | * This file is property of and copyright by the ALICE HLT Project * | |
5 | * ALICE Experiment at CERN, All rights reserved. * | |
6 | * * | |
7 | * Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> * | |
8 | * for The ALICE HLT Project. * | |
9 | * * | |
10 | * Permission to use, copy, modify and distribute this software and its * | |
11 | * documentation strictly for non-commercial purposes is hereby granted * | |
12 | * without fee, provided that the above copyright notice appears in all * | |
13 | * copies and that both the copyright notice and this permission notice * | |
14 | * appear in the supporting documentation. The authors make no claims * | |
15 | * about the suitability of this software for any purpose. It is * | |
16 | * provided "as is" without express or implied warranty. * | |
17 | **************************************************************************/ | |
18 | ||
19 | /** @file AliHLTJETTrackCuts.h | |
20 | @author Jochen Thaeder | |
21 | @date | |
22 | @brief Cuts for jet input tracks | |
23 | */ | |
24 | ||
25 | // see header file for class documentation | |
26 | // or | |
27 | // refer to README to build package | |
28 | // or | |
29 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
30 | ||
31 | #if __GNUC__ >= 3 | |
32 | using namespace std; | |
33 | #endif | |
34 | ||
35 | #include "AliHLTJETTrackCuts.h" | |
36 | ||
37 | /** ROOT macro for the implementation of ROOT specific class methods */ | |
38 | ClassImp(AliHLTJETTrackCuts) | |
39 | ||
40 | /* | |
41 | * --------------------------------------------------------------------------------- | |
42 | * Constructor / Destructor | |
43 | * --------------------------------------------------------------------------------- | |
44 | */ | |
45 | ||
46 | // ################################################################################# | |
47 | AliHLTJETTrackCuts::AliHLTJETTrackCuts(const Char_t* name, const Char_t* title ) | |
48 | : | |
49 | AliAnalysisCuts(name, title), | |
6ce099ba | 50 | fChargedOnly(kFALSE), |
51 | fPtMin(0.0), | |
52 | fEtaMin(-0.9), | |
53 | fEtaMax(0.9), | |
54 | fPhiMin(0.0), | |
55 | fPhiMax(6.3) { | |
0734d112 | 56 | // see header file for class documentation |
57 | // or | |
58 | // refer to README to build package | |
59 | // or | |
60 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
61 | ||
62 | } | |
63 | ||
64 | // ################################################################################# | |
65 | AliHLTJETTrackCuts::~AliHLTJETTrackCuts() { | |
66 | // see header file for class documentation | |
67 | ||
68 | } | |
69 | ||
70 | /* | |
71 | * --------------------------------------------------------------------------------- | |
72 | * Selection | |
73 | * --------------------------------------------------------------------------------- | |
74 | */ | |
75 | ||
76 | // ################################################################################# | |
77 | Bool_t AliHLTJETTrackCuts::IsSelected( TObject *obj ) { | |
78 | // see header file for class documentation | |
79 | ||
80 | Bool_t bResult = kTRUE; | |
81 | ||
82 | if ( ! strcmp(obj->ClassName(),"TParticle") ) | |
83 | bResult = IsSelected( dynamic_cast<TParticle*> (obj)); | |
84 | else if ( ! strcmp(obj->ClassName(),"AliESDtrack") ) | |
85 | bResult = IsSelected( dynamic_cast<AliESDtrack*> (obj)); | |
86 | else { | |
87 | HLTError("Unknown object type %s", obj->ClassName() ); | |
88 | bResult = kFALSE; | |
89 | } | |
90 | ||
91 | HLTError("Unknown object dd type %s", obj->ClassName() ); | |
92 | ||
93 | return bResult; | |
94 | } | |
95 | ||
96 | // ################################################################################# | |
97 | Bool_t AliHLTJETTrackCuts::IsSelected( TParticle *particle ) { | |
98 | // see header file for class documentation | |
99 | ||
6ce099ba | 100 | // ---------------------------------- |
101 | // Applied before in AliHLTMCEvent: | |
102 | // - Is Physical Primary | |
103 | // stack->IsPhysicalPrimary(iter) | |
104 | // - final state | |
105 | // particle->GetNDaughters() == 0 | |
106 | // ---------------------------------- | |
107 | ||
0734d112 | 108 | Bool_t bResult = kTRUE; |
109 | ||
110 | Int_t status = particle->GetStatusCode(); | |
6ce099ba | 111 | Int_t pdgCode = TMath::Abs( particle->GetPdgCode() ); |
0734d112 | 112 | |
113 | // -- Skip non-final state particles (status != 1), neutrinos (12,14,16) | |
6ce099ba | 114 | if ( (status != 1) || (pdgCode == 12 || pdgCode == 14 || pdgCode == 16) ) |
115 | bResult = kFALSE; | |
116 | ||
117 | // -- Charged particles only | |
118 | if ( fChargedOnly && !particle->GetPDG()->Charge() ) | |
119 | bResult = kFALSE; | |
120 | ||
121 | // -- cut on min Pt | |
122 | if ( particle->Pt() < fPtMin ) | |
123 | bResult = kFALSE; | |
124 | ||
125 | // -- cut on eta acceptance | |
126 | if ( ( particle->Eta() < fEtaMin ) || ( particle->Eta() > fEtaMax ) ) | |
127 | bResult = kFALSE; | |
128 | ||
129 | // -- cut on phi acceptance | |
130 | if ( ( particle->Phi() < fPhiMin ) || ( particle->Phi() > fPhiMax ) ) | |
0734d112 | 131 | bResult = kFALSE; |
0734d112 | 132 | |
133 | return bResult; | |
134 | } | |
135 | ||
136 | // ################################################################################# | |
6ce099ba | 137 | Bool_t AliHLTJETTrackCuts::IsSelected( AliESDtrack *esdTrack ) { |
0734d112 | 138 | // see header file for class documentation |
139 | ||
140 | Bool_t bResult = kTRUE; | |
141 | ||
6ce099ba | 142 | // -- cut on min Pt |
143 | if ( esdTrack->Pt() < fPtMin ) | |
144 | bResult = kFALSE; | |
145 | ||
146 | // -- cut on eta acceptance | |
147 | if ( ( esdTrack->Eta() < fEtaMin ) || ( esdTrack->Eta() > fEtaMax ) ) | |
148 | bResult = kFALSE; | |
149 | ||
150 | cout << esdTrack->Phi() << endl; | |
151 | ||
152 | // -- cut on phi acceptance | |
153 | if ( ( esdTrack->Phi() < fPhiMin ) || ( esdTrack->Phi() > fPhiMax ) ) | |
154 | bResult = kFALSE; | |
155 | ||
0734d112 | 156 | return bResult; |
157 | } |