]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/JET/AliHLTJETJetCuts.cxx
read magnetic field from local GRP
[u/mrichter/AliRoot.git] / HLT / JET / AliHLTJETJetCuts.cxx
1 //-*- Mode: C++ -*-
2 // $Id: AliHLTJETJetCuts.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   AliHLTJETJetCuts.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 "AliHLTJETJetCuts.h"
36
37 /** ROOT macro for the implementation of ROOT specific class methods */
38 ClassImp(AliHLTJETJetCuts)
39
40 /*
41  * ---------------------------------------------------------------------------------
42  *                            Constructor / Destructor
43  * ---------------------------------------------------------------------------------
44  */
45   
46 // #################################################################################
47 AliHLTJETJetCuts::AliHLTJETJetCuts(const Char_t* name, const Char_t* title )
48   : 
49   AliAnalysisCuts(name, title),
50   fEtMin(0.) {
51   // see header file for class documentation
52   // or
53   // refer to README to build package
54   // or
55   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
56
57 }
58
59 // #################################################################################
60 AliHLTJETJetCuts::~AliHLTJETJetCuts() {
61   // see header file for class documentation
62
63 }
64
65 /*
66  * ---------------------------------------------------------------------------------
67  *                                   Selection
68  * ---------------------------------------------------------------------------------
69  */
70
71 // #################################################################################
72 Bool_t AliHLTJETJetCuts::IsSelected( TObject *obj ) {
73   // see header file for class documentation
74
75   Bool_t bResult = kTRUE;
76
77   if ( ! strcmp(obj->ClassName(),"AliHLTJETConeJetCandidate") )
78     bResult = IsSelected( dynamic_cast<AliHLTJETConeJetCandidate*> (obj));
79   else if ( ! strcmp(obj->ClassName(),"AliAODJet") )
80     bResult = IsSelected( dynamic_cast<AliAODJet*> (obj));
81   else {
82     HLTError("Unknown object type %s", obj->ClassName() );
83     bResult = kFALSE;
84   }
85   
86    HLTError("Unknown object dd type %s", obj->ClassName() );
87
88   return bResult;
89 }
90
91 // #################################################################################
92 Bool_t AliHLTJETJetCuts::IsSelected( AliHLTJETConeJetCandidate* jet ) {
93   // see header file for class documentation
94
95   Bool_t bResult = kTRUE;
96
97   // -- cut on min Pt
98   if ( jet->GetEt() < fEtMin )
99     bResult = kFALSE;
100
101   return bResult;
102 }
103
104 // #################################################################################
105 Bool_t AliHLTJETJetCuts::IsSelected( AliAODJet* jet ) {
106   // see header file for class documentation
107
108   Bool_t bResult = kTRUE;
109
110   // -- cut on min Pt
111   if ( jet->Pt() < fEtMin )
112     bResult = kFALSE;
113
114   return bResult;
115 }
116
117
118 #if 0
119 /*
120 Int_t AliHLTJetFinder::CleanJetCandidates(){
121   // see header file for class documentation
122
123   Int_t iResult = 0;
124   
125   fJets->SortJets();
126   
127   Int_t nIntitalJetCandidates = fJets->GetNJets();
128
129   for ( Int_t iter = 0; iter < nIntitalJetCandidates; iter++ ) {
130
131     if ( ! fJets->IsJet( iter ) )
132         continue;
133
134     AliHLTJetFinderJetCandidate* jet = fJets->GetJet( iter );
135
136     for ( Int_t compareIter = 0; compareIter < iter ; compareIter++ ) {
137
138       if ( ! fJets->IsJet( compareIter ) )
139         continue;
140
141       if ( ! fJets->IsJet( iter ) )
142         break;
143
144       
145       AliHLTJetFinderJetCandidate* compareJet = fJets->GetJet( compareIter );
146
147       Double_t distance2 = AliHLTJetDefinitions::GetDistance2( jet->GetEta(), jet->GetPhi(), 
148                                                                compareJet->GetEta(), compareJet->GetPhi() );
149
150       // -- check if Jet is close to another one
151       if ( distance2 > ( fDistanceCutJet*fDistanceCutJet) ) 
152         continue;
153
154       // -- one has to go
155       if ( jet->GetPt() >= compareJet->GetPt() )
156         fJets->RemoveJet( compareIter );
157       
158       else {
159         fJets->RemoveJet( iter );
160         break;
161       }
162
163     } // for ( Int_t compareIter = 0; compareIter < iter ; compareIter++ ) {
164     
165   } // for ( Int_t iter = 0; iter < fNJetCandidates; iter++ ) {
166   
167   fJets->CompressJets();
168
169   return iResult;
170 }
171
172 */
173 #endif
174