17#include "gtest/gtest.h"
18#include "framework/core/RandomNumbers.h"
19#include <framework/logging/LogSystem.h>
20#include <framework/logging/LogConfig.h>
21#include <framework/dbobjects/MagneticField.h>
22#include <framework/dbobjects/MagneticFieldComponentConstant.h>
23#include <mdst/dbobjects/CollisionInvariantMass.h>
24#include <mdst/dbobjects/CollisionBoostVector.h>
25#include <mdst/dbobjects/CollisionAxisCMS.h>
26#include <mdst/dbobjects/BeamSpot.h>
27#include <framework/database/DBStore.h>
34 class TestEventListener:
public ::testing::EmptyTestEventListener {
37 explicit TestEventListener(
bool debug): ::testing::EmptyTestEventListener(), m_enableDebug{debug} {}
42 virtual void OnTestStart(const ::testing::TestInfo& test)
final override
48 std::string name = test.test_case_name();
52 Belle2::MagneticField* field =
new Belle2::MagneticField();
53 field->addComponent(
new Belle2::MagneticFieldComponentConstant({0, 0, 1.5 *
Belle2::Unit::T}));
61 auto* collisionInvariantMass =
new Belle2::CollisionInvariantMass();
62 collisionInvariantMass->setMass(10.579557836806245064, 0, 0);
65 auto* collisionBoostVector =
new Belle2::CollisionBoostVector();
66 collisionBoostVector->setBoost(TVector3(0.041488088603337358595, 0, 0.27252546681036521337), TMatrixDSym(3));
69 auto* collisionAxisCMS =
new Belle2::CollisionAxisCMS();
70 collisionAxisCMS->setAngles(0.0057699660560828307243, 0, TMatrixDSym(2));
71 collisionAxisCMS->setSpread(TMatrixDSym(2), 0, 0, 0);
75 auto* beamSpot =
new Belle2::BeamSpot();
80 virtual void OnTestEnd(const ::testing::TestInfo&)
final override
91int main(
int argc,
char** argv)
93 ::testing::InitGoogleTest(&argc, argv);
94 ::testing::UnitTest& unit_test = *::testing::UnitTest::GetInstance();
96 for (
int i = 1; i < argc; ++i) {
97 if (std::string(argv[i]) ==
"--debug") debug =
true;
99 unit_test.listeners().Append(
new TestEventListener(debug));
100 return RUN_ALL_TESTS();
void setDebugLevel(int debugLevel)
Configure the debug messaging level.
@ c_Debug
Debug: for code development.
void setLogLevel(ELogLevel logLevel)
Configure the log level.
void resetLogging()
Reset logging system to defaults: empty all log messages and reset connections to the default.
LogConfig * getLogConfig()
Returns global log system configuration.
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
static void initialize()
Initialize the random number generator with a unique random seed;.
static const double T
[tesla]
static DBStore & Instance()
Instance of a singleton DBStore.
void addConstantOverride(const std::string &name, TObject *obj, bool oneRun=false)
Add constant override payload.