]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLTANALYSIS/JET/AliHLTJETTrackCuts.cxx
Split: fixed more module incpaths
[u/mrichter/AliRoot.git] / HLTANALYSIS / JET / AliHLTJETTrackCuts.cxx
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 #include "AliHLTJETTrackCuts.h"
32 #include <TDatabasePDG.h>
33
34 using namespace std;
35
36 /** ROOT macro for the implementation of ROOT specific class methods */
37 ClassImp(AliHLTJETTrackCuts)
38
39 /*
40  * ---------------------------------------------------------------------------------
41  *                            Constructor / Destructor
42  * ---------------------------------------------------------------------------------
43  */
44   
45 // #################################################################################
46 AliHLTJETTrackCuts::AliHLTJETTrackCuts(const Char_t* name, const Char_t* title )
47   : 
48   AliAnalysisCuts(name, title),
49   fChargedOnly(kFALSE),
50   fPtMin(0.0),
51   fEtaMin(-0.9),
52   fEtaMax(0.9),
53   fPhiMin(0.0),
54   fPhiMax(6.3) {
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 // #################################################################################
64 AliHLTJETTrackCuts::~AliHLTJETTrackCuts() {
65   // see header file for class documentation
66
67 }
68
69 /*
70  * ---------------------------------------------------------------------------------
71  *                                   Selection
72  * ---------------------------------------------------------------------------------
73  */
74
75 // #################################################################################
76 Bool_t AliHLTJETTrackCuts::IsSelected( TObject *obj ) {
77   // see header file for class documentation
78
79   Bool_t bResult = kTRUE;
80   
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));
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 // #################################################################################
96 Bool_t AliHLTJETTrackCuts::IsSelected( TParticle *particle ) {
97   // see header file for class documentation
98
99   // ----------------------------------
100   //  Applied before in AliHLTMCEvent:
101   //  - Is Physical Primary  
102   //   stack->IsPhysicalPrimary(iter)
103   //  - final state
104   //   particle->GetNDaughters() == 0
105   // ----------------------------------
106
107   Bool_t bResult = kTRUE;
108
109   Int_t   status  = particle->GetStatusCode();
110   Int_t   pdgCode = TMath::Abs( particle->GetPdgCode() );
111   
112   // -- Skip non-final state particles (status != 1), neutrinos (12,14,16)
113   if ( (status != 1) || (pdgCode == 12 || pdgCode == 14 || pdgCode == 16) )
114     bResult = kFALSE;
115
116   // -- Charged particles only
117   if ( ! particle->GetPDG() )
118     bResult = kFALSE;
119   else {
120     if ( fChargedOnly && !particle->GetPDG()->Charge() )
121       bResult = kFALSE;
122   }
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 ) )
134     bResult = kFALSE;
135
136   return bResult;
137 }
138
139 // #################################################################################
140 Bool_t AliHLTJETTrackCuts::IsSelected( AliESDtrack *esdTrack ) {
141   // see header file for class documentation
142
143   Bool_t bResult = kTRUE;
144
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
153   // -- cut on phi acceptance
154   if ( ( esdTrack->Phi() < fPhiMin ) || ( esdTrack->Phi() > fPhiMax ) )
155     bResult = kFALSE;
156
157   return bResult;
158 }