Belle II Software  release-08-01-10
DQMHistAnalysisInputPVSrv.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 //+
9 // File : DQMHistAnalysisInputPVSrv.h
10 // Description : Input module for DQM Histogram analysis
11 //-
12 
13 #pragma once
14 
15 #include <framework/dataobjects/EventMetaData.h>
16 #include <framework/datastore/StoreObjPtr.h>
17 
18 #include <dqm/core/DQMHistAnalysis.h>
19 //#include <THttpServer.h>
20 
21 #include <string>
22 #ifdef _BELLE2_EPICS
23 #include "cadef.h"
24 #include "dbDefs.h"
25 #include "epicsString.h"
26 #include "cantProceed.h"
27 #endif
28 
29 namespace Belle2 {
36 #ifdef _BELLE2_EPICS
37 #define MAX_PV_NAME_LEN 40
38 
39  typedef struct {
40  char name[MAX_PV_NAME_LEN];
41  chid mychid;
42  evid myevid;
43  bool changed;
44  TH1* histo;
45  unsigned int binx; // not needed until now
46  unsigned int biny; // not needed until now
47  unsigned int binmax; // store bincount to prevent overflow
48  } MYNODE;
49 #endif
50 
52 
53  // Public functions
54  public:
55 
60 
65 
69  void initialize() override final;
70 
74  void beginRun() override final;
75 
79  void event() override final;
80 
84  void endRun() override final;
85 
89  void terminate() override final;
90 
91  // Data members
92  private:
96  bool m_callback;
98  bool m_server;
99  //THttpServer* m_serv{0};
100  //int m_nhist = 0;
101 
103  std::vector< std::vector<std::string>> m_histlist;
104 
105 #ifdef _BELLE2_EPICS
106  std::vector<MYNODE*> pmynode;
107 #endif
108 
111 
113  unsigned int m_expno = 0;
115  unsigned int m_runno = 0;
117  unsigned int m_count = 0;
118  };
120 } // end namespace Belle2
121 
Class definition for the output module of Sequential ROOT I/O.
void initialize() override final
Definition of the histograms.
void terminate() override final
This method is called at the end of the event processing.
void event() override final
This method is called for each event.
void endRun() override final
This method is called if the current run ends.
bool m_server
Whether to start http server on port 8082.
std::vector< std::vector< std::string > > m_histlist
Parameter list for histograms.
void beginRun() override final
Called when entering a new run.
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
The metadata for each event.
bool m_callback
Whether to use EPICS callback for changes.
The base class for the histogram analysis module.
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.