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"
50 /** global instance for agent registration */
51 AliHLTAgentUtil gAliHLTAgentUtil;
53 /** ROOT macro for the implementation of ROOT specific class methods */
54 ClassImp(AliHLTAgentUtil)
56 AliHLTAgentUtil::AliHLTAgentUtil()
57 : AliHLTModuleAgent("Util")
58 , fCompStatDataHandler(NULL)
59 , fStreamerInfoDataHandler(NULL)
61 // see header file for class documentation
63 // refer to README to build package
65 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
68 AliHLTAgentUtil::~AliHLTAgentUtil()
70 // see header file for class documentation
73 int AliHLTAgentUtil::CreateConfigurations(AliHLTConfigurationHandler* handler,
74 AliRawReader* /*rawReader*/,
75 AliRunLoader* /*runloader*/) const
77 // see header file for class documentation
78 if (!handler) return 0;
80 /////////////////////////////////////////////////////////////////////////////////////
82 // a kChain HLTOUT configuration for processing of {'COMPSTAT':'PRIV'} data blocks
83 // produces a TTree object of the component statistics and writes it to disc
85 // publisher component
86 handler->CreateConfiguration("UTIL-hltout-compstat-publisher", "AliHLTOUTPublisher" , NULL, "-disable-component-stat");
88 // collector configuration
89 handler->CreateConfiguration("UTIL-compstat-converter", "StatisticsCollector", "UTIL-hltout-compstat-publisher", "-disable-component-stat");
91 // writer configuration
92 handler->CreateConfiguration("UTIL-compstat-writer", "ROOTFileWriter", "UTIL-compstat-converter", "-datafile HLT.statistics.root -concatenate-events -overwrite");
97 const char* AliHLTAgentUtil::GetReconstructionChains(AliRawReader* /*rawReader*/,
98 AliRunLoader* /*runloader*/) const
100 // see header file for class documentation
104 const char* AliHLTAgentUtil::GetRequiredComponentLibraries() const
106 // see header file for class documentation
110 int AliHLTAgentUtil::RegisterComponents(AliHLTComponentHandler* pHandler) const
112 // see header file for class documentation
114 if (!pHandler) return -EINVAL;
115 pHandler->AddComponent(new AliHLTDataGenerator);
116 pHandler->AddComponent(new AliHLTRawReaderPublisherComponent);
117 pHandler->AddComponent(new AliHLTLoaderPublisherComponent);
118 pHandler->AddComponent(new AliHLTRootFileStreamerComponent);
119 pHandler->AddComponent(new AliHLTRootFileWriterComponent);
120 pHandler->AddComponent(new AliHLTRootFilePublisherComponent);
121 pHandler->AddComponent(new AliHLTRootSchemaEvolutionComponent);
122 pHandler->AddComponent(new AliHLTRecoParamComponent);
123 // pHandler->AddComponent(new AliHLTMCGeneratorComponent);
124 pHandler->AddComponent(new AliHLTESDMCEventPublisherComponent);
125 pHandler->AddComponent(new AliHLTFileWriter);
126 pHandler->AddComponent(new AliHLTFilePublisher);
127 pHandler->AddComponent(new AliHLTBlockFilterComponent);
128 pHandler->AddComponent(new AliHLTMonitoringRelay);
129 pHandler->AddComponent(new AliHLTEsdCollectorComponent);
130 pHandler->AddComponent(new AliHLTReadoutListDumpComponent);
131 pHandler->AddComponent(new AliHLTOUTPublisherComponent);
132 pHandler->AddComponent(new AliHLTCompStatCollector);
133 pHandler->AddComponent(new AliHLTCorruptorComponent);
137 int AliHLTAgentUtil::GetHandlerDescription(AliHLTComponentDataType dt,
138 AliHLTUInt32_t /*spec*/,
139 AliHLTOUTHandlerDesc& desc) const
141 // see header file for class documentation
143 // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
144 if (dt==kAliHLTDataTypeComponentStatistics ||
145 dt==kAliHLTDataTypeComponentTable) {
146 desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
150 // handler for the component statistics data blocks {'ROOTSTRI':'HLT '}
151 if (dt==kAliHLTDataTypeStreamerInfo) {
152 desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId());
158 AliHLTOUTHandler* AliHLTAgentUtil::GetOutputHandler(AliHLTComponentDataType dt,
159 AliHLTUInt32_t /*spec*/)
161 // see header file for class documentation
163 // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
164 if (dt==kAliHLTDataTypeComponentStatistics ||
165 dt==kAliHLTDataTypeComponentTable) {
166 if (fCompStatDataHandler==NULL)
167 fCompStatDataHandler=new AliHLTOUTHandlerChain("chains=UTIL-compstat-writer");
168 return fCompStatDataHandler;
171 // handler for the component statistics data blocks {'ROOTSTRI':'HLT '}
172 if (dt==kAliHLTDataTypeStreamerInfo) {
173 if (fStreamerInfoDataHandler==NULL)
174 fStreamerInfoDataHandler=new AliHLTStreamerInfoHandler;
175 return fStreamerInfoDataHandler;
181 int AliHLTAgentUtil::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
183 // see header file for class documentation
184 if (pInstance==NULL) return -EINVAL;
186 if (pInstance==fCompStatDataHandler) {
187 delete fCompStatDataHandler;
188 fCompStatDataHandler=NULL;
191 if (pInstance==fStreamerInfoDataHandler) {
192 delete fStreamerInfoDataHandler;
193 fStreamerInfoDataHandler=NULL;