minor code cleanup and coding rules
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTRecoParamComponent.cxx
CommitLineData
0ab521d5 1// $Id$
2
3//**************************************************************************
94d06b79 4//* This file is property of and copyright by the ALICE *
0ab521d5 5//* ALICE Experiment at CERN, All rights reserved. *
6//* *
7//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
0ab521d5 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
f84fefa5 24#include <cstring>
25
0ab521d5 26#include "AliHLTRecoParamComponent.h"
f84fefa5 27#include "AliHLTReadoutList.h"
0ab521d5 28
29/** ROOT macro for the implementation of ROOT specific class methods */
30ClassImp(AliHLTRecoParamComponent)
31
32AliHLTRecoParamComponent::AliHLTRecoParamComponent()
33 : AliHLTCalibrationProcessor()
f84fefa5 34 , fOnlineConfig()
35 , fOutputSize(0)
0ab521d5 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
45AliHLTRecoParamComponent::~AliHLTRecoParamComponent()
46{
47 // see header file for class documentation
48}
49
50void AliHLTRecoParamComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list)
51{
52 // see header file for class documentation
53 list.push_back(kAliHLTAnyDataType);
54}
55
56AliHLTComponentDataType AliHLTRecoParamComponent::GetOutputDataType()
57{
58 // see header file for class documentation
59 return kAliHLTDataTypeFXSCalib;
60}
61
62void AliHLTRecoParamComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
63{
64 // see header file for class documentation
f84fefa5 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;
0ab521d5 70}
71
72void AliHLTRecoParamComponent::GetOCDBObjectDescription( TMap* const /*targetArray*/)
73{
74 // see header file for class documentation
75}
76
77int AliHLTRecoParamComponent::InitCalibration()
78{
79 // see header file for class documentation
80
81 int iResult=0;
82
80d9bdfe 83 return iResult;
0ab521d5 84}
85
86int AliHLTRecoParamComponent::DeinitCalibration()
87{
88 // see header file for class documentation
89
80d9bdfe 90 int iResult=0;
91
92 return iResult;
0ab521d5 93}
94
95int 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
104int AliHLTRecoParamComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/,
105 AliHLTComponentTriggerData& /*trigData*/)
106{
107 // see header file for class documentation
108
f84fefa5 109 AliHLTReadoutList rdList(AliHLTReadoutList::kHLT);
110 PushToFXS(&fOnlineConfig, "HLT", "OnlineRecoParam", &rdList);
0ab521d5 111 return 0;
112}
113
114int AliHLTRecoParamComponent::ScanConfigurationArgument(int argc, const char** argv)
115{
116 // see header file for class documentation
117 int iResult=0;
f84fefa5 118 int result=0;
119 char* configFile;
120 if (argc == 1) {
121 int argLen = strlen(argv[0]);
122 char argument[argLen+1];
a6e720a2 123 strncpy(argument, argv[0], argLen+1);
f84fefa5 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;
0ab521d5 143 }
0ab521d5 144 return iResult;
145}