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. *
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 AliHLTJETJetCuts.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
35 #include "AliHLTJETJetCuts.h"
37 /** ROOT macro for the implementation of ROOT specific class methods */
38 ClassImp(AliHLTJETJetCuts)
41 * ---------------------------------------------------------------------------------
42 * Constructor / Destructor
43 * ---------------------------------------------------------------------------------
46 // #################################################################################
47 AliHLTJETJetCuts::AliHLTJETJetCuts(const Char_t* name, const Char_t* title )
49 AliAnalysisCuts(name, title),
51 // see header file for class documentation
53 // refer to README to build package
55 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
59 // #################################################################################
60 AliHLTJETJetCuts::~AliHLTJETJetCuts() {
61 // see header file for class documentation
66 * ---------------------------------------------------------------------------------
68 * ---------------------------------------------------------------------------------
71 // #################################################################################
72 Bool_t AliHLTJETJetCuts::IsSelected( TObject *obj ) {
73 // see header file for class documentation
75 Bool_t bResult = kTRUE;
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));
82 HLTError("Unknown object type %s", obj->ClassName() );
86 HLTError("Unknown object dd type %s", obj->ClassName() );
91 // #################################################################################
92 Bool_t AliHLTJETJetCuts::IsSelected( AliHLTJETConeJetCandidate* jet ) {
93 // see header file for class documentation
95 Bool_t bResult = kTRUE;
98 if ( jet->GetEt() < fEtMin )
104 // #################################################################################
105 Bool_t AliHLTJETJetCuts::IsSelected( AliAODJet* jet ) {
106 // see header file for class documentation
108 Bool_t bResult = kTRUE;
111 if ( jet->Pt() < fEtMin )
120 Int_t AliHLTJetFinder::CleanJetCandidates(){
121 // see header file for class documentation
127 Int_t nIntitalJetCandidates = fJets->GetNJets();
129 for ( Int_t iter = 0; iter < nIntitalJetCandidates; iter++ ) {
131 if ( ! fJets->IsJet( iter ) )
134 AliHLTJetFinderJetCandidate* jet = fJets->GetJet( iter );
136 for ( Int_t compareIter = 0; compareIter < iter ; compareIter++ ) {
138 if ( ! fJets->IsJet( compareIter ) )
141 if ( ! fJets->IsJet( iter ) )
145 AliHLTJetFinderJetCandidate* compareJet = fJets->GetJet( compareIter );
147 Double_t distance2 = AliHLTJetDefinitions::GetDistance2( jet->GetEta(), jet->GetPhi(),
148 compareJet->GetEta(), compareJet->GetPhi() );
150 // -- check if Jet is close to another one
151 if ( distance2 > ( fDistanceCutJet*fDistanceCutJet) )
155 if ( jet->GetPt() >= compareJet->GetPt() )
156 fJets->RemoveJet( compareIter );
159 fJets->RemoveJet( iter );
163 } // for ( Int_t compareIter = 0; compareIter < iter ; compareIter++ ) {
165 } // for ( Int_t iter = 0; iter < fNJetCandidates; iter++ ) {
167 fJets->CompressJets();