Belle II Software  release-06-01-15
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/analysis/modules/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  virtual void initialize() override;
70 
74  virtual void beginRun() override;
75 
79  virtual void event() override;
80 
84  virtual void endRun() override;
85 
89  virtual void terminate() override;
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.
virtual void initialize() override
Definition of the histograms.
virtual void event() override
This method is called for each event.
virtual void endRun() override
This method is called if the current run ends.
virtual void terminate() override
This method is called at the end of the event processing.
virtual void beginRun() override
Called when entering a new run.
bool m_server
Whether to start http server on port 8082.
std::vector< std::vector< std::string > > m_histlist
Parameter list for histograms.
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:95
Abstract base class for different kinds of events.