From e4b542f37798bc22130f61fd4d8b5f910fa9f3f6 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 11 Sep 2025 14:00:11 -0500 Subject: [PATCH] Remove unused DetSetVector test in FWCore/Integration The test code has never been run automatically. These test do not do anything unique so are not necessary. --- FWCore/Framework/test/stubs/ToyAnalyzers.cc | 99 ------------------- FWCore/Framework/test/stubs/ToyModules.cc | 71 ------------- FWCore/Integration/test/detsetvector_t.sh | 6 -- FWCore/Integration/test/detsetvector_t_cfg.py | 27 ----- FWCore/Integration/test/newdetsetvector_t.sh | 7 -- .../Integration/test/newdetsetvector_t_cfg.py | 27 ----- 6 files changed, 237 deletions(-) delete mode 100755 FWCore/Integration/test/detsetvector_t.sh delete mode 100644 FWCore/Integration/test/detsetvector_t_cfg.py delete mode 100755 FWCore/Integration/test/newdetsetvector_t.sh delete mode 100644 FWCore/Integration/test/newdetsetvector_t_cfg.py diff --git a/FWCore/Framework/test/stubs/ToyAnalyzers.cc b/FWCore/Framework/test/stubs/ToyAnalyzers.cc index a361a6c9c4c36..ebd757f6f0918 100644 --- a/FWCore/Framework/test/stubs/ToyAnalyzers.cc +++ b/FWCore/Framework/test/stubs/ToyAnalyzers.cc @@ -318,36 +318,6 @@ namespace edmtest { edm::InputTag moduleLabel_; }; - //-------------------------------------------------------------------- - // - class SCSimpleAnalyzer : public edm::global::EDAnalyzer<> { - public: - SCSimpleAnalyzer(edm::ParameterSet const&) {} - - void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const final; - }; - - void SCSimpleAnalyzer::analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const { - // Get the product back out; it should be sorted. - edm::Handle h; - e.getByLabel("scs", h); - assert(h.isValid()); - - // Check the sorting. DO NOT DO THIS IN NORMAL CODE; we are - // copying all the values out of the SortedCollection so we can - // manipulate them via an interface different from - // SortedCollection, just so that we can make sure the collection - // is sorted. - std::vector after(h->begin(), h->end()); - typedef std::vector::size_type size_type; - - // Verify that the vector *is* sorted. - - for (size_type i = 1, end = after.size(); i < end; ++i) { - assert(after[i - 1].id() < after[i].id()); - } - } - //-------------------------------------------------------------------- // // Consumes View @@ -383,82 +353,15 @@ namespace edmtest { bool const checkSize_; }; - //-------------------------------------------------------------------- - // - class DSVAnalyzer : public edm::global::EDAnalyzer<> { - public: - DSVAnalyzer(edm::ParameterSet const&) {} - - void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const final; - - private: - void do_sorted_stuff(edm::Event const& e) const; - void do_unsorted_stuff(edm::Event const& e) const; - }; - - void DSVAnalyzer::analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const { - do_sorted_stuff(e); - do_unsorted_stuff(e); - } - - void DSVAnalyzer::do_sorted_stuff(edm::Event const& e) const { - typedef DSVSimpleProduct product_type; - typedef product_type::value_type detset; - typedef detset::value_type value_type; - // Get the product back out; it should be sorted. - edm::Handle h; - e.getByLabel("dsv1", h); - assert(h.isValid()); - - // Check the sorting. DO NOT DO THIS IN NORMAL CODE; we are - // copying all the values out of the DetSetVector's first DetSet so we can - // manipulate them via an interface different from - // DetSet, just so that we can make sure the collection - // is sorted. - std::vector const& after = (h->end() - 1)->data; - typedef std::vector::size_type size_type; - - // Verify that the vector *is* sorted. - - for (size_type i = 1, end = after.size(); i < end; ++i) { - assert(after[i - 1].data < after[i].data); - } - } - - void DSVAnalyzer::do_unsorted_stuff(edm::Event const& e) const { - typedef DSVWeirdProduct product_type; - typedef product_type::value_type detset; - typedef detset::value_type value_type; - // Get the product back out; it should be unsorted. - edm::Handle h; - e.getByLabel("dsv1", h); - assert(h.isValid()); - - // Check the sorting. DO NOT DO THIS IN NORMAL CODE; we are - // copying all the values out of the DetSetVector's first DetSet so we can - // manipulate them via an interface different from - // DetSet, just so that we can make sure the collection - // is not sorted. - std::vector const& after = (h->end() - 1)->data; - typedef std::vector::size_type size_type; - - // Verify that the vector is reverse-sorted. - - for (size_type i = 1, end = after.size(); i < end; ++i) { - assert(after[i - 1].data > after[i].data); - } - } } // namespace edmtest using edmtest::BuiltinIntTestAnalyzer; using edmtest::ConsumingOneSharedResourceAnalyzer; using edmtest::ConsumingStreamAnalyzer; -using edmtest::DSVAnalyzer; using edmtest::IntConsumingAnalyzer; using edmtest::IntTestAnalyzer; using edmtest::MultipleIntsAnalyzer; using edmtest::NonAnalyzer; -using edmtest::SCSimpleAnalyzer; using edmtest::SimpleViewAnalyzer; DEFINE_FWK_MODULE(NonAnalyzer); DEFINE_FWK_MODULE(IntTestAnalyzer); @@ -468,7 +371,5 @@ DEFINE_FWK_MODULE(IntConsumingAnalyzer); DEFINE_FWK_MODULE(edmtest::IntFromRunConsumingAnalyzer); DEFINE_FWK_MODULE(ConsumingStreamAnalyzer); DEFINE_FWK_MODULE(ConsumingOneSharedResourceAnalyzer); -DEFINE_FWK_MODULE(SCSimpleAnalyzer); DEFINE_FWK_MODULE(SimpleViewAnalyzer); -DEFINE_FWK_MODULE(DSVAnalyzer); DEFINE_FWK_MODULE(BuiltinIntTestAnalyzer); diff --git a/FWCore/Framework/test/stubs/ToyModules.cc b/FWCore/Framework/test/stubs/ToyModules.cc index 59b42641cde55..50ba64ec08d9c 100644 --- a/FWCore/Framework/test/stubs/ToyModules.cc +++ b/FWCore/Framework/test/stubs/ToyModules.cc @@ -265,75 +265,6 @@ namespace edmtest { e.put(std::move(p)); } - //-------------------------------------------------------------------- - // - // Produces two products: (new DataSetVector) - // DSTVSimpleProduct - // DSTVSimpleDerivedProduct - // - class DSTVProducer : public edm::stream::EDProducer<> { - public: - explicit DSTVProducer(edm::ParameterSet const& p) : size_(p.getParameter("size")) { - produces(); - produces(); - assert(size_ > 1); - } - - explicit DSTVProducer(int i) : size_(i) { - produces(); - produces(); - assert(size_ > 1); - } - - virtual ~DSTVProducer() {} - - virtual void produce(edm::Event& e, edm::EventSetup const&) override; - - private: - template - void make_a_product(edm::Event& e); - void fill_a_data(DSTVSimpleProduct::data_type& d, unsigned int i); - void fill_a_data(DSTVSimpleDerivedProduct::data_type& d, unsigned int i); - - int size_; - }; - - void DSTVProducer::produce(edm::Event& e, edm::EventSetup const& /* unused */) { - this->make_a_product(e); - this->make_a_product(e); - } - - void DSTVProducer::fill_a_data(DSTVSimpleDerivedProduct::data_type& d, unsigned int i) { - d.key = size_ - i; - d.value = 1.5 * i; - } - - void DSTVProducer::fill_a_data(DSTVSimpleProduct::data_type& d, unsigned int i) { d.data = size_ - i; } - - template - void DSTVProducer::make_a_product(edm::Event& e) { - typedef PROD product_type; - //FIXME - typedef typename product_type::FastFiller detset; - typedef typename detset::id_type id_type; - - auto p = std::make_unique(); - product_type& v = *p; - - unsigned int n = 0; - for (id_type id = 1; id < static_cast(size_); ++id) { - ++n; - detset item(v, id); // this will get DetID id - item.resize(n); - for (unsigned int i = 0; i < n; ++i) - fill_a_data(item[i], i); - } - - // Put the product into the Event, thus sorting is not done by magic, - // up to one user-line - e.put(std::move(p)); - } - //-------------------------------------------------------------------- // // Produces an Prodigal instance. @@ -402,7 +333,6 @@ namespace edmtest { } // namespace edmtest using edmtest::AVSimpleProducer; -using edmtest::DSTVProducer; using edmtest::DSVProducer; using edmtest::IntProductFilter; using edmtest::OVSimpleProducer; @@ -414,6 +344,5 @@ DEFINE_FWK_MODULE(OVSimpleProducer); DEFINE_FWK_MODULE(VSimpleProducer); DEFINE_FWK_MODULE(AVSimpleProducer); DEFINE_FWK_MODULE(DSVProducer); -DEFINE_FWK_MODULE(DSTVProducer); DEFINE_FWK_MODULE(ProdigalProducer); DEFINE_FWK_MODULE(IntProductFilter); diff --git a/FWCore/Integration/test/detsetvector_t.sh b/FWCore/Integration/test/detsetvector_t.sh deleted file mode 100755 index 8ee2d38a198c0..0000000000000 --- a/FWCore/Integration/test/detsetvector_t.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -function die { echo $1: status $2 ; exit $2; } - -cmsRun ${SCRAM_TEST_PATH}/detsetvector_t_cfg.py || die 'Failed in detsetvector_t_cfg.py' $? - diff --git a/FWCore/Integration/test/detsetvector_t_cfg.py b/FWCore/Integration/test/detsetvector_t_cfg.py deleted file mode 100644 index e9be8eb605dfd..0000000000000 --- a/FWCore/Integration/test/detsetvector_t_cfg.py +++ /dev/null @@ -1,27 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("TEST") - -process.load("FWCore.Framework.test.cmsExceptionsFatal_cff") - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(3) -) - -process.source = cms.Source("EmptySource") - -process.scs = cms.EDProducer("SCSimpleProducer", - size = cms.int32(5) -) - -process.dsv1 = cms.EDProducer("DSVProducer", - size = cms.int32(10) -) - -process.a1 = cms.EDAnalyzer("SCSimpleAnalyzer") - -process.a2 = cms.EDAnalyzer("DSVAnalyzer") - -process.p = cms.Path(process.scs*process.dsv1*process.a1*process.a2) - - diff --git a/FWCore/Integration/test/newdetsetvector_t.sh b/FWCore/Integration/test/newdetsetvector_t.sh deleted file mode 100755 index efec717ed9816..0000000000000 --- a/FWCore/Integration/test/newdetsetvector_t.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -function die { echo $1: status $2 ; exit $2; } - -cmsRun ${SCRAM_TEST_PATH}/newdetsetvector_t_cfg.py || die 'Failed in detsetvector_t_cfg.py' $? -edmEventSize -A -v testDSTV.root - diff --git a/FWCore/Integration/test/newdetsetvector_t_cfg.py b/FWCore/Integration/test/newdetsetvector_t_cfg.py deleted file mode 100644 index 479c604bfc243..0000000000000 --- a/FWCore/Integration/test/newdetsetvector_t_cfg.py +++ /dev/null @@ -1,27 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("TEST") - -process.load("FWCore.Framework.test.cmsExceptionsFatal_cff") - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(500) -) -process.source = cms.Source("EmptySource") - -process.dsv1 = cms.EDProducer("DSVProducer", - size = cms.int32(10) -) - -process.dsv2 = cms.EDProducer("DSTVProducer", - size = cms.int32(10) -) - -process.a2 = cms.EDAnalyzer("DSVAnalyzer") - -process.out = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('testDSTV.root') -) - -process.p = cms.Path(process.dsv1 * process.dsv2 * process.a2) -process.e = cms.EndPath(process.out)