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: Chiara Oppedisano <Chiara.Oppedisano@to.infn.it> *
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 AliHLTZDCAgent.cxx
21 @author Chiara Oppedisano <Chiara.Oppedisano@to.infn.it>
22 @brief Agent of the libAliHLTZDC library
29 #include "AliHLTZDCAgent.h"
31 #include "AliHLTErrorGuard.h"
33 // header files of library components
34 #include "AliHLTZDCESDRecoComponent.h"
36 // raw data handler of HLTOUT data
37 #include "AliHLTOUTHandlerEquId.h"
38 #include "AliHLTOUTHandlerEsdBranch.h"
40 /** global instance for agent registration */
41 AliHLTZDCAgent gAliHLTZDCAgent;
43 /** ROOT macro for the implementation of ROOT specific class methods */
44 ClassImp(AliHLTZDCAgent)
46 AliHLTZDCAgent::AliHLTZDCAgent() :
47 AliHLTModuleAgent("ZDC")
49 // see header file for class documentation
51 // refer to README to build package
53 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
56 AliHLTZDCAgent::~AliHLTZDCAgent()
58 // see header file for class documentation
61 int AliHLTZDCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
62 AliRawReader* rawReader,
63 AliRunLoader* runloader) const
65 // see header file for class documentation
70 if (rawReader || !runloader) {
71 // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
72 // Alireconstruction: indicated by runloader==NULL, run always on raw data
74 // -- Define the ZDC raw publisher
75 // -----------------------------------
76 TString arg("-equipmentid 3840 -datatype 'DDL_RAW ' 'ZDC ' -dataspec 0x01");
77 handler->CreateConfiguration("ZDC-DP_0", "AliRawReaderPublisher", NULL , arg.Data());
79 // -- Define the VZERO reconstruction components
80 // -----------------------------------------------
81 handler->CreateConfiguration("ZDC-RECO", "ZDCESDReco", "ZDC-DP_0", "");
83 else if (runloader && !rawReader) {
84 // indicates AliSimulation with no RawReader available -> run on digits
86 /* NOT Tested/ implemented yet
87 handler->CreateConfiguration("DigitPublisher","AliLoaderPublisher",NULL,
88 "-loader ZDCLoader -datatype 'ALITREED' 'ZDC '");
89 handler->CreateConfiguration("Digit","ZDCReconstruction","DigitPublisher","");
96 const char* AliHLTZDCAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
97 AliRunLoader* /*runloader*/) const
99 // see header file for class documentation
101 // ZDC called only from the EsdConverter
105 const char* AliHLTZDCAgent::GetRequiredComponentLibraries() const
107 // see header file for class documentation
108 return "libAliHLTUtil.so libAliHLTZDC.so";
111 int AliHLTZDCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
113 // see header file for class documentation
115 if (!pHandler) return -EINVAL;
116 pHandler->AddComponent(new AliHLTZDCESDRecoComponent);
121 int AliHLTZDCAgent::GetHandlerDescription(AliHLTComponentDataType dt,
123 AliHLTOUTHandlerDesc& desc) const
125 // see header file for class documentation
126 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginZDC)) {
127 desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
128 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
129 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
133 // add TObject data blocks of type {ESD_CONT:ZDC } to ESD
134 if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginZDC)) {
135 desc=AliHLTOUTHandlerDesc(kEsd, dt, GetModuleId());
136 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
137 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
144 AliHLTOUTHandler* AliHLTZDCAgent::GetOutputHandler(AliHLTComponentDataType dt,
145 AliHLTUInt32_t /*spec*/)
147 // see header file for class documentation
148 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginZDC)) {
149 // use the default handler
150 static AliHLTOUTHandlerEquId handler;
154 if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginZDC)) {
155 // use AliHLTOUTHandlerEsdBranch handler to add the TObject
157 // Note: the object should have an appropriate name returned
158 // by GetName(). Use SetName() to prepare the object before streaming
159 static AliHLTOUTHandlerEsdBranch handler;
166 int AliHLTZDCAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
168 // see header file for class documentation
169 if (pInstance==NULL) return -EINVAL;
171 // nothing to delete, the handler have been defined static
175 // #################################################################################
176 AliHLTModulePreprocessor* AliHLTZDCAgent::GetPreprocessor() {
177 // see header file for class documentation
178 ALIHLTERRORGUARD(5, "GetPreProcessor not implemented for this module");