Belle II Software  release-08-01-10
BackgroundMetaData.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/pcore/Mergeable.h>
12 #include <framework/core/FrameworkExceptions.h>
13 #include <string>
14 
15 namespace Belle2 {
24  class BackgroundMetaData: public Mergeable {
25 
26  public:
27 
31  enum BG_TAG { bg_none = 0,
34  bg_RBB_LER = 3,
35  bg_RBB_HER = 4,
48  bg_RBB = 17,
49  bg_BHWide = 18,
53  bg_Brems_LER = 23,
54  bg_Brems_HER = 24,
63  bg_other = 99
64  };
65 
69  BELLE2_DEFINE_EXCEPTION(BackgroundMetaDataNotMergeable,
70  "BackgroundMetaData: objects cannot be merged");
71 
75  enum EFileType { c_Usual = 0,
76  c_ECL = 1,
77  c_PXD = 2
78  };
79 
84  {}
85 
90  void setBackgroundType(const std::string& type) {m_backgroundType = type;}
91 
97 
102  void setRealTime(float time) {m_realTime = time;}
103 
108  void setFileType(EFileType type) {m_fileType = type;}
109 
114  const std::string& getBackgroundType() const {return m_backgroundType;}
115 
121 
126  float getRealTime() const {return m_realTime;}
127 
132  EFileType getFileType() const {return m_fileType;}
133 
137  virtual void merge(const Mergeable* other) override;
138 
142  virtual void clear() override;
143 
144 
145  private:
146 
152  bool canBeMerged(const BackgroundMetaData* other);
153 
154  std::string m_backgroundType;
156  float m_realTime = 0;
163  };
165 }
166 
Metadata information about the beam background file.
BG_TAG m_backgroundTag
background tag
void setRealTime(float time)
Sets real time that corresponds to this background sample.
float m_realTime
real time that corresponds to beam background sample
EFileType
Enum for BG file types.
ClassDefOverride(BackgroundMetaData, 4)
Class definition required for creation of ROOT dictionary.
bool canBeMerged(const BackgroundMetaData *other)
Checks if other object can be merged with this object.
const std::string & getBackgroundType() const
Returns the type of background.
BELLE2_DEFINE_EXCEPTION(BackgroundMetaDataNotMergeable, "BackgroundMetaData: objects cannot be merged")
Exception definition.
void setBackgroundTag(BG_TAG tag)
Sets background tag value that corresponds to background type.
float getRealTime() const
Returns real time that corresponds to this background sample.
void setBackgroundType(const std::string &type)
Sets background type.
EFileType getFileType() const
Returns file type.
BG_TAG
Enum for background tags.
@ bg_RBB_HER_far
Radiative Bhabha far HER.
@ bg_BHWide_LER
Wide angle radiative Bhabha LER.
@ bg_Coulomb_dynamic_LER
Coulomb dynamic LER.
@ bg_Coulomb_dynamic_HER
Coulomb dynamic HER.
@ bg_BHWideLargeAngle
Large angle radiative Bhabha.
@ bg_RBB_LER
Radiative Bhabha LER.
@ bg_Brems_base_HER
bremsstrahlung base HER
@ bg_Touschek_HER_far
Touschek far HER.
@ bg_Brems_LER
bremsstrahlung LER
@ bg_InjectionLER
injection background LER
@ bg_Brems_dynamic_HER
bremsstrahlung dynamic HER
@ bg_BHWide_HER
Wide angle radiative Bhabha HER.
@ bg_Coulomb_base_HER
Coulomb base HER.
@ bg_SynchRad_HER
Synchrotron radiation HER.
@ bg_Coulomb_base_LER
Coulomb base LER.
@ bg_Brems_HER
bremsstrahlung HER
@ bg_Brems_dynamic_LER
bremsstrahlung dynamic LER
@ bg_Touschek_LER_far
Touschek far LER.
@ bg_BHWide
Wide angle radiative Bhabha.
@ bg_RBB_HER
Radiative Bhabha HER.
@ bg_SynchRad_LER
Synchrotron radiation LER.
@ bg_InjectionHER
injection background HER
@ bg_RBB_LER_far
Radiative Bhabha far LER.
@ bg_other
Other type of background.
@ bg_Brems_base_LER
bremsstrahlung base LER
@ bg_RBB_gamma
Gammas from radiative Bhabha.
virtual void merge(const Mergeable *other) override
Implementation of abstract class function.
std::string m_backgroundType
beam background type
void setFileType(EFileType type)
Sets file type.
BG_TAG getBackgroundTag() const
Returns background tag value.
virtual void clear() override
Implementation of abstract class function.
Abstract base class for objects that can be merged.
Definition: Mergeable.h:31
Abstract base class for different kinds of events.