Belle II Software  release-05-02-19
framework
Collaboration diagram for framework:

Modules

 framework data objects
 
 framework modules
 

Namespaces

 Belle2::PyObjConvUtils
 Python object converter utilities namespace.
 
 Belle2::_RelationsInterfaceImpl
 hide some implementation details.
 
 Belle2::_StoreArrayImpl
 hide some implementation details.
 
 Belle2::RootIOUtilities
 Some constants and helpers common to the RootInput and RootOutput modules.
 
 Belle2::TangoPalette
 Implements a colour palette, see http://sobac.com/sobac/tangocolors.htm.
 
 Belle2::HTML
 return information on objects in a nice format.
 
 Belle2::IOIntercept
 Encapsulate all classes needed to intercept stdout and stderr.
 
 Belle2::Stream
 Define (de)serialization methods for TObject.
 
 Belle2::TestHelpers
 Some utilities to help with writing unit tests.
 
 Belle2::Utils
 General utility functions.
 

Classes

class  DataFlowVisualization
 class to visualize data flow between modules. More...
 
class  Environment
 This class stores all environment information required to run the framework, such as module or data filepaths, number of processes to be used in parallel processing etc. More...
 
class  EventProcessor
 provides the core event processing loop. More...
 
class  FileCatalog
 This class provides an interface to the file (metadata) catalog. More...
 
class  HistoModule
 HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions to be managed by HistoManager. More...
 
class  InputController
 A static class to control supported input modules. More...
 
class  MemoryPool< T, chunkSize >
 Class to provide a constant access time memory pool for one kind of objects. More...
 
class  MetadataService
 This class provides a service for writing metadata about the basf2 execution and about output files to a json file. More...
 
class  Module
 Base class for Modules. More...
 
class  ModuleProxyBase
 The base module proxy class is used to create new instances of a module. More...
 
class  ModuleCondition
 Wraps a condition set on a Module instance. More...
 
class  ModuleManager
 The ModuleManager Class. More...
 
class  ModuleParam< T >
 A single parameter of the module. More...
 
class  ModuleParamBase
 Base class for module parameter. More...
 
class  ModuleParamInfoPython
 Class to store basic information about a parameter. More...
 
class  ModuleParamList
 The Module parameter list class. More...
 
class  ModuleStatistics
 Keep track of time and memory consumption during processing. More...
 
class  MRUCache< KEY, VALUE >
 Class implementing a generic Most Recently Used cache. More...
 
class  Path
 Implements a path consisting of Module and/or Path objects. More...
 
class  PathElement
 Base for classes that can be elements of a Path. More...
 
class  PathIterator
 Iterator over a Path (returning Module pointers). More...
 
class  ProcessStatistics
 Class to collect call statistics for all modules. More...
 
class  PyModule
 Python wrapper for Belle2::Module. More...
 
class  RandomGenerator
 Fast Random number Generator using on xorshift1024* [arXiv:1402.6246]. More...
 
class  RandomNumbers
 The class for handling the random number generation. More...
 
class  SubEventModule
 Framework-internal module that implements the functionality of Path::forEach() as well as Path::doWhile(). More...
 
class  SwitchDataStoreModule
 Internal module used by Path.add_independent_path(). More...
 
class  ConditionsDatabase
 Database backend that uses the conditions service. More...
 
class  Database
 Singleton base class for the low-level interface to the database. More...
 
class  DatabaseChain
 Implementation of a database backend that uses a chain of other database backends to obtain the payloads. More...
 
class  DBAccessorBase
 Base class for DBObjPtr and DBArray for easier common treatment. More...
 
class  DBArray< T >
 Class for accessing arrays of objects in the database. More...
 
class  OptionalDBArray< T >
 Optional DBArray: This class behaves the same as the DBArray except that it will not raise errors when an object could not be found in the database. More...
 
class  DBImportArray< T >
 Class for importing array of objects to the database. More...
 
class  DBImportBase
 Base class for importing objects to the database. More...
 
class  DBImportObjPtr< T >
 Class for importing a single object to the database. More...
 
class  DBObjPtr< T >
 Class for accessing objects in the database. More...
 
class  OptionalDBObjPtr< T >
 Optional DBObjPtr: This class behaves the same as the DBObjPtr except that it will not raise errors when an object could not be found in the database. More...
 
class  DBPointer< T, KEY, METHOD, NAME >
 Class for pointing to an element in an array stored in the database. More...
 
class  DBStore
 Singleton class to cache database objects. More...
 
class  DBStoreEntry
 Class to hold one entry from the ConditionsDB in the DBStore. More...
 
class  EventDependency
 Class for handling changing conditions as a function of event number. More...
 
class  IntervalOfValidity
 A class that describes the interval of experiments/runs for which an object in the database is valid. More...
 
class  IntraRunDependency
 Base class for handling changing conditions during a run. More...
 
class  LocalDatabase
 Implentation of a database backend that uses local root files for the payload storage and a text file for the assignment of IoVs to payloads. More...
 
class  PayloadFile
 A wrapper class for payload files used by the Database and DBStore classes. More...
 
class  DBObjPtr< PayloadFile >
 Specialization of DBObjPtr in case of PayloadFiles. More...
 
class  RelationVector< T >
 Class for type safe access to objects that are referred to in relations. More...
 
class  DataStore
 In the store you can park objects that have to be accessed by various modules. More...
 
class  DependencyMap
 Collect information about the dependencies between modules. More...
 
class  StoreArray< T >
 Accessor to arrays stored in the data store. More...
 
class  RelationArray
 Low-level class to create/modify relations between StoreArrays. More...
 
struct  RelationEntry
 Struct for relations. More...
 
class  RelationIndex< FROM, TO >
 Provides access to fast ( O(log n) ) bi-directional lookups on a specified relation. More...
 
class  RelationIndexBase
 Baseclass for all RelationIndexContainers. More...
 
class  RelationIndexContainer< FROM, TO >
 Class to store a bidirectional index between two StoreArrays. More...
 
class  RelationIndexManager
 Manager to keep a cache of existing RelationIndexContainers. More...
 
class  RelationsInterface< BASE >
 Defines interface for accessing relations of objects in StoreArray. More...
 
class  RelationVectorBase
 base class for RelationVector<T> More...
 
class  SelectSubsetBase
 Type-independent implementation details of SelectSubset. More...
 
class  SelectSubset< StoredClass >
 Class to create a subset of a given StoreArray together with the relations with other StoreArrays. More...
 
class  StoreAccessorBase
 Base class for StoreObjPtr and StoreArray for easier common treatment. More...
 
struct  StoreEntry
 Wraps a stored array/object, stored under unique (name, durability) key. More...
 
class  StoreObjPtr< T >
 Type-safe access to single objects in the data store. More...
 
class  BeamParameters
 This class contains the nominal beam parameters and the parameters used for smearing of the primary vertex and the beam energy and momentum. More...
 
class  MagneticField
 Magnetic field map. More...
 
class  MagneticFieldComponent
 Abstract base class for BField components. More...
 
class  MagneticFieldComponentConstant
 Describe one component of the Geometry. More...
 
class  RunInfo
 Database object for Run Information. More...
 
class  Const
 This class provides a set of constants for the framework. More...
 
class  Gearbox
 Singleton class responsible for loading detector parameters from an XML file. More...
 
struct  InputHandlerFactory< T >
 Helper class to easily register new input handlers. More...
 
class  GearDir
 GearDir is the basic class used for accessing the parameter store. More...
 
class  Unit
 The Unit class. More...
 
class  B2Vector3< DataType >
 A fast and root compatible alternative to TVector3. More...
 
class  BFieldManager
 Bfield manager to obtain the magnetic field at any point. More...
 
class  LogConfig
 The LogConfig class. More...
 
class  LogConnectionBase
 Abstract base class for the different types of log connections. More...
 
class  LogConnectionConsole
 Implements a log connection to an IO Stream. More...
 
class  LogConnectionFilter
 Implements a log connection that filters repeated messages. More...
 
class  LogConnectionJSON
 Implements a log connection to stdout but with messages formatted as json objects to allow easy parsing by other tools, say jupyter notebooks. More...
 
class  LogConnectionTxtFile
 Implements a log connection to a text file. More...
 
class  LogConnectionUDP
 Log Connection to send the log message as JSON to a UDP server. More...
 
class  LogMessage
 The LogMessage class. More...
 
class  LogMethod
 The LogMethod class. More...
 
class  LogSystem
 Class for logging debug, info and error messages. More...
 
class  EvtGenDatabasePDG
 Replacement for TDatabasePDG that is filled from EvtGen's evt.pdl. More...
 
class  EvtGenParticlePDG
 Helper class for setting additional TParticlePDG members and storing the ones it doesn't have yet. More...
 
class  AsyncWrapper
 Wraps a given Module to execute it asynchronously. More...
 
class  DataStoreStreamer
 Stream/restore DataStore objects to/from EvtMessage. More...
 
struct  EvtHeader
 Header structure of streamed object list. More...
 
class  EvtMessage
 Class to manage streamed object. More...
 
class  GlobalProcHandler
 A class to manage processes for parallel processing. More...
 
class  MapMergeable< T >
 Wrap an STL map to make it mergeable. More...
 
class  Mergeable
 Abstract base class for objects that can be merged. More...
 
class  CharBuffer
 dynamic character buffer that knows its size. More...
 
class  InMessage
 Reusable Message class derived from TMessage (for reading only) More...
 
class  MsgHandler
 A class to encode/decode an EvtMessage. More...
 
class  PathUtils
 Helper utils for path arithmetics needed in the pEventProcessor. More...
 
class  pEventProcessor
 This class provides the core event processing loop for parallel processing. More...
 
class  ProcessMonitor
 Class to monitor all started framework processes (input, workers, output), kill them if requested and handle the signals from the OS. More...
 
class  ProcHandler
 A class to manage processes for parallel processing. More...
 
class  RbTupleManager
 Class to manage histograms defined in registered modules. More...
 
struct  RingBufInfo
 Internal metadata structure for RingBuffer. More...
 
class  RingBuffer
 Class to manage a Ring Buffer placed in an IPC shared memory. More...
 
class  RootMergeable< T >
 Wrap a root histogram or TNtuple to make it mergeable. More...
 
class  RxModule
 Module to decode data store contents from RingBuffer. More...
 
class  SemaphoreLocker
 Handles creation, locking and unlocking of System V semaphores. More...
 
class  SeqFile
 A class to manage I/O for a chain of blocked files. More...
 
class  SetMergeable< T >
 Wrap an STL set to make it mergeable. More...
 
class  TxModule
 Module for encoding data store contents into a RingBuffer. More...
 
class  ZMQEventProcessor
 This class provides the core event processing loop for parallel processing with ZMQ. More...
 
class  ZMQConfirmedInput
 Input part of a confirmed connection. More...
 
class  ZMQConfirmedOutput
 Output part of a confirmed connection. More...
 
class  ZMQConnection
 Base class for every connection with virtual functions to be implemented: More...
 
class  ZMQConnectionOverSocket
 Specialized connection over a ZMQ socket. More...
 
class  ZMQLoadBalancedInput
 Input part of a load-balanced connection. More...
 
class  ZMQLoadBalancedOutput
 Output part of a load-balanced connection. More...
 
class  ZMQNullConnection
 Connection doing just nothing: without the capability to pull, send or receive. Useful for template interfaces. More...
 
class  ZMQRawInput
 Input connection allowing to speak with non-zmq sockets via a ZMQ_STREAM socket. More...
 
class  ZMQRawOutput
 Output connection to speak to non-zmq sockets via a ZMQ_STREAM socket. More...
 
class  ZMQSimpleConnection
 Connection type to be used for answering simple requests, e.g. More...
 
class  ZMQIdMessage
 A message with the socket ID. Needed in input<->worker communication. More...
 
class  ZMQMessageFactory
 Helper class for creating new ID/No-ID messages. More...
 
class  ZMQMessageHelper
 Internal helper for creating ZMQ messages (should not be used otherwise). More...
 
class  ZMQModuleMessage< AMessageFrameNumber >
 A general message with as many parts as given as template argument. More...
 
class  ZMQNoIdMessage
 A message without an associated socket ID. Is used in most cases. More...
 
class  ProcessedEventBackup
 Storage item for the event backup storing the event message, the time stamp and the event meta data. More...
 
class  ProcessedEventsBackupList
 List-like structure for storing and retaining event backups. More...
 
class  ZMQRxOutputModule
 Module connecting the worker path with the output path on the output side. More...
 
class  ZMQRxWorkerModule
 Module connecting the input path with the worker path on the worker side. More...
 
class  ZMQTxInputModule
 Module connecting the input path with the worker path on the input side. More...
 
class  ZMQTxWorkerModule
 Module connecting the worker path with the output path on the worker side. More...
 
class  ZMQClient
 A helper class for communicating over ZMQ. Includes a multicast and (if needed) also a data socket. More...
 
class  EventMetaDataSerialization
 Helper class for (de)serializing the event meta data used for the event backup transferral. More...
 
class  StreamHelper
 Helper class for data store serialization. More...
 
class  ZMQAddressUtils
 Summary of some address helpers. More...
 
class  ZMQLogger
 Base class for the ZMQ connection to help monitor and log certain values. More...
 
class  ZMQParent
 A helper class for creating ZMQ sockets keeping track of the ZMQ context and terminating it if needed. More...
 
