4 #ifndef ALIHLTGLOBALDCSPUBLISHERCOMPONENT_H
5 #define ALIHLTGLOBALDCSPUBLISHERCOMPONENT_H
7 //* This file is property of and copyright by the ALICE HLT Project *
8 //* ALICE Experiment at CERN, All rights reserved. *
9 //* See cxx source for full Copyright notice *
11 /** @file AliHLTGlobalDCSPublisherComponent.h
12 @author Matthias Richter
14 @brief DIM publisher component for global HLT data
16 #include "AliHLTDataSink.h"
17 #include "AliHLTDimServer.h"
21 * @class AliHLTGlobalDCSPublisherComponent
22 * DIM Publisher component for global HLT data.
23 * It implements a DIM server which publishes global HLT data through the
33 class AliHLTGlobalDCSPublisherComponent : public AliHLTDataSink {
35 AliHLTGlobalDCSPublisherComponent();
36 ~AliHLTGlobalDCSPublisherComponent();
38 /// service enumerators
44 kVertexRmsX=kDimensions,
50 virtual const char* GetComponentID();
51 virtual void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
52 virtual AliHLTComponent* Spawn();
55 /// component initialization
56 int DoInit( int argc, const char** argv );
61 /// Data processing method for the component.
62 virtual int DumpEvent( const AliHLTComponentEventData& evtData,
63 AliHLTComponentTriggerData& trigData );
65 using AliHLTDataSink::DumpEvent;
67 int ScanConfigurationArgument(int argc, const char** argv);
68 int Publish(bool reset=false);
71 /// copy constructor not permitted
72 AliHLTGlobalDCSPublisherComponent(const AliHLTGlobalDCSPublisherComponent&);
73 /// assignment operator not permitted
74 AliHLTGlobalDCSPublisherComponent& operator=(const AliHLTGlobalDCSPublisherComponent&);
76 /// binary function for the calculation of rms using std::accumulate
77 template <class T> class MeanSqtOp {
79 MeanSqtOp() : fMean(0) {}
80 MeanSqtOp(T mean) : fMean(mean) {}
81 T operator() (const T& x, const T& y) const {
82 T val=x+(y-fMean)*(y-fMean);
89 void Reset(vector<float>& sample, int size) const;
90 template <class T> T Mean(const vector<T>& sample, int count) const;
91 template <class T> T Rms(const vector<T>& sample, T mean, int count) const;
94 string fServerName; //!
95 /// dim DNS server name
97 /// dim server instance
98 AliHLTDimServer* fpServer; //!
100 /// position in the event buffer
102 /// size of the event buffer
103 int fEventBufferSize; //!
105 unsigned int fLastUpdate; //!
106 /// update period in seconds
107 unsigned int fUpdatePeriod; //!
110 vector<float> fEventBuffers[kDimensions]; //!
111 /// array of dim services
112 AliHLTDimServer::AliHLTDimService* fDimServices[kLastService]; //!
113 /// dim service for the number of samples for
114 AliHLTDimServer::AliHLTDimService* fDimServiceEventCount; //!
116 /// names of services
117 static const char* fgkServiceNames[kLastService]; //!
119 ClassDef(AliHLTGlobalDCSPublisherComponent, 0)