]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliHLTGlobalDCSPublisherComponent.cxx
- fixing binning
[u/mrichter/AliRoot.git] / HLT / global / AliHLTGlobalDCSPublisherComponent.cxx
1 // $Id$
2
3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project        * 
5 //* ALICE Experiment at CERN, All rights reserved.                         *
6 //*                                                                        *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
8 //*                  for The ALICE HLT Project.                            *
9 //*                                                                        *
10 //* Permission to use, copy, modify and distribute this software and its   *
11 //* documentation strictly for non-commercial purposes is hereby granted   *
12 //* without fee, provided that the above copyright notice appears in all   *
13 //* copies and that both the copyright notice and this permission notice   *
14 //* appear in the supporting documentation. The authors make no claims     *
15 //* about the suitability of this software for any purpose. It is          *
16 //* provided "as is" without express or implied warranty.                  *
17 //**************************************************************************
18
19 /** @file   AliHLTGlobalDCSPublisherComponent.cxx
20     @author Matthias Richter
21     @date   20010-03-10
22     @brief  DIM publisher component for global HLT data
23 */
24
25 #include "AliHLTGlobalDCSPublisherComponent.h"
26 #include "AliHLTDimServer.h"
27
28 /** ROOT macro for the implementation of ROOT specific class methods */
29 ClassImp(AliHLTGlobalDCSPublisherComponent)
30
31 AliHLTGlobalDCSPublisherComponent::AliHLTGlobalDCSPublisherComponent()
32   : AliHLTDataSink()
33   , fpServer(NULL)
34 {
35   // see header file for class documentation
36   // or
37   // refer to README to build package
38   // or
39   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
40 }
41
42 AliHLTGlobalDCSPublisherComponent::~AliHLTGlobalDCSPublisherComponent()
43 {
44   // see header file for class documentation
45
46   // file list and file name list are owner of their objects and
47   // delete all the objects
48 }
49
50 const char* AliHLTGlobalDCSPublisherComponent::GetComponentID()
51 {
52   // see header file for class documentation
53   return "DCSPublisher";
54 }
55
56 void AliHLTGlobalDCSPublisherComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
57 {
58   // see header file for class documentation
59   list.clear();
60   list.push_back(kAliHLTAnyDataType);
61 }
62
63 AliHLTComponent* AliHLTGlobalDCSPublisherComponent::Spawn()
64 {
65   // see header file for class documentation
66   return new AliHLTGlobalDCSPublisherComponent;
67 }
68
69 int AliHLTGlobalDCSPublisherComponent::DoInit( int argc, const char** argv )
70 {
71   // see header file for class documentation
72   int iResult=0;
73   iResult=ConfigureFromArgumentString(argc, argv);
74
75   return iResult;
76 }
77
78 int AliHLTGlobalDCSPublisherComponent::ScanConfigurationArgument(int argc, const char** argv)
79 {
80   // see header file for class documentation
81   int iResult=0;
82
83   // -servername
84   if (argc==0) return 0;
85   int i=0;
86   const char* serverName=NULL;
87   const char* dimdns=NULL;
88   TString argument=argv[0];
89   if (argument.CompareTo("-servername")==0) {
90     if (++i>=argc) return -EPROTO;
91     serverName=argv[i];
92
93     // --dimdns
94   } else if (argument.BeginsWith("-dimdns")) {
95     if (++i>=argc) return -EPROTO;
96     dimdns=argv[i];
97
98   } else {
99     return -EINVAL;
100   }
101
102   fpServer=new AliHLTDimServer(serverName);
103   if (!fpServer) return -ENOMEM;
104   if ((iResult=fpServer->Init(dimdns))>=0) {
105     // add services
106
107     iResult=fpServer->Start();
108   }
109
110   return iResult;
111 }
112
113 int AliHLTGlobalDCSPublisherComponent::DoDeinit()
114 {
115   // see header file for class documentation
116   int iResult=0;
117   if (!fpServer) return -ENODEV;
118   fpServer->Stop();
119   delete fpServer;
120   fpServer=NULL;
121
122   return iResult;
123 }
124
125 int AliHLTGlobalDCSPublisherComponent::DumpEvent( const AliHLTComponentEventData& /*evtData*/,
126                                                   AliHLTComponentTriggerData& /*trigData*/ )
127 {
128   // see header file for class documentation
129   int iResult=0;
130   return iResult;
131 }