From: richterm Date: Mon, 15 Mar 2010 08:34:14 +0000 (+0000) Subject: adding first sketch of a DCS publisher component for global HLT data points X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=3e8728edac80bbb915bb630f399f3876433fbb5e;p=u%2Fmrichter%2FAliRoot.git adding first sketch of a DCS publisher component for global HLT data points not yet activated, needs to be finalized --- diff --git a/HLT/global/AliHLTGlobalDCSPublisherComponent.cxx b/HLT/global/AliHLTGlobalDCSPublisherComponent.cxx new file mode 100644 index 00000000000..8112dcaa629 --- /dev/null +++ b/HLT/global/AliHLTGlobalDCSPublisherComponent.cxx @@ -0,0 +1,131 @@ +// $Id$ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** @file AliHLTGlobalDCSPublisherComponent.cxx + @author Matthias Richter + @date 20010-03-10 + @brief DIM publisher component for global HLT data +*/ + +#include "AliHLTGlobalDCSPublisherComponent.h" +#include "AliHLTDimServer.h" + +/** ROOT macro for the implementation of ROOT specific class methods */ +ClassImp(AliHLTGlobalDCSPublisherComponent) + +AliHLTGlobalDCSPublisherComponent::AliHLTGlobalDCSPublisherComponent() + : AliHLTDataSink() + , fpServer(NULL) +{ + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +} + +AliHLTGlobalDCSPublisherComponent::~AliHLTGlobalDCSPublisherComponent() +{ + // see header file for class documentation + + // file list and file name list are owner of their objects and + // delete all the objects +} + +const char* AliHLTGlobalDCSPublisherComponent::GetComponentID() +{ + // see header file for class documentation + return "DCSPublisher"; +} + +void AliHLTGlobalDCSPublisherComponent::GetInputDataTypes( vector& list) +{ + // see header file for class documentation + list.clear(); + list.push_back(kAliHLTAnyDataType); +} + +AliHLTComponent* AliHLTGlobalDCSPublisherComponent::Spawn() +{ + // see header file for class documentation + return new AliHLTGlobalDCSPublisherComponent; +} + +int AliHLTGlobalDCSPublisherComponent::DoInit( int argc, const char** argv ) +{ + // see header file for class documentation + int iResult=0; + iResult=ConfigureFromArgumentString(argc, argv); + + return iResult; +} + +int AliHLTGlobalDCSPublisherComponent::ScanConfigurationArgument(int argc, const char** argv) +{ + // see header file for class documentation + int iResult=0; + + // -servername + if (argc==0) return 0; + int i=0; + const char* serverName=NULL; + const char* dimdns=NULL; + TString argument=argv[0]; + if (argument.CompareTo("-servername")==0) { + if (++i>=argc) return -EPROTO; + serverName=argv[i]; + + // --dimdns + } else if (argument.BeginsWith("-dimdns")) { + if (++i>=argc) return -EPROTO; + dimdns=argv[i]; + + } else { + return -EINVAL; + } + + fpServer=new AliHLTDimServer(serverName); + if (!fpServer) return -ENOMEM; + if ((iResult=fpServer->Init(dimdns))>=0) { + // add services + + iResult=fpServer->Start(); + } + + return iResult; +} + +int AliHLTGlobalDCSPublisherComponent::DoDeinit() +{ + // see header file for class documentation + int iResult=0; + if (!fpServer) return -ENODEV; + fpServer->Stop(); + delete fpServer; + fpServer=NULL; + + return iResult; +} + +int AliHLTGlobalDCSPublisherComponent::DumpEvent( const AliHLTComponentEventData& /*evtData*/, + AliHLTComponentTriggerData& /*trigData*/ ) +{ + // see header file for class documentation + int iResult=0; + return iResult; +} diff --git a/HLT/global/AliHLTGlobalDCSPublisherComponent.h b/HLT/global/AliHLTGlobalDCSPublisherComponent.h new file mode 100644 index 00000000000..36bf9e3d828 --- /dev/null +++ b/HLT/global/AliHLTGlobalDCSPublisherComponent.h @@ -0,0 +1,67 @@ +//-*- Mode: C++ -*- +// $Id$ + +#ifndef ALIHLTGLOBALDCSPUBLISHERCOMPONENT_H +#define ALIHLTGLOBALDCSPUBLISHERCOMPONENT_H + +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * + +/** @file AliHLTGlobalDCSPublisherComponent.h + @author Matthias Richter + @date 20010-03-10 + @brief DIM publisher component for global HLT data +*/ +#include "AliHLTDataSink.h" + +class AliHLTDimServer; + +/** + * @class AliHLTGlobalDCSPublisherComponent + * DIM Publisher component for global HLT data. + * It implements a DIM server which publishes global HLT data through the + * following services: + * - Vertex_X + * - Vertex_Y + * - Vertex_Z + * - ResVertex_X + * - ResVertex_Y + * - ResVertex_Z + * + */ +class AliHLTGlobalDCSPublisherComponent : public AliHLTDataSink { +public: + AliHLTGlobalDCSPublisherComponent(); + ~AliHLTGlobalDCSPublisherComponent(); + + virtual const char* GetComponentID(); + virtual void GetInputDataTypes( vector& list); + virtual AliHLTComponent* Spawn(); + + protected: + /// component initialization + int DoInit( int argc, const char** argv ); + + /// component cleanup + int DoDeinit(); + + /// Data processing method for the component. + virtual int DumpEvent( const AliHLTComponentEventData& evtData, + AliHLTComponentTriggerData& trigData ); + + using AliHLTDataSink::DumpEvent; + + int ScanConfigurationArgument(int argc, const char** argv); + +private: + /// copy constructor not permitted + AliHLTGlobalDCSPublisherComponent(const AliHLTGlobalDCSPublisherComponent&); + /// assignment operator not permitted + AliHLTGlobalDCSPublisherComponent& operator=(const AliHLTGlobalDCSPublisherComponent&); + + AliHLTDimServer* fpServer; //! dim server instance + + ClassDef(AliHLTGlobalDCSPublisherComponent, 0) +}; +#endif diff --git a/HLT/libAliHLTGlobal.pkg b/HLT/libAliHLTGlobal.pkg index 5cae14197be..19f715a68a5 100644 --- a/HLT/libAliHLTGlobal.pkg +++ b/HLT/libAliHLTGlobal.pkg @@ -5,6 +5,7 @@ CLASS_HDRS:= AliHLTGlobalEsdConverterComponent.h \ AliHLTGlobalTrackMergerComponent.h \ AliHLTGlobalTrackMerger.h \ AliHLTGlobalAgent.h \ + AliHLTGlobalDCSPublisherComponent.h \ AliHLTGlobalVertexerComponent.h \ AliHLTGlobalTrackMatcher.h \ AliHLTGlobalTrackMatcherComponent.h \