2 // $Id: AliHLTVZEROAgent.cxx $
4 /**************************************************************************
5 * This file is property of and copyright by the ALICE HLT Project *
6 * ALICE Experiment at CERN, All rights reserved. *
8 * Primary Authors: Jochen Thaeder <jochen@thaeder.de> *
9 * for The ALICE HLT Project. *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
20 /** @file AliHLTVZEROAgent.cxx
21 @author Jochen Thaeder <jochen@thaeder.de>
22 @brief Agent of the libAliHLTVZERO library
29 #include "AliHLTVZEROAgent.h"
31 #include "AliHLTErrorGuard.h"
33 // header files of library components
34 #include "AliHLTVZERORecoComponent.h"
36 // raw data handler of HLTOUT data
37 #include "AliHLTOUTHandlerEquId.h"
38 #include "AliHLTOUTHandlerEsdBranch.h"
40 /** global instance for agent registration */
41 AliHLTVZEROAgent gAliHLTVZEROAgent;
43 /** ROOT macro for the implementation of ROOT specific class methods */
44 ClassImp(AliHLTVZEROAgent)
47 * ---------------------------------------------------------------------------------
48 * Constructor / Destructor
49 * ---------------------------------------------------------------------------------
52 // #################################################################################
53 AliHLTVZEROAgent::AliHLTVZEROAgent() :
54 AliHLTModuleAgent("VZERO") {
55 // see header file for class documentation
57 // refer to README to build package
59 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
62 // #################################################################################
63 AliHLTVZEROAgent::~AliHLTVZEROAgent() {
64 // see header file for class documentation
68 * ---------------------------------------------------------------------------------
69 * Public functions to implement AliHLTModuleAgent's interface.
70 * These functions are required for the registration process
71 * ---------------------------------------------------------------------------------
74 // #################################################################################
75 Int_t AliHLTVZEROAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
76 AliRawReader* rawReader, AliRunLoader* runloader) const {
77 // see header file for class documentation
82 if (rawReader || !runloader) {
83 // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
84 // Alireconstruction: indicated by runloader==NULL, run always on raw data
86 // -- Define the VZERO raw publisher
87 // -----------------------------------
88 TString arg("-equipmentid 3584 -datatype 'DDL_RAW ' 'VZRO' -dataspec 0x01");
89 handler->CreateConfiguration("VZERO-DP_0", "AliRawReaderPublisher", NULL , arg.Data());
91 // -- Define the VZERO reconstruction components
92 // -----------------------------------------------
93 handler->CreateConfiguration("VZERO-RECO", "VZEROReconstruction", "VZERO-DP_0", "");
95 else if (runloader && !rawReader) {
96 // indicates AliSimulation with no RawReader available -> run on digits
98 /* NOT Tested/ implemented yet
99 handler->CreateConfiguration("DigitPublisher","AliLoaderPublisher",NULL,
100 "-loader VZEROLoader -datatype 'ALITREED' 'VZRO'");
101 handler->CreateConfiguration("Digit","VZEROReconstruction","DigitPublisher","");
108 // #################################################################################
109 const Char_t* AliHLTVZEROAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
110 AliRunLoader* /*runloader*/) const {
111 // see header file for class documentation
113 // VZERO called only from the EsdConverter
117 // #################################################################################
118 const Char_t* AliHLTVZEROAgent::GetRequiredComponentLibraries() const {
119 // see header file for class documentation
120 return "libAliHLTUtil.so libAliHLTVZERO.so";
123 // #################################################################################
124 Int_t AliHLTVZEROAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const {
125 // see header file for class documentation
127 if (!pHandler) return -EINVAL;
129 pHandler->AddComponent(new AliHLTVZERORecoComponent);
134 // #################################################################################
135 Int_t AliHLTVZEROAgent::GetHandlerDescription(AliHLTComponentDataType dt, AliHLTUInt32_t spec,
136 AliHLTOUTHandlerDesc& desc) const {
137 // see header file for class documentation
138 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginVZERO)) {
139 desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
140 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
141 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
145 // add TObject data blocks of type {ESD_CONT:VZRO} to ESD
146 if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO)) {
147 desc=AliHLTOUTHandlerDesc(kEsd, dt, GetModuleId());
148 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
149 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
156 // #################################################################################
157 AliHLTOUTHandler* AliHLTVZEROAgent::GetOutputHandler(AliHLTComponentDataType dt,
158 AliHLTUInt32_t /*spec*/) {
159 // see header file for class documentation
160 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginVZERO)) {
161 // use the default handler
162 static AliHLTOUTHandlerEquId handler;
166 if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO)) {
167 // use AliHLTOUTHandlerEsdBranch handler to add the TObject
169 // Note: the object should have an appropriate name returned
170 // by GetName(). Use SetName() to prepare the object before streaming
171 static AliHLTOUTHandlerEsdBranch handler;
178 // #################################################################################
179 Int_t AliHLTVZEROAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance) {
180 // see header file for class documentation
181 if (pInstance==NULL) return -EINVAL;
183 // nothing to delete, the handler have been defined static
187 // #################################################################################
188 AliHLTModulePreprocessor* AliHLTVZEROAgent::GetPreprocessor() {
189 // see header file for class documentation
190 ALIHLTERRORGUARD(5, "GtePreProcessor not implemented for this module");