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 UInt_t AliHLTZDCAgent::GetDetectorMask() const
66 int AliHLTZDCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
67 AliRawReader* rawReader,
68 AliRunLoader* runloader) const
70 // see header file for class documentation
75 if (rawReader || !runloader) {
76 // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
77 // Alireconstruction: indicated by runloader==NULL, run always on raw data
79 // -- Define the ZDC raw publisher
80 // -----------------------------------
81 TString arg("-equipmentid 3840 -datatype 'DDL_RAW ' 'ZDC ' -dataspec 0x01");
82 handler->CreateConfiguration("ZDC-DP_0", "AliRawReaderPublisher", NULL , arg.Data());
84 // -- Define the VZERO reconstruction components
85 // -----------------------------------------------
86 handler->CreateConfiguration("ZDC-RECO", "ZDCESDReco", "ZDC-DP_0", "");
88 else if (runloader && !rawReader) {
89 // indicates AliSimulation with no RawReader available -> run on digits
91 /* NOT Tested/ implemented yet
92 handler->CreateConfiguration("DigitPublisher","AliLoaderPublisher",NULL,
93 "-loader ZDCLoader -datatype 'ALITREED' 'ZDC '");
94 handler->CreateConfiguration("Digit","ZDCReconstruction","DigitPublisher","");
101 const char* AliHLTZDCAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
102 AliRunLoader* /*runloader*/) const
104 // see header file for class documentation
106 // ZDC called only from the EsdConverter
110 const char* AliHLTZDCAgent::GetRequiredComponentLibraries() const
112 // see header file for class documentation
113 return "libAliHLTUtil.so libAliHLTZDC.so";
116 int AliHLTZDCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
118 // see header file for class documentation
120 if (!pHandler) return -EINVAL;
121 pHandler->AddComponent(new AliHLTZDCESDRecoComponent);
126 int AliHLTZDCAgent::GetHandlerDescription(AliHLTComponentDataType dt,
128 AliHLTOUTHandlerDesc& desc) const
130 // see header file for class documentation
131 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginZDC)) {
132 desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
133 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
134 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
138 // add TObject data blocks of type {ESD_CONT:ZDC } to ESD
139 if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginZDC)) {
140 desc=AliHLTOUTHandlerDesc(kEsd, dt, GetModuleId());
141 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
142 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
149 AliHLTOUTHandler* AliHLTZDCAgent::GetOutputHandler(AliHLTComponentDataType dt,
150 AliHLTUInt32_t /*spec*/)
152 // see header file for class documentation
153 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginZDC)) {
154 // use the default handler
155 static AliHLTOUTHandlerEquId handler;
159 if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginZDC)) {
160 // use AliHLTOUTHandlerEsdBranch handler to add the TObject
162 // Note: the object should have an appropriate name returned
163 // by GetName(). Use SetName() to prepare the object before streaming
164 static AliHLTOUTHandlerEsdBranch handler;
171 int AliHLTZDCAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
173 // see header file for class documentation
174 if (pInstance==NULL) return -EINVAL;
176 // nothing to delete, the handler have been defined static
180 // #################################################################################
181 AliHLTModulePreprocessor* AliHLTZDCAgent::GetPreprocessor() {
182 // see header file for class documentation
183 ALIHLTERRORGUARD(5, "GetPreProcessor not implemented for this module");