Belle II Software  release-08-01-10
TOPDoublePulseGeneratorModule.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 #pragma once
10 
11 #include <framework/core/Module.h>
12 #include <top/dbobjects/TOPSampleTimes.h>
13 #include <top/dbobjects/TOPCalTimebase.h>
14 #include <framework/database/DBObjPtr.h>
15 #include <vector>
16 #include <string>
17 
18 namespace Belle2 {
31 
32  public:
33 
38 
43 
48  virtual void initialize() override;
49 
54  virtual void beginRun() override;
55 
59  virtual void event() override;
60 
65  virtual void endRun() override;
66 
71  virtual void terminate() override;
72 
73  private:
74 
79  void storeSampleTimes(std::string fileName);
80 
89  void saveAsHistogram(const std::vector<double>& vec,
90  const std::string& name,
91  const std::string& title,
92  const std::string& xTitle = "",
93  const std::string& yTitle = "") const;
94 
95  // module steering parameters
96 
97  std::vector<int> m_moduleIDs;
98  std::vector<unsigned> m_asicChannels;
99  double m_timeDifference = 0;
100  double m_timeResolution = 0;
101  std::vector<double> m_sampleTimeIntervals;
102  bool m_useDatabase = false;
103  unsigned m_storageWindows = 0;
104  std::string m_outputFileName;
106  // other
107 
112  };
113 
115 } // Belle2 namespace
116 
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Base class for Modules.
Definition: Module.h:72
Generator of double calibration pulses Output to TOPDigits.
double m_timeDifference
time difference between first and second pulse
std::vector< unsigned > m_asicChannels
ASIC calibration channels.
std::vector< double > m_sampleTimeIntervals
sample time intervals
DBObjPtr< TOPCalTimebase > * m_timebase
sample times from database
unsigned m_storageWindows
number of storage windows
std::vector< int > m_moduleIDs
slot ID's to generate for
bool m_useDatabase
if true, use sample times from database
int m_sampleDivisions
number of sample divisions (from NominalTDC)
std::string m_outputFileName
if given, store sample times as root histograms
TOPSampleTimes m_sampleTimes
sample times from steering input
Calibration constants of a singe ASIC channel: time axis (sample times)
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
virtual void endRun() override
End-of-run action.
virtual void terminate() override
Termination action.
void storeSampleTimes(std::string fileName)
Optionally store sample times used by the generator as root histograms fileName root output file name...
virtual void beginRun() override
Called when entering a new run.
void saveAsHistogram(const std::vector< double > &vec, const std::string &name, const std::string &title, const std::string &xTitle="", const std::string &yTitle="") const
Save vector to histogram and write it out.
Abstract base class for different kinds of events.