]>
Commit | Line | Data |
---|---|---|
49d085b5 | 1 | // $Id$ |
e7918895 | 2 | |
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: Jochen Thaeder <jochen@thaeder.de> * | |
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 | ||
19 | /** @file AliHLTVZEROAgent.cxx | |
20 | @author Jochen Thaeder <jochen@thaeder.de> | |
21 | @brief Agent of the libAliHLTVZERO library | |
22 | */ | |
23 | ||
24 | #include <cassert> | |
25 | ||
26 | #include "TSystem.h" | |
b0692a71 | 27 | #include "AliDAQ.h" |
e7918895 | 28 | |
29 | #include "AliHLTVZEROAgent.h" | |
30 | ||
31 | #include "AliHLTErrorGuard.h" | |
32 | ||
33 | // header files of library components | |
34 | #include "AliHLTVZERORecoComponent.h" | |
35 | ||
36 | // raw data handler of HLTOUT data | |
37 | #include "AliHLTOUTHandlerEquId.h" | |
38 | #include "AliHLTOUTHandlerEsdBranch.h" | |
39 | ||
40 | /** global instance for agent registration */ | |
41 | AliHLTVZEROAgent gAliHLTVZEROAgent; | |
42 | ||
43 | /** ROOT macro for the implementation of ROOT specific class methods */ | |
44 | ClassImp(AliHLTVZEROAgent) | |
45 | ||
46 | /* | |
47 | * --------------------------------------------------------------------------------- | |
48 | * Constructor / Destructor | |
49 | * --------------------------------------------------------------------------------- | |
50 | */ | |
51 | ||
52 | // ################################################################################# | |
53 | AliHLTVZEROAgent::AliHLTVZEROAgent() : | |
54 | AliHLTModuleAgent("VZERO") { | |
55 | // see header file for class documentation | |
56 | // or | |
57 | // refer to README to build package | |
58 | // or | |
59 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
60 | } | |
61 | ||
62 | // ################################################################################# | |
63 | AliHLTVZEROAgent::~AliHLTVZEROAgent() { | |
64 | // see header file for class documentation | |
65 | } | |
66 | ||
67 | /* | |
68 | * --------------------------------------------------------------------------------- | |
69 | * Public functions to implement AliHLTModuleAgent's interface. | |
70 | * These functions are required for the registration process | |
71 | * --------------------------------------------------------------------------------- | |
72 | */ | |
73 | ||
b0692a71 | 74 | UInt_t AliHLTVZEROAgent::GetDetectorMask() const |
75 | { | |
76 | return AliDAQ::kVZERO; | |
77 | } | |
78 | ||
e7918895 | 79 | // ################################################################################# |
80 | Int_t AliHLTVZEROAgent::CreateConfigurations(AliHLTConfigurationHandler* handler, | |
81 | AliRawReader* rawReader, AliRunLoader* runloader) const { | |
82 | // see header file for class documentation | |
83 | ||
84 | if (!handler) | |
85 | return -EINVAL; | |
86 | ||
87 | if (rawReader || !runloader) { | |
88 | // AliSimulation: use the AliRawReaderPublisher if the raw reader is available | |
89 | // Alireconstruction: indicated by runloader==NULL, run always on raw data | |
90 | ||
91 | // -- Define the VZERO raw publisher | |
92 | // ----------------------------------- | |
93 | TString arg("-equipmentid 3584 -datatype 'DDL_RAW ' 'VZRO' -dataspec 0x01"); | |
94 | handler->CreateConfiguration("VZERO-DP_0", "AliRawReaderPublisher", NULL , arg.Data()); | |
95 | ||
96 | // -- Define the VZERO reconstruction components | |
97 | // ----------------------------------------------- | |
98 | handler->CreateConfiguration("VZERO-RECO", "VZEROReconstruction", "VZERO-DP_0", ""); | |
99 | } | |
100 | else if (runloader && !rawReader) { | |
101 | // indicates AliSimulation with no RawReader available -> run on digits | |
102 | ||
103 | /* NOT Tested/ implemented yet | |
104 | handler->CreateConfiguration("DigitPublisher","AliLoaderPublisher",NULL, | |
105 | "-loader VZEROLoader -datatype 'ALITREED' 'VZRO'"); | |
106 | handler->CreateConfiguration("Digit","VZEROReconstruction","DigitPublisher",""); | |
107 | */ | |
108 | } | |
109 | ||
110 | return 0; | |
111 | } | |
112 | ||
113 | // ################################################################################# | |
114 | const Char_t* AliHLTVZEROAgent::GetReconstructionChains(AliRawReader* /*rawReader*/, | |
115 | AliRunLoader* /*runloader*/) const { | |
116 | // see header file for class documentation | |
117 | ||
118 | // VZERO called only from the EsdConverter | |
119 | return NULL; | |
120 | } | |
121 | ||
122 | // ################################################################################# | |
123 | const Char_t* AliHLTVZEROAgent::GetRequiredComponentLibraries() const { | |
124 | // see header file for class documentation | |
125 | return "libAliHLTUtil.so libAliHLTVZERO.so"; | |
126 | } | |
127 | ||
128 | // ################################################################################# | |
129 | Int_t AliHLTVZEROAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const { | |
130 | // see header file for class documentation | |
131 | assert(pHandler); | |
132 | if (!pHandler) return -EINVAL; | |
133 | ||
134 | pHandler->AddComponent(new AliHLTVZERORecoComponent); | |
135 | ||
136 | return 0; | |
137 | } | |
138 | ||
139 | // ################################################################################# | |
140 | Int_t AliHLTVZEROAgent::GetHandlerDescription(AliHLTComponentDataType dt, AliHLTUInt32_t spec, | |
141 | AliHLTOUTHandlerDesc& desc) const { | |
142 | // see header file for class documentation | |
143 | if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginVZERO)) { | |
144 | desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId()); | |
145 | HLTInfo("module %s handles data block type %s specification %d (0x%x)", | |
146 | GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec); | |
147 | return 1; | |
148 | } | |
149 | ||
150 | // add TObject data blocks of type {ESD_CONT:VZRO} to ESD | |
151 | if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO)) { | |
152 | desc=AliHLTOUTHandlerDesc(kEsd, dt, GetModuleId()); | |
153 | HLTInfo("module %s handles data block type %s specification %d (0x%x)", | |
154 | GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec); | |
155 | return 1; | |
156 | } | |
157 | ||
158 | return 0; | |
159 | } | |
160 | ||
161 | // ################################################################################# | |
162 | AliHLTOUTHandler* AliHLTVZEROAgent::GetOutputHandler(AliHLTComponentDataType dt, | |
163 | AliHLTUInt32_t /*spec*/) { | |
164 | // see header file for class documentation | |
165 | if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginVZERO)) { | |
166 | // use the default handler | |
167 | static AliHLTOUTHandlerEquId handler; | |
168 | return &handler; | |
169 | } | |
170 | ||
171 | if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO)) { | |
172 | // use AliHLTOUTHandlerEsdBranch handler to add the TObject | |
173 | // to the ESD branch | |
174 | // Note: the object should have an appropriate name returned | |
175 | // by GetName(). Use SetName() to prepare the object before streaming | |
176 | static AliHLTOUTHandlerEsdBranch handler; | |
177 | return &handler; | |
178 | } | |
179 | ||
180 | return NULL; | |
181 | } | |
182 | ||
183 | // ################################################################################# | |
184 | Int_t AliHLTVZEROAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance) { | |
185 | // see header file for class documentation | |
186 | if (pInstance==NULL) return -EINVAL; | |
187 | ||
188 | // nothing to delete, the handler have been defined static | |
189 | return 0; | |
190 | } | |
191 | ||
192 | // ################################################################################# | |
193 | AliHLTModulePreprocessor* AliHLTVZEROAgent::GetPreprocessor() { | |
194 | // see header file for class documentation | |
195 | ALIHLTERRORGUARD(5, "GtePreProcessor not implemented for this module"); | |
196 | return NULL; | |
197 | } |