]>
Commit | Line | Data |
---|---|---|
95f2fcd7 | 1 | // $Id$ |
242bb794 | 2 | |
9be2600f | 3 | /************************************************************************** |
4 | * This file is property of and copyright by the ALICE HLT Project * | |
5 | * ALICE Experiment at CERN, All rights reserved. * | |
6 | * * | |
7 | * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> * | |
8 | * for The ALICE HLT Project. * | |
9 | * * | |
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 | **************************************************************************/ | |
18 | ||
242bb794 | 19 | /** @file AliHLTAgentUtil.cxx |
20 | @author Matthias Richter | |
21 | @date | |
22 | @brief Agent of the libAliHLTUtil library | |
23 | */ | |
24 | ||
f3506ea2 | 25 | #include <cassert> |
242bb794 | 26 | #include "AliHLTAgentUtil.h" |
b765ad15 | 27 | #include "AliHLTOUTHandlerChain.h" |
242bb794 | 28 | |
f3506ea2 | 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" | |
65106d07 | 36 | #include "AliHLTRootSchemaEvolutionComponent.h" |
8d37c582 | 37 | //#include "AliHLTMCGeneratorComponent.h" |
fa5e8413 | 38 | #include "AliHLTESDMCEventPublisherComponent.h" |
f3506ea2 | 39 | #include "AliHLTFileWriter.h" |
40 | #include "AliHLTFilePublisher.h" | |
9bf94558 | 41 | #include "AliHLTBlockFilterComponent.h" |
b0955ff1 | 42 | #include "AliHLTMonitoringRelay.h" |
c1292031 | 43 | #include "AliHLTEsdCollectorComponent.h" |
209986b4 | 44 | #include "AliHLTReadoutListDumpComponent.h" |
c1292031 | 45 | #include "AliHLTOUTPublisherComponent.h" |
b765ad15 | 46 | #include "AliHLTCompStatCollector.h" |
f3506ea2 | 47 | |
242bb794 | 48 | /** global instance for agent registration */ |
49 | AliHLTAgentUtil gAliHLTAgentUtil; | |
50 | ||
51 | /** ROOT macro for the implementation of ROOT specific class methods */ | |
52 | ClassImp(AliHLTAgentUtil) | |
53 | ||
54 | AliHLTAgentUtil::AliHLTAgentUtil() | |
d3382be1 | 55 | : AliHLTModuleAgent("Util") |
56 | , fCompStatDataHandler(NULL) | |
57 | , fStreamerInfoDataHandler(NULL) | |
242bb794 | 58 | { |
59 | // see header file for class documentation | |
60 | // or | |
61 | // refer to README to build package | |
62 | // or | |
63 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
64 | } | |
65 | ||
66 | AliHLTAgentUtil::~AliHLTAgentUtil() | |
67 | { | |
68 | // see header file for class documentation | |
69 | } | |
70 | ||
b765ad15 | 71 | int AliHLTAgentUtil::CreateConfigurations(AliHLTConfigurationHandler* handler, |
dee38f1b | 72 | AliRawReader* /*rawReader*/, |
298ef463 | 73 | AliRunLoader* /*runloader*/) const |
242bb794 | 74 | { |
75 | // see header file for class documentation | |
b765ad15 | 76 | if (!handler) return 0; |
77 | ||
78 | ///////////////////////////////////////////////////////////////////////////////////// | |
79 | // | |
80 | // a kChain HLTOUT configuration for processing of {'COMPSTAT':'PRIV'} data blocks | |
81 | // produces a TTree object of the component statistics and writes it to disc | |
82 | ||
83 | // publisher component | |
3d2686d3 | 84 | handler->CreateConfiguration("UTIL-hltout-compstat-publisher", "AliHLTOUTPublisher" , NULL, "-disable-component-stat"); |
b765ad15 | 85 | |
86 | // collector configuration | |
3d2686d3 | 87 | handler->CreateConfiguration("UTIL-compstat-converter", "StatisticsCollector", "UTIL-hltout-compstat-publisher", "-disable-component-stat -arraysize 10000"); |
b765ad15 | 88 | |
89 | // writer configuration | |
90 | handler->CreateConfiguration("UTIL-compstat-writer", "ROOTFileWriter", "UTIL-compstat-converter", "-datafile HLT.statistics.root -concatenate-events -overwrite"); | |
91 | ||
242bb794 | 92 | return 0; |
93 | } | |
94 | ||
dee38f1b | 95 | const char* AliHLTAgentUtil::GetReconstructionChains(AliRawReader* /*rawReader*/, |
96 | AliRunLoader* /*runloader*/) const | |
242bb794 | 97 | { |
98 | // see header file for class documentation | |
99 | return NULL; | |
100 | } | |
101 | ||
102 | const char* AliHLTAgentUtil::GetRequiredComponentLibraries() const | |
103 | { | |
104 | // see header file for class documentation | |
dee38f1b | 105 | return NULL; |
242bb794 | 106 | } |
f3506ea2 | 107 | |
108 | int AliHLTAgentUtil::RegisterComponents(AliHLTComponentHandler* pHandler) const | |
109 | { | |
110 | // see header file for class documentation | |
111 | assert(pHandler); | |
112 | if (!pHandler) return -EINVAL; | |
113 | pHandler->AddComponent(new AliHLTDataGenerator); | |
114 | pHandler->AddComponent(new AliHLTRawReaderPublisherComponent); | |
115 | pHandler->AddComponent(new AliHLTLoaderPublisherComponent); | |
116 | pHandler->AddComponent(new AliHLTRootFileStreamerComponent); | |
117 | pHandler->AddComponent(new AliHLTRootFileWriterComponent); | |
118 | pHandler->AddComponent(new AliHLTRootFilePublisherComponent); | |
65106d07 | 119 | pHandler->AddComponent(new AliHLTRootSchemaEvolutionComponent); |
8d37c582 | 120 | // pHandler->AddComponent(new AliHLTMCGeneratorComponent); |
fa5e8413 | 121 | pHandler->AddComponent(new AliHLTESDMCEventPublisherComponent); |
f3506ea2 | 122 | pHandler->AddComponent(new AliHLTFileWriter); |
123 | pHandler->AddComponent(new AliHLTFilePublisher); | |
9bf94558 | 124 | pHandler->AddComponent(new AliHLTBlockFilterComponent); |
b0955ff1 | 125 | pHandler->AddComponent(new AliHLTMonitoringRelay); |
c1292031 | 126 | pHandler->AddComponent(new AliHLTEsdCollectorComponent); |
209986b4 | 127 | pHandler->AddComponent(new AliHLTReadoutListDumpComponent); |
c1292031 | 128 | pHandler->AddComponent(new AliHLTOUTPublisherComponent); |
b765ad15 | 129 | pHandler->AddComponent(new AliHLTCompStatCollector); |
130 | return 0; | |
131 | } | |
132 | ||
133 | int AliHLTAgentUtil::GetHandlerDescription(AliHLTComponentDataType dt, | |
134 | AliHLTUInt32_t /*spec*/, | |
fa5e8413 | 135 | AliHLTOUTHandlerDesc& desc) const |
b765ad15 | 136 | { |
137 | // see header file for class documentation | |
138 | ||
139 | // handler for the component statistics data blocks {'COMPSTAT':'PRIV'} | |
53f79557 | 140 | if (dt==kAliHLTDataTypeComponentStatistics || |
141 | dt==kAliHLTDataTypeComponentTable) { | |
b765ad15 | 142 | desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId()); |
143 | return 1; | |
144 | } | |
145 | ||
d3382be1 | 146 | // handler for the component statistics data blocks {'ROOTSTRI':'HLT '} |
147 | if (dt==kAliHLTDataTypeStreamerInfo) { | |
148 | desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId()); | |
149 | return 1; | |
150 | } | |
b765ad15 | 151 | return 0; |
152 | } | |
153 | ||
154 | AliHLTOUTHandler* AliHLTAgentUtil::GetOutputHandler(AliHLTComponentDataType dt, | |
155 | AliHLTUInt32_t /*spec*/) | |
156 | { | |
157 | // see header file for class documentation | |
158 | ||
159 | // handler for the component statistics data blocks {'COMPSTAT':'PRIV'} | |
53f79557 | 160 | if (dt==kAliHLTDataTypeComponentStatistics || |
161 | dt==kAliHLTDataTypeComponentTable) { | |
b765ad15 | 162 | if (fCompStatDataHandler==NULL) |
163 | fCompStatDataHandler=new AliHLTOUTHandlerChain("chains=UTIL-compstat-writer"); | |
164 | return fCompStatDataHandler; | |
165 | } | |
166 | ||
d3382be1 | 167 | // handler for the component statistics data blocks {'ROOTSTRI':'HLT '} |
168 | if (dt==kAliHLTDataTypeStreamerInfo) { | |
169 | if (fStreamerInfoDataHandler==NULL) | |
170 | fStreamerInfoDataHandler=new AliHLTStreamerInfoHandler; | |
171 | return fStreamerInfoDataHandler; | |
172 | } | |
173 | ||
b765ad15 | 174 | return NULL; |
175 | } | |
176 | ||
177 | int AliHLTAgentUtil::DeleteOutputHandler(AliHLTOUTHandler* pInstance) | |
178 | { | |
179 | // see header file for class documentation | |
180 | if (pInstance==NULL) return -EINVAL; | |
181 | ||
182 | if (pInstance==fCompStatDataHandler) { | |
183 | delete fCompStatDataHandler; | |
184 | fCompStatDataHandler=NULL; | |
185 | } | |
d3382be1 | 186 | |
187 | if (pInstance==fStreamerInfoDataHandler) { | |
188 | delete fStreamerInfoDataHandler; | |
189 | fStreamerInfoDataHandler=NULL; | |
190 | } | |
f3506ea2 | 191 | return 0; |
192 | } |