]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TRD/AliHLTTRDAgent.cxx
bugfixes by Theodor and Raphaelle
[u/mrichter/AliRoot.git] / HLT / TRD / AliHLTTRDAgent.cxx
CommitLineData
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 */
32AliHLTTRDAgent 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"
4de61263 40#include "AliHLTTRDOfflineClusterizerComponent.h"
41#include "AliHLTTRDOfflineTrackerV1Component.h"
d679dd6c 42
43/** ROOT macro for the implementation of ROOT specific class methods */
44ClassImp(AliHLTTRDAgent)
45
46 AliHLTTRDAgent::AliHLTTRDAgent()
47 :
48 AliHLTModuleAgent("TRD"),
49 fRawDataHandler(NULL)
50{
51 // see header file for class documentation
52 // or
53 // refer to README to build package
54 // or
55 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
56}
57
58AliHLTTRDAgent::~AliHLTTRDAgent()
59{
60 // see header file for class documentation
61}
62
63int AliHLTTRDAgent::CreateConfigurations(AliHLTConfigurationHandler* /*handler*/,
64 AliRawReader* /*rawReader*/,
65 AliRunLoader* /*runloader*/) const
66{
67 // see header file for class documentation
68
69 return 0;
70}
71
72const char* AliHLTTRDAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
73 AliRunLoader* /*runloader*/) const
74{
75 // see header file for class documentation
76
77 return "";
78}
79
80const char* AliHLTTRDAgent::GetRequiredComponentLibraries() const
81{
82 return "";
83}
84
85int AliHLTTRDAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
86{
87 // see header file for class documentation
88 if (!pHandler) return -EINVAL;
89 pHandler->AddComponent(new AliHLTTRDClusterizerComponent);
d679dd6c 90 pHandler->AddComponent(new AliHLTTRDTrackerV1Component);
91 pHandler->AddComponent(new AliHLTTRDCalibrationComponent);
92 pHandler->AddComponent(new AliHLTTRDEsdWriterComponent);
9772d58a 93 pHandler->AddComponent(new AliHLTTRDClusterHistoComponent);
4de61263 94 pHandler->AddComponent(new AliHLTTRDOfflineClusterizerComponent);
95 pHandler->AddComponent(new AliHLTTRDOfflineTrackerV1Component);
d679dd6c 96
97 return 0;
98}
99
100int AliHLTTRDAgent::GetHandlerDescription(AliHLTComponentDataType dt,
101 AliHLTUInt32_t spec,
102 AliHLTOUTHandlerDesc& desc) const
103{
104 // see header file for class documentation
105
106 // raw data blocks to be fed into offline reconstruction
107 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTRD)) {
108 desc=AliHLTOUTHandlerDesc(kRawReader, dt, GetModuleId());
109 HLTInfo("module %s handles data block type %s specification %d (0x%x)",
110 GetModuleId(), AliHLTComponent::DataType2Text(dt).c_str(), spec, spec);
111 return 1;
112 }
113 return 0;
114}
115
116AliHLTOUTHandler* AliHLTTRDAgent::GetOutputHandler(AliHLTComponentDataType dt,
117 AliHLTUInt32_t /*spec*/)
118{
119 // see header file for class documentation
120
121 // raw data blocks to be fed into offline reconstruction
122 if (dt==(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTRD)) {
123 // use the default handler
124 if (!fRawDataHandler) {
125 fRawDataHandler=new AliHLTOUTHandlerEquId;
126 }
127 return fRawDataHandler;
128 }
129 return NULL;
130}
131
132int AliHLTTRDAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
133{
134 // see header file for class documentation
135 if (pInstance==NULL) return -EINVAL;
136
137 if (pInstance==fRawDataHandler) {
138 delete fRawDataHandler;
139 fRawDataHandler=NULL;
140 return 0;
141 }
142
143 delete pInstance;
144 return 0;
145}
146