class  Framework
 This class combines all subsystems of the framework, and exports the main interface to Python. More...
 
class  LogPythonInterface
 Thin wrapper to expose a usable interface to the logging framework in python. More...
 
class  ProcessStatisticsPython
 Python interface for ProcessStatistics. More...
 
class  PyDBArray
 Class to access a DB Array from Python. More...
 
class  PyDBObj
 Class to access a DBObjPtr from Python. More...
 
class  PyStoreArray
 a (simplified) python wrapper for StoreArray. More...
 
class  PyStoreObj
 a (simplified) python wrapper for StoreObjPtr. More...
 
class  BaseAngle
 Class to compare if two angles are compatible withing a given error range. More...
 
class  ThetaAngle
 
class  PhiAngle
 
class  ObjArrayIterator< ArrayType, ValueType >
 Optimizes class to iterate over TObjArray and classes inheriting from it. More...
 
class  ArrayIterator< ArrayType, ValueType >
 Generic iterator class for arrays, allowing use of STL algorithms, range-based for etc. More...
 
class  CalcMeanCov< N, RealType >
 Class to calculate mean and and covariance between a number of parameters on running data without storing the actual values, also for weighted entries. More...
 
class  EnvironmentVariables
 Utility functions related to environment variables. More...
 
class  FileSystem
 Utility functions related to filename validation and filesystem access. More...
 
class  FormulaParserBase
 Base class with the non-templated part of the formula parser. More...
 
class  FormulaParser< VariableConstructor >
 FormulaParser to parse a text formula like "a + b * c ^ d" where the separate parts can be either variables (with and without arguments) or numbers. More...
 
struct  StringFormulaConstructor
 Example struct to be used with the FormulaParser to create a string representation of the formula, mainly for testing and debugging. More...
 
class  GeneralCut< AVariableManager >
 This class implements a common way to implement cut/selection functionality for arbitrary objects. More...
 
class  KeyValuePrinter
 create human-readable or JSON output for key value pairs. More...
 
class  MultivariateNormalGenerator
 Class to generate normal distributed, correlated random numbers given the mean values and the covariance matrix of all dimensions. More...
 
class  BoostPythonModuleProxy
 Proxy class to register python modules (the things you can 'import'). More...
 
class  RootFileCreationManager
 This single instance class takes track of all open ROOT files open in "create" mode, usually meant for all the ntuple output modules. More...
 
class  ScopeGuard
 Simple ScopeGuard to execute a function at the end of the object lifetime. More...
 
class  SHA3Hash
 Simple interface to calculate SHA3 hash sum (FIPS 202 draft) with fixed size from given data inputs. More...
 
class  ShakeHash
 Simple interface to calculate SHAKE256 hash sum (FIPS 202 draft) with variable size from given data inputs. More...
 

Macros

#define BELLE2_DEFINE_EXCEPTION(ClassName, Message)
 Macro that defines an exception with the given message template. More...
 
#define _PACKAGE_   ""
 make sure REG_MODULE works outside the normal build system
 
#define REG_MODULE(moduleName)
 Register the given module (without 'Module' suffix) with the framework. More...
 
#define B2_GEARBOX_REGISTER_INPUTHANDLER(classname, prefix)   InputHandlerFactory<classname> Gearbox_InputHandlerFactory_##classname(prefix)
 Helper macro to easily register new input handlers. More...
 
#define DEFINE_UNIT_NAME(var, value, name)   const double Unit::var = Unit::registerConversion(name,value)
 Define a new Unit given a name for the conversion table.
 
#define DEFINE_UNIT(var, value)   DEFINE_UNIT_NAME(var,value,#var)
 Define a new Unit and take the variable name as name for the conversion table.
 
#define REGISTER_PYTHON_MODULE(moduleName)   Belle2::BoostPythonModuleProxy boostPythonModuleProxy##moduleName(#moduleName, PyInit_##moduleName);
 Register a python module to make available when loading the library. More...
 
#define REGISTER_PYTHON_MODULE_AUTOIMPORT(moduleName)   Belle2::BoostPythonModuleProxy boostPythonModuleProxy##moduleName(#moduleName, PyInit_##moduleName, true);
 Identical to REGISTER_PYTHON_MODULE(), but will also import the module into the global namespace after loading it. More...
 
#define B2INFO_MEASURE_TIME(txt, ...)
 Print an INFO message txt followed by the time it took to execute the statment given as second argument. More...
 
#define branch_likely(x)   (x)
 A macro to tell the compiler that the argument x will be very likely be true. More...
 
#define branch_unlikely(x)   (x)
 A macro to tell the compiler that the argument x will be very likely be false. More...
 

Typedefs

typedef std::shared_ptr< ModuleModulePtr
 Defines a pointer to a module object as a boost shared pointer.
 
typedef std::list< ModulePtrModulePtrList
 Defines a std::list of shared module pointers.
 
using ModuleParamPtr = std::shared_ptr< ModuleParamBase >
 Defines a pointer to a module parameter as a boost shared pointer. *‍/.
 
typedef std::shared_ptr< PathPathPtr
 Defines a pointer to a path object as a boost shared pointer.
 
typedef RelationsInterface< TObject > RelationsObject
 Provides interface for getting/adding relations to objects in StoreArrays. More...
 
typedef std::pair< std::string, DataStore::EDurabilityAccessorParams
 Pair of parameters needed to find an object in the DataStore.
 
typedef B2Vector3< double > B2Vector3D
 typedef for common usage with double
 
typedef B2Vector3< float > B2Vector3F
 typedef for common usage with float
 

Enumerations

enum  ERecordType {
  MSG_EVENT,
  MSG_BEGIN_RUN,
  MSG_END_RUN,
  MSG_TERMINATE,
  MSG_NORECORD,
  MSG_STREAMERINFO
}
 What type of message is this? More...
 
enum  ProcType {
  c_Input = 'i',
  c_Worker = 'w',
  c_Output = 'o',
  c_Proxy = 'p',
  c_Monitor = 'm',
  c_Init = '0',
  c_Stopped = 's'
}
 Type of the process used for storing and mapping the child processes in the process handler. More...
 
enum  EMessageTypes {
  c_confirmMessage = 'c',
  c_helloMessage = 'h',
  c_deleteWorkerMessage = 'd',
  c_lastEventMessage = 'l',
  c_readyMessage = 'r',
  c_terminateMessage = 'x',
  c_rawDataMessage = 'u',
  c_compressedDataMessage = 'v',
  c_eventMessage = 'w',
  c_goodbyeMessage = 'g',
  c_statisticMessage = 's',
  c_killWorkerMessage = 'k',
  c_monitoringMessage = 'm',
  c_newRunMessage = 'n'
}
 Type the messages can have.
 
enum  ZMQAddressType {
  c_input,
  c_output,
  c_pub,
  c_sub,
  c_control
}
 The type of a ZMQ socket address (which socket to use) More...
 

Functions

template<class T >
boost::python::object createROOTObjectPyCopy (const T &instance)
 Create a python wrapped copy from a class instance which has a ROOT dictionary. More...
 
std::istream & operator>> (std::istream &input, IntervalOfValidity &iov)
 
std::ostream & operator<< (std::ostream &output, const IntervalOfValidity &iov)
 
 ADD_BITMASK_OPERATORS (DataStore::EStoreFlags)
 Add bitmask operators to DataStore::EStoreFlags.
 
 DEFINE_UNIT (cm, 1.)
 Standard units with the value = 1. More...
 
 DEFINE_UNIT (ns, 1.)
 Standard of [time].
 
 DEFINE_UNIT (GHz, 1.)
 Standard of [frequency].
 
 DEFINE_UNIT (rad, 1.)
 Standard of [angle].
 
 DEFINE_UNIT (GeV, 1.)
 Standard of [energy, momentum, mass].
 
 DEFINE_UNIT (K, 1.)
 Standard of [temperature].
 
 DEFINE_UNIT (e, 1.)
 Standard of [electric charge].
 
 DEFINE_UNIT_NAME (g_cm3, 1., "g/cm3")
 Practical units with the value = 1. More...
 
 DEFINE_UNIT (km, Unit::cm *1e5)
 Derived units. More...
 
 DEFINE_UNIT (m, Unit::cm *1e2)
 [meters]
 
 DEFINE_UNIT (mm, Unit::m *1e-3)
 [millimeters]
 
 DEFINE_UNIT (um, Unit::m *1e-6)
 [micrometers]
 
 DEFINE_UNIT (nm, Unit::m *1e-9)
 [nanometers]
 
 DEFINE_UNIT (pm, Unit::m *1e-12)
 [picometers]
 
 DEFINE_UNIT (fm, Unit::m *1e-15)
 [femtometers]
 
 DEFINE_UNIT (m2, Unit::m *Unit::m)
 [square meters]
 
 DEFINE_UNIT (cm2, Unit::cm *Unit::cm)
 [square centimeters]
 
 DEFINE_UNIT (mm2, Unit::mm *Unit::mm)
 [square millimeters]
 
 DEFINE_UNIT (b, Unit::m2 *1e-28)
 [barn]
 
 DEFINE_UNIT (mb, Unit::b *1e-3)
 [millibarn]
 
 DEFINE_UNIT (ub, Unit::b *1e-6)
 [microbarn]
 
 DEFINE_UNIT (nb, Unit::b *1e-9)
 [nanobarn]
 
 DEFINE_UNIT (pb, Unit::b *1e-12)
 [picobarn]
 
 DEFINE_UNIT (fb, Unit::b *1e-15)
 [femtobarn]
 
 DEFINE_UNIT (ab, Unit::b *1e-18)
 [attobarn]
 
 DEFINE_UNIT (m3, Unit::m *Unit::m *Unit::m)
 [cubic meters]
 
 DEFINE_UNIT (cm3, Unit::cm *Unit::cm *Unit::cm)
 [cubic centimeters]
 
 DEFINE_UNIT (mm3, Unit::mm *Unit::mm *Unit::mm)
 [cubic millimeters]
 
 DEFINE_UNIT (s, Unit::ns *1e9)
 [second]
 
 DEFINE_UNIT (ms, Unit::s *1e-3)
 [millisecond]
 
 DEFINE_UNIT (us, Unit::s *1e-6)
 [microsecond]
 
 DEFINE_UNIT (ps, Unit::s *1e-12)
 [picosecond]
 
 DEFINE_UNIT (fs, Unit::s *1e-15)
 [femtosecond]
 
 DEFINE_UNIT (Hz, Unit::GHz *1e-9)
 [Hertz]
 
 DEFINE_UNIT (kHz, Unit::GHz *1e-6)
 [Kilohertz]
 
 DEFINE_UNIT (MHz, Unit::GHz *1e-3)
 [Megahertz]
 
 DEFINE_UNIT (mHz, Unit::GHz *1e-12)
 [Millihertz]
 
 DEFINE_UNIT (mrad, Unit::rad *1e-3)
 [millirad]
 
 DEFINE_UNIT (deg, TMath::DegToRad())
 degree to radians
 
 DEFINE_UNIT (eV, Unit::GeV *1e-9)
 [electronvolt]
 
 DEFINE_UNIT (keV, Unit::eV *1e3)
 [kiloelectronvolt]
 
 DEFINE_UNIT (MeV, Unit::eV *1e6)
 [megaelectronvolt]
 
 DEFINE_UNIT (TeV, Unit::eV *1e12)
 [teraelectronvolt]
 
 DEFINE_UNIT (J, 1.0/TMath::Qe() *Unit::eV)
 [joule]
 
 DEFINE_UNIT (V, Unit::eV/Unit::e)
 Standard of [voltage].
 
 DEFINE_UNIT (C, 1.0/TMath::Qe() *Unit::e)
 [Coulomb]
 
 DEFINE_UNIT (fC, Unit::C/1.0e15)
 [femtoCoulomb]
 
 DEFINE_UNIT (T, Unit::V *Unit::s/Unit::m2)
 [Tesla]
 
 DEFINE_UNIT (mT, Unit::T *1e-3)
 [millitesla]
 
 DEFINE_UNIT (Gauss, Unit::T *1e-4)
 [Gauss]
 
 DEFINE_UNIT (kGauss, Unit::Gauss *1e3)
 [kiloGauss]
 
 DEFINE_UNIT_NAME (mg_cm3, Unit::g_cm3 *1e-3, "mg/cm3")
 [mg/cm^3]
 
 DEFINE_UNIT_NAME (kg_cm3, Unit::g_cm3 *1e3, "kg/cm3")
 [kg/cm^3]
 
 DEFINE_UNIT_NAME (g_mm3, Unit::g_cm3/Unit::mm3, "g/mm3")
 [g/mm^3]
 
 DEFINE_UNIT_NAME (mg_mm3, Unit::mg_cm3/Unit::mm3, "mg/mm3")
 [mg/mm^3]
 
 DEFINE_UNIT_NAME (kg_mm3, Unit::kg_cm3/Unit::mm3, "kg/mm3")
 [kg/mm^3]
 
template<typename DataType >
Bool_t operator== (const TVector3 &a, const B2Vector3< DataType > &b)
 non-memberfunction Comparison for equality with a TVector3
 
template<typename DataType >
Bool_t operator!= (const TVector3 &a, const B2Vector3< DataType > &b)
 non-memberfunction Comparison for equality with a TVector3
 
template<typename DataType >
B2Vector3< DataType > operator* (DataType a, const B2Vector3< DataType > &p)
 non-memberfunction Scaling of 3-vectors with a real number
 
