]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/VZERO/AliHLTVZEROAgent.cxx
removing the HLT autoconf build system, however keep on using that for the
[u/mrichter/AliRoot.git] / HLT / VZERO / AliHLTVZEROAgent.cxx
1 //-*- Mode: C++ -*-
2 // $Id: AliHLTVZEROAgent.cxx  $
3
4 /**************************************************************************
5  * This file is property of and copyright by the ALICE HLT Project        * 
6  * ALICE Experiment at CERN, All rights reserved.                         *
7  *                                                                        *
8  * Primary Authors: Jochen Thaeder <jochen@thaeder.de>                    *
9  *                  for The ALICE HLT Project.                            *
10  *                                                                        *
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  **************************************************************************/
19
20 /** @file   AliHLTVZEROAgent.cxx
21     @author Jochen Thaeder <jochen@thaeder.de>
22     @brief  Agent of the libAliHLTVZERO library
23 */
24
25 #include <cassert>
26
27 #include "TSystem.h"
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
74 // #################################################################################
75 Int_t AliHLTVZEROAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
76                                              AliRawReader* rawReader, AliRunLoader* runloader) const {
77   // see header file for class documentation
78
79   if (!handler) 
80     return -EINVAL;
81
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
85
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());
90
91     // -- Define the VZERO reconstruction components
92     // -----------------------------------------------
93     handler->CreateConfiguration("VZERO-RECO", "VZEROReconstruction", "VZERO-DP_0", "");
94   }
95   else if (runloader && !rawReader) {
96     // indicates AliSimulation with no RawReader available -> run on digits
97     
98     /* NOT Tested/ implemented yet
99       handler->CreateConfiguration("DigitPublisher","AliLoaderPublisher",NULL,
100       "-loader VZEROLoader -datatype 'ALITREED' 'VZRO'");
101       handler->CreateConfiguration("Digit","VZEROReconstruction","DigitPublisher","");
102     */
103   }
104   
105   return 0;
106 }
107
108 // #################################################################################
109 const Char_t* AliHLTVZEROAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
110                                                         AliRunLoader* /*runloader*/) const {
111   // see header file for class documentation
112
113   // VZERO called only from the EsdConverter
114   return NULL;
115 }
116
117 // #################################################################################
118 const Char_t* AliHLTVZEROAgent::GetRequiredComponentLibraries() const {
119   // see header file for class documentation
120   return "libAliHLTUtil.so libAliHLTVZERO.so";
121 }
122
123 // #################################################################################
124 Int_t AliHLTVZEROAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const {
125   // see header file for class documentation
126   assert(pHandler);
127   if (!pHandler) return -EINVAL;
128   
129   pHandler->AddComponent(new AliHLTVZERORecoComponent);
130   
131   return 0;
132 }
133
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);
142       return 1;
143   }
144
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);
150       return 1;
151   }
152
153   return 0;
154 }
155
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;
163     return &handler;
164   }
165
166   if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO)) {
167     // use AliHLTOUTHandlerEsdBranch handler to add the TObject
168     // to the ESD branch
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;
172     return &handler;
173   }
174
175   return NULL;
176 }
177
178 // #################################################################################
179 Int_t AliHLTVZEROAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance) {
180   // see header file for class documentation
181   if (pInstance==NULL) return -EINVAL;
182   
183   // nothing to delete, the handler have been defined static
184   return 0;
185 }
186
187 // #################################################################################
188 AliHLTModulePreprocessor* AliHLTVZEROAgent::GetPreprocessor() {
189   // see header file for class documentation
190   ALIHLTERRORGUARD(5, "GtePreProcessor not implemented for this module");
191   return NULL;
192 }