2 // $Id: AliHLTJETFastJetHeader.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 AliHLTJETFastJetHeader.cxx
20 @author Jochen Thaeder
22 @brief Header of the FastJet finder interface
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 "AliHLTJETJetCuts.h"
33 #include "AliHLTJETReaderHeader.h"
34 #include "AliHLTJETFastJetHeader.h"
38 /** ROOT macro for the implementation of ROOT specific class methods */
39 ClassImp(AliHLTJETFastJetHeader)
42 * ---------------------------------------------------------------------------------
43 * Constructor / Destructor
44 * ---------------------------------------------------------------------------------
47 // #################################################################################
48 AliHLTJETFastJetHeader::AliHLTJETFastJetHeader()
50 AliJetHeader("AliHLTJETFastJetHeader"),
51 fAlgorithm(fastjet::kt_algorithm),
52 fStrategy(fastjet::Best),
53 fRecombScheme(fastjet::BIpt_scheme),
55 fActiveAreaRepeats(1),
56 fAreaType(fastjet::active_area),
59 fGhostedAreaSpec(NULL),
60 fAreaDefinition(NULL),
61 fRangeDefinition(NULL),
63 // see header file for class documentation
65 // refer to README to build package
67 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
69 // SetRapRange(rapmin, rapmax);
72 // #################################################################################
73 AliHLTJETFastJetHeader::~AliHLTJETFastJetHeader() {
74 // see header file for class documentation
77 delete fJetDefinition;
78 fJetDefinition = NULL;
80 if ( fGhostedAreaSpec)
81 delete fGhostedAreaSpec;
82 fGhostedAreaSpec = NULL;
84 if ( fAreaDefinition )
85 delete fAreaDefinition;
86 fAreaDefinition = NULL;
88 if ( fRangeDefinition )
89 delete fRangeDefinition;
90 fRangeDefinition = NULL;
94 * ---------------------------------------------------------------------------------
96 * ---------------------------------------------------------------------------------
99 // #################################################################################
100 Int_t AliHLTJETFastJetHeader::Initialize() {
101 // see header file for class documentation
103 HLTInfo(" -= AliHLTJETFastJetHeader =- " );
107 AliHLTJETReaderHeader* readerHeader = dynamic_cast<AliHLTJETReaderHeader*>(fReaderHeader);
110 HLTError("No HLT jet cuts set!");
115 fPtMin = fJetCuts->GetMinEt();
118 AliHLTJETBase::JetAlgorithmType_t GetJetAlgorithm();
120 if ( readerHeader->GetJetAlgorithm() == AliHLTJETBase::kKt )
121 fAlgorithm = fastjet::kt_algorithm;
122 else if ( readerHeader->GetJetAlgorithm() == AliHLTJETBase::kAntiKt )
123 fAlgorithm = fastjet::antikt_algorithm;
125 HLTError("No algorithm found!");
129 // -- Create an object that represents your choice of jet algorithm,
130 // and the associated parameters
131 if ( fJetDefinition )
132 delete fJetDefinition;
133 fJetDefinition = new fastjet::JetDefinition(fAlgorithm, readerHeader->GetConeRadius(),
134 fRecombScheme, fStrategy);
136 // -- Create the object that holds info about ghosts
137 if ( fGhostedAreaSpec )
138 delete fGhostedAreaSpec;
139 fGhostedAreaSpec = new fastjet::GhostedAreaSpec(readerHeader->GetFiducialEtaMax(),
140 fActiveAreaRepeats, fGhostArea);
142 // -- Create area definition
143 if ( fAreaDefinition )
144 delete fAreaDefinition;
145 // xxx fAreaDefinition = new fastjet::AreaDefinition(fAreaType, fGhostedAreaSpec);
146 fAreaDefinition = new fastjet::AreaDefinition(fAreaType, (*fGhostedAreaSpec) );
148 // -- Set the rapididty, phi range within which to study the background
149 if ( fRangeDefinition )
150 delete fRangeDefinition;
151 fRangeDefinition = new fastjet::RangeDefinition( readerHeader->GetFiducialEtaMin()+readerHeader->GetConeRadius(),
152 readerHeader->GetFiducialEtaMax()-readerHeader->GetConeRadius(),
153 readerHeader->GetFiducialPhiMin(),
154 readerHeader->GetFiducialPhiMax() );
156 // -- Check initialization
157 if ( !fJetDefinition || !fGhostedAreaSpec ||
158 !fAreaDefinition || !fRangeDefinition ) {
159 HLTError("Initializing FastJet failed!");
165 fComment = "Running FastJet algorithm with the following setup.";
166 fComment+= "\n-Jet definition:\n ";
167 fComment+= TString(fJetDefinition->description());
168 fComment+= ". \n-Area definition:\n ";
169 fComment+= TString(fAreaDefinition->description());
170 fComment+= ". \n-Strategy adopted by FastJet:\n ";
177 * ---------------------------------------------------------------------------------
179 * ---------------------------------------------------------------------------------
182 // #################################################################################
183 void AliHLTJETFastJetHeader::PrintParameters() const {
184 // see header file for class documentation
186 HLTInfo( "FastJet algorithm parameters:" );
188 HLTInfo( "-- Jet Definition --- " );
190 HLTInfo( "R %f ",fRparam );
191 HLTInfo( "Jet Algorithm %s", fAlgorithm );
192 HLTInfo( "Strategy " << fStrategy );
193 HLTInfo( "Recombination Scheme " << fRecombScheme );
195 HLTInfo( "-- Ghosted Area Spec parameters --- " );
196 HLTInfo( "Ghost Eta Max " << fGhostEtaMax );
197 HLTInfo( "Ghost Area " << fGhostArea );
198 HLTInfo( "Active Area Repeats " << fActiveAreaRepeats );
200 HLTInfo( "-- Area Definition parameters --- " );
201 HLTInfo( "Area Type " << fAreaType );
203 HLTInfo( "-- Cluster Sequence Area parameters --- " );
204 HLTInfo( "pt min " << fPtMin );
206 HLTInfo( "-- Range Definition parameters --- " );
207 HLTInfo( " bkg rapidity range from " << fRapMin << " to " << fRapMax );
208 HLTInfo( " bkg phi range from " << fPhiMin << " to " << fPhiMax );