template<typename DataType >
B2Vector3< DataType > operator+ (const TVector3 &a, const B2Vector3< DataType > &b)
 non-memberfunction for adding a TVector3 to a B2Vector3
 
template<typename DataType >
B2Vector3< DataType > operator- (const TVector3 &a, const B2Vector3< DataType > &b)
 non-memberfunction for substracting a TVector3 from a B2Vector3
 
template<typename DataType >
B2Vector3< DataType > operator+ (const B2Vector3< DataType > &a, const TVector3 &b)
 non-memberfunction for adding a B2Vector3 to a TVector3
 
template<typename DataType >
B2Vector3< DataType > operator- (const B2Vector3< DataType > &a, const TVector3 &b)
 non-memberfunction for substracting a B2Vector3 from a TVector3
 
template<typename T >
convertString (const std::string &str)
 Converts a string to type T (one of float, double, long double, int, long int, unsigned long int). More...
 
unsigned long int findMatchedParenthesis (std::string str, char open='[', char close=']')
 Returns position of the matched closing parenthesis if the first character in the given string contains an opening parenthesis. More...
 
std::vector< std::string > splitOnDelimiterAndConserveParenthesis (std::string str, char delimiter, char open, char close)
 Split into std::vector on delimiter ignoring delimiters between parenthesis.
 
unsigned long int findIgnoringParenthesis (std::string str, std::string pattern, unsigned int begin=0)
 Returns the position of a pattern in a string ignoring everything that is in parenthesis.
 
bool almostEqualFloat (const float &a, const float &b)
 Helper function to test if two floats are almost equal.
 
bool almostEqualDouble (const double &a, const double &b)
 Helper function to test if two doubles are almost equal.
 
std::string makeROOTCompatible (std::string str)
 Remove special characters that ROOT dislikes in branch names, e.g. More...
 
std::string invertMakeROOTCompatible (std::string str)
 Invert makeROOTCompatible operation.
 
std::map< std::string, std::string > getSubstitutionMap ()
 Substituation map for makeROOTCompatible.
 
std::set< int64_t > generate_number_sequence (const std::string &str)
 Generate a sequence of numbers defined by a string. More...
 
template<>
float convertString (const std::string &str)
 Converts a string to float. More...
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
 Adds a new parameter to the module. More...
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module. More...
 
template<typename T >
ModuleParam< T > & getParam (const std::string &name) const
 Returns a reference to a parameter. More...
 
static std::string TypeInfo ()
 Static function to generate a string description for the parameter type. More...
 
 ModuleParam (T &paramVariable, const std::string &description="", bool force=false)
 Constructor. More...
 
virtual ~ModuleParam ()
 Destructor.
 
void setValue (const T &value)
 Sets the value of a parameter. More...
 
void setDefaultValue (const T &defaultValue)
 Sets the default value of a parameter. More...
 
T & getValue ()
 Returns the value of the parameter. More...
 
T & getDefaultValue ()
 Returns the default value of the parameter. More...
 
virtual void setValueFromPythonObject (const boost::python::object &pyObject) final
 Implements a method for setting boost::python objects. More...
 
virtual void setValueToPythonObject (boost::python::object &pyObject, bool defaultValues=false) const final
 Returns a python object containing the value or the default value of the given parameter. More...
 
virtual void setValueFromParam (const ModuleParamBase &param) final
 Set value from other ModuleParam of same type.
 
void resetValue ()
 Resets the parameter value by assigning the default value to the parameter value.
 
template<typename T >
void addParameter (const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
 Adds a new parameter to the module list. More...
 
template<typename T >
void addParameter (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module list. More...
 
template<typename T >
void setParameter (const std::string &name, const T &value)
 Sets the value of a parameter given by its name. More...
 
template<typename T >
ModuleParam< T > & getParameter (const std::string &name) const
 Returns a reference to a parameter. More...
 
template<typename PythonObject >
void setParamPython (const std::string &name, const PythonObject &pyObj)
 Implements a method for setting boost::python objects. More...
 
template<typename PythonObject >
void getParamValuesPython (const std::string &name, PythonObject &pyOutput, bool defaultValues) const
 Returns a python object containing the value or default value of the given parameter. More...
 
uint64_t random64 ()
 Generate one 64bit unsigned integer between 0 and UINT64_MAX (both inclusive). More...
 
void RndmArray (Int_t n, Float_t *array)
 Fill an array of floats with random values in (0,1), both limits excluded. More...
 
void RndmArray (Int_t n, Double_t *array)
 Fill an array of doubles with random values in (0,1), both limits excluded. More...
 
void RndmArray (Int_t n, ULong64_t *array)
 Fill an array of unsigned 64bit integers with random values in [0, UINT64_MAX], both limits included. More...
 
void RndmArray (Int_t n, UInt_t *array)
 Fill an array of unsigned integers with random values in [0, UINT32_MAX], both limits included. More...
 
double random01 ()
 Generate a random double value between 0 and 1, both limits excluded. More...
 
static DatabaseInstance ()
 Instance of a singleton Database.
 
 ~Database ()
 Hidden destructor, as it is a singleton.
 
static void reset (bool keepConfig=false)
 Reset the database instance. More...
 
ScopeGuard createScopedUpdateSession ()
 Make sure we have efficient http pipelinging during initialize/beginRun but don't keep session alive for full processing time. More...
 
std::pair< TObject *, IntervalOfValiditygetData (const EventMetaData &event, const std::string &name)
 Request an object from the database. More...
 
bool getData (const EventMetaData &event, std::vector< DBQuery > &query)
 Request multiple objects from the database. More...
 
bool storeData (std::list< DBImportQuery > &query)
 Store multiple objects in the database. More...
 
bool storeData (const std::string &name, TObject *object, const IntervalOfValidity &iov)
 Store an object in the database. More...
 
std::string getGlobalTags ()
 Return the global tags used by the database. More...
 
void nextMetadataProvider ()
 Enable the next metadataprovider in the list.
 
void initialize (const EDatabaseState target=c_Ready)
 Initialize the database connection settings on first use.
 
static void exposePythonAPI ()
 Exposes setGlobalTag function of the Database class to Python.
 
static void createInstance (bool resetIoVs=false, LogConfig::ELogLevel logLevel=LogConfig::c_Warning, bool invertLogging=false)
 Method to set the database instance to a local database. More...
 
 ~DBStore ()
 Destructor.
 
static DBStoreInstance ()
 Instance of a singleton DBStore. More...
 
DBStoreEntrygetEntry (DBStoreEntry::EPayloadType payloadType, const std::string &name, const TClass *objClass, bool array, bool required=true)
 Returns the entry with the requested name in the DBStore. More...
 
void update ()
 Updates all objects that are outside their interval of validity. More...
 
void update (const EventMetaData &event)
 Updates all objects that are outside their interval of validity. More...
 
void performUpdate (const EventMetaData &event)
 The main code that does an update, factored out so it can be used by both update and update(event).
 
void updateEvent ()
 Updates all intra-run dependent objects. More...
 
void updateEvent (const unsigned int eventNumber)
 Updates all intra-run dependent objects. More...
 
void performUpdateEvent (const EventMetaData &event)
 The main code that does an updateEvent. More...
 
void reset (bool keepEntries=false)
 Invalidate all payloads. More...
 
void addConstantOverride (const std::string &name, TObject *obj, bool oneRun=false)
 Add constant override payload. More...
 
static DBStoreEntry fromObject (const std::string &name, const TObject *obj, bool isRequired)
 Construct a new DBStoreEntry with a requested name and an object directly. More...
 
 ~DBStoreEntry ()
 Clean up memory. More...
 
void updateObject (const EventMetaData &event)
 update the payload object according to the new event information. More...
 
void resetPayload ()
 reset the payload to nothing
 
void updatePayload (unsigned int revision, const IntervalOfValidity &iov, const std::string &filename, const std::string &checksum, const EventMetaData &event)
 Update the payload information for this entry and if appropriate open the new file and extract the object as needed. More...
 
void loadPayload (const EventMetaData &event)
 Actual load the payload from file after all info is set.
 
void overrideObject (TObject *obj, const IntervalOfValidity &iov)
 Set an override object in case we want to use a different object then actually provided by the database. More...
 
void notifyAccessors (bool onDestruction=false)
 Notify all the registered accessors.
 
bool checkType (EPayloadType type, const TClass *objClass, bool array, bool inverse=false) const
 Check if a given TClass is compatible with the type of this entry.
 
bool checkType (const TObject *object) const
 Check if a given TObject instance is compatible with the type of this entry.
 
static void createInstance (const std::string &fileName="database.txt", const std::string &payloadDir="", bool readOnly=false, LogConfig::ELogLevel logLevel=LogConfig::c_Warning, bool invertLogging=false)
 Method to set the database instance to a local database. More...
 
template<class FunctionFrom , class FunctionTo >
void consolidate (const FunctionFrom &replaceFrom=FunctionFrom(), const FunctionTo &replaceTo=FunctionTo(), EConsolidationAction action=c_doNothing)
 Consolidate RelationElements. More...
 
void rebuild (bool force=false)
 Rebuild the index. More...
 
std::map< int, int > copySetWithRelations (std::function< bool(const StoredClass *)> f)
 Selects the elements, fill the subset and copies all the relations in which the set is involved.
 
void copyRelationsToSelf ()
 Copy any set -> set relations between selected objects.
 
void select (const std::function< bool(const StoredClass *)> &f)
 This method is the actual worker. More...
 
B2Vector3D getField (const B2Vector3D &pos) const
 Calculate the magnetic field at a given position. More...
 
 Gearbox ()
 Singleton: private constructor.
 
 ~Gearbox ()
 Free structures on destruction.
 
static GearboxgetInstance ()
 Return reference to the Gearbox instance.
 
gearbox::InputContextopenXmlUri (const std::string &uri) const
 Function to be called when libxml requests a new input uri to be opened.
 
void setBackends (const std::vector< std::string > &backends)
 Select the backends to use to find resources. More...
 
void clearBackends ()
 Clear list of backends.
 
void open (const std::string &name="Belle2.xml", size_t cacheSize=c_DefaultCacheSize)
 Open connection to backend and parse tree. More...
 
void close ()
 Free internal structures of previously parsed tree and clear cache.
 
void overridePathValue (const PathOverride &poverride)
 Change the value of a given path expression.
 
PathValue getPathValue (const std::string &path) const
 Return the (cached) value of a given path.
 
virtual const TObject * getTObject (const std::string &path) const noexcept(false) override
 Get the parameter path as a TObject. More...
 
GearDir getDetectorComponent (const std::string &component)
 Return GearDir representing a given DetectorComponent. More...
 
static double convertValue (double value, const std::string &unitString)
 Converts a floating point value to the standard framework unit. More...
 
static double convertValueToUnit (double value, const std::string &unitString)
 Converts a floating point value from the standard framework unit to the given unit. More...
 
static double registerConversion (const std::string &name, double value)
 registers the name and value of a conversion in s_conversionFactors.
 
B2Vector3< DataType > & operator= (const B2Vector3< DataType > &b)
 Assignment via B2Vector3.
 
B2Vector3< DataType > & operator= (const TVector3 &b)
 Assignment via TVector3.
 
B2Vector3< DataType > & operator+= (const B2Vector3< DataType > &b)
 addition
 
B2Vector3< DataType > & operator-= (const B2Vector3< DataType > &b)
 subtraction
 
B2Vector3< DataType > & operator*= (DataType a)
 scaling with real numbers More...
 
void SetXYZ (const TVector3 &tVec)
 set all coordinates using a reference to TVector3
 
void SetXYZ (const TVector3 *tVec)
 set all coordinates using a pointer to TVector3
 
void GetXYZ (TVector3 *tVec) const
 directly copies coordinates to a TVector3
 
TVector3 GetTVector3 () const
 returns a TVector3 containing the same coordinates
 
DataType at (unsigned i) const
 safe member access (with boundary check!) More...
 
static std::string name ()
 Returns the name of the B2Vector. More...
 
B2Vector3D calculate (const B2Vector3D &pos) const
 Calculate the field value at a given position and return it. More...
 
static void getField (const double *pos, double *field)
 return the magnetic field at a given position. More...
 
const LogConfiggetCurrentLogConfig (const char *package=nullptr) const
 Returns the current LogConfig object used by the logging system. More...
 
bool isLevelEnabled (LogConfig::ELogLevel level, int debugLevel=0, const char *package=nullptr) const
 Returns true if the given log level is allowed by the log system (i.e. More...
 
 LogConnectionJSON (bool complete=false)
 The constructor. More...
 
bool sendMessage (const LogMessage &message) override
 Sends a log message. More...
 
std::string __repr__ () const
 Return a string repesentation of this particle to be used when printing the particle in python.
 
template<class AZMQClient >
void sendToSocket (const AZMQClient &socket)
 Publish this event backup directly to the given client.
 
template<class AZMQClient >
void sendWorkerBackupEvents (unsigned int worker, const AZMQClient &socket)
 Send all backups of a given worker directly to the multicast and delete them.
 
template<class AMulticastAnswer , class ASocketAnswer >
int poll (unsigned int timeout, AMulticastAnswer multicastAnswer, ASocketAnswer socketAnswer) const
 Poll both the multicast and the data socket until, either: More...
 
template<class ASocketAnswer >
int pollSocket (unsigned int timeout, ASocketAnswer socketAnswer) const
 Poll method to only the data socket. More...
 
template<class AMulticastAnswer >
int pollMulticast (unsigned int timeout, AMulticastAnswer multicastAnswer) const
 Poll method to only the multicast socket. More...
 
template<class AClass >
void log (const std::string &key, const AClass &value)
 Store a value under a certain key. Different types of values can be stored, namely long, double or string. Mixtures are not allowed for a given key.
 
template<size_t MAX_SIZE = 100>
void average (const std::string &key, double value)
 Instead of storeing the double value directly under the given key, store the average of the last MAX_SIZE values.
 
template<size_t AVERAGE_SIZE = 2000>
void timeit (const std::string &key)
 Measure the rate of calls with the same key every AVERAGE_SIZE calls (and also display the last time AVERAGE_SIZE was reached under <key>_last_measurement)
 
template<int AZMQType>
std::unique_ptr< zmq::socket_t > createSocket (const std::string &socketAddress, bool bind)
 Create a socket of the given type with the given address and bind or not bind it. More...
 
template<int AZMQType>
std::unique_ptr< zmq::socket_t > createSocket (const std::string &socketAddress)
 Create a socket of the given type while deciding on the bind behaviour via the address. More...
 
template<class AZMQMessage >
static void send (std::unique_ptr< zmq::socket_t > &socket, AZMQMessage message)
 Send a given message over the given created socket. You need to move in the message for zero-copy.
 
template<class value_type >
bool setMeanCov (const TVectorT< value_type > &mean, const TMatrixTBase< value_type > &cov)
 set mean and covariance matrix from ROOT vector/matrix objects, e.g. More...
 
template<class value_type >
bool setMeanCov (const TVector3 &mean, const TMatrixTBase< value_type > &cov)
 set mean and covariance matrix from ROOT vector/matrix objects, e.g. More...
 
 SHA3Hash (EHashMode length)
 Constructor initializing the hash structure with a given output size.
 
 ~SHA3Hash ()
 destructor freeing the memory
 
void clear ()
 reinit the hash structure to create a new hash sum
 
void update (int n, unsigned char *buff)
 update the internal state by adding n bytes of data from buff
 
void getHash (unsigned char *buff)
 obtain the hash value into buff. More...
 
std::vector< unsigned char > getHash ()
 obtain the hash value as a vector of unsigned char
 
 ShakeHash (EHashMode mode)
 constructor initializing the hash structure
 
 ~ShakeHash ()
 destructor freeing the memory
 
void clear ()
 reinit the hash structure to create a new hash sum
 
void update (int n, unsigned char *buff)
 update the internal state by adding n bytes of data from buff
 
void getHash (int n, unsigned char *buff)
 obtain the hash value with a length of n bytes into buff
 
static bool isSet (const std::string &name)
 Check if a value is set in the database.
 
static std::string get (const std::string &name, const std::string &fallback="")
 Get the value of an environment variable or the given fallback value if the variable is not set.
 
static std::vector< std::string > getList (const std::string &name, const std::vector< std::string > &fallback={}, const std::string &separators=" \t\n\r")
 Get a list of values from an environment variable or the given fallback list if the variable is not set. More...
 
static std::vector< std::string > getOrCreateList (const std::string &name, const std::string &fallback, const std::string &separators=" \t\n\r")
 Get a list of values from an environment variable or the given fallback string if the variable is not set. More...
 
static std::string expand (const std::string &text)
 Modify the given string and replace every occurence of $NAME or ${NAME} with the value of the environment variable NAME. More...
 
static char operatorToChar (EOperator op) noexcept
 Convert operator code to character.
 
static double applyOperator (EOperator op, double a, double b)
 Apply operator on two values.
 
static ENumberStatus checkNumber (ENumberStatus current, char next)
 Check if a string literal with a given number status continues to be a valid number if next is appended to it.
 
static void assertOperatorUsable (size_t stacksize)
 Make sure we have enough operands to use an operator.
 
void addOperator (EOperator op)
 Add an operator to the internal state, convert them to reverse polish notation using the shunting yard algorithm and execute them as they become available.
 
void flushPendingOperators ()
 Flush all pending operators at the end of processing.
 
void flushCurrentVariable ()
 Flush the currently parsed variable name and add it to the state either as variable or number.
 
EOperator checkForOperator (char next)
 Check if the next character is a operator.
 
void processString (const std::string &formula)
 Process the given formula and store the final state.
 
void raiseError (const std::runtime_error &e)
 Format the given runtime_error with context information and rethrow a new one.
 
std::shared_ptr< TFile > getFile (std::string, bool ignoreErrors=false)
 Get a file with a specific name, if is does not exist it will be created. More...
 
static RootFileCreationManagergetInstance ()
 Interface for the FileManager.
 

Variables

std::string DBPointer_defaultName = ""
 Use default name for array in DBPointer.
 
static std::map< std::string, double > s_conversionFactors
 Map to be able to convert between units using string representations of the unit name.
 

Detailed Description

Macro Definition Documentation

◆ B2_GEARBOX_REGISTER_INPUTHANDLER

#define B2_GEARBOX_REGISTER_INPUTHANDLER (   classname,
  prefix 
)    InputHandlerFactory<classname> Gearbox_InputHandlerFactory_##classname(prefix)

Helper macro to easily register new input handlers.

It will create a factory function for the InputHandler and register it with the Gearbox instance

Parameters
classnameClassname to create factory for
prefixPrefix to register the handler for, e.g. "file" to register a handler responsible for uris starting with file:

Definition at line 266 of file Gearbox.h.

◆ B2INFO_MEASURE_TIME

#define B2INFO_MEASURE_TIME (   txt,
  ... 
)
Value:
{\
std::stringstream __b2_timer_str__;\
__b2_timer_str__ << txt;\
::Belle2::Utils::Timer __b2_timer__(__b2_timer_str__.str());\
{__VA_ARGS__;}\
}

Print an INFO message txt followed by the time it took to execute the statment given as second argument.

Care should be taken not to define variables in this call since they will be scoped and thus unavaiable after the macro

Definition at line 95 of file Utils.h.

◆ BELLE2_DEFINE_EXCEPTION

#define BELLE2_DEFINE_EXCEPTION (   ClassName,
  Message 
)
Value:
class ClassName : public std::runtime_error { \
public: \
ClassName(): std::runtime_error(""), m_format(Message) { } \
~ClassName() noexcept {} \
virtual const char * what() const noexcept override { \
m_finalStr = m_format.str();\
return m_finalStr.c_str();\
}\
template <class T> ClassName& operator<<(const T& param) {\
m_format % param;\
return *this;\
}\
private:\
boost::format m_format;\
mutable std::string m_finalStr;\
};

