Belle II Software  release-05-02-19
SVDDetectorConfiguration.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Laura Zani *
7  * *
8  * This software is provided "as is" without any warranty. *
9  * WARNING: Do not try to fry it with water. Use only olive oil. *
10  **************************************************************************/
11 
12 #pragma once
13 
14 #include <svd/dbobjects/SVDLocalConfigParameters.h>
15 #include <svd/dbobjects/SVDGlobalConfigParameters.h>
16 #include <framework/database/DBObjPtr.h>
17 #include <framework/logging/Logger.h>
18 #include <string>
19 
20 namespace Belle2 {
36  class SVDDetectorConfiguration {
37  public:
38 
39  static std::string svdLocalConfig_name;
40  static std::string svdGlobalConfig_name;
42  typedef SVDLocalConfigParameters t_svdLocalConfig_payload;
43  typedef SVDGlobalConfigParameters t_svdGlobalConfig_payload;
51  {
52 
53  m_svdGlobalConfig_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
54  B2INFO("SVDDetectorConfiguration, GLOBAL run parameters: from now on we are using " <<
55  this->m_svdGlobalConfig_aDBObjPtr -> get_uniqueID()); });
56 
57  m_svdLocalConfig_aDBObjPtr.addCallback([ this ](const std::string&) -> void {
58  B2INFO("SVDDetectorConfiguration, LOCAL run parameters: from now on we are using " <<
59  this->m_svdLocalConfig_aDBObjPtr -> get_uniqueID()); });
60  }
61 
71  float getInjectedCharged()
72  {
73  return m_svdLocalConfig_aDBObjPtr->getInjectedCharge();
74  }
75 
76 
86  {
87  return m_svdLocalConfig_aDBObjPtr->getCalibrationTimeInRFCUnits();
88  }
89 
90 
99  std::string getCalibDate()
100  {
101  return m_svdLocalConfig_aDBObjPtr->getCalibDate();
102  }
103 
112  float getZeroSuppression()
113  {
114  return m_svdGlobalConfig_aDBObjPtr->getZeroSuppression();
115  }
116 
125  int getLatency()
126  {
127  return m_svdGlobalConfig_aDBObjPtr->getLatency();
128  }
129 
130 
139  float getMaskFilter()
140  {
141  return m_svdGlobalConfig_aDBObjPtr->getMaskFilter();
142  }
143 
144 
152  float getAPVClockInRFCUnits()
153  {
154  return m_svdGlobalConfig_aDBObjPtr->getAPVClockInRFCUnits();
155  }
156 
165  float getHV()
166  {
167  return m_svdGlobalConfig_aDBObjPtr->getHV();
168  }
169 
178  float getRelativeTimeShift()
179  {
180  return m_svdGlobalConfig_aDBObjPtr->getRelativeTimeShift();
181  }
182 
186  int getNrFrames()
187  {
188  return m_svdGlobalConfig_aDBObjPtr->getNrFrames();
189  }
190 
192  // TString getUniqueID() { return m_svdLocalConfig_aDBObjPtr->get_uniqueID(); }
193 
195  bool isValid()
196  {
197  // return m_svdLocalConfig_aDBObjPtr.isValid();
198  return m_svdGlobalConfig_aDBObjPtr.isValid();
199  }
200 
201 
202 
203  private:
208  };
210 }
Belle2::SVDDetectorConfiguration::getHV
float getHV()
GLOBAL CONFIGURATION PARAMETERS: Return the HV applied during data taking.
Definition: SVDDetectorConfiguration.h:174
Belle2::SVDDetectorConfiguration::m_svdLocalConfig_aDBObjPtr
DBObjPtr< t_svdLocalConfig_payload > m_svdLocalConfig_aDBObjPtr
SVDLocalConfigParameters payload.
Definition: SVDDetectorConfiguration.h:213
Belle2::SVDDetectorConfiguration::getRelativeTimeShift
float getRelativeTimeShift()
GLOBAL CONFIGURATION PARAMETERS: Return the relative time shift in units of APV clock /4 between the ...
Definition: SVDDetectorConfiguration.h:187
Belle2::SVDDetectorConfiguration::svdGlobalConfig_name
static std::string svdGlobalConfig_name
name of the SVDGlobalConfigParameters payload
Definition: SVDDetectorConfiguration.h:49
Belle2::SVDDetectorConfiguration::getCalibDate
std::string getCalibDate()
LOCAL CONFIGURATION PARAMETERS: Return the time stamp (date, hour) of the calibration.
Definition: SVDDetectorConfiguration.h:108
Belle2::SVDDetectorConfiguration::getNrFrames
int getNrFrames()
GLOBAL CONFIGURATION PARAMETER: Return the int corresponding to the sumber of samples (3 -> 3-sample ...
Definition: SVDDetectorConfiguration.h:195
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVDDetectorConfiguration::getMaskFilter
float getMaskFilter()
GLOBAL CONFIGURATION PARAMETERS: Return the masking bitmap applied to mask strips at FADC level (only...
Definition: SVDDetectorConfiguration.h:148
Belle2::SVDDetectorConfiguration::getLatency
int getLatency()
GLOBAL CONFIGURATION PARAMETERS: Return the latency during applied during data taking.
Definition: SVDDetectorConfiguration.h:134
Belle2::SVDDetectorConfiguration::getZeroSuppression
float getZeroSuppression()
GLOBAL CONFIGURATION PARAMETERS: Return the zero suppression cut applied during data taking.
Definition: SVDDetectorConfiguration.h:121
Belle2::SVDDetectorConfiguration::m_svdGlobalConfig_aDBObjPtr
DBObjPtr< t_svdGlobalConfig_payload > m_svdGlobalConfig_aDBObjPtr
SVDGlobalConfigParameters payload.
Definition: SVDDetectorConfiguration.h:214
Belle2::SVDDetectorConfiguration::getAPVClockInRFCUnits
float getAPVClockInRFCUnits()
GLOBAL CONFIGURATION PARAMETERS: Return the APV clock units [ns] in term of accelerator RFC converted...
Definition: SVDDetectorConfiguration.h:161
Belle2::SVDDetectorConfiguration::svdLocalConfig_name
static std::string svdLocalConfig_name
name of the SVDLocalConfigParameters payload
Definition: SVDDetectorConfiguration.h:48
Belle2::SVDDetectorConfiguration::SVDDetectorConfiguration
SVDDetectorConfiguration()
Constructor, no input argument is required.
Definition: SVDDetectorConfiguration.h:57
Belle2::SVDDetectorConfiguration::t_svdGlobalConfig_payload
SVDGlobalConfigParameters t_svdGlobalConfig_payload
typedef of the SVDGlobalConfigParameters payload
Definition: SVDDetectorConfiguration.h:52
Belle2::SVDDetectorConfiguration::t_svdLocalConfig_payload
SVDLocalConfigParameters t_svdLocalConfig_payload
typedef of the SVDLocalConfigParameters payload
Definition: SVDDetectorConfiguration.h:51
Belle2::SVDDetectorConfiguration::getCalibrationTimeInRFCUnits
float getCalibrationTimeInRFCUnits()
LOCAL CONFIGURATION PARAMETERS: Return the time units of the measured peak time of the pulse shape gi...
Definition: SVDDetectorConfiguration.h:94
Belle2::SVDDetectorConfiguration::getInjectedCharged
float getInjectedCharged()
LOCAL CONFIGURATION PARAMETERS: Return the charge injected on each strip for the pulse shape calibrat...
Definition: SVDDetectorConfiguration.h:80
Belle2::SVDDetectorConfiguration::isValid
bool isValid()
returns the unique ID of the payload
Definition: SVDDetectorConfiguration.h:204