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