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: Jochen Thaeder <jochen@thaeder.de> *
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 AliHLTVZEROAgent.cxx
20 @author Jochen Thaeder <jochen@thaeder.de>
21 @brief Agent of the libAliHLTVZERO library
28 #include "AliHLTVZEROAgent.h"
30 #include "AliHLTErrorGuard.h"
32 // header files of library components
33 #include "AliHLTVZERORecoComponent.h"
35 // raw data handler of HLTOUT data
36 #include "AliHLTOUTHandlerEquId.h"
37 #include "AliHLTOUTHandlerEsdBranch.h"
39 /** global instance for agent registration */
40 AliHLTVZEROAgent gAliHLTVZEROAgent;
42 /** ROOT macro for the implementation of ROOT specific class methods */
43 ClassImp(AliHLTVZEROAgent)
46 * ---------------------------------------------------------------------------------
47 * Constructor / Destructor
48 * ---------------------------------------------------------------------------------
51 // #################################################################################
52 AliHLTVZEROAgent::AliHLTVZEROAgent() :
53 AliHLTModuleAgent("VZERO") {
54 // see header file for class documentation
56 // refer to README to build package
58 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
61 // #################################################################################
62 AliHLTVZEROAgent::~AliHLTVZEROAgent() {
63 // see header file for class documentation
67 * ---------------------------------------------------------------------------------
68 * Public functions to implement AliHLTModuleAgent's interface.
69 * These functions are required for the registration process
70 * ---------------------------------------------------------------------------------
73 // #################################################################################
74 Int_t AliHLTVZEROAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
75 AliRawReader* rawReader, AliRunLoader* runloader) const {
76 // see header file for class documentation
81 if (rawReader || !runloader) {
82 // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
83 // Alireconstruction: indicated by runloader==NULL, run always on raw data
85 // -- Define the VZERO raw publisher
86 // -----------------------------------
87 TString arg("-equipmentid 3584 -datatype 'DDL_RAW ' 'VZRO' -dataspec 0x01");
88 handler->CreateConfiguration("VZERO-DP_0", "AliRawReaderPublisher", NULL , arg.Data());
90 // -- Define the VZERO reconstruction components
91 // -----------------------------------------------
92 handler->CreateConfiguration("VZERO-RECO", "VZEROReconstruction", "VZERO-DP_0", "");
94 else if (runloader && !rawReader) {
95 // indicates AliSimulation with no RawReader available -> run on digits
97 /* NOT Tested/ implemented yet
98 handler->CreateConfiguration("DigitPublisher","AliLoaderPublisher",NULL,
99 "-loader VZEROLoader -datatype 'ALITREED' 'VZRO'");
100 handler->CreateConfiguration("Digit","VZEROReconstruction","DigitPublisher","");
107 // #################################################################################
108 const Char_t* AliHLTVZEROAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
109 AliRunLoader* /*runloader*/) const {
110 // see header file for class documentation
112 // VZERO called only from the EsdConverter
116 // #################################################################################
117 const Char_t* AliHLTVZEROAgent::GetRequiredComponentLibraries() const {
118 // see header file for class documentation
119 return "libAliHLTUtil.so libAliHLTVZERO.so";
122 // #################################################################################
123 Int_t AliHLTVZEROAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const {
124 // see header file for class documentation
126 if (!pHandler) return -EINVAL;
128 pHandler->AddComponent(new AliHLTVZERORecoComponent);
133 // #################################################################################
134 Int_t AliHLTVZEROAgent::GetHandlerDescription(AliHLTComponentDataType dt, AliHLTUInt32_t spec,
135 AliHLTOUTHandlerDesc& desc) const {
136 // see header file for class documentation
137 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginVZERO)) {
138 desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
139 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
140 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
144 // add TObject data blocks of type {ESD_CONT:VZRO} to ESD
145 if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO)) {
146 desc=AliHLTOUTHandlerDesc(kEsd, dt, GetModuleId());
147 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
148 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
155 // #################################################################################
156 AliHLTOUTHandler* AliHLTVZEROAgent::GetOutputHandler(AliHLTComponentDataType dt,
157 AliHLTUInt32_t /*spec*/) {
158 // see header file for class documentation
159 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginVZERO)) {
160 // use the default handler
161 static AliHLTOUTHandlerEquId handler;
165 if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO)) {
166 // use AliHLTOUTHandlerEsdBranch handler to add the TObject
168 // Note: the object should have an appropriate name returned
169 // by GetName(). Use SetName() to prepare the object before streaming
170 static AliHLTOUTHandlerEsdBranch handler;
177 // #################################################################################
178 Int_t AliHLTVZEROAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance) {
179 // see header file for class documentation
180 if (pInstance==NULL) return -EINVAL;
182 // nothing to delete, the handler have been defined static
186 // #################################################################################
187 AliHLTModulePreprocessor* AliHLTVZEROAgent::GetPreprocessor() {
188 // see header file for class documentation
189 ALIHLTERRORGUARD(5, "GtePreProcessor not implemented for this module");