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