Macro that defines an exception with the given message template.

Use the macro inside your class (header file) and specify a class name for your exception, plus a format string that contains a description of what went wrong:

BELLE2_DEFINE_EXCEPTION(ModuleNotCreatedError, "Could not create module: %1%")

When throwing, simply create an instance of this class, use operator<< to fill any placeholders (n%) specified, and pass this to the throw keyword:

throw (ModuleNotCreatedError() << moduleName);

Exceptions defined using this macro inherit from std::runtime_error, and can be queried using their what() member.

Definition at line 46 of file FrameworkExceptions.h.

◆ branch_likely

#define branch_likely (   x)    (x)

A macro to tell the compiler that the argument x will be very likely be true.

This could result in optimized code as the compiler can reorder the code to reduce conditional jumps during execution. Due to the high efficiency of todays branch prediction systems the effect is probably small.

Warning
Use of this macro should be accompanied by a comment documenting the (significant) performance gains that justify its use. (Please make sure you compile in 'opt' mode.)
See also

Usage:

if (branch_unlikely(my_number > 10)) {
  // executed only rarely
} else {
  // executed very often
}

Definition at line 147 of file Utils.h.

◆ branch_unlikely

#define branch_unlikely (   x)    (x)

A macro to tell the compiler that the argument x will be very likely be false.

Usage:

if (branch_likely(my_number > 10)) {
  // executed very often
} else {
  // executed only rarely
}

This could result in optimized code as the compiler can reorder the code to reduce conditional jumps during execution. Due to the high efficiency of todays branch prediction systems the effect is probably small.

Warning
Use of this macro should be accompanied by a comment documenting the (significant) performance gains that justify its use. (Please make sure you compile in 'opt' mode.)
See also

Definition at line 148 of file Utils.h.

◆ REG_MODULE

#define REG_MODULE (   moduleName)
Value:
namespace { struct ModuleProxy##moduleName: public ModuleProxyBase { \
ModuleProxy##moduleName(): ModuleProxyBase(#moduleName, "" _PACKAGE_) {} \
virtual ::Belle2::Module* createInstance() const override final { return new moduleName##Module(); } \
} proxy##moduleName##Module; }

Register the given module (without 'Module' suffix) with the framework.

Definition at line 652 of file Module.h.

◆ REGISTER_PYTHON_MODULE

#define REGISTER_PYTHON_MODULE (   moduleName)    Belle2::BoostPythonModuleProxy boostPythonModuleProxy##moduleName(#moduleName, PyInit_##moduleName);

Register a python module to make available when loading the library.

Use it by defining your module via BOOST_PYTHON_MODULE(name), then call REGISTER_PYTHON_MODULE(name) with the same name.

After the library has been loaded, you can use 'import name' to import the defined objects.

Definition at line 46 of file RegisterPythonModule.h.

◆ REGISTER_PYTHON_MODULE_AUTOIMPORT

#define REGISTER_PYTHON_MODULE_AUTOIMPORT (   moduleName)    Belle2::BoostPythonModuleProxy boostPythonModuleProxy##moduleName(#moduleName, PyInit_##moduleName, true);

Identical to REGISTER_PYTHON_MODULE(), but will also import the module into the global namespace after loading it.

This might be useful to allow extra definitions for individual basf2 modules, consider for example:

//in MyTestModule.h (preferably as a member of your Module class):
enum class Shape {
Sphere,
Cube
};
//in MyTestModule.cc
#include <boost/python.hpp>
#include <framework/utilities/RegisterPythonModule.h>
//...
using namespace boost::python;
BOOST_PYTHON_MODULE(MyTest)
{
//export enum to python, e.g. Shape::Sphere becomes Shape.Sphere
enum_<Shape>("Shape")
.value("Sphere", Shape::Sphere)
.value("Cube", Shape::Cube)
;
}

In a steering file, the type MyTest.Sphere is available immediately after register_module('MyTest').

Definition at line 84 of file RegisterPythonModule.h.

Typedef Documentation

◆ RelationsObject

Provides interface for getting/adding relations to objects in StoreArrays.

See RelationsInterface for details.

Definition at line 443 of file RelationsObject.h.

Enumeration Type Documentation

◆ ERecordType

What type of message is this?

Note: for parallel processing, the only type that can work is MSG_EVENT. Other messages would need to be sent once to each process, which would result in all kinds of race conditions.

Definition at line 26 of file EvtMessage.h.

26 { MSG_EVENT, MSG_BEGIN_RUN, MSG_END_RUN, MSG_TERMINATE, MSG_NORECORD, MSG_STREAMERINFO };

◆ ProcType

enum ProcType
strong

Type of the process used for storing and mapping the child processes in the process handler.

Enumerator
c_Input 

Input Process.

c_Worker 

Worker/Reconstruction Process.

c_Output 

Output Process.

c_Proxy 

Multicast Proxy Process.

c_Monitor 

Monitoring Process.

c_Init 

Before the forks, the process is in init state.

c_Stopped 

The process is stopped/killed.

Definition at line 9 of file ProcHelper.h.

9  {
10  c_Input = 'i',
11  c_Worker = 'w',
12  c_Output = 'o',
13  c_Proxy = 'p',
14  c_Monitor = 'm',
15  c_Init = '0',
16  c_Stopped = 's'
17  };

◆ ZMQAddressType

The type of a ZMQ socket address (which socket to use)

Enumerator
c_output 

Input socket.

c_pub 

Output socket.

c_sub 

Multicast publish socket.

c_control 

Multicast subscribe socket.

Multicast control socket

Definition at line 28 of file ZMQAddressUtils.h.

29  {
30  public:
32  static std::string randomSocketName(const std::string& hostname);
34  static std::string randomSocketName();

Function Documentation

◆ addConstantOverride()

void addConstantOverride ( const std::string &  name,
TObject *  obj,
bool  oneRun = false 
)

Add constant override payload.

This payload will be valid for all possible iov and will be used instead of values from the database.

Parameters
nameName under which the object will be accessible
objPointer to the object to be used. Ownership will be transfered to the DBStore.
oneRunif true the override will only be in effect for this one run, not for any other runs
Warning
don't use this if you do not know exactly what you are doing. This is meant mainly for beamparameters

Definition at line 204 of file DBStore.cc.

204  {
205  exp = m_storeEvent->getExperiment();
206  run = m_storeEvent->getRun();
207  }
208  iov = IntervalOfValidity(exp, run, exp, run);
209  }
210  // Add the DBStore entry
211  auto iter = m_dbEntries.find(name);
212  if (iter == end(m_dbEntries)) {
213  iter = m_dbEntries.emplace(name, DBStoreEntry::fromObject(name, obj, true)).first;
214  }
215  DBStoreEntry& dbEntry = iter->second;
216  dbEntry.overrideObject(obj, iov);
217  // we need to remove this entry from the intraRunDependencies list now.
218  // Otherwise it will reset the object on the next event call
219  m_intraRunDependencies.erase(&dbEntry);
220  B2WARNING("An override for DBEntry " << name << " was created.");
221  }
222 
224 } // namespace Belle2

