Belle II Software  release-05-02-19
TOPDoublePulseGeneratorModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/core/Module.h>
14 #include <top/dbobjects/TOPSampleTimes.h>
15 #include <top/dbobjects/TOPCalTimebase.h>
16 #include <framework/database/DBObjPtr.h>
17 #include <vector>
18 #include <string>
19 
20 namespace Belle2 {
32  class TOPDoublePulseGeneratorModule : public Module {
33 
34  public:
35 
40 
45 
50  virtual void initialize() override;
51 
56  virtual void beginRun() override;
57 
61  virtual void event() override;
62 
67  virtual void endRun() override;
68 
73  virtual void terminate() override;
74 
75  private:
76 
81  void storeSampleTimes(std::string fileName);
82 
91  void saveAsHistogram(const std::vector<double>& vec,
92  const std::string& name,
93  const std::string& title,
94  const std::string& xTitle = "",
95  const std::string& yTitle = "") const;
96 
97  // module steering parameters
98 
99  std::vector<int> m_moduleIDs;
100  std::vector<unsigned> m_asicChannels;
101  double m_timeDifference = 0;
102  double m_timeResolution = 0;
103  std::vector<double> m_sampleTimeIntervals;
104  bool m_useDatabase = false;
105  unsigned m_storageWindows = 0;
106  std::string m_outputFileName;
108  // other
109 
114  };
115 
117 } // Belle2 namespace
118 
Belle2::TOPDoublePulseGeneratorModule::m_sampleDivisions
int m_sampleDivisions
number of sample divisions (from NominalTDC)
Definition: TOPDoublePulseGeneratorModule.h:120
Belle2::TOPDoublePulseGeneratorModule::m_sampleTimeIntervals
std::vector< double > m_sampleTimeIntervals
sample time intervals
Definition: TOPDoublePulseGeneratorModule.h:111
Belle2::TOPDoublePulseGeneratorModule::event
virtual void event() override
Event processor.
Definition: TOPDoublePulseGeneratorModule.cc:162
Belle2::TOPDoublePulseGeneratorModule::terminate
virtual void terminate() override
Termination action.
Definition: TOPDoublePulseGeneratorModule.cc:223
Belle2::TOPDoublePulseGeneratorModule::m_timeResolution
double m_timeResolution
sigma of time difference
Definition: TOPDoublePulseGeneratorModule.h:110
Belle2::TOPDoublePulseGeneratorModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: TOPDoublePulseGeneratorModule.cc:148
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::TOPDoublePulseGeneratorModule::TOPDoublePulseGeneratorModule
TOPDoublePulseGeneratorModule()
Constructor.
Definition: TOPDoublePulseGeneratorModule.cc:52
Belle2::TOPDoublePulseGeneratorModule::~TOPDoublePulseGeneratorModule
virtual ~TOPDoublePulseGeneratorModule()
Destructor.
Definition: TOPDoublePulseGeneratorModule.cc:85
Belle2::TOPDoublePulseGeneratorModule::m_timebase
DBObjPtr< TOPCalTimebase > * m_timebase
sample times from database
Definition: TOPDoublePulseGeneratorModule.h:119
Belle2::TOPDoublePulseGeneratorModule::endRun
virtual void endRun() override
End-of-run action.
Definition: TOPDoublePulseGeneratorModule.cc:219
Belle2::TOPDoublePulseGeneratorModule::m_asicChannels
std::vector< unsigned > m_asicChannels
ASIC calibration channels.
Definition: TOPDoublePulseGeneratorModule.h:108
Belle2::TOPSampleTimes
Calibration constants of a singe ASIC channel: time axis (sample times)
Definition: TOPSampleTimes.h:34
Belle2::TOPDoublePulseGeneratorModule::m_outputFileName
std::string m_outputFileName
if given, store sample times as root histograms
Definition: TOPDoublePulseGeneratorModule.h:114
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPDoublePulseGeneratorModule::m_sampleTimes
TOPSampleTimes m_sampleTimes
sample times from steering input
Definition: TOPDoublePulseGeneratorModule.h:118
Belle2::TOPDoublePulseGeneratorModule::saveAsHistogram
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.
Definition: TOPDoublePulseGeneratorModule.cc:299
Belle2::TOPDoublePulseGeneratorModule::storeSampleTimes
void storeSampleTimes(std::string fileName)
Optionally store sample times used by the generator as root histograms fileName root output file name...
Definition: TOPDoublePulseGeneratorModule.cc:228
Belle2::TOPDoublePulseGeneratorModule::m_useDatabase
bool m_useDatabase
if true, use sample times from database
Definition: TOPDoublePulseGeneratorModule.h:112
Belle2::TOPDoublePulseGeneratorModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: TOPDoublePulseGeneratorModule.cc:90
Belle2::TOPDoublePulseGeneratorModule::m_storageWindows
unsigned m_storageWindows
number of storage windows
Definition: TOPDoublePulseGeneratorModule.h:113
Belle2::TOPDoublePulseGeneratorModule::m_moduleIDs
std::vector< int > m_moduleIDs
slot ID's to generate for
Definition: TOPDoublePulseGeneratorModule.h:107
Belle2::TOPDoublePulseGeneratorModule::m_timeDifference
double m_timeDifference
time difference between first and second pulse
Definition: TOPDoublePulseGeneratorModule.h:109