Belle II Software  release-06-00-14
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,
55  bg_other = 99
56  };
57 
61  BELLE2_DEFINE_EXCEPTION(BackgroundMetaDataNotMergeable,
62  "BackgroundMetaData: objects cannot be merged");
63 
67  enum EFileType { c_Usual = 0,
68  c_ECL = 1,
69  c_PXD = 2
70  };
71 
76  {}
77 
82  void setBackgroundType(const std::string& type) {m_backgroundType = type;}
83 
89 
94  void setRealTime(float time) {m_realTime = time;}
95 
100  void setFileType(EFileType type) {m_fileType = type;}
101 
106  const std::string& getBackgroundType() const {return m_backgroundType;}
107 
113 
118  float getRealTime() const {return m_realTime;}
119 
124  EFileType getFileType() const {return m_fileType;}
125 
129  virtual void merge(const Mergeable* other) override;
130 
134  virtual void clear() override;
135 
136 
137  private:
138 
144  bool canBeMerged(const BackgroundMetaData* other);
145 
146  std::string m_backgroundType;
148  float m_realTime = 0;
155  };
157 }
158 
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_BHWideLargeAngle
Large angle radiative Bhabha.
@ bg_RBB_LER
Radiative Bhabha LER.
@ bg_Touschek_HER_far
Touschek far HER.
@ bg_Brems_LER
bremsstrahlung LER
@ bg_InjectionLER
injection background LER
@ bg_BHWide_HER
Wide angle radiative Bhabha HER.
@ bg_SynchRad_HER
Synchrotron radiation HER.
@ bg_Brems_HER
bremsstrahlung HER
@ 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_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.