Belle II Software  release-05-02-19
BackgroundMetaData Class Reference

Metadata information about the beam background file. More...

#include <BackgroundMetaData.h>

Inheritance diagram for BackgroundMetaData:
Collaboration diagram for BackgroundMetaData:

Public Types

enum  BG_TAG {
  bg_none = 0,
  bg_Coulomb_LER = 1,
  bg_Coulomb_HER = 2,
  bg_RBB_LER = 3,
  bg_RBB_HER = 4,
  bg_Touschek_LER = 5,
  bg_Touschek_HER = 6,
  bg_twoPhoton = 7,
  bg_RBB_gamma = 8,
  bg_RBB_LER_far = 9,
  bg_RBB_HER_far = 10,
  bg_Touschek_LER_far = 11,
  bg_Touschek_HER_far = 12,
  bg_SynchRad_LER = 13,
  bg_SynchRad_HER = 14,
  bg_BHWide_LER = 15,
  bg_BHWide_HER = 16,
  bg_RBB = 17,
  bg_BHWide = 18,
  bg_BHWideLargeAngle = 19,
  bg_InjectionLER = 21,
  bg_InjectionHER = 22,
  bg_Brems_LER = 23,
  bg_Brems_HER = 24,
  bg_other = 99
}
 Enum for background tags. More...
 
enum  EFileType {
  c_Usual = 0,
  c_ECL = 1,
  c_PXD = 2
}
 Enum for BG file types. More...
 

Public Member Functions

 BELLE2_DEFINE_EXCEPTION (BackgroundMetaDataNotMergeable, "BackgroundMetaData: objects cannot be merged")
 Exception definition.
 
 BackgroundMetaData ()
 Constructor.
 
void setBackgroundType (const std::string &type)
 Sets background type. More...
 
void setBackgroundTag (BG_TAG tag)
 Sets background tag value that corresponds to background type. More...
 
void setRealTime (float time)
 Sets real time that corresponds to this background sample. More...
 
void setFileType (EFileType type)
 Sets file type. More...
 
const std::string & getBackgroundType () const
 Returns the type of background. More...
 
BG_TAG getBackgroundTag () const
 Returns background tag value. More...
 
float getRealTime () const
 Returns real time that corresponds to this background sample. More...
 
EFileType getFileType () const
 Returns file type. More...
 
virtual void merge (const Mergeable *other) override
 Implementation of abstract class function.
 
virtual void clear () override
 Implementation of abstract class function.
 
virtual void removeSideEffects ()
 An ugly little method that is called before event() for input and worker processes. More...
 
virtual Long64_t Merge (TCollection *hlist)
 Allow merging using TFileMerger if saved directly to a file. More...
 
virtual void Reset ()
 Root-like Reset function for "template compatibility" with ROOT objects. More...
 
virtual void SetDirectory (TDirectory *)
 Root-like SetDirectory function for "template compatibility" with ROOT objects. More...
 

Private Member Functions

bool canBeMerged (const BackgroundMetaData *other)
 Checks if other object can be merged with this object. More...
 
 ClassDefOverride (BackgroundMetaData, 4)
 Class definition required for creation of ROOT dictionary.
 
 ClassDef (Mergeable, 0)
 Abstract base class for objects that can be merged.
 

Private Attributes

std::string m_backgroundType
 beam background type
 
BG_TAG m_backgroundTag = bg_other
 background tag
 
float m_realTime = 0
 real time that corresponds to beam background sample
 
EFileType m_fileType = c_Usual
 file type
 

Detailed Description

Metadata information about the beam background file.

Definition at line 34 of file BackgroundMetaData.h.

Member Enumeration Documentation

◆ BG_TAG

enum BG_TAG

Enum for background tags.

Enumerator
bg_none 

No background.

bg_Coulomb_LER 

Coulomb LER.

bg_Coulomb_HER 

Coulomb HER.

bg_RBB_LER 

Radiative Bhabha LER.

bg_RBB_HER 

Radiative Bhabha HER.

bg_Touschek_LER 

Touschek LER.

bg_Touschek_HER 

Touschek HER.

bg_twoPhoton 

2-photon

bg_RBB_gamma 

Gammas from radiative Bhabha.

bg_RBB_LER_far 

Radiative Bhabha far LER.

bg_RBB_HER_far 

Radiative Bhabha far HER.

bg_Touschek_LER_far 

Touschek far LER.

bg_Touschek_HER_far 

Touschek far HER.

bg_SynchRad_LER 

Synchrotron radiation LER.

bg_SynchRad_HER 

Synchrotron radiation HER.

bg_BHWide_LER 

Wide angle radiative Bhabha LER.

bg_BHWide_HER 

Wide angle radiative Bhabha HER.

