3 #include "DataFormats/TestObjects/interface/Thing.h" 4 #include "DataFormats/TestObjects/interface/TrackOfDSVThings.h" 29 std::optional<edmtest::Thing>
choose(
unsigned int iIndex, edmtest::Thing
const& iItem)
const;
44 : trackToken_(
cc.consumes<TrackOfDSVThingsCollection>(
pset.getParameter<
edm::
InputTag>(
"trackTag"))),
45 offsetToThinnedKey_(
pset.getParameter<unsigned
int>(
"offsetToThinnedKey")),
46 offsetToValue_(
pset.getParameter<unsigned
int>(
"offsetToValue")),
47 expectedDetSets_(
pset.getParameter<unsigned
int>(
"expectedDetSets")),
48 expectedDetSetSize_(
pset.getParameter<unsigned
int>(
"expectedDetSetSize")),
49 slimmedValueFactor_(
pset.getParameter<
int>(
"slimmedValueFactor")) {}
53 desc.add<
unsigned int>(
"offsetToThinnedKey");
54 desc.add<
unsigned int>(
"offsetToValue", 0);
55 desc.add<
unsigned int>(
"expectedDetSets");
56 desc.add<
unsigned int>(
"expectedDetSetSize");
57 desc.add<
int>(
"slimmedValueFactor", 1);
70 throw cms::Exception(
"TestFailure") <<
"SlimmingDSVThingSelector::preChoose, number of DetSets = " << tc->size()
73 for (
auto const& ds : *tc) {
76 <<
"SlimmingDSVThingSelector::preChoose, number of elements in DetSet with id " << ds.id() <<
" = " 83 edmtest::Thing
const& iItem)
const {
87 if (static_cast<unsigned>(iItem.a % 10) !=
static_cast<unsigned>(expected % 10)) {
88 throw cms::Exception(
"TestFailure") <<
"SlimmingDSVThingSelector::choose, item content = " << iItem.a
89 <<
" index = " << iIndex <<
" expected " << expected;
static void fillPSetDescription(edm::ParameterSetDescription &desc)
uint32_t cc[maxCellsPerHit]
std::optional< edmtest::Thing > choose(unsigned int iIndex, edmtest::Thing const &iItem) const
edm::EDGetTokenT< TrackOfDSVThingsCollection > const trackToken_
int const slimmedValueFactor_
void preChoose(edm::Handle< edmNew::DetSetVector< Thing >> tc, edm::Event const &event, edm::EventSetup const &es)
unsigned int const expectedDetSets_
std::set< unsigned int > keysToSave_
#define DEFINE_FWK_MODULE(type)
unsigned int const expectedDetSetSize_
unsigned int const offsetToThinnedKey_
unsigned int const offsetToValue_
SlimmingDSVThingSelector(edm::ParameterSet const &pset, edm::ConsumesCollector &&cc)