]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/VZERO/AliHLTVZEROAgent.cxx
-leg values and sparse for HF -new var cuts
[u/mrichter/AliRoot.git] / HLT / VZERO / AliHLTVZEROAgent.cxx
1 // $Id$
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"
27
28 #include "AliHLTVZEROAgent.h"
29
30 #include "AliHLTErrorGuard.h"
31
32 // header files of library components
33 #include "AliHLTVZERORecoComponent.h"
34
35 // raw data handler of HLTOUT data
36 #include "AliHLTOUTHandlerEquId.h"
37 #include "AliHLTOUTHandlerEsdBranch.h"
38
39 /** global instance for agent registration */
40 AliHLTVZEROAgent gAliHLTVZEROAgent;
41
42 /** ROOT macro for the implementation of ROOT specific class methods */
43 ClassImp(AliHLTVZEROAgent)
44
45 /*
46  * ---------------------------------------------------------------------------------
47  *                            Constructor / Destructor
48  * ---------------------------------------------------------------------------------
49  */
50
51 // #################################################################################
52 AliHLTVZEROAgent::AliHLTVZEROAgent() :
53   AliHLTModuleAgent("VZERO") {
54   // see header file for class documentation
55   // or
56   // refer to README to build package
57   // or
58   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
59 }
60
61 // #################################################################################
62 AliHLTVZEROAgent::~AliHLTVZEROAgent() {
63   // see header file for class documentation
64 }
65
66 /*
67  * ---------------------------------------------------------------------------------
68  * Public functions to implement AliHLTModuleAgent's interface.
69  * These functions are required for the registration process
70  * ---------------------------------------------------------------------------------
71  */
72
73 // #################################################################################
74 Int_t AliHLTVZEROAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
75                                              AliRawReader* rawReader, AliRunLoader* runloader) const {
76   // see header file for class documentation
77
78   if (!handler) 
79     return -EINVAL;
80
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
84
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());
89
90     // -- Define the VZERO reconstruction components
91     // -----------------------------------------------
92     handler->CreateConfiguration("VZERO-RECO", "VZEROReconstruction", "VZERO-DP_0", "");
93   }
94   else if (runloader && !rawReader) {
95     // indicates AliSimulation with no RawReader available -> run on digits
96     
97     /* NOT Tested/ implemented yet
98       handler->CreateConfiguration("DigitPublisher","AliLoaderPublisher",NULL,
99       "-loader VZEROLoader -datatype 'ALITREED' 'VZRO'");
100       handler->CreateConfiguration("Digit","VZEROReconstruction","DigitPublisher","");
101     */
102   }
103   
104   return 0;
105 }
106
107 // #################################################################################
108 const Char_t* AliHLTVZEROAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
109                                                         AliRunLoader* /*runloader*/) const {
110   // see header file for class documentation
111
112   // VZERO called only from the EsdConverter
113   return NULL;
114 }
115
116 // #################################################################################
117 const Char_t* AliHLTVZEROAgent::GetRequiredComponentLibraries() const {
118   // see header file for class documentation
119   return "libAliHLTUtil.so libAliHLTVZERO.so";
120 }
121
122 // #################################################################################
123 Int_t AliHLTVZEROAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const {
124   // see header file for class documentation
125   assert(pHandler);
126   if (!pHandler) return -EINVAL;
127   
128   pHandler->AddComponent(new AliHLTVZERORecoComponent);
129   
130   return 0;
131 }
132
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);
141       return 1;
142   }
143
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);
149       return 1;
150   }
151
152   return 0;
153 }
154
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;
162     return &handler;
163   }
164
165   if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO)) {
166     // use AliHLTOUTHandlerEsdBranch handler to add the TObject
167     // to the ESD branch
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;
171     return &handler;
172   }
173
174   return NULL;
175 }
176
177 // #################################################################################
178 Int_t AliHLTVZEROAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance) {
179   // see header file for class documentation
180   if (pInstance==NULL) return -EINVAL;
181   
182   // nothing to delete, the handler have been defined static
183   return 0;
184 }
185
186 // #################################################################################
187 AliHLTModulePreprocessor* AliHLTVZEROAgent::GetPreprocessor() {
188   // see header file for class documentation
189   ALIHLTERRORGUARD(5, "GtePreProcessor not implemented for this module");
190   return NULL;
191 }