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 {
45 std::filesystem::remove_all(
"testPayloads");
51 TEST_F(DBRepresentationOfSoftwareTriggerCutTest, basic)
57 EXPECT_EQ(cut->decompile(), returnedCut->decompile());
58 EXPECT_EQ(cut->getPreScaleFactor(), returnedCut->getPreScaleFactor());
59 EXPECT_EQ(cut->isRejectCut(), returnedCut->isRejectCut());
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.
static DataStore & Instance()
Instance of singleton Store.
void setInitializeActive(bool active)
Setter for m_initializeActive.
void reset(EDurability durability)
Frees memory occupied by data store items and removes all objects from the map.
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.
static std::unique_ptr< SoftwareTriggerCut > compile(const std::string &cut_string, const unsigned int prescaleFactor, const bool rejectCut=false)
Compile a new SoftwareTriggerCut from a cut string (by using the GeneralCut::compile function) and an...
static std::unique_ptr< SoftwareTriggerCut > createCutFromDB(const DBRepresentationOfSoftwareTriggerCut &dbCut)
Helper factory function to generate a unique cut pointer from its representation in the database.
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...
Abstract base class for different kinds of events.