◆ addParam() [1/2]

void addParam ( const std::string &  name,
T &  paramVariable,
const std::string &  description 
)
protected

Adds a new enforced parameter to the module.

This method has to be called in the constructor of the module. The user has to set the value for this parameter in the steering file.

Parameters
nameThe unique name of the parameter.
paramVariableThe member variable of the module to which the value from the steering file is written.
descriptionA description of the parameter.

Definition at line 569 of file Module.h.

570  {
571  m_moduleParamList.addParameter(name, paramVariable, description);
572  }

◆ addParam() [2/2]

void addParam ( const std::string &  name,
T &  paramVariable,
const std::string &  description,
const T &  defaultValue 
)
protected

Adds a new parameter to the module.

This method has to be called in the constructor of the module.

Parameters
nameThe unique name of the parameter.
paramVariableThe member variable of the module to which the value from the steering file is written.
descriptionA description of the parameter.
defaultValueThe default value of the parameter which is used if there was no value given in the steering file.

Definition at line 562 of file Module.h.

◆ addParameter() [1/2]

void addParameter ( const std::string &  name,
T &  paramVariable,
const std::string &  description 
)

Adds a new enforced parameter to the module list.

A parameter consists of a reference pointing to a member variable in the module which stores and allows fast access to the parameter value. In addition the type of the parameter is saved and a description is given. This parameter has to be set by the user in the steering file.

Parameters
nameThe unique name of the parameter.
paramVariableReference to the variable which stores the parameter value.
descriptionAn description of the parameter.

Definition at line 60 of file ModuleParamList.templateDetails.h.

62  {
63  m_paramMap.insert(std::make_pair(name, newParam));
64  } else {
65  B2ERROR("A parameter with the name '" + name +
66  "' already exists! The name of a module parameter must be unique within a module.");
67  }
68  }
69 
70  template <typename T>
71  void ModuleParamList::setParameter(const std::string& name, const T& value)
72  {
73  try {
74  ModuleParam<T>& explModParam = getParameter<T>(name);
75  explModParam.setValue(value);
76  } catch (std::runtime_error& exc) {

◆ addParameter() [2/2]

void addParameter ( const std::string &  name,
T &  paramVariable,
const std::string &  description,
const T &  defaultValue 
)

Adds a new parameter to the module list.

A parameter consists of a reference pointing to a member variable in the module which stores and allows fast access to the parameter value. In addition the type of the parameter is saved and a description is given.

Parameters
nameThe unique name of the parameter.
paramVariableReference to the variable which stores the parameter value.
descriptionAn description of the parameter.
defaultValueThe default value of the parameter.

Definition at line 38 of file ModuleParamList.templateDetails.h.

◆ at()

DataType at ( unsigned  i) const

safe member access (with boundary check!)

safe member access (with boundary check!) should always be used!

Definition at line 664 of file B2Vector3.h.

664  : given index (i=" << i << ") is out of bounds!");
665  return 0.;
666  }
667 
669  template < typename DataType>
670  std::string B2Vector3<DataType>::name()
671  {
672  return std::string("B2Vector3<") + typeid(DataType).name() + std::string(">");
673  }
674 
676 } // end namespace Belle2

◆ calculate()

B2Vector3D calculate ( const B2Vector3D pos) const
inlineprivate

Calculate the field value at a given position and return it.

Parameters
posposition where to evaluate the magnetic field
Returns
magnetic field value at position pos

Definition at line 104 of file BFieldManager.h.

◆ consolidate()

void consolidate ( const FunctionFrom &  replaceFrom = FunctionFrom(),
const FunctionTo &  replaceTo = FunctionTo(),
EConsolidationAction  action = c_doNothing 
)

Consolidate RelationElements.

This function will loop over the relation and "compress" it by merging all elements with the same fromIndex.

The optional arguments can be used to replace indices in the relation, mainly useful in the simulation to replace the Geant4 TrackID with the index of the MCParticle at the end of the event

The Function objects should return a new (index,bool) pair for every index in the old relation. The returned index will be used as the new index in the relation and the bool pair indicates whether the original element got re-attributed or if it is just an index reordering. If it the original element got re-attributed the behaviour depends on the value of action, see EConsolidationAction

Warning: If action is set to c_negativeWeight and there is more than one element having the same from->to index pair after transformation the behaviour is undefined as the two elements get merged. It could happen that a negative and a positive weight get summed up, leaving the weight rather meaningless

See also
Identity, ReplaceMap, ReplaceVec, EConsolidationAction
Parameters
replaceFromFunction object containing replacements for the from indices
replaceToFunction object containing replacements for the to indices
actionAction to be performed when the old element got removed

Definition at line 476 of file RelationArray.h.

484  {
485  RelationElement& element = *static_cast<RelationElement*>(elements[i]);
486  //Replace from index
487  consolidation_type from = replaceFrom(element.getFromIndex());
488 
489  //Ignore whole element if original element got deleted
490  if (action == c_deleteElement && from.second) continue;
491 
492  //Check if the fromIndex is the same as the last one and reuse
493  //iterator if possible
494  if (from.first != lastFromIndex || lastFromIter == buffer.end()) {
495  lastFromIter = buffer.insert(make_pair(from.first, element_t())).first;
496  lastFromIndex = from.first;
497  }
498  //Loop over all elements of this relationelement and add them to the map
499  size_t size = element.getSize();
500  for (size_t j = 0; j < size; ++j) {
501  //Replace to Index
502  consolidation_type to = replaceTo(element.getToIndex(j));
503  //Ignore whole element if original element got deleted
504  if (action == c_deleteElement && to.second) continue;
505  double weight = element.getWeight(j);
506  //Original from or to element got deleted. Do whatever is specified by action
507  //Warning: if there is more than one element pointing to the same
508  //from->to element after transformation the negative weight option is
509  //not safe as we sum a positive and a negative weight when
510  //consolidating.
511  if (from.second || to.second) {
512  if (action == c_zeroWeight) {
513  weight = 0;
514  } else if (action == c_negativeWeight && weight > 0) {
515  weight = -weight;
516  }
517  }
518  //add the weight to the new from->to index pair
519  lastFromIter->second[to.first] += weight;
520  }
521  }
522  //Clear the existing relation
523  elements.Delete();
524  //Fill the map into the relation
525  for (buffer_t::iterator iter = buffer.begin(); iter != buffer.end(); ++iter) {
526  add(iter->first, iter->second.begin(), iter->second.end());
527  }
528  }
529 
531 } // end namespace Belle2

◆ convertString() [1/2]

unsigned long int convertString ( const std::string &  str)

Converts a string to float.

Converts a string to type T (one of float, double, long double, int, long int, unsigned long int).

Converts a string to unsigned long int.

Converts a string to long int.

Converts a string to int.

Converts a string to long double.

Converts a string to double.

Parameters
strstring which is converted to float
Returns
converted float
Parameters
strstring which is converted to double
Returns
converted double
Parameters
strstring which is converted to long double
Returns
converted long double
Parameters
strstring which is converted to int
Returns
converted int
Parameters
strstring which is converted to long int
Returns
converted long int
Parameters
strstring which is converted to unsigned long int
Returns
converted unsigned long int

Definition at line 23 of file Conversion.cc.

24  {
25  std::string::size_type n;
26  float number = std::stof(str, &n);
27  if (n != str.size()) {
28  throw std::invalid_argument("Could only parse a part of the given string " + str);
29  }
30  return number;
31  }

◆ convertString() [2/2]

T Belle2::convertString ( const std::string &  str)

Converts a string to type T (one of float, double, long double, int, long int, unsigned long int).

Throws std::invalid_argument on conversion errors, out_of_range if T cannot hold the given value. You can catch both possible exception types of the function (invalid_argument and out_of_range) using the base class logic_error

Converts a string to type T (one of float, double, long double, int, long int, unsigned long int).

Converts a string to unsigned long int.

Converts a string to long int.

Converts a string to int.

Converts a string to long double.

Converts a string to double.

Parameters
strstring which is converted to float
Returns
converted float
Parameters
strstring which is converted to double
Returns
converted double
Parameters
strstring which is converted to long double
Returns
converted long double
Parameters
strstring which is converted to int
Returns
converted int
Parameters
strstring which is converted to long int
Returns
converted long int
Parameters
strstring which is converted to unsigned long int
Returns
converted unsigned long int

Definition at line 23 of file Conversion.cc.

◆ convertValue()

double convertValue ( double  value,
const std::string &  unitString 
)
static

Converts a floating point value to the standard framework unit.

If the given unit is not found, the value is returned unchanged (and an error printed).

Parameters
valueThe value which should be converted.
unitStringThe string of the unit of the specified value.
Returns
The value converted to the standard unit.

Definition at line 136 of file UnitConst.cc.

137  {
138  auto it = s_conversionFactors.find(unitString);
139  if (it == s_conversionFactors.end()) {
140  B2ERROR("Could not find conversion factor for unit " << unitString << ", assuming 1.0");
141  return value;
142  }
143  return it->second * value;
144  }

◆ convertValueToUnit()

double convertValueToUnit ( double  value,
const std::string &  unitString 
)
static

Converts a floating point value from the standard framework unit to the given unit.

If the given unit is not found, the value is returned unchanged (and an error printed).

Parameters
valueThe value which should be converted.
unitStringThe string of the unit of the specified value.
Returns
The value converted to the given unit.

Definition at line 146 of file UnitConst.cc.

◆ createInstance() [1/2]

void createInstance ( bool  resetIoVs = false,
LogConfig::ELogLevel  logLevel = LogConfig::c_Warning,
bool  invertLogging = false 
)
static

Method to set the database instance to a local database.

Parameters
resetIoVsA flag to indicate whether IoVs from non-primary databases should be set to the current run
logLevelThe level of log messages about not-found payloads.
invertLoggingIf true log messages will be created when a payload is found. This is intended for the local database to notify the user that a non-standard payload from a local directory is used.

Definition at line 36 of file DatabaseChain.cc.

◆ createInstance() [2/2]

void createInstance ( const std::string &  fileName = "database.txt",
const std::string &  payloadDir = "",
bool  readOnly = false,
LogConfig::ELogLevel  logLevel = LogConfig::c_Warning,
bool  invertLogging = false 
)
static

Method to set the database instance to a local database.

Parameters
fileNameThe name of the database text file with the IoV assignments.
payloadDirThe name of the directory in which the payloads are stored. By default the same directory as the one containing the database text file is used.
readOnlyIf this flag is set the database is opened in read only mode without locking.
logLevelThe level of log messages about not-found payloads.
invertLoggingIf true log messages will be created when a payload is found. This is intended for override setups where a few payloads are taken from non standard locations

Definition at line 39 of file LocalDatabase.cc.

40  {
41  boost::filesystem::path file(fileName);
42  std::string absFileDir = boost::filesystem::absolute(file.parent_path()).string();
43  std::string payloads = boost::filesystem::absolute(payloadDir).string();
44  boost::algorithm::trim_right_if(absFileDir, boost::is_any_of("/"));
45  boost::algorithm::trim_right_if(payloads, boost::is_any_of("/"));
46  if (absFileDir != payloads) {
47  B2FATAL(R"warn(Local databases with payloads in different files than the text file is no longer supported:
48  Payloads need to be in the same file as the text file)warn"
49  << LogVar("filename", fileName) << LogVar("payloaddir", payloadDir));
50  }
51  }
53  }
54 
56 }

◆ createROOTObjectPyCopy()

boost::python::object Belle2::createROOTObjectPyCopy ( const T &  instance)

Create a python wrapped copy from a class instance which has a ROOT dictionary.

This piece of dark magic creates a python object referencing a ROOT object the same way as you would see it in the ROOT python module.

It will create a copy of the object using the copy constructor which is then owned by python.

Definition at line 36 of file PyObjROOTUtils.h.

◆ createScopedUpdateSession()

ScopeGuard createScopedUpdateSession ( )

Make sure we have efficient http pipelinging during initialize/beginRun but don't keep session alive for full processing time.

This will return an object which keeps the session open as long as it is alive.

Definition at line 74 of file Database.cc.

