1 // $Id: AliHLTPreprocessor.cxx 23039 2007-12-13 20:53:02Z richterm $
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: Matthias Richter <Matthias.Richter@ift.uib.no> *
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 //**************************************************************************
20 * @file AliHLTPreprocessor.cxx
21 * @author Matthias Richter
23 * @brief Container for HLT module preprocessors, acts to the outside as
24 * HLT preprocessor used by the Offline Shuttle
27 #include "AliHLTPreprocessor.h"
28 #include "AliHLTModulePreprocessor.h"
29 #include "AliHLTSystem.h"
30 #include "AliHLTModuleAgent.h"
33 ClassImp(AliHLTPreprocessor)
35 AliHLTPreprocessor::AliHLTPreprocessor(AliShuttleInterface* shuttle)
37 AliPreprocessor(fgkHLTPreproc, shuttle),
40 // see header file for class documentation
42 // refer to README to build package
44 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
46 fProcessors.SetOwner();
49 const char* AliHLTPreprocessor::fgkHLTPreproc = "HLT";
51 /** HLT default component libraries */
52 const char* AliHLTPreprocessor::fgkHLTDefaultShuttleLibs[]= {
63 AliHLTPreprocessor::~AliHLTPreprocessor()
65 // see header file for function documentation
68 void AliHLTPreprocessor::Initialize(Int_t run, UInt_t startTime,
71 // see header file for function documentation
73 fStartTime = startTime;
76 // TString msg("Preprocessor for HLT initialized for run: ");
80 // load component libraries
82 const char** deflib=fgkHLTDefaultShuttleLibs;
84 if (gSystem->Load(*deflib)==0) {
85 Log(Form("HLT component library %s loaded", *deflib));
89 AliHLTModuleAgent* pAgent=AliHLTModuleAgent::GetFirstAgent();
91 AliHLTModulePreprocessor* pProc=pAgent->GetPreprocessor();
93 pProc->SetContainer(this);
94 pProc->Initialize(run, startTime, endTime);
95 fProcessors.Add(pProc);
97 msg.Form("added preprocessor %p for module %p", pProc, pAgent);
103 UInt_t AliHLTPreprocessor::Process(TMap* dcsAliasMap)
105 // see header file for function documentation
108 if (!GetHLTStatus()) {
112 bool bAllFailed=true;
113 TObjLink *lnk = NULL;
114 lnk=fProcessors.FirstLink();
116 AliHLTModulePreprocessor* pProc=dynamic_cast<AliHLTModulePreprocessor*>(lnk->GetObject());
118 UInt_t result=pProc->Process(dcsAliasMap);
121 msg.Form("preprocessor for module %s failed with error code %d", pProc->GetName(), result);
130 if (bAllFailed) return 1;
135 Bool_t AliHLTPreprocessor::ProcessDCS()
137 // see header file for function documentation