tdaq-develop-2025-02-12
ROCStoppingTargetMonitorInterface.h
1 #ifndef _otsdaq_mu2e_stm_ROCStoppingTargetMonitorInterface_h_
2 #define _otsdaq_mu2e_stm_ROCStoppingTargetMonitorInterface_h_
3 
4 #include <sstream>
5 #include <string>
6 #include "dtcInterfaceLib/DTC.h"
7 #include "otsdaq-mu2e/ROCCore/ROCCoreVInterface.h"
8 
9 namespace ots
10 {
11 class ROCStoppingTargetMonitorInterface : public ROCCoreVInterface
12 {
13  // clang-format off
14 public:
16  const std::string& rocUID,
17  const ConfigurationTree& theXDAQContextConfigTree,
18  const std::string& interfaceConfigurationPath);
19 
21 
22  // state machine
23  //----------------
24  void configure (void) override;
25  void halt (void) override;
26  void pause (void) override;
27  void resume (void) override;
28  void start (std::string runNumber) override;
29  void stop (void) override;
30  bool running (void) override;
31 
32  // write and read to registers
33  virtual void writeEmulatorRegister (uint16_t address, uint16_t data_to_write) override;
34  virtual uint16_t readEmulatorRegister (uint16_t address) override;
35 
36  virtual void readEmulatorBlock (std::vector<uint16_t>& data, uint16_t address, uint16_t numberOfReads, bool incrementAddress) override { }
37 
38 
39  // specific ROC functions
40  // virtual int readInjectedPulseTimestamp (void) override;
41  // virtual void writeDelay (uint16_t delay) override; // 5ns steps
42  // virtual int readDelay (void) override; // 5ns steps
43 
44  // virtual int readDTCLinkLossCounter (void) override;
45  // virtual void resetDTCLinkLossCounter (void) override;
46 
47 
48 
49  private:
50 
51  unsigned int STMParameter_1_;
52  bool STMParameter_2_;
53  std::string STMParameter_3_;
54  unsigned int number_of_good_events_;
55  unsigned int number_of_bad_events_;
56  unsigned int number_of_empty_events_;
57 // std::ofstream datafile_;
58  unsigned int event_number_;
59 
60 
61  // clang-format on
62 };
63 } // namespace ots
64 
65 #endif