77  {
78  DBStoreEntry entry(DBStoreEntry::c_Object, name, TObject::Class(), false, true);
79  std::vector<DBQuery> query{DBQuery{name, true}};
80  getData(event, query);
81  entry.updatePayload(query[0].revision, query[0].iov, query[0].filename, query[0].checksum, event);
82  return std::make_pair(entry.releaseObject(), query[0].iov);

◆ createSocket() [1/2]

std::unique_ptr< zmq::socket_t > createSocket ( const std::string &  socketAddress)

Create a socket of the given type while deciding on the bind behaviour via the address.

An address in the form "tcp://ast:<port>" (with ast = *) means the socket is bound to a local interface. An address in the from "tcp://<host>:<port>" means it connects to the given host.

If you want to fore a given bind behaviour (and fail if the address is invalid), use the function above.

Definition at line 151 of file ZMQParent.h.

156  {
157  AZMQMessage::element_type::toSocket(std::move(message), socket);
158  }
159 

◆ createSocket() [2/2]

std::unique_ptr< zmq::socket_t > createSocket ( const std::string &  socketAddress,
bool  bind 
)

Create a socket of the given type with the given address and bind or not bind it.

Typical socket types are ZMQ_ROUTER, ZMQ_DEALER and ZMQ_STREAM.

The address needs to be in the form "tcp://ast:<port>" (with ast = *) if you want to bind to a local interface or "tcp://<host>:<port>" if you want to connect. Use the convenience function below if you want the program to decide based on your address and use this function if you want the program to force a specific bind behaviour (it will raise an exception if given an invalid address).

Definition at line 115 of file ZMQParent.h.

◆ DEFINE_UNIT() [1/2]

Belle2::DEFINE_UNIT ( cm  ,
1.   
)

Standard units with the value = 1.

Standard of [length]

◆ DEFINE_UNIT() [2/2]

Belle2::DEFINE_UNIT ( km  ,
Unit::cm 1e5 
)

Derived units.

[kilometers]

◆ DEFINE_UNIT_NAME()

Belle2::DEFINE_UNIT_NAME ( g_cm3  ,
1.  ,
"g/cm3"   
)

Practical units with the value = 1.

These units are NOT consistent with the other standard units. Please use them carefully. Standard of [density]

◆ expand()

std::string expand ( const std::string &  text)
static

Modify the given string and replace every occurence of $NAME or ${NAME} with the value of the environment variable NAME.

Variables which are not found are returned unchanged

Definition at line 70 of file EnvironmentVariables.cc.

◆ findMatchedParenthesis()

unsigned long int findMatchedParenthesis ( std::string  str,
char  open = '[',
char  close = ']' 
)

Returns position of the matched closing parenthesis if the first character in the given string contains an opening parenthesis.

Otherwise return 0.

Definition at line 24 of file GeneralCut.cc.

25  {
26  unsigned long int end = 1;
27  if (str[0] == open) {
28  unsigned int count = 1;
29  for (end = 1; end < str.size() and count > 0; ++end) {
30  if (str[end] == open) ++count;
31  else if (str[end] == close) --count;
32  }
33 
34  if (count > 0)
35  throw std::runtime_error("Variable string has an invalid format: " + str);
36  }
37  return end - 1;
38  }

◆ fromObject()

DBStoreEntry fromObject ( const std::string &  name,
const TObject *  obj,
bool  isRequired 
)
static

Construct a new DBStoreEntry with a requested name and an object directly.

The constructor arguments type, objClass and isArray will be filled correctly by looking at obj

Parameters
namename of the payload, ususally the class name of the payload but can be any string identifying the payload in the database
objinstance of an object representing the correct type
Returns
new DBStoreEntry instance with the correct name and types set

Definition at line 40 of file DBStoreEntry.cc.

41  {
42  bool isArray = dynamic_cast<const TClonesArray*>(obj) != nullptr;
43  TClass* objClass = isArray ? (dynamic_cast<const TClonesArray*>(obj)->GetClass()) : (obj->IsA());
44  return DBStoreEntry(c_Object, name, objClass, isArray, isRequired);
45  }

◆ generate_number_sequence()

std::set< int64_t > generate_number_sequence ( const std::string &  str)

Generate a sequence of numbers defined by a string.

The syntax looks like this: sequence = interval,interval,interval,... interval = begin:end number

For instance. 3,23:27,101 Would generate the following sequence of numbers 3,23,24,25,26,27,101

If intervals overlap the number is only returned once, so the following string 27,24:28,26:29 yields 24,25,26,27,28,29

Negative numbers and intervals are supported as well -3:3 yields -3,-2,-1,0,1,2,3

But reversed intervals are considered empty 5:3 yields an empty sequence

Returns a std::set, which contains the number sequence, each number (as stated above) occurs only once (obviously, since it's a set) and the numbers are ordered using the default Compare operator less<int> of std::set.

Definition at line 30 of file NumberSequence.cc.

34  {
35  tokens.push_back(last);
36  }
37 
38  // Convert tokens into intervals
39  std::vector<std::pair<int64_t, int64_t>> intervals;
40  intervals.reserve(tokens.size());
41  for (const auto& token : tokens) {
42  size_t interval_marker_position = token.find(':');
43  // Single number
44  if (interval_marker_position == std::string::npos) {
45  int64_t number = std::stol(token);
46  intervals.emplace_back(number, number);
47  } else {
48  int64_t interval_begin = std::stol(token.substr(0, interval_marker_position));
49  int64_t interval_end = std::stol(token.substr(interval_marker_position + 1));
50  intervals.emplace_back(interval_begin, interval_end);
51  }
52  }
53 
54  // Convert tokens into number sequence
55  std::set<int64_t> sequence;
56  for (const auto& interval : intervals) {
57  for (int64_t number = interval.first; number <= interval.second; ++number)
58  sequence.insert(number);
59  }
60 
61  return sequence;
62  }
63 
65 }

◆ getCurrentLogConfig()

const LogConfig & getCurrentLogConfig ( const char *  package = nullptr) const
inline

Returns the current LogConfig object used by the logging system.

Will use the configuration of the current package, if available, or the current module, if available, or, otherwise, the global configuration.

The idea is that a module can call functions in a different package, and the log configuration for that package will be used.

Definition at line 268 of file LogSystem.h.

269  {
270  const LogConfig& logConfig = it->second;
271  if (logConfig.getLogLevel() != LogConfig::c_Default)
272  return logConfig;
273  }
274  }
275  //global config
276  return m_logConfig;
277  }
278 
279  inline bool LogSystem::isLevelEnabled(LogConfig::ELogLevel level, int debugLevel, const char* package) const
280  {
281  const LogConfig& config = getCurrentLogConfig(package);
282  const LogConfig::ELogLevel logLevelLimit = config.getLogLevel();
283  const int debugLevelLimit = config.getDebugLevel();
284  return logLevelLimit <= level && (level != LogConfig::c_Debug || debugLevelLimit >= debugLevel);
285  }

◆ getData() [1/2]

std::pair< TObject *, IntervalOfValidity > getData ( const EventMetaData event,
const std::string &  name 
)

Request an object from the database.

Parameters
eventThe metadata of the event for which the object should be valid.
nameName that identifies the object in the database.
Returns
A pair containing the object and the iov for which it is valid. Ownership will be given to the caller
Warning
The returned object has to be deleted by the caller

Definition at line 84 of file Database.cc.

◆ getData() [2/2]

bool getData ( const EventMetaData event,
std::vector< DBQuery > &  query 
)

Request multiple objects from the database.

Parameters
eventThe metadata of the event for which the objects should be valid.
queryA list of DBQuery entries that contains the names of the objects to be retrieved. On return the object and iov fields are filled.

Definition at line 93 of file Database.cc.

◆ getDefaultValue()

T & getDefaultValue

Returns the default value of the parameter.

Returns
The default value of the parameter.

Definition at line 66 of file ModuleParam.templateDetails.h.

◆ getDetectorComponent()

GearDir getDetectorComponent ( const std::string &  component)

Return GearDir representing a given DetectorComponent.

Parameters
componentName of the DetectorComponent (e.g. IR, PXD)

Definition at line 307 of file Gearbox.cc.

308  {
309  return GearDir("/Detector/DetectorComponent[@name='" + component + "']/Content");
310  }

◆ getEntry()

DBStoreEntry * getEntry ( DBStoreEntry::EPayloadType  payloadType,
const std::string &  name,
const TClass *  objClass,
bool  array,
bool  required = true 
)

Returns the entry with the requested name in the DBStore.

If the DBStore entry does not exist yet it is added to the map.

If the DBStore map already contains an object under the key with a DIFFERENT type than the given type one, an error will be reported.

Parameters
payloadTypeType of the payload. Usually c_Object.
nameName under which the object is stored in the database (and in the DBStore).
objClassThe class of the object.
arrayWhether it is a TClonesArray or not.
requiredIf true emit errors if the object cannot be found
Returns
DBEntry, or nullptr if the requested type does not match the one in the DBStore

Definition at line 42 of file DBStore.cc.

◆ getField() [1/2]

B2Vector3D getField ( const B2Vector3D pos) const
inline

Calculate the magnetic field at a given position.

Parameters
posposition where the field should be evaluated in framework units.
Returns
magnetic field at pos in framework units.
Warning
The returned field is in basf2 units which is NOT Tesla. If you need the field strength in a fixed unit please divide the returned value by Unit::T or similar.

Definition at line 78 of file MagneticField.h.

◆ getField() [2/2]

void getField ( const double *  pos,
double *  field 
)
inlinestatic

return the magnetic field at a given position.

Parameters
[in]posposition in framework units, needs to be of at least size 3
[out]fieldmagnetic field field value at position pos in framework units

Definition at line 110 of file BFieldManager.h.

◆ getFile()

std::shared_ptr< TFile > getFile ( std::string  fileName,
bool  ignoreErrors = false 
)

Get a file with a specific name, if is does not exist it will be created.

If the file cannot be created and opened an error is emitted and you get an empty shared_ptr. If you don't want an error to be emitted you can provide ignoreErrors=true as second argument.

WARNING: When you get this file it is probably not set as current directory so before you use it you have to call file->cd();

Definition at line 36 of file RootFileCreationManager.cc.

37  {
38  std::shared_ptr<TFile> ptr = m_files[fileName].lock();
39  if (!ptr) {
40  // make sure stupid gDirectory is not modified ... that means that users
41  // have to ptr->cd() but plays nice with other modules which might not
42  // set their cd() correctly.
43  TDirectory::TContext gDirectoryGuard;
44  // Create shared ptr for the file which will correctly close it when the last user disconnects.
45  ptr = std::shared_ptr<TFile>(TFile::Open(fileName.c_str(), "RECREATE"), TFile_Deleter);
46  // Check if the file is actually open ... otherwise no use in returning it
47  if (!ptr || !ptr->IsOpen()) {
48  if (!ignoreErrors) B2ERROR("Could not create file " << std::quoted(fileName));
49  return nullptr;
50  }
51  //remember this ...
52  m_files[fileName] = ptr;
53  }
54  return ptr;
55  }

◆ getGlobalTags()

std::string getGlobalTags ( )

Return the global tags used by the database.

If no conditions database is configured return an empty string. If more then one database is configured return all global tags concatenated by ','

Definition at line 165 of file Database.cc.

◆ getHash()

void getHash ( unsigned char *  buff)

obtain the hash value into buff.

buff must be large enough for the chosen hash size. The values of EHashLength correspond to the number of required bytes, e.g. unsigned char hashValue[c_SHA3_512];

Definition at line 64 of file Hash.cc.

65  {
66  Keccak_HashFinal(m_instance, buff);
67  }

◆ getList()

std::vector< std::string > getList ( const std::string &  name,
const std::vector< std::string > &  fallback = {},
const std::string &  separators = " \t\n\r" 
)
static

Get a list of values from an environment variable or the given fallback list if the variable is not set.

By default the value of the environment variable is split by whitespace (" \t\n\r") but a different list of characters can be supplied, for example ":" for path lists or ", " for comma or space separated values

Definition at line 46 of file EnvironmentVariables.cc.

◆ getOrCreateList()

std::vector< std::string > getOrCreateList ( const std::string &  name,
const std::string &  fallback,
const std::string &  separators = " \t\n\r" 
)
static

Get a list of values from an environment variable or the given fallback string if the variable is not set.

By default the value of the environment variable is split by whitespace (" \t\n\r") but a different list of characters can be supplied, for example ":" for path lists or ", " for comma or space separated values

In case the variable is not set this function will convert the fallback string to a list using the same rules as would apply for the envirnoment value itself.

Definition at line 58 of file EnvironmentVariables.cc.

◆ getParam()

ModuleParam< T > & getParam ( const std::string &  name) const

Returns a reference to a parameter.

The returned parameter has already the correct type.

Throws an exception of type ModuleParameterNotFoundError if a parameter with the given name does not exist. Throws an exception of type ModuleParameterTypeError if the parameter type of does not match to the template parameter.

Parameters
nameThe unique name of the parameter.
Returns
A reference to a module parameter having the correct type.

Definition at line 575 of file Module.h.

◆ getParameter()

ModuleParam< T > & getParameter ( const std::string &  name) const

Returns a reference to a parameter.

The returned parameter has already the correct type.

Throws an exception of type ModuleParameterNotFoundError if a parameter with the given name does not exist. Throws an exception of type ModuleParameterTypeError if the parameter type of does not match to the template parameter.

Parameters
nameThe unique name of the parameter.
Returns
A reference to a module parameter having the correct type.

Definition at line 90 of file ModuleParamList.templateDetails.h.

◆ getParamValuesPython()

void getParamValuesPython ( const std::string &  name,
PythonObject &  pyOutput,
bool  defaultValues 
) const

Returns a python object containing the value or default value of the given parameter.

Calls according to the parameter type a specialized converter in PyObjConvUtils.h

Parameters
nameThe unique name of the parameter.
pyOutputReference to the output object containing the parameter value or default values.
defaultValuesIf true returns a list of default values otherwise a list of the parameter values.

Definition at line 122 of file ModuleParamList.templateDetails.h.

◆ getTObject()

const TObject * getTObject ( const std::string &  path) const
overridevirtualnoexcept

Get the parameter path as a TObject.

Exceptions
gearbox::PathEmptyErrorif path is empty or does not exist
gearbox::TObjectConversionErrorif the value could not be deserialized
Parameters
pathPath of the parameter to get
Returns
pointer to object, owned and managed by gearbox. Object will be deleted once it is no longer valid (e.g. after the current run if it belongs to this run)

Implements Interface.

Definition at line 288 of file Gearbox.cc.

