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