]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/JET/AliHLTJETTrackCuts.cxx
In test:
[u/mrichter/AliRoot.git] / HLT / JET / AliHLTJETTrackCuts.cxx
CommitLineData
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
32using namespace std;
33#endif
34
35#include "AliHLTJETTrackCuts.h"
c180f65d 36#include <TDatabasePDG.h>
0734d112 37
38/** ROOT macro for the implementation of ROOT specific class methods */
39ClassImp(AliHLTJETTrackCuts)
40
41/*
42 * ---------------------------------------------------------------------------------
43 * Constructor / Destructor
44 * ---------------------------------------------------------------------------------
45 */
46
47// #################################################################################
48AliHLTJETTrackCuts::AliHLTJETTrackCuts(const Char_t* name, const Char_t* title )
49 :
50 AliAnalysisCuts(name, title),
6ce099ba 51 fChargedOnly(kFALSE),
52 fPtMin(0.0),
53 fEtaMin(-0.9),
54 fEtaMax(0.9),
55 fPhiMin(0.0),
56 fPhiMax(6.3) {
0734d112 57 // see header file for class documentation
58 // or
59 // refer to README to build package
60 // or
61 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
62
63}
64
65// #################################################################################
66AliHLTJETTrackCuts::~AliHLTJETTrackCuts() {
67 // see header file for class documentation
68
69}
70
71/*
72 * ---------------------------------------------------------------------------------
73 * Selection
74 * ---------------------------------------------------------------------------------
75 */
76
77// #################################################################################
78Bool_t AliHLTJETTrackCuts::IsSelected( TObject *obj ) {
79 // see header file for class documentation
80
81 Bool_t bResult = kTRUE;
82
83 if ( ! strcmp(obj->ClassName(),"TParticle") )
84 bResult = IsSelected( dynamic_cast<TParticle*> (obj));
85 else if ( ! strcmp(obj->ClassName(),"AliESDtrack") )
86 bResult = IsSelected( dynamic_cast<AliESDtrack*> (obj));
87 else {
88 HLTError("Unknown object type %s", obj->ClassName() );
89 bResult = kFALSE;
90 }
91
92 HLTError("Unknown object dd type %s", obj->ClassName() );
93
94 return bResult;
95}
96
97// #################################################################################
98Bool_t AliHLTJETTrackCuts::IsSelected( TParticle *particle ) {
99 // see header file for class documentation
100
6ce099ba 101 // ----------------------------------
102 // Applied before in AliHLTMCEvent:
103 // - Is Physical Primary
104 // stack->IsPhysicalPrimary(iter)
105 // - final state
106 // particle->GetNDaughters() == 0
107 // ----------------------------------
108
0734d112 109 Bool_t bResult = kTRUE;
110
111 Int_t status = particle->GetStatusCode();
6ce099ba 112 Int_t pdgCode = TMath::Abs( particle->GetPdgCode() );
0734d112 113
114 // -- Skip non-final state particles (status != 1), neutrinos (12,14,16)
6ce099ba 115 if ( (status != 1) || (pdgCode == 12 || pdgCode == 14 || pdgCode == 16) )
116 bResult = kFALSE;
117
118 // -- Charged particles only
119 if ( fChargedOnly && !particle->GetPDG()->Charge() )
120 bResult = kFALSE;
121
122 // -- cut on min Pt
123 if ( particle->Pt() < fPtMin )
124 bResult = kFALSE;
125
126 // -- cut on eta acceptance
127 if ( ( particle->Eta() < fEtaMin ) || ( particle->Eta() > fEtaMax ) )
128 bResult = kFALSE;
129
130 // -- cut on phi acceptance
131 if ( ( particle->Phi() < fPhiMin ) || ( particle->Phi() > fPhiMax ) )
0734d112 132 bResult = kFALSE;
0734d112 133
134 return bResult;
135}
136
137// #################################################################################
6ce099ba 138Bool_t AliHLTJETTrackCuts::IsSelected( AliESDtrack *esdTrack ) {
0734d112 139 // see header file for class documentation
140
141 Bool_t bResult = kTRUE;
142
6ce099ba 143 // -- cut on min Pt
144 if ( esdTrack->Pt() < fPtMin )
145 bResult = kFALSE;
146
147 // -- cut on eta acceptance
148 if ( ( esdTrack->Eta() < fEtaMin ) || ( esdTrack->Eta() > fEtaMax ) )
149 bResult = kFALSE;
150
151 cout << esdTrack->Phi() << endl;
152
153 // -- cut on phi acceptance
154 if ( ( esdTrack->Phi() < fPhiMin ) || ( esdTrack->Phi() > fPhiMax ) )
155 bResult = kFALSE;
156
0734d112 157 return bResult;
158}