]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/util/AliHLTAgentUtil.cxx
* Added Component "AliHLTMCGeneratorComponent" -> Creates Pthyias events in HLT aliro...
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTAgentUtil.cxx
CommitLineData
242bb794 1// @(#) $Id$
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"
27#include "AliHLTConfiguration.h"
b765ad15 28#include "AliHLTOUTHandlerChain.h"
242bb794 29
f3506ea2 30// header files of library components
31#include "AliHLTDataGenerator.h"
32#include "AliHLTRawReaderPublisherComponent.h"
33#include "AliHLTLoaderPublisherComponent.h"
34#include "AliHLTRootFileStreamerComponent.h"
35#include "AliHLTRootFileWriterComponent.h"
36#include "AliHLTRootFilePublisherComponent.h"
7aac8168 37#include "AliHLTMCGeneratorComponent.h"
fa5e8413 38#include "AliHLTESDMCEventPublisherComponent.h"
f3506ea2 39#include "AliHLTFileWriter.h"
40#include "AliHLTFilePublisher.h"
9bf94558 41#include "AliHLTBlockFilterComponent.h"
c1292031 42#include "AliHLTEsdCollectorComponent.h"
43#include "AliHLTOUTPublisherComponent.h"
b765ad15 44#include "AliHLTCompStatCollector.h"
f3506ea2 45
242bb794 46/** global instance for agent registration */
47AliHLTAgentUtil gAliHLTAgentUtil;
48
49/** ROOT macro for the implementation of ROOT specific class methods */
50ClassImp(AliHLTAgentUtil)
51
52AliHLTAgentUtil::AliHLTAgentUtil()
626bfcc1 53 :
b765ad15 54 AliHLTModuleAgent("Util"),
55 fCompStatDataHandler(NULL)
242bb794 56{
57 // see header file for class documentation
58 // or
59 // refer to README to build package
60 // or
61 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
62}
63
64AliHLTAgentUtil::~AliHLTAgentUtil()
65{
66 // see header file for class documentation
67}
68
b765ad15 69int AliHLTAgentUtil::CreateConfigurations(AliHLTConfigurationHandler* handler,
dee38f1b 70 AliRawReader* /*rawReader*/,
298ef463 71 AliRunLoader* /*runloader*/) const
242bb794 72{
73 // see header file for class documentation
b765ad15 74 if (!handler) return 0;
75
76 /////////////////////////////////////////////////////////////////////////////////////
77 //
78 // a kChain HLTOUT configuration for processing of {'COMPSTAT':'PRIV'} data blocks
79 // produces a TTree object of the component statistics and writes it to disc
80
81 // publisher component
82 handler->CreateConfiguration("UTIL-hltout-compstat-publisher", "AliHLTOUTPublisher" , NULL, "");
83
84 // collector configuration
85 handler->CreateConfiguration("UTIL-compstat-converter", "StatisticsCollector", "UTIL-hltout-compstat-publisher", "");
86
87 // writer configuration
88 handler->CreateConfiguration("UTIL-compstat-writer", "ROOTFileWriter", "UTIL-compstat-converter", "-datafile HLT.statistics.root -concatenate-events -overwrite");
89
242bb794 90 return 0;
91}
92
dee38f1b 93const char* AliHLTAgentUtil::GetReconstructionChains(AliRawReader* /*rawReader*/,
94 AliRunLoader* /*runloader*/) const
242bb794 95{
96 // see header file for class documentation
97 return NULL;
98}
99
100const char* AliHLTAgentUtil::GetRequiredComponentLibraries() const
101{
102 // see header file for class documentation
dee38f1b 103 return NULL;
242bb794 104}
f3506ea2 105
106int AliHLTAgentUtil::RegisterComponents(AliHLTComponentHandler* pHandler) const
107{
108 // see header file for class documentation
109 assert(pHandler);
110 if (!pHandler) return -EINVAL;
111 pHandler->AddComponent(new AliHLTDataGenerator);
112 pHandler->AddComponent(new AliHLTRawReaderPublisherComponent);
113 pHandler->AddComponent(new AliHLTLoaderPublisherComponent);
114 pHandler->AddComponent(new AliHLTRootFileStreamerComponent);
115 pHandler->AddComponent(new AliHLTRootFileWriterComponent);
116 pHandler->AddComponent(new AliHLTRootFilePublisherComponent);
7aac8168 117 pHandler->AddComponent(new AliHLTMCGeneratorComponent);
fa5e8413 118 pHandler->AddComponent(new AliHLTESDMCEventPublisherComponent);
f3506ea2 119 pHandler->AddComponent(new AliHLTFileWriter);
120 pHandler->AddComponent(new AliHLTFilePublisher);
9bf94558 121 pHandler->AddComponent(new AliHLTBlockFilterComponent);
c1292031 122 pHandler->AddComponent(new AliHLTEsdCollectorComponent);
123 pHandler->AddComponent(new AliHLTOUTPublisherComponent);
b765ad15 124 pHandler->AddComponent(new AliHLTCompStatCollector);
125 return 0;
126}
127
128int AliHLTAgentUtil::GetHandlerDescription(AliHLTComponentDataType dt,
129 AliHLTUInt32_t /*spec*/,
fa5e8413 130 AliHLTOUTHandlerDesc& desc) const
b765ad15 131{
132 // see header file for class documentation
133
134 // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
53f79557 135 if (dt==kAliHLTDataTypeComponentStatistics ||
136 dt==kAliHLTDataTypeComponentTable) {
b765ad15 137 desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
138 return 1;
139 }
140
141 return 0;
142}
143
144AliHLTOUTHandler* AliHLTAgentUtil::GetOutputHandler(AliHLTComponentDataType dt,
145 AliHLTUInt32_t /*spec*/)
146{
147 // see header file for class documentation
148
149 // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
53f79557 150 if (dt==kAliHLTDataTypeComponentStatistics ||
151 dt==kAliHLTDataTypeComponentTable) {
b765ad15 152 if (fCompStatDataHandler==NULL)
153 fCompStatDataHandler=new AliHLTOUTHandlerChain("chains=UTIL-compstat-writer");
154 return fCompStatDataHandler;
155 }
156
157 return NULL;
158}
159
160int AliHLTAgentUtil::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
161{
162 // see header file for class documentation
163 if (pInstance==NULL) return -EINVAL;
164
165 if (pInstance==fCompStatDataHandler) {
166 delete fCompStatDataHandler;
167 fCompStatDataHandler=NULL;
168 }
f3506ea2 169 return 0;
170}