9#include <hlt/softwaretrigger/core/SoftwareTriggerCut.h>
10#include <gtest/gtest.h>
20 namespace SoftwareTrigger {
28 SoftwareTriggerObject object;
44 TEST_F(SoftwareTriggerCutTest, prescalingRandom)
47 SoftwareTriggerObject object;
51 for (
unsigned int i = 0; i < 1e3; i++) {
57 for (
unsigned int i = 0; i < 1e3; i++) {
62 for (
unsigned int i = 0; i < 1e3; i++) {
67 for (
unsigned int i = 0; i < 1e3; i++) {
73 unsigned int numberOfYes = 0;
74 unsigned int numberOfNo = 0;
75 for (
unsigned int i = 0; i < 1e4; i++) {
76 const auto cutResult = cut->checkPreScaled(
object);
87 EXPECT_EQ(numberOfYes, 1022);
88 EXPECT_EQ(numberOfNo, 1e4 - 1022);
92 TEST_F(SoftwareTriggerCutTest, prescalingCounter)
95 SoftwareTriggerObject object;
99 for (uint32_t i = 0; i < 1e3; i++) {
105 for (uint32_t i = 0; i < 1e3; i++) {
110 for (uint32_t i = 0; i < 1e3; i++) {
115 for (uint32_t i = 0; i < 1e3; i++) {
121 uint32_t counter = 0;
122 uint32_t numberOfYes = 0;
123 uint32_t numberOfNo = 0;
125 for (uint32_t i = 0; i < 729; i++) {
126 const auto cutResult = cut->check(
object, &counter).first;
134 uint32_t expectedYes = (729 / 10) + 1;
135 EXPECT_EQ(numberOfYes, expectedYes);
136 EXPECT_EQ(numberOfNo, 729 - expectedYes);
143 for (uint32_t i = 1; i <= 544; i++) {
144 const auto cutResult = cut->check(
object, &counter).first;
152 expectedYes = (544 / 7);
153 EXPECT_EQ(numberOfYes, expectedYes);
154 EXPECT_EQ(numberOfNo, 544 - expectedYes);
Base class for the cut tests.
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...
@ c_accept
Accept this event.
@ c_reject
Reject this event.
@ c_noResult
There were not enough information to decide on what to do with the event.
Abstract base class for different kinds of events.