9 #include <mdst/dbobjects/DBRepresentationOfSoftwareTriggerCut.h>
10 #include <hlt/softwaretrigger/core/SoftwareTriggerCut.h>
11 #include <hlt/softwaretrigger/core/SoftwareTriggerDBHandler.h>
14 #include <framework/utilities/TestHelpers.h>
15 #include <gtest/gtest.h>
24 namespace SoftwareTrigger {
36 DataStore::Instance().setInitializeActive(
true);
38 DataStore::Instance().setInitializeActive(
false);
45 std::filesystem::remove_all(
"testPayloads");
46 DataStore::Instance().reset();
51 TEST_F(DBRepresentationOfSoftwareTriggerCutTest, basic)
53 auto cut = SoftwareTriggerCut::compile(
"1 == 2", 10,
true);
55 auto returnedCut = SoftwareTriggerDBHandler::createCutFromDB(representation);
57 EXPECT_EQ(cut->decompile(), returnedCut->decompile());
58 EXPECT_EQ(cut->getPreScaleFactor(), returnedCut->getPreScaleFactor());
59 EXPECT_EQ(cut->isRejectCut(), returnedCut->isRejectCut());
61 auto cut2 = SoftwareTriggerCut::compile(
"1 == 2", 10,
false);
63 auto returnedCut2 = SoftwareTriggerDBHandler::createCutFromDB(representation2);
65 EXPECT_EQ(cut2->decompile(), returnedCut2->decompile());
66 EXPECT_EQ(cut2->getPreScaleFactor(), returnedCut2->getPreScaleFactor());
67 EXPECT_EQ(cut2->isRejectCut(), returnedCut2->isRejectCut());
Class to handle storing SoftwareTriggerCuts in the database.
Class to test the db representation of the cuts.
void SetUp()
Setup the local DB and the datastore with the event meta data.
TestHelpers::TempDirCreator tmp_dir
Do everything in a temporary dir.
void TearDown()
Destroy the DB and the DataStore.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Type-safe access to single objects in the data store.
bool construct(Args &&... params)
Construct an object of type T in this StoreObjPtr, using the provided constructor arguments.
changes working directory into a newly created directory, and removes it (and contents) on destructio...
TEST_F(GlobalLabelTest, LargeNumberOfTimeDependentParameters)
Test large number of time-dep params for registration and retrieval.
Abstract base class for different kinds of events.