]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/JET/cone/AliHLTJETConeJetComponent.cxx
Put the QA images into a compac format
[u/mrichter/AliRoot.git] / HLT / JET / cone / AliHLTJETConeJetComponent.cxx
CommitLineData
33daad3d 1//-*- Mode: C++ -*-
2// $Id: $
3
4//**************************************************************************
5//* This file is property of and copyright by the ALICE HLT Project *
6//* ALICE Experiment at CERN, All rights reserved. *
7//* *
8//* Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
9//* for The ALICE HLT Project. *
10//* *
11//* Permission to use, copy, modify and distribute this software and its *
12//* documentation strictly for non-commercial purposes is hereby granted *
13//* without fee, provided that the above copyright notice appears in all *
14//* copies and that both the copyright notice and this permission notice *
15//* appear in the supporting documentation. The authors make no claims *
16//* about the suitability of this software for any purpose. It is *
17//* provided "as is" without express or implied warranty. *
18//**************************************************************************
19
20/** @file AliHLTJETConeJetComponent.cxx
21 @author Jochen Thaeder <thaeder@kip.uni-heidelberg.de>
22 @date
23 @brief Component to run the ConeJet jetfinder
24*/
25
26#if __GNUC__>= 3
27using namespace std;
28#endif
29
30#include <cstdlib>
31#include <cerrno>
32#include <sys/time.h>
33
34#include "AliHLTJETConeJetComponent.h"
35
33daad3d 36#include "TString.h"
37#include "TObjString.h"
38
39/** ROOT macro for the implementation of ROOT specific class methods */
40ClassImp(AliHLTJETConeJetComponent)
41
42/*
43 * ---------------------------------------------------------------------------------
44 * Constructor / Destructor
45 * ---------------------------------------------------------------------------------
46 */
47
48// #################################################################################
49AliHLTJETConeJetComponent::AliHLTJETConeJetComponent()
0734d112 50 :
51 //fJetFinder(NULL),
52 // fJetHeader(NULL),*/
53 fJetReader(NULL),
54 fJetReaderHeader(NULL),
55 fJetTrackCuts(NULL) {
33daad3d 56 // see header file for class documentation
57 // or
58 // refer to README to build package
59 // or
60 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
0734d112 61
33daad3d 62}
63
64// #################################################################################
65AliHLTJETConeJetComponent::~AliHLTJETConeJetComponent() {
66 // see header file for class documentation
67}
68
69/*
70 * ---------------------------------------------------------------------------------
71 * Public functions to implement AliHLTComponent's interface.
72 * These functions are required for the registration process
73 * ---------------------------------------------------------------------------------
74 */
75
76// #################################################################################
77const Char_t* AliHLTJETConeJetComponent::GetComponentID() {
78 // see header file for class documentation
79 return "JETConeJetFinder";
80}
81
82// #################################################################################
83void AliHLTJETConeJetComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
84 // see header file for class documentation
85 list.clear();
86 list.push_back( kAliHLTDataTypeMCObject|kAliHLTDataOriginOffline );
0734d112 87 list.push_back( kAliHLTDataTypeMCObject|kAliHLTDataOriginHLT );
33daad3d 88 list.push_back( kAliHLTDataTypeESDObject|kAliHLTDataOriginOffline );
89 list.push_back( kAliHLTDataTypeESDObject|kAliHLTDataOriginHLT );
90}
91
92// #################################################################################
93AliHLTComponentDataType AliHLTJETConeJetComponent::GetOutputDataType() {
94 // see header file for class documentation
95 return (kAliHLTDataTypeESDObject| kAliHLTDataOriginHLT);
96}
97
98// #################################################################################
99void AliHLTJETConeJetComponent::GetOutputDataSize( ULong_t& constBase, Double_t& inputMultiplier ) {
100 // see header file for class documentation
101
102 constBase = 0;
103 inputMultiplier = 0.3;
104}
105
106// #################################################################################
107AliHLTComponent* AliHLTJETConeJetComponent::Spawn() {
108 // see header file for class documentation
109 return new AliHLTJETConeJetComponent();
110}
111
112/*
113 * ---------------------------------------------------------------------------------
114 * Protected functions to implement AliHLTComponent's interface.
115 * These functions provide initialization as well as the actual processing
116 * capabilities of the component.
117 * ---------------------------------------------------------------------------------
118 */
119
120// #################################################################################
121Int_t AliHLTJETConeJetComponent::DoInit( Int_t /*argc*/, const Char_t** /*argv*/ ) {
122 // see header file for class documentation
123
0734d112 124 if ( /*fJetFinder || fJetHeader ||*/ fJetReader || fJetReader || fJetTrackCuts)
125 return -EINPROGRESS;
33daad3d 126
33daad3d 127
0734d112 128 // -- Jet Track Cuts
129 // -------------------------------------------
130 if ( ! (fJetTrackCuts = new AliHLTJETTrackCuts()) ) {
131 HLTError("Error initializing Track Cuts");
132 return -EINPROGRESS;
133 }
33daad3d 134
0734d112 135 // fJetTrackCuts->Set ...
33daad3d 136
0734d112 137 // -- Jet Reader Header
138 // -------------------------------------------
139 if ( ! (fJetReaderHeader = new AliHLTJETReaderHeader()) ) {
140 HLTError("Error initializing Jet Reader Header");
141 return -EINPROGRESS;
142 }
143
144 fJetReaderHeader->SetAnalysisCuts( dynamic_cast<AliAnalysisCuts*>(fJetTrackCuts) );
145
146 // -- Jet Reader
147 // -------------------------------------------
148 if ( ! (fJetReader = new AliHLTJETReader()) ) {
149 HLTError("Error initializing Jet Reader");
150 return -EINPROGRESS;
151 }
152
33daad3d 153 fJetReader->SetReaderHeader(fJetReaderHeader);
33daad3d 154
0734d112 155#if 0
156 // -- Jet Header
157 // -------------------------------------------
158 if ( ! (fJetHeader = new AliFastJetHeader()) ) {
159 HLTError("Error initializing Jet Header");
160 return -EINPROGRESS;
161 }
162
163 fJetHeader->SetRparam(0.7);
164
165 // -- Jet Finder
166 // -------------------------------------------
167 if ( ! (fJetFinder = new AliFastJetFinder()) ) {
168 HLTError("Error initializing Jet Finder");
169 return -EINPROGRESS;
170 }
171
33daad3d 172 fJetFinder->SetJetHeader(fJetHeader);
173 fJetFinder->SetJetReader(fJetReader);
174 fJetFinder->SetOutputFile("jets.root");
0734d112 175
176 // -- Initialize Jet Finder
177 // -------------------------------------------
178 fJetFinder->Init();
179#endif
180
181
33daad3d 182 return 0;
183}
184
185// #################################################################################
186Int_t AliHLTJETConeJetComponent::DoDeinit() {
187 // see header file for class documentation
188
189 /*
190 if ( fJetFinder )
191 delete fJetFinder;
192 fJetFinder = NULL;
193
194 if ( fJetHeader )
195 delete fJetHeader;
196 fJetHeader = NULL;
197 */
198 /*
199 if ( fJetReader )
200 delete fJetReader;
201 fJetReader = NULL;
202
203 if ( fJetReaderHeader )
204 delete fJetReaderHeader;
205 fJetReaderHeader = NULL;
0734d112 206
207 if ( fJetTrackCuts )
208 delete fJetTrackCuts;
209 fJetTrackCuts = NULL;
210
211
212
33daad3d 213 */
214 return 0;
215}
216
217// #################################################################################
218Int_t AliHLTJETConeJetComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/,
219 AliHLTComponentTriggerData& /*trigData*/ ) {
220 // see header file for class documentation
221
0734d112 222 Int_t iResult = 0;
223
33daad3d 224 const TObject* iter = NULL;
33daad3d 225
0734d112 226 // -- Start-Of-Run
227 // -----------------
228 if ( GetFirstInputObject(kAliHLTDataTypeSOR) && !iResult ) {
229 HLTInfo("On-line SOR Event");
33daad3d 230 }
231
0734d112 232 // -- ADD MC Object -- Off-line
233 // ------------------------------
234 for ( iter=GetFirstInputObject(kAliHLTDataTypeMCObject|kAliHLTDataOriginOffline); iter != NULL && !iResult; iter=GetNextInputObject() ) {
235 HLTInfo("Off-line MC Event");
33daad3d 236 }
237
0734d112 238 // -- ADD MC Object -- On-line
239 // ------------------------------
240 for ( iter=GetFirstInputObject(kAliHLTDataTypeMCObject|kAliHLTDataOriginHLT); iter != NULL && !iResult; iter=GetNextInputObject() ) {
241 HLTInfo("On-line MC Event");
242
243 // -- Set input event
244 fJetReader->SetInputEvent( NULL, NULL, const_cast<TObject*>(iter) );
245
246 // -- FillMomentumArrayMC
247 if ( ! (fJetReader->FillMomentumArrayMC()) )
248 iResult = -1;
249
250 // -- Process Event
251 // fJetFinder->ProcessEvent();
252
33daad3d 253 }
254
0734d112 255 // -- ADD ESD Object -- Off-line
256 // -------------------------------
257 for ( iter=GetFirstInputObject(kAliHLTDataTypeESDObject|kAliHLTDataOriginOffline); iter != NULL && !iResult; iter=GetNextInputObject() ) {
258 HLTInfo("Off-line ESD Event");
259 }
bb7774d6 260
0734d112 261 // -- ADD ESD Object -- On-line
262 // ------------------------------
263 for ( iter=GetFirstInputObject(kAliHLTDataTypeESDObject|kAliHLTDataOriginHLT); iter != NULL && !iResult; iter=GetNextInputObject() ) {
264 HLTInfo("On-line ESD Event");
265 }
33daad3d 266
0734d112 267 // -- End-Of-Run
268 // ---------------
269 if ( GetFirstInputObject(kAliHLTDataTypeEOR) && !iResult ) {
270 HLTInfo("On-line EOR Event");
271
272 // -- Finish Event ?
273 // fJetFinder->FinishRun();
274 }
275
276 // -- PushBack
277 // -------------
278
33daad3d 279 return 0;
280}