◆ getValue()

T & getValue

Returns the value of the parameter.

Returns
The value of the parameter.

Definition at line 60 of file ModuleParam.templateDetails.h.

◆ Instance()

DBStore & Instance ( )
static

Instance of a singleton DBStore.

This method is used to access the DBStore directly. It is used internally in the DBStore accessor classes.

Definition at line 36 of file DBStore.cc.

◆ isLevelEnabled()

bool isLevelEnabled ( LogConfig::ELogLevel  level,
int  debugLevel = 0,
const char *  package = nullptr 
) const
inline

Returns true if the given log level is allowed by the log system (i.e.

>= the system level).

Parameters
levelThe log level which should be compared with the log level of the log system
debugLevelThe level for debug messages. Only used for the debug level.
packageCurrent package (e.g. framework). NULL for package-independent config.

Definition at line 287 of file LogSystem.h.

◆ LogConnectionJSON()

LogConnectionJSON ( bool  complete = false)
explicit

The constructor.

Parameters
completeif true ignore the LogInfo settings and output all parts of the message (like file, line, etc.)

Definition at line 29 of file LogConnectionJSON.cc.

◆ makeROOTCompatible()

std::string makeROOTCompatible ( std::string  str)

Remove special characters that ROOT dislikes in branch names, e.g.

(, ), :, etc

Definition at line 74 of file MakeROOTCompatible.cc.

74  : replace) {
75  boost::replace_all(str, pair.first, pair.second);
76  }
77  const static std::regex blackList("[^a-zA-Z0-9_]");
78  return std::regex_replace(str, blackList, "");
79  }
80 
81  std::string invertMakeROOTCompatible(std::string str)
82  {
83  auto replace = getSubstitutionMap();
84  for (auto& pair : replace) {
85  boost::replace_all(str, pair.second, pair.first);
86  }
87  return str;

◆ ModuleParam()

ModuleParam ( T &  paramVariable,
const std::string &  description = "",
bool  force = false 
)
explicit

Constructor.

A parameter consists of a reference pointing to a member variable in the module which stores and allows fast access to the parameter value. In addition the type of the parameter is saved and optionally a description can be given.

Parameters
paramVariableReference to the variable which stores the parameter value.
descriptionThe optional description of the parameter.
forceIf true the parameter has to be set by the user in the steering file.

Definition at line 38 of file ModuleParam.templateDetails.h.

◆ name()

std::string name
static

Returns the name of the B2Vector.

Returns a less readable (but more compatible) name of the B2Vector3.

Definition at line 680 of file B2Vector3.h.

◆ open()

void open ( const std::string &  name = "Belle2.xml",
size_t  cacheSize = c_DefaultCacheSize 
)

Open connection to backend and parse tree.

Parameters
nameName of the tree to parse
cacheSizemaximum cache size in entries

Definition at line 126 of file Gearbox.cc.

◆ operator*=()

B2Vector3< DataType > & operator*= ( DataType  a)

scaling with real numbers

multiplication with a real number

Definition at line 605 of file B2Vector3.h.

◆ operator<<()

std::ostream& Belle2::operator<< ( std::ostream &  output,
const IntervalOfValidity iov 
)
Parameters
outputThe output stream.
iovThe IntervalOfValidity object.

Definition at line 196 of file IntervalOfValidity.cc.

197  {
198  output << iov.m_experimentLow << "," << iov.m_runLow << "," << iov.m_experimentHigh << "," << iov.m_runHigh;
199 
200  return output;
201  }

◆ operator>>()

std::istream& Belle2::operator>> ( std::istream &  input,
IntervalOfValidity iov 
)
Parameters
inputThe input stream.
iovThe InervalOfValidity object.

Definition at line 152 of file IntervalOfValidity.cc.

◆ overrideObject()

void overrideObject ( TObject *  obj,
const IntervalOfValidity iov 
)
private

Set an override object in case we want to use a different object then actually provided by the database.

Parameters
objInstance to use as payload, this entry will take over ownership.
iovinterval how long this object should be valid

Definition at line 158 of file DBStoreEntry.cc.

◆ performUpdateEvent()

void performUpdateEvent ( const EventMetaData event)
private

The main code that does an updateEvent.

Factored out so it can be used by both updateEvent and updateEvent(eventNumber).

Definition at line 177 of file DBStore.cc.

◆ poll()

int poll ( unsigned int  timeout,
AMulticastAnswer  multicastAnswer,
ASocketAnswer  socketAnswer 
) const

Poll both the multicast and the data socket until, either:

  • the timeout is raised. The method will return with 0.
  • a message came to the multicast socket. Then, the multicastAnswer will be called with the socket as an argument. If this method returns true, the polling will go on like before. If it returns false, the polling will be stopped. The return value of this function is 1.
  • a message came to the data socket. See above.

A note on the order: if there are messages on both the data socket and the multicast socket, first all messages to the multicast socket will be answered and then all messages to the data socket.

Definition at line 122 of file ZMQClient.h.

124  {m_subSocket.get()};
125  while (pollSocketVector(vector, 0) and repeat) {
126  repeat = multicastAnswer(m_subSocket);
127  }
128  }
129 
130  if (pollResult & 2) {
131  // Get all entries if possible, but do not block anymore.
132  std::vector<zmq::socket_t*> vector = {m_socket.get()};
133  while (pollSocketVector(vector, 0) and repeat) {
134  repeat = socketAnswer(m_socket);
135  }
136  }
137  } while (repeat and pollResult);
138 
139  return pollResult;
140  }
141 
142  template <class ASocketAnswer>
143  int ZMQClient::pollSocket(unsigned int timeout, ASocketAnswer socketAnswer) const
144  {
145  B2ASSERT("Can only run this on started clients", m_socket);
146  std::vector<zmq::socket_t*> vector = {m_socket.get()};
147 
148  bool repeat = true;

◆ pollMulticast()

int pollMulticast ( unsigned int  timeout,
AMulticastAnswer  multicastAnswer 
) const

Poll method to only the multicast socket.

Basically the same as the poll function to both sockets, except: If the answer function returns false, the polling will stop as above, BUT: it will first answer all messages that are already in the socket!

Definition at line 171 of file ZMQClient.h.

◆ pollSocket()

int pollSocket ( unsigned int  timeout,
ASocketAnswer  socketAnswer 
) const

Poll method to only the data socket.

Basically the same as the poll function to both sockets, except: If the answer function returns false, the polling will stop as above, BUT: it will first answer all messages that are already in the socket!

Definition at line 151 of file ZMQClient.h.

◆ random01()

double random01 ( )
inline

Generate a random double value between 0 and 1, both limits excluded.

Returns
value in (0,1)

Definition at line 250 of file RandomGenerator.h.

262  { uint64_t i; double d; } x;
263  x.i = random64() >> 12;
264  //This is a bit academic but we want (0,1) so if we happen to get
265  //exactly zero we try again. Chance is 1 in 2^52
266  if (x.i == 0) return random01();
267  x.i |= 0x3FF0000000000000ULL;
268  return x.d - 1.0;
269 #else
270  //Generate a double (0,1) the traditional way by multiplying it with a
271  //constant. As doubles only have a precision of 52 bits we need to
272  //remove the 12 leading bits from our random int value
273  const uint64_t x = random64() >> 12;
274  //This is a bit academic but we want (0,1) so if we happen to get
275  //exactly zero we try again. Chance is 1 in 2^52
276  if (!x) return random01();
277  //return x / 2^{52};
278  return x * 2.220446049250313080847263336181640625e-16;
279 #endif
280  }
282 }

◆ random64()

uint64_t random64 ( )
inline

Generate one 64bit unsigned integer between 0 and UINT64_MAX (both inclusive).

Returns
random value in [0, UINT64_MAX]

Definition at line 210 of file RandomGenerator.h.

◆ rebuild()

void rebuild ( bool  force = false)
protected

Rebuild the index.

Parameters
forceif force is true, the index will be rebuild even if the RelationArray says that it has not been modified

Definition at line 164 of file RelationIndexContainer.h.

191  {
192  const RelationElement& r = m_storeRel[i];
193  RelationElement::index_type idxFrom = r.getFromIndex();
194  if (idxFrom >= nFrom)
195  B2FATAL("Relation " << m_storeRel.getName() << " is inconsistent: from-index (" << idxFrom << ") out of range");
196  const FROM* from = storeFrom[idxFrom];
197 
198  //Loop over index and weight vector at once
199  const auto& indices = r.getToIndices();
200  const auto& weights = r.getWeights();
201  auto itIdx = indices.begin();
202  auto itWgt = weights.begin();
203  const auto& idxEnd = indices.end();
204  for (; itIdx != idxEnd; ++itIdx, ++itWgt) {
205  const RelationElement::index_type idxTo = *itIdx;
206  if (idxTo >= nTo)
207  B2FATAL("Relation " << m_storeRel.getName() << " is inconsistent: to-index (" << idxTo << ") out of range");
208  const TO* to = storeTo[idxTo];
209  m_index.insert(Element(idxFrom, idxTo, from, to, *itWgt));
210  }
211  }
212  }
213 
215 } // end namespace Belle2

◆ reset() [1/2]

void reset ( bool  keepConfig = false)
static

Reset the database instance.

Parameters
keepConfigif true the configuration object itself is not resetted so that initializing the database again will result in the same configuration as before. This is useful when running process multiple times.

Definition at line 62 of file Database.cc.

◆ reset() [2/2]

void reset ( bool  keepEntries = false)

Invalidate all payloads.

Parameters
keepEntriesKeep the existing entries so that future calls to update the database will try to obtain the payloads which were registered so far.

Definition at line 185 of file DBStore.cc.

◆ RndmArray() [1/4]

void RndmArray ( Int_t  n,
Double_t *  array 
)
inline

Fill an array of doubles with random values in (0,1), both limits excluded.

Parameters
nnumber of doubles to generate
arraypointer to an array where the numbers should be stored

Definition at line 229 of file RandomGenerator.h.

◆ RndmArray() [2/4]

void RndmArray ( Int_t  n,
Float_t *  array 
)
inline

Fill an array of floats with random values in (0,1), both limits excluded.

Parameters
nnumber of floats to generate
arraypointer to an array where the numbers should be stored

Definition at line 222 of file RandomGenerator.h.

◆ RndmArray() [3/4]

void RndmArray ( Int_t  n,
UInt_t *  array 
)
inline

Fill an array of unsigned integers with random values in [0, UINT32_MAX], both limits included.

Parameters
nnumber of ints to generate
arraypointer to an array where the numbers should be stored

Definition at line 241 of file RandomGenerator.h.

◆ RndmArray() [4/4]

void RndmArray ( Int_t  n,
ULong64_t *  array 
)
inline

Fill an array of unsigned 64bit integers with random values in [0, UINT64_MAX], both limits included.

Parameters
nnumber of ints to generate
arraypointer to an array where the numbers should be stored

Definition at line 235 of file RandomGenerator.h.

◆ select()

void select ( const std::function< bool(const StoredClass *)> &  f)

This method is the actual worker.

It selects the elements, fill the subset and all the relations in which the subset is involved.

Parameters
fthe pointer to the function (or a nameless lambda expression) returning true for the elements to be selected and false for the others.

Definition at line 423 of file SelectSubset.h.

423  {
425  }
426  }
428 }

◆ sendMessage()

bool sendMessage ( const LogMessage message)
overridevirtual

Sends a log message.

Parameters
messageThe log message object.
Returns
Returns true if the message could be send.

Implements LogConnectionBase.

Definition at line 33 of file LogConnectionJSON.cc.

◆ setBackends()

void setBackends ( const std::vector< std::string > &  backends)

Select the backends to use to find resources.

Parameters
backendslist of URIs identifying the backends starting with the handler prefix followed by a colon, the rest is handler specific

Definition at line 92 of file Gearbox.cc.

◆ setDefaultValue()

void setDefaultValue ( const T &  defaultValue)

Sets the default value of a parameter.

Parameters
defaultValueThe parameter default value of the parameter.

Definition at line 52 of file ModuleParam.templateDetails.h.

◆ setMeanCov() [1/2]

bool setMeanCov ( const TVector3 &  mean,
const TMatrixTBase< value_type > &  cov 
)

set mean and covariance matrix from ROOT vector/matrix objects, e.g.

TMatrixD, TMatrixF, TMatrixDSym and so forth but with exactly three dimensions

Parameters
meanVector of mean values
covMatrix containing the covariance values
Returns
true if covariance could be decomposited, false otherwise

Definition at line 199 of file MultivariateNormalGenerator.h.

◆ setMeanCov() [2/2]

bool setMeanCov ( const TVectorT< value_type > &  mean,
const TMatrixTBase< value_type > &  cov 
)

set mean and covariance matrix from ROOT vector/matrix objects, e.g.

TMatrixD, TMatrixF, TMatrixDSym and so forth

Parameters
meanVector of mean values
covMatrix containing the covariance values
Returns
true if covariance could be decomposited, false otherwise

Definition at line 185 of file MultivariateNormalGenerator.h.

◆ setParameter()

void setParameter ( const std::string &  name,
const T &  value 
)

Sets the value of a parameter given by its name.

A template based method which is invoked by the module.

Parameters
nameThe unique name of the parameter.
valueThe parameter value which should be assigned to the parameter given by its name.

Definition at line 79 of file ModuleParamList.templateDetails.h.

◆ setParamPython()

void setParamPython ( const std::string &  name,
const PythonObject &  pyObj 
)

