Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 0 additions & 99 deletions FWCore/Framework/test/stubs/ToyAnalyzers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<SCSimpleProduct> 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<Simple> after(h->begin(), h->end());
typedef std::vector<Simple>::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<Simple>
Expand Down Expand Up @@ -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<product_type> 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<value_type> const& after = (h->end() - 1)->data;
typedef std::vector<value_type>::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<product_type> 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<value_type> const& after = (h->end() - 1)->data;
typedef std::vector<value_type>::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);
Expand All @@ -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);
71 changes: 0 additions & 71 deletions FWCore/Framework/test/stubs/ToyModules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>("size")) {
produces<DSTVSimpleProduct>();
produces<DSTVSimpleDerivedProduct>();
assert(size_ > 1);
}

explicit DSTVProducer(int i) : size_(i) {
produces<DSTVSimpleProduct>();
produces<DSTVSimpleDerivedProduct>();
assert(size_ > 1);
}

virtual ~DSTVProducer() {}

virtual void produce(edm::Event& e, edm::EventSetup const&) override;

private:
template <typename PROD>
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<DSTVSimpleProduct>(e);
this->make_a_product<DSTVSimpleDerivedProduct>(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 <typename PROD>
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>();
product_type& v = *p;

unsigned int n = 0;
for (id_type id = 1; id < static_cast<id_type>(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.
Expand Down Expand Up @@ -402,7 +333,6 @@ namespace edmtest {
} // namespace edmtest

using edmtest::AVSimpleProducer;
using edmtest::DSTVProducer;
using edmtest::DSVProducer;
using edmtest::IntProductFilter;
using edmtest::OVSimpleProducer;
Expand All @@ -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);
6 changes: 0 additions & 6 deletions FWCore/Integration/test/detsetvector_t.sh

This file was deleted.

27 changes: 0 additions & 27 deletions FWCore/Integration/test/detsetvector_t_cfg.py

This file was deleted.

7 changes: 0 additions & 7 deletions FWCore/Integration/test/newdetsetvector_t.sh

This file was deleted.

27 changes: 0 additions & 27 deletions FWCore/Integration/test/newdetsetvector_t_cfg.py

This file was deleted.