Line data Source code
1 : // $Id$
2 : //**************************************************************************
3 : //* This file is property of and copyright by the ALICE HLT Project *
4 : //* ALICE Experiment at CERN, All rights reserved. *
5 : //* *
6 : //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
7 : //* for The ALICE HLT Project. *
8 : //* *
9 : //* Permission to use, copy, modify and distribute this software and its *
10 : //* documentation strictly for non-commercial purposes is hereby granted *
11 : //* without fee, provided that the above copyright notice appears in all *
12 : //* copies and that both the copyright notice and this permission notice *
13 : //* appear in the supporting documentation. The authors make no claims *
14 : //* about the suitability of this software for any purpose. It is *
15 : //* provided "as is" without express or implied warranty. *
16 : //**************************************************************************
17 :
18 : /// @file AliHLTTRDAgent.cxx
19 : /// @author Matthias Richter
20 : /// @date
21 : /// @brief Agent of the libAliHLTTRD library
22 : ///
23 :
24 : #include "AliHLTTRDAgent.h"
25 : #include "AliHLTTRDDefinitions.h"
26 : #include "AliDAQ.h"
27 :
28 : // #include "AliHLTOUT.h"
29 : // #include "AliHLTOUTHandlerChain.h"
30 : // #include "AliRunLoader.h"
31 :
32 : /** global instance for agent registration */
33 6 : AliHLTTRDAgent gAliHLTTRDAgent;
34 :
35 : // component headers
36 : #include "AliHLTTRDClusterizerComponent.h"
37 : #include "AliHLTTRDTrackerV1Component.h"
38 : #include "AliHLTTRDCalibrationComponent.h"
39 : #include "AliHLTTRDCalibFitComponent.h"
40 : #include "AliHLTTRDCalibHistoComponent.h"
41 : #include "AliHLTTRDEsdWriterComponent.h"
42 : #include "AliHLTTRDClusterHistoComponent.h"
43 : #include "AliHLTTRDTrackHistoComponent.h"
44 : #include "AliHLTTRDHistoMergerComponent.h"
45 : #include "AliHLTTRDOfflineClusterizerComponent.h"
46 : #include "AliHLTTRDOfflineTrackerV1Component.h"
47 : #include "AliHLTTRDPreprocessorComponent.h"
48 : #include "AliHLTTRDMonitorComponent.h"
49 :
50 : /** ROOT macro for the implementation of ROOT specific class methods */
51 6 : ClassImp(AliHLTTRDAgent)
52 :
53 : AliHLTTRDAgent::AliHLTTRDAgent()
54 : :
55 3 : AliHLTModuleAgent("TRD"),
56 3 : fRawDataHandler(NULL)
57 15 : {
58 : // see header file for class documentation
59 : // or
60 : // refer to README to build package
61 : // or
62 : // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
63 6 : }
64 :
65 0 : AliHLTTRDAgent::~AliHLTTRDAgent()
66 6 : {
67 : // see header file for class documentation
68 9 : }
69 :
70 : UInt_t AliHLTTRDAgent::GetDetectorMask() const
71 : {
72 0 : return AliDAQ::kTRD;
73 : }
74 :
75 : int AliHLTTRDAgent::CreateConfigurations(AliHLTConfigurationHandler* /*handler*/,
76 : AliRawReader* /*rawReader*/,
77 : AliRunLoader* /*runloader*/) const
78 : {
79 : // see header file for class documentation
80 0 : for (int module = 0;module < 18;module++)
81 : {
82 0 : TString arg, publisher;
83 : // raw data publisher components
84 0 : publisher.Form("TRD-RP_%02d", module);
85 0 : arg.Form("-minid %d -datatype 'DDL_RAW ' 'TRD ' -dataspec %i", 1024 + module, (int) TMath::Power(2, module));
86 0 : AliHLTConfiguration pubConf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
87 0 : }
88 0 : return 0;
89 0 : }
90 :
91 : const char* AliHLTTRDAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
92 : AliRunLoader* /*runloader*/) const
93 : {
94 : // see header file for class documentation
95 :
96 0 : return "";
97 : }
98 :
99 : const char* AliHLTTRDAgent::GetRequiredComponentLibraries() const
100 : {
101 0 : return "";
102 : }
103 :
104 : int AliHLTTRDAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
105 : {
106 : // see header file for class documentation
107 6 : if (!pHandler) return -EINVAL;
108 6 : pHandler->AddComponent(new AliHLTTRDClusterizerComponent);
109 6 : pHandler->AddComponent(new AliHLTTRDTrackerV1Component);
110 6 : pHandler->AddComponent(new AliHLTTRDCalibrationComponent);
111 6 : pHandler->AddComponent(new AliHLTTRDCalibFitComponent);
112 6 : pHandler->AddComponent(new AliHLTTRDCalibHistoComponent);
113 6 : pHandler->AddComponent(new AliHLTTRDEsdWriterComponent);
114 6 : pHandler->AddComponent(new AliHLTTRDClusterHistoComponent);
115 6 : pHandler->AddComponent(new AliHLTTRDTrackHistoComponent);
116 6 : pHandler->AddComponent(new AliHLTTRDHistoMergerComponent);
117 6 : pHandler->AddComponent(new AliHLTTRDOfflineClusterizerComponent);
118 6 : pHandler->AddComponent(new AliHLTTRDOfflineTrackerV1Component);
119 6 : pHandler->AddComponent(new AliHLTTRDPreprocessorComponent);
120 6 : pHandler->AddComponent(new AliHLTTRDMonitorComponent);
121 3 : return 0;
122 3 : }
123 :
124 : int AliHLTTRDAgent::GetHandlerDescription(AliHLTComponentDataType dt,
125 : AliHLTUInt32_t spec,
126 : AliHLTOUTHandlerDesc& desc) const
127 : {
128 : // see header file for class documentation
129 :
130 : // raw data blocks to be fed into offline reconstruction
131 0 : if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTRD)) {
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 0 : return 0;
138 0 : }
139 :
140 : AliHLTOUTHandler* AliHLTTRDAgent::GetOutputHandler(AliHLTComponentDataType dt,
141 : AliHLTUInt32_t /*spec*/)
142 : {
143 : // see header file for class documentation
144 :
145 : // raw data blocks to be fed into offline reconstruction
146 0 : if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTRD)) {
147 : // use the default handler
148 0 : if (!fRawDataHandler) {
149 0 : fRawDataHandler=new AliHLTOUTHandlerEquId;
150 0 : }
151 0 : return fRawDataHandler;
152 : }
153 0 : return NULL;
154 0 : }
155 :
156 : int AliHLTTRDAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
157 : {
158 : // see header file for class documentation
159 0 : if (pInstance==NULL) return -EINVAL;
160 :
161 0 : if (pInstance==fRawDataHandler) {
162 0 : delete fRawDataHandler;
163 0 : fRawDataHandler=NULL;
164 0 : return 0;
165 : }
166 :
167 0 : delete pInstance;
168 0 : return 0;
169 0 : }
170 :
|