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 **************************************************************************/
19 /** @file AliHLTAgentUtil.cxx
20 @author Matthias Richter
22 @brief Agent of the libAliHLTUtil library
26 #include "AliHLTAgentUtil.h"
27 #include "AliHLTOUTHandlerChain.h"
29 // header files of library components
30 #include "AliHLTDataGenerator.h"
31 #include "AliHLTRawReaderPublisherComponent.h"
32 #include "AliHLTLoaderPublisherComponent.h"
33 #include "AliHLTRootFileStreamerComponent.h"
34 #include "AliHLTRootFileWriterComponent.h"
35 #include "AliHLTRootFilePublisherComponent.h"
36 #include "AliHLTRootSchemaEvolutionComponent.h"
37 #include "AliHLTRecoParamComponent.h"
38 //#include "AliHLTMCGeneratorComponent.h"
39 #include "AliHLTESDMCEventPublisherComponent.h"
40 #include "AliHLTFileWriter.h"
41 #include "AliHLTFilePublisher.h"
42 #include "AliHLTBlockFilterComponent.h"
43 #include "AliHLTMonitoringRelay.h"
44 #include "AliHLTEsdCollectorComponent.h"
45 #include "AliHLTReadoutListDumpComponent.h"
46 #include "AliHLTOUTPublisherComponent.h"
47 #include "AliHLTCompStatCollector.h"
48 #include "AliHLTCorruptorComponent.h"
49 #include "AliHLTObjectCompressionComponent.h"
51 /** global instance for agent registration */
52 AliHLTAgentUtil gAliHLTAgentUtil;
54 /** ROOT macro for the implementation of ROOT specific class methods */
55 ClassImp(AliHLTAgentUtil)
57 AliHLTAgentUtil::AliHLTAgentUtil()
58 : AliHLTModuleAgent("Util")
59 , fCompStatDataHandler(NULL)
60 , fStreamerInfoDataHandler(NULL)
62 // see header file for class documentation
64 // refer to README to build package
66 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
69 AliHLTAgentUtil::~AliHLTAgentUtil()
71 // see header file for class documentation
74 int AliHLTAgentUtil::CreateConfigurations(AliHLTConfigurationHandler* handler,
75 AliRawReader* /*rawReader*/,
76 AliRunLoader* /*runloader*/) const
78 // see header file for class documentation
79 if (!handler) return 0;
81 /////////////////////////////////////////////////////////////////////////////////////
83 // a kChain HLTOUT configuration for processing of {'COMPSTAT':'PRIV'} data blocks
84 // produces a TTree object of the component statistics and writes it to disc
86 // publisher component
87 handler->CreateConfiguration("UTIL-hltout-compstat-publisher", "AliHLTOUTPublisher" , NULL, "-disable-component-stat");
89 // collector configuration
90 handler->CreateConfiguration("UTIL-compstat-converter", "StatisticsCollector", "UTIL-hltout-compstat-publisher", "-disable-component-stat");
92 // writer configuration
93 handler->CreateConfiguration("UTIL-compstat-writer", "ROOTFileWriter", "UTIL-compstat-converter", "-datafile HLT.statistics.root -concatenate-events -overwrite");
98 const char* AliHLTAgentUtil::GetReconstructionChains(AliRawReader* /*rawReader*/,
99 AliRunLoader* /*runloader*/) const
101 // see header file for class documentation
105 const char* AliHLTAgentUtil::GetRequiredComponentLibraries() const
107 // see header file for class documentation
111 int AliHLTAgentUtil::RegisterComponents(AliHLTComponentHandler* pHandler) const
113 // see header file for class documentation
115 if (!pHandler) return -EINVAL;
116 pHandler->AddComponent(new AliHLTDataGenerator);
117 pHandler->AddComponent(new AliHLTRawReaderPublisherComponent);
118 pHandler->AddComponent(new AliHLTLoaderPublisherComponent);
119 pHandler->AddComponent(new AliHLTRootFileStreamerComponent);
120 pHandler->AddComponent(new AliHLTRootFileWriterComponent);
121 pHandler->AddComponent(new AliHLTRootFilePublisherComponent);
122 pHandler->AddComponent(new AliHLTRootSchemaEvolutionComponent);
123 pHandler->AddComponent(new AliHLTRecoParamComponent);
124 // pHandler->AddComponent(new AliHLTMCGeneratorComponent);
125 pHandler->AddComponent(new AliHLTESDMCEventPublisherComponent);
126 pHandler->AddComponent(new AliHLTFileWriter);
127 pHandler->AddComponent(new AliHLTFilePublisher);
128 pHandler->AddComponent(new AliHLTBlockFilterComponent);
129 pHandler->AddComponent(new AliHLTMonitoringRelay);
130 pHandler->AddComponent(new AliHLTEsdCollectorComponent);
131 pHandler->AddComponent(new AliHLTReadoutListDumpComponent);
132 pHandler->AddComponent(new AliHLTOUTPublisherComponent);
133 pHandler->AddComponent(new AliHLTCompStatCollector);
134 pHandler->AddComponent(new AliHLTCorruptorComponent);
135 pHandler->AddComponent(new AliHLTObjectCompressionComponent);
139 int AliHLTAgentUtil::GetHandlerDescription(AliHLTComponentDataType dt,
140 AliHLTUInt32_t /*spec*/,
141 AliHLTOUTHandlerDesc& desc) const
143 // see header file for class documentation
145 // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
146 if (dt==kAliHLTDataTypeComponentStatistics ||
147 dt==kAliHLTDataTypeComponentTable) {
148 desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
152 // handler for the component statistics data blocks {'ROOTSTRI':'HLT '}
153 if (dt==kAliHLTDataTypeStreamerInfo) {
154 desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId());
160 AliHLTOUTHandler* AliHLTAgentUtil::GetOutputHandler(AliHLTComponentDataType dt,
161 AliHLTUInt32_t /*spec*/)
163 // see header file for class documentation
165 // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
166 if (dt==kAliHLTDataTypeComponentStatistics ||
167 dt==kAliHLTDataTypeComponentTable) {
168 if (fCompStatDataHandler==NULL)
169 fCompStatDataHandler=new AliHLTOUTHandlerChain("chains=UTIL-compstat-writer");
170 return fCompStatDataHandler;
173 // handler for the component statistics data blocks {'ROOTSTRI':'HLT '}
174 if (dt==kAliHLTDataTypeStreamerInfo) {
175 if (fStreamerInfoDataHandler==NULL)
176 fStreamerInfoDataHandler=new AliHLTStreamerInfoHandler;
177 return fStreamerInfoDataHandler;
183 int AliHLTAgentUtil::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
185 // see header file for class documentation
186 if (pInstance==NULL) return -EINVAL;
188 if (pInstance==fCompStatDataHandler) {
189 delete fCompStatDataHandler;
190 fCompStatDataHandler=NULL;
193 if (pInstance==fStreamerInfoDataHandler) {
194 delete fStreamerInfoDataHandler;
195 fStreamerInfoDataHandler=NULL;