bg_RBB 

Radiative Bhabha.

bg_BHWide 

Wide angle radiative Bhabha.

bg_BHWideLargeAngle 

Large angle radiative Bhabha.

bg_InjectionLER 

injection background LER

bg_InjectionHER 

injection background HER

bg_Brems_LER 

bremsstrahlung LER

bg_Brems_HER 

bremsstrahlung HER

bg_other 

Other type of background.

Definition at line 41 of file BackgroundMetaData.h.

64  : objects cannot be merged");
65 

◆ EFileType

enum EFileType

Enum for BG file types.

Enumerator
c_Usual 

usual BG file

c_ECL 

additional for ECL

c_PXD 

additional for PXD

Definition at line 77 of file BackgroundMetaData.h.

Member Function Documentation

◆ canBeMerged()

bool canBeMerged ( const BackgroundMetaData other)
private

Checks if other object can be merged with this object.

Parameters
otherobject to be merged with this object
Returns
true, if can be merged

Definition at line 18 of file BackgroundMetaData.cc.

19 {
20 
21  if (otherObj->getBackgroundType() != m_backgroundType) {
22  B2ERROR("BackgroundMetaData: objects cannot be merged (different backgroundType)");
23  return false;
24  }
25 
26  if (otherObj->getBackgroundTag() != m_backgroundTag) {
27  B2ERROR("BackgroundMetaData: objects cannot be merged (different backgroundTag)");
28  return false;
29  }
30 
31  if (otherObj->getFileType() != m_fileType) {
32  B2ERROR("BackgroundMetaData: objects cannot be merged (different fileType)");
33  return false;
34  }
35 
36  return true;
37 }

◆ getBackgroundTag()

BG_TAG getBackgroundTag ( ) const
inline

Returns background tag value.

Returns
tag value

Definition at line 122 of file BackgroundMetaData.h.

◆ getBackgroundType()

const std::string& getBackgroundType ( ) const
inline

Returns the type of background.

Returns
background type

Definition at line 116 of file BackgroundMetaData.h.

◆ getFileType()

EFileType getFileType ( ) const
inline

Returns file type.

Returns
file type

Definition at line 134 of file BackgroundMetaData.h.

◆ getRealTime()

float getRealTime ( ) const
inline

Returns real time that corresponds to this background sample.

Returns
real time

Definition at line 128 of file BackgroundMetaData.h.

◆ Merge()

Long64_t Merge ( TCollection *  hlist)
virtualinherited

Allow merging using TFileMerger if saved directly to a file.

Note
dictionaries containing your Mergeable class need to be loaded, so 'hadd' will not work currently.

Definition at line 7 of file Mergeable.cc.

◆ removeSideEffects()

virtual void removeSideEffects ( )
inlinevirtualinherited

An ugly little method that is called before event() for input and worker processes.

Main use case is to detach any attached TFile from this object. In the output process, it can stay attached (and grow as much as it likes).

Reimplemented in RootMergeable< T >.

Definition at line 60 of file Mergeable.h.

◆ Reset()

virtual void Reset ( )
inlinevirtualinherited

Root-like Reset function for "template compatibility" with ROOT objects.

Alias for clear().

Definition at line 68 of file Mergeable.h.

◆ setBackgroundTag()

void setBackgroundTag ( BG_TAG  tag)
inline

Sets background tag value that corresponds to background type.

Parameters
taga tag value

Definition at line 98 of file BackgroundMetaData.h.

◆ setBackgroundType()

void setBackgroundType ( const std::string &  type)
inline

Sets background type.

Parameters
typebackground type

Definition at line 92 of file BackgroundMetaData.h.

◆ SetDirectory()

virtual void SetDirectory ( TDirectory *  )
inlinevirtualinherited

Root-like SetDirectory function for "template compatibility" with ROOT objects.

Does nothing.

Definition at line 70 of file Mergeable.h.

◆ setFileType()

void setFileType ( EFileType  type)
inline

Sets file type.

Parameters
typefile type

Definition at line 110 of file BackgroundMetaData.h.

◆ setRealTime()

void setRealTime ( float  time)
inline

Sets real time that corresponds to this background sample.

Parameters
timereal time

Definition at line 104 of file BackgroundMetaData.h.


The documentation for this class was generated from the following files:
Belle2::BackgroundMetaData::m_backgroundTag
BG_TAG m_backgroundTag
background tag
Definition: BackgroundMetaData.h:157
Belle2::BackgroundMetaData::m_fileType
EFileType m_fileType
file type
Definition: BackgroundMetaData.h:159
Belle2::BackgroundMetaData::m_backgroundType
std::string m_backgroundType
beam background type
Definition: BackgroundMetaData.h:156