File indexing completed on 2024-04-06 12:13:59
0001 #include "catch.hpp"
0002 #include "FWCore/TestProcessor/interface/TestProcessor.h"
0003 #include "FWCore/Utilities/interface/Exception.h"
0004
0005 static constexpr auto s_tag = "[Pythia8GeneratorFilter]";
0006
0007 TEST_CASE("Standard checks of Pythia8GeneratorFilter", s_tag) {
0008 const std::string baseConfig{
0009 R"_(from FWCore.TestProcessor.TestProcess import *
0010 process = TestProcess()
0011 process.load("Configuration.StandardSequences.SimulationRandomNumberGeneratorSeeds_cff")
0012 process.RandomNumberGeneratorService.toTest = process.RandomNumberGeneratorService.generator.clone()
0013 process.toTest = cms.EDFilter("Pythia8GeneratorFilter",
0014 comEnergy = cms.double(7000.),
0015 PythiaParameters = cms.PSet(
0016 pythia8_example02 = cms.vstring('HardQCD:all = on',
0017 'PhaseSpace:pTHatMin = 20.'),
0018 parameterSets = cms.vstring('pythia8_example02')
0019 )
0020 )
0021 process.moduleToTest(process.toTest)
0022 )_"};
0023
0024 edm::test::TestProcessor::Config config{baseConfig};
0025 SECTION("base configuration is OK") { REQUIRE_NOTHROW(edm::test::TestProcessor(config)); }
0026
0027 SECTION("No event data") {
0028 edm::test::TestProcessor tester(config);
0029
0030 REQUIRE_NOTHROW(tester.test());
0031 }
0032
0033 SECTION("beginJob and endJob only") {
0034 edm::test::TestProcessor tester(config);
0035
0036 REQUIRE_NOTHROW(tester.testBeginAndEndJobOnly());
0037 }
0038
0039 SECTION("Run with no LuminosityBlocks") {
0040 edm::test::TestProcessor tester(config);
0041
0042 REQUIRE_NOTHROW(tester.testRunWithNoLuminosityBlocks());
0043 }
0044
0045 SECTION("LuminosityBlock with no Events") {
0046 edm::test::TestProcessor tester(config);
0047
0048 REQUIRE_NOTHROW(tester.testLuminosityBlockWithNoEvents());
0049 }
0050 }
0051
0052