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
22 * @brief Container for HLT module preprocessors, acts to the outside as
23 * HLT preprocessor used by the Offline Shuttle
26 #include "AliHLTPreprocessor.h"
27 #include "AliHLTModulePreprocessor.h"
28 #include "AliHLTSystem.h"
29 #include "AliHLTModuleAgent.h"
32 ClassImp(AliHLTPreprocessor)
34 AliHLTPreprocessor::AliHLTPreprocessor(AliShuttleInterface* shuttle)
36 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 // run types according to
47 // http://alice-ecs.web.cern.ch/alice-ecs/runtypes_3.16.html
49 // PHOS (retrieve Huffman tables)
50 AddRunType("STANDALONE");
52 // TPC (retrieve Huffman tables and temperature data)
53 AddRunType("PHYSICS");
56 AddRunType("PEDESTAL");
60 AddRunType("PEDESTAL");
61 AddRunType("STANDALONE");
63 fProcessors.SetOwner();
67 const char* AliHLTPreprocessor::fgkHLTPreproc = "HLT";
69 /** HLT default component libraries */
70 const char* AliHLTPreprocessor::fgkHLTDefaultShuttleLibs[]= {
82 AliHLTPreprocessor::~AliHLTPreprocessor()
84 // see header file for function documentation
87 void AliHLTPreprocessor::Initialize(Int_t run, UInt_t startTime,
90 // see header file for function documentation
92 fStartTime = startTime;
95 // retrieve list of active detectors from previous run.
96 fActiveDetectors = atoi(AliPreprocessor::GetRunParameter("detectorMask"));
98 // TString msg("Preprocessor for HLT initialized for run: ");
102 // load component libraries
104 const char** deflib=fgkHLTDefaultShuttleLibs;
106 if (gSystem->Load(*deflib)==0) {
107 Log(Form("HLT component library %s loaded", *deflib));
113 for (AliHLTModuleAgent* pAgent=AliHLTModuleAgent::GetFirstAgent();
115 pAgent=AliHLTModuleAgent::GetNextAgent()) {
116 AliHLTModulePreprocessor* pProc=pAgent->GetPreprocessor();
120 // test if pProc is necessary, if not, take next one
121 if((pProc->GetModuleNumber() & fActiveDetectors) == 0)
124 msg.Form("%s not needed", pProc->GetModuleID());
129 pProc->SetShuttleInterface(this);
130 pProc->Initialize(run, startTime, endTime);
131 fProcessors.Add(pProc);
133 msg.Form("added preprocessor %p with ID %s for module %p", pProc, pProc->GetModuleID(), pAgent);
139 UInt_t AliHLTPreprocessor::Process(TMap* dcsAliasMap)
141 // see header file for function documentation
144 if (!GetHLTStatus()) {
148 bool bAllFailed=true;
149 TObjLink *lnk = NULL;
150 lnk=fProcessors.FirstLink();
152 AliHLTModulePreprocessor* pProc=dynamic_cast<AliHLTModulePreprocessor*>(lnk->GetObject());
154 UInt_t result=pProc->Process(dcsAliasMap);
157 msg.Form("preprocessor for module %s failed with error code %d", pProc->GetName(), result);
166 if (bAllFailed) return 1;
171 Bool_t AliHLTPreprocessor::ProcessDCS()
173 // see header file for function documentation