]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTRecoParamComponent.cxx
bugfix AliHLTCompStatCollector: filling entry 'Level' of the component statistics...
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTRecoParamComponent.cxx
1 // $Id$
2
3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE                    * 
5 //* ALICE Experiment at CERN, All rights reserved.                         *
6 //*                                                                        *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
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   AliHLTRecoParamComponent.cxx
19 /// @author Matthias Richter
20 /// @date   2010-10-18
21 /// @brief  Online HLT RecoParam generator component
22 ///
23
24 #include <cstring>
25
26 #include "AliHLTRecoParamComponent.h"
27 #include "AliHLTReadoutList.h"
28
29 /** ROOT macro for the implementation of ROOT specific class methods */
30 ClassImp(AliHLTRecoParamComponent)
31
32 AliHLTRecoParamComponent::AliHLTRecoParamComponent()
33   : AliHLTCalibrationProcessor()
34   , fOnlineConfig()
35   , fOutputSize(0)
36 {
37   // see header file for class documentation
38   // or
39   // refer to README to build package
40   // or
41   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
42
43 }
44
45 AliHLTRecoParamComponent::~AliHLTRecoParamComponent()
46 {
47   // see header file for class documentation
48 }
49
50 void AliHLTRecoParamComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list)
51 {
52   // see header file for class documentation
53   list.push_back(kAliHLTAnyDataType);
54 }
55
56 AliHLTComponentDataType AliHLTRecoParamComponent::GetOutputDataType()
57 {
58   // see header file for class documentation
59   return kAliHLTDataTypeFXSCalib;
60 }
61
62 void AliHLTRecoParamComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
63 {
64   // see header file for class documentation
65   const UInt_t streamerInfoEstSize = 1024; // Estimated size of streamer info
66   // total size: FXSHeader + StreamerInfo + XML configuration
67   constBase = AliHLTCalibrationProcessor::fgkFXSProtocolHeaderSize +
68     streamerInfoEstSize + fOutputSize;
69   inputMultiplier = 0;
70 }
71
72 void AliHLTRecoParamComponent::GetOCDBObjectDescription( TMap* const /*targetArray*/)
73 {
74   // see header file for class documentation
75 }
76
77 int AliHLTRecoParamComponent::InitCalibration()
78 {
79   // see header file for class documentation
80
81   int iResult=0;
82
83   return iResult;
84 }
85
86 int AliHLTRecoParamComponent::DeinitCalibration()
87 {
88   // see header file for class documentation
89
90   int iResult=0;
91
92   return iResult;
93 }
94
95 int AliHLTRecoParamComponent::ProcessCalibration( const AliHLTComponentEventData& /*evtData*/,
96                                                             AliHLTComponentTriggerData& /*trigData*/ )
97 {
98   // see header file for class documentation
99   int iResult=0;
100
101   return iResult;
102 }
103
104 int AliHLTRecoParamComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/,
105                                                        AliHLTComponentTriggerData& /*trigData*/)
106 {
107   // see header file for class documentation
108
109   AliHLTReadoutList rdList(AliHLTReadoutList::kHLT);
110   PushToFXS(&fOnlineConfig, "HLT", "OnlineRecoParam", &rdList);
111   return 0;
112 }
113
114 int AliHLTRecoParamComponent::ScanConfigurationArgument(int argc, const char** argv)
115 {
116   // see header file for class documentation
117   int iResult=0;
118   int result=0;
119   char* configFile;
120   if (argc == 1) {
121     int argLen = strlen(argv[0]);
122     char argument[argLen+1];
123     strncpy(argument, argv[0], argLen+1);
124     argument[argLen] = '\0';
125     if (strstr(argument, "-configfile")) {
126       strtok(argument, "=");
127       configFile = strtok(0, "=");
128       if (configFile)
129         result = fOnlineConfig.LoadConfiguration(configFile);
130       if (result > 0) {
131         fOutputSize = result; // configuration file was successfully read
132         iResult = 1;
133       }
134     }
135   }
136   if (result == 0) {
137     HLTError("Missing argument -configfile");
138     iResult = -EPROTO;
139   }
140   else if (result < 0) {
141     HLTError("Could not read configuration file %s", configFile);
142     iResult = -ENOENT;
143   }
144   return iResult;
145 }