Line data Source code
1 : //-*- Mode: C++ -*-
2 : // $Id$
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: Chiara Oppedisano <Chiara.Oppedisano@to.infn.it> *
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 AliHLTZDCAgent.cxx
21 : @author Chiara Oppedisano <Chiara.Oppedisano@to.infn.it>
22 : @brief Agent of the libAliHLTZDC library
23 : */
24 :
25 : #include <cassert>
26 :
27 : #include "TSystem.h"
28 : #include "AliDAQ.h"
29 : #include "AliHLTZDCAgent.h"
30 :
31 : #include "AliHLTErrorGuard.h"
32 :
33 : // header files of library components
34 : #include "AliHLTZDCESDRecoComponent.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 6 : AliHLTZDCAgent gAliHLTZDCAgent;
42 :
43 : /** ROOT macro for the implementation of ROOT specific class methods */
44 6 : ClassImp(AliHLTZDCAgent)
45 :
46 : AliHLTZDCAgent::AliHLTZDCAgent() :
47 3 : AliHLTModuleAgent("ZDC")
48 15 : {
49 : // see header file for class documentation
50 : // or
51 : // refer to README to build package
52 : // or
53 : // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
54 6 : }
55 :
56 0 : AliHLTZDCAgent::~AliHLTZDCAgent()
57 6 : {
58 : // see header file for class documentation
59 9 : }
60 :
61 : UInt_t AliHLTZDCAgent::GetDetectorMask() const
62 : {
63 0 : return AliDAQ::kZDC;
64 : }
65 :
66 : int AliHLTZDCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
67 : AliRawReader* rawReader,
68 : AliRunLoader* runloader) const
69 : {
70 : // see header file for class documentation
71 :
72 0 : if (!handler)
73 0 : return -EINVAL;
74 :
75 0 : 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
78 :
79 : // -- Define the ZDC raw publisher
80 : // -----------------------------------
81 0 : TString arg("-equipmentid 3840 -datatype 'DDL_RAW ' 'ZDC ' -dataspec 0x01");
82 0 : handler->CreateConfiguration("ZDC-DP_0", "AliRawReaderPublisher", NULL , arg.Data());
83 :
84 : // -- Define the VZERO reconstruction components
85 : // -----------------------------------------------
86 0 : handler->CreateConfiguration("ZDC-RECO", "ZDCESDReco", "ZDC-DP_0", "");
87 0 : }
88 0 : else if (runloader && !rawReader) {
89 : // indicates AliSimulation with no RawReader available -> run on digits
90 :
91 : /* NOT Tested/ implemented yet
92 : handler->CreateConfiguration("DigitPublisher","AliLoaderPublisher",NULL,
93 : "-loader ZDCLoader -datatype 'ALITREED' 'ZDC '");
94 : handler->CreateConfiguration("Digit","ZDCReconstruction","DigitPublisher","");
95 : */
96 : }
97 :
98 0 : return 0;
99 0 : }
100 :
101 : const char* AliHLTZDCAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
102 : AliRunLoader* /*runloader*/) const
103 : {
104 : // see header file for class documentation
105 :
106 : // ZDC called only from the EsdConverter
107 0 : return NULL;
108 : }
109 :
110 : const char* AliHLTZDCAgent::GetRequiredComponentLibraries() const
111 : {
112 : // see header file for class documentation
113 0 : return "libAliHLTUtil.so libAliHLTZDC.so";
114 : }
115 :
116 : int AliHLTZDCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
117 : {
118 : // see header file for class documentation
119 6 : assert(pHandler);
120 3 : if (!pHandler) return -EINVAL;
121 6 : pHandler->AddComponent(new AliHLTZDCESDRecoComponent);
122 :
123 3 : return 0;
124 3 : }
125 :
126 : int AliHLTZDCAgent::GetHandlerDescription(AliHLTComponentDataType dt,
127 : AliHLTUInt32_t spec,
128 : AliHLTOUTHandlerDesc& desc) const
129 : {
130 : // see header file for class documentation
131 0 : if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginZDC)) {
132 0 : desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
133 0 : HLTInfo("module %s handles data block type %s specification %d (0x%x)",
134 : GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
135 0 : return 1;
136 : }
137 :
138 : // add TObject data blocks of type {ESD_CONT:ZDC } to ESD
139 0 : if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginZDC)) {
140 0 : desc=AliHLTOUTHandlerDesc(kEsd, dt, GetModuleId());
141 0 : HLTInfo("module %s handles data block type %s specification %d (0x%x)",
142 : GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
143 0 : return 1;
144 : }
145 :
146 0 : return 0;
147 0 : }
148 :
149 : AliHLTOUTHandler* AliHLTZDCAgent::GetOutputHandler(AliHLTComponentDataType dt,
150 : AliHLTUInt32_t /*spec*/)
151 : {
152 : // see header file for class documentation
153 0 : if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginZDC)) {
154 : // use the default handler
155 0 : static AliHLTOUTHandlerEquId handler;
156 0 : return &handler;
157 : }
158 :
159 0 : if (dt==(kAliHLTDataTypeESDContent|kAliHLTDataOriginZDC)) {
160 : // use AliHLTOUTHandlerEsdBranch handler to add the TObject
161 : // to the ESD branch
162 : // Note: the object should have an appropriate name returned
163 : // by GetName(). Use SetName() to prepare the object before streaming
164 0 : static AliHLTOUTHandlerEsdBranch handler;
165 0 : return &handler;
166 : }
167 :
168 0 : return NULL;
169 0 : }
170 :
171 : int AliHLTZDCAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
172 : {
173 : // see header file for class documentation
174 0 : if (pInstance==NULL) return -EINVAL;
175 :
176 : // nothing to delete, the handler have been defined static
177 0 : return 0;
178 0 : }
179 :
180 : // #################################################################################
181 : AliHLTModulePreprocessor* AliHLTZDCAgent::GetPreprocessor() {
182 : // see header file for class documentation
183 0 : ALIHLTERRORGUARD(5, "GetPreProcessor not implemented for this module");
184 0 : return NULL;
185 0 : }
|