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