Belle II Software development
Utilities.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#ifndef TRGUtilities_FLAG_
10#define TRGUtilities_FLAG_
11
12#include <string>
13
14#ifdef TRG_SHORT_NAMES
15#define TRGUtil TRGUtilities
16#endif
17
18namespace Belle2 {
26
27 public: // Utility functions
28
30 static std::string itostring(int i);
31
33 static std::string dtostring(double d, unsigned int precision);
34
36 static std::string carstring(const std::string& s);
37
39 static std::string cdrstring(const std::string& s);
40
42 static std::string dateString(void);
43
45 static std::string dateStringF(void);
46
48 static void bitDisplay(unsigned);
49
51 static void bitDisplay(unsigned val,
52 unsigned firstDigit,
53 unsigned lastDigit);
54
56 static std::string streamDisplay(unsigned);
57
59 static std::string streamDisplay(unsigned,
60 unsigned firstDigit,
61 unsigned lastDigit);
62
63 };
64
65//-----------------------------------------------------------------------------
66
68} // namespace Belle2
69
70#endif /* TRGUtilities_FLAG_ */
A class to provide TRG utility functions.
Definition: Utilities.h:25
static std::string dateStringF(void)
returns date string for filename.
Definition: Utilities.cc:38
static std::string dateString(void)
returns date string.
Definition: Utilities.cc:26
static std::string cdrstring(const std::string &s)
CERNLIB cdr.
Definition: Utilities.cc:88
static std::string itostring(int i)
converts int to string. (Use boost::lexical_cast)
Definition: Utilities.cc:50
static std::string dtostring(double d, unsigned int precision)
converts double to string.
Definition: Utilities.cc:60
static std::string carstring(const std::string &s)
CERNLIB car.
Definition: Utilities.cc:68
static void bitDisplay(unsigned)
Dumps bit contents to cout.
Definition: Utilities.cc:109
static std::string streamDisplay(unsigned)
Dumps bit stream in string.
Definition: Utilities.cc:136
Abstract base class for different kinds of events.