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. *
7 * Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
8 * for The ALICE HLT Project. *
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 **************************************************************************/
19 /** @file AliHLTJETTrackCuts.h
20 @author Jochen Thaeder
22 @brief Cuts for jet input tracks
25 // see header file for class documentation
27 // refer to README to build package
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
31 #include "AliHLTJETTrackCuts.h"
32 #include <TDatabasePDG.h>
36 /** ROOT macro for the implementation of ROOT specific class methods */
37 ClassImp(AliHLTJETTrackCuts)
40 * ---------------------------------------------------------------------------------
41 * Constructor / Destructor
42 * ---------------------------------------------------------------------------------
45 // #################################################################################
46 AliHLTJETTrackCuts::AliHLTJETTrackCuts(const Char_t* name, const Char_t* title )
48 AliAnalysisCuts(name, title),
55 // see header file for class documentation
57 // refer to README to build package
59 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
63 // #################################################################################
64 AliHLTJETTrackCuts::~AliHLTJETTrackCuts() {
65 // see header file for class documentation
70 * ---------------------------------------------------------------------------------
72 * ---------------------------------------------------------------------------------
75 // #################################################################################
76 Bool_t AliHLTJETTrackCuts::IsSelected( TObject *obj ) {
77 // see header file for class documentation
79 Bool_t bResult = kTRUE;
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));
86 HLTError("Unknown object type %s", obj->ClassName() );
90 HLTError("Unknown object dd type %s", obj->ClassName() );
95 // #################################################################################
96 Bool_t AliHLTJETTrackCuts::IsSelected( TParticle *particle ) {
97 // see header file for class documentation
99 // ----------------------------------
100 // Applied before in AliHLTMCEvent:
101 // - Is Physical Primary
102 // stack->IsPhysicalPrimary(iter)
104 // particle->GetNDaughters() == 0
105 // ----------------------------------
107 Bool_t bResult = kTRUE;
109 Int_t status = particle->GetStatusCode();
110 Int_t pdgCode = TMath::Abs( particle->GetPdgCode() );
112 // -- Skip non-final state particles (status != 1), neutrinos (12,14,16)
113 if ( (status != 1) || (pdgCode == 12 || pdgCode == 14 || pdgCode == 16) )
116 // -- Charged particles only
117 if ( ! particle->GetPDG() )
120 if ( fChargedOnly && !particle->GetPDG()->Charge() )
125 if ( particle->Pt() < fPtMin )
128 // -- cut on eta acceptance
129 if ( ( particle->Eta() < fEtaMin ) || ( particle->Eta() > fEtaMax ) )
132 // -- cut on phi acceptance
133 if ( ( particle->Phi() < fPhiMin ) || ( particle->Phi() > fPhiMax ) )
139 // #################################################################################
140 Bool_t AliHLTJETTrackCuts::IsSelected( AliESDtrack *esdTrack ) {
141 // see header file for class documentation
143 Bool_t bResult = kTRUE;
146 if ( esdTrack->Pt() < fPtMin )
149 // -- cut on eta acceptance
150 if ( ( esdTrack->Eta() < fEtaMin ) || ( esdTrack->Eta() > fEtaMax ) )
153 // -- cut on phi acceptance
154 if ( ( esdTrack->Phi() < fPhiMin ) || ( esdTrack->Phi() > fPhiMax ) )