Implements a method for setting boost::python objects.

The method supports the following types: dict, list, int, double, string, bool The conversion of the python object to the C++ type and the final storage of the parameter value is done by specialized converter in PyObjConvUtils.h

Parameters
nameThe unique name of the parameter.
pyObjThe object which should be converted and stored as the parameter value.

Definition at line 114 of file ModuleParamList.templateDetails.h.

◆ setValue()

void setValue ( const T &  value)

Sets the value of a parameter.

Parameters
valueThe parameter value which should be assigned to the parameter.

Definition at line 45 of file ModuleParam.templateDetails.h.

◆ setValueFromPythonObject()

void setValueFromPythonObject ( const boost::python::object &  pyObject)
finalvirtual

Implements a method for setting boost::python objects.

The method supports the following types: list, dict, int, double, string, bool The conversion of the python object to the C++ type and the final storage of the parameter value is done by PyObjConvUtils::convertPythonObject.

Parameters
pyObjectThe object which should be converted and stored as the parameter value.

Definition at line 72 of file ModuleParam.templateDetails.h.

◆ setValueToPythonObject()

void setValueToPythonObject ( boost::python::object &  pyObject,
bool  defaultValues = false 
) const
finalvirtual

Returns a python object containing the value or the default value of the given parameter.

Parameters
pyObjectReference to the python object which is set to the parameter value.
defaultValuesIf true returns default value otherwise parameter value.

Definition at line 78 of file ModuleParam.templateDetails.h.

◆ storeData() [1/2]

bool storeData ( const std::string &  name,
TObject *  object,
const IntervalOfValidity iov 
)

Store an object in the database.

Parameters
nameName that identifies the object in the database.
objectThe object that should be stored in the database.
iovThe interval of validity of the the object.
Returns
True if the storage of the object succeeded.

Definition at line 152 of file Database.cc.

◆ storeData() [2/2]

bool storeData ( std::list< DBImportQuery > &  query)

Store multiple objects in the database.

Parameters
queryA list of DBImportQuery entries that contains the objects, their names, and their intervals of validity.
Returns
True if the storage of the object succeeded.

Definition at line 145 of file Database.cc.

◆ TypeInfo()

std::string TypeInfo
static

Static function to generate a string description for the parameter type.

This string will be used to identify the contained type and guaranties some level of type safety in this type erasure.

Definition at line 32 of file ModuleParam.templateDetails.h.

◆ update() [1/2]

void update ( )

Updates all objects that are outside their interval of validity.

This method is called by the framework for each new run.

Definition at line 87 of file DBStore.cc.

◆ update() [2/2]

void update ( const EventMetaData event)

Updates all objects that are outside their interval of validity.

This method is for calling the DBStore manually using an EventMetaData object instead of relying on the DataStore containing one.

Definition at line 105 of file DBStore.cc.

◆ updateEvent() [1/2]

void updateEvent ( )

Updates all intra-run dependent objects.

This method is called by the framework for each event.

Definition at line 150 of file DBStore.cc.

◆ updateEvent() [2/2]

void updateEvent ( const unsigned int  eventNumber)

Updates all intra-run dependent objects.

This method is for specifying the event number to update to manually. Updates the m_manualEvent to use the event number given in the argument, before performing the intra-run update. This doesn't alter/use the DataStore EventMetaData.

Definition at line 161 of file DBStore.cc.

◆ updateObject()

void updateObject ( const EventMetaData event)
private

update the payload object according to the new event information.

If the payload has no intra run dependency this does nothing, otherwise it will load the appropirate object for the given event and call the update notifications on changes to the object.

Definition at line 57 of file DBStoreEntry.cc.

◆ updatePayload()

void updatePayload ( unsigned int  revision,
const IntervalOfValidity iov,
const std::string &  filename,
const std::string &  checksum,
const EventMetaData event 
)
private

Update the payload information for this entry and if appropriate open the new file and extract the object as needed.

If another version is already loaded the object will be deleted and the file closed.

If neither revision or filename change we assume the payload is not modified and will not update anything and not call any update notifications.

Parameters
revisionnew revision of the payload
iovnew interval of validity for the payload
filenamefilename for the payload

Definition at line 84 of file DBStoreEntry.cc.

◆ ~DBStoreEntry()

Clean up memory.

Some of the members are raw pointers to limit the include burden on this class as it will be included by anyone using Conditions data

Definition at line 47 of file DBStoreEntry.cc.

Belle2::ProcType::c_Monitor
@ c_Monitor
Monitoring Process.
Belle2::ProcType::c_Output
@ c_Output
Output Process.
_PACKAGE_
#define _PACKAGE_
make sure REG_MODULE works outside the normal build system
Definition: Module.h:645
Belle2::B2Vector3::name
static std::string name()
Returns the name of the B2Vector.
Definition: B2Vector3.h:680
Belle2::Database::getData
std::pair< TObject *, IntervalOfValidity > getData(const EventMetaData &event, const std::string &name)
Request an object from the database.
Definition: Database.cc:84
Belle2::operator<<
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Definition: IntervalOfValidity.cc:196
Belle2::RelationIndexContainer::m_index
ElementIndex m_index
Instance of the index.
Definition: RelationIndexContainer.h:145
Belle2::DBStoreEntry::c_Object
@ c_Object
A ROOT file containing a object with the name of the DBStoreEntry.
Definition: DBStoreEntry.h:58
Belle2::ZMQClient::pollSocketVector
static int pollSocketVector(const std::vector< zmq::socket_t * > &socketList, int timeout)
Internal poll function.
Definition: ZMQClient.cc:118
Belle2::ModuleParamList::m_paramMap
std::map< std::string, ModuleParamPtr > m_paramMap
Stores the module parameters together with a string name as key.
Definition: ModuleParamList.h:216
Belle2::DBStoreEntry::isRequired
bool isRequired() const
check whether this payload is required for operation
Definition: DBStoreEntry.h:112
Belle2::RelationArray::c_negativeWeight
@ c_negativeWeight
Flip the sign of the weight to become negative if the original element got re-attributed.
Definition: RelationArray.h:89
Belle2::ZMQClient::pollSocket
int pollSocket(unsigned int timeout, ASocketAnswer socketAnswer) const
Poll method to only the data socket.
Definition: ZMQClient.h:151
Belle2::RelationArray::consolidation_type
std::pair< index_type, bool > consolidation_type
Typedef declaring the return value of any consolidation mapping.
Definition: RelationArray.h:98
Belle2::DBStoreEntry::isArray
bool isArray() const
get whether this payload is an array of objects or a single objects
Definition: DBStoreEntry.h:110
Belle2::ZMQClient::m_socket
std::unique_ptr< zmq::socket_t > m_socket
ZMQ socket.
Definition: ZMQClient.h:118
Belle2::StoreAccessorBase::getName
const std::string & getName() const
Return name under which the object is saved in the DataStore.
Definition: StoreAccessorBase.h:130
Belle2::invertMakeROOTCompatible
std::string invertMakeROOTCompatible(std::string str)
Invert makeROOTCompatible operation.
Definition: MakeROOTCompatible.cc:89
Belle2::RelationArray::c_zeroWeight
@ c_zeroWeight
Set the weight of the relation to 0 if the original element got re-attributed.
Definition: RelationArray.h:90
Belle2::DBStoreEntry::DBStoreEntry
DBStoreEntry(EPayloadType type, const std::string &name, const TClass *objClass, bool isArray, bool isRequired)
Construct a new DBStoreEntry.
Definition: DBStoreEntry.h:68
Belle2::LogConfig::ELogLevel
ELogLevel
Definition of the supported log levels.
Definition: LogConfig.h:36
Belle2::ProcType::c_Init
@ c_Init
Before the forks, the process is in init state.
Belle2::Unit::s_conversionFactors
static std::map< std::string, double > s_conversionFactors
Map to be able to convert between units using string representations of the unit name.
Definition: Unit.h:173
Belle2::ProcType::c_Stopped
@ c_Stopped
The process is stopped/killed.
Belle2::Utils::Timer
Small helper class that prints its lifetime when destroyed.
Definition: Utils.h:72
Belle2::DBStoreEntry::fromObject
static DBStoreEntry fromObject(const std::string &name, const TObject *obj, bool isRequired)
Construct a new DBStoreEntry with a requested name and an object directly.
Definition: DBStoreEntry.cc:40
Belle2::ProcType::c_Input
@ c_Input
Input Process.
Belle2::ProcType::c_Worker
@ c_Worker
Worker/Reconstruction Process.
Belle2::LogSystem::m_logConfig
LogConfig m_logConfig
The global log system configuration.
Definition: LogSystem.h:217
Belle2::DBStore::m_storeEvent
StoreObjPtr< EventMetaData > m_storeEvent
StoreObjPtr for the EventMetaData to get the current experiment and run from the DataStore.
Definition: DBStore.h:189
Belle2::RootFileCreationManager::m_files
std::map< std::string, std::weak_ptr< TFile > > m_files
store for the open files
Definition: RootFileCreationManager.h:75
Belle2::RelationIndexContainer::m_storeRel
RelationArray m_storeRel
the underlying relation.
Definition: RelationIndexContainer.h:148
REGISTER_PYTHON_MODULE_AUTOIMPORT
#define REGISTER_PYTHON_MODULE_AUTOIMPORT(moduleName)
Identical to REGISTER_PYTHON_MODULE(), but will also import the module into the global namespace afte...
Definition: RegisterPythonModule.h:84
Belle2::ModuleParamList::addParameter
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Definition: ModuleParamList.templateDetails.h:38
Belle2::RandomGenerator::random64
uint64_t random64()
Generate one 64bit unsigned integer between 0 and UINT64_MAX (both inclusive).
Definition: RandomGenerator.h:210
Belle2::Conditions::Configuration::getInstance
static Configuration & getInstance()
Get a reference to the instance which will be used when the Database is initialized.
Belle2::RelationArray::c_deleteElement
@ c_deleteElement
Delete the whole relation element if the original element got re-attributed.
Definition: RelationArray.h:91
Belle2::getSubstitutionMap
std::map< std::string, std::string > getSubstitutionMap()
Substituation map for makeROOTCompatible.
Definition: MakeROOTCompatible.cc:32
Belle2::SHA3Hash::m_instance
KeccakHashInstance * m_instance
memory structure to calculate the hash value
Definition: Hash.h:53
Belle2::B2Vector3::B2Vector3
B2Vector3(void)
empty Constructor sets everything to 0
Definition: B2Vector3.h:66
Belle2::RelationElement::index_type
unsigned int index_type
type used for indices.
Definition: RelationElement.h:37
LogVar
Class to store variables with their name which were sent to the logging service.
Definition: LogVariableStream.h:24
Belle2::LogSystem::getCurrentLogConfig
const LogConfig & getCurrentLogConfig(const char *package=nullptr) const
Returns the current LogConfig object used by the logging system.
Definition: LogSystem.h:268
Belle2::RelationArray::add
void add(index_type from, index_type to, weight_type weight=1.0)
Add a new element to the relation.
Definition: RelationArray.h:291
Belle2::Module::m_moduleParamList
ModuleParamList m_moduleParamList
List storing and managing all parameter of the module.
Definition: Module.h:518
Belle2::DBStore::m_dbEntries
std::unordered_map< std::string, DBStoreEntry > m_dbEntries
Map names to DBEntry objects.
Definition: DBStore.h:181
Belle2::RandomGenerator::random01
double random01()
Generate a random double value between 0 and 1, both limits excluded.
Definition: RandomGenerator.h:250
Belle2::LogConfig::c_Debug
@ c_Debug
Debug: for code development.
Definition: LogConfig.h:36
Belle2::LogConfig::c_Default
@ c_Default
Default: use globally configured log level.
Definition: LogConfig.h:42
BELLE2_DEFINE_EXCEPTION
#define BELLE2_DEFINE_EXCEPTION(ClassName, Message)
Macro that defines an exception with the given message template.
Definition: FrameworkExceptions.h:46
Belle2::ZMQClient::m_subSocket
std::unique_ptr< zmq::socket_t > m_subSocket
ZMQ sub socket.
Definition: ZMQClient.h:116
Belle2::SelectSubsetBase::swapSetsAndDestroyOriginal
void swapSetsAndDestroyOriginal()
Swap set and subset (+relations), and keep only the reduced set.
Definition: SelectSubset.cc:7
Belle2::LogSystem::isLevelEnabled
bool isLevelEnabled(LogConfig::ELogLevel level, int debugLevel=0, const char *package=nullptr) const
Returns true if the given log level is allowed by the log system (i.e.
Definition: LogSystem.h:287
Belle2::Conditions::Configuration::prependTestingPayloadLocation
void prependTestingPayloadLocation(const std::string &filename)
Prepend a local text file with testing payloads to the list.
Definition: Configuration.h:205
Belle2::ProcType::c_Proxy
@ c_Proxy
Multicast Proxy Process.
Belle2::Database::DBQuery
Conditions::PayloadMetadata DBQuery
Struct for bulk read queries.
Definition: Database.h:74
Belle2::ModuleParamList::setParameter
void setParameter(const std::string &name, const T &value)
Sets the value of a parameter given by its name.
Definition: ModuleParamList.templateDetails.h:79
Belle2::DBStore::m_intraRunDependencies
std::set< DBStoreEntry * > m_intraRunDependencies
List of intra-run dependent conditions.
Definition: DBStore.h:184