2 #include "DataFormats/TestObjects/interface/Thing.h" 3 #include "DataFormats/TestObjects/interface/ThingCollection.h" 4 #include "DataFormats/TestObjects/interface/TrackOfThings.h" 32 std::optional<edmtest::Thing>
choose(
unsigned int iIndex, edmtest::Thing
const& iItem)
const;
47 : trackToken_(
cc.consumes<TrackOfThingsCollection>(
pset.getParameter<
edm::
InputTag>(
"trackTag"))),
49 offsetToThinnedKey_(
pset.getParameter<unsigned
int>(
"offsetToThinnedKey")),
50 offsetToValue_(
pset.getParameter<unsigned
int>(
"offsetToValue")),
51 expectedCollectionSize_(
pset.getParameter<unsigned
int>(
"expectedCollectionSize")),
52 slimmedValueFactor_(
pset.getParameter<
int>(
"slimmedValueFactor")) {}
56 desc.add<
unsigned int>(
"offsetToThinnedKey");
57 desc.add<
unsigned int>(
"offsetToValue", 0);
58 desc.add<
unsigned int>(
"expectedCollectionSize");
59 desc.add<
int>(
"slimmedValueFactor", 1);
74 throw cms::Exception(
"TestFailure") <<
"SlimmingThingSelector::preChoose, collection size = " << tc->size()
87 if (static_cast<unsigned>(iItem.a % 10) !=
static_cast<unsigned>(expected % 10)) {
88 throw cms::Exception(
"TestFailure") <<
"SlimmingThingSelector::choose, item content = " << iItem.a
89 <<
" index = " << iIndex <<
" expected " << expected;
std::optional< edmtest::Thing > choose(unsigned int iIndex, edmtest::Thing const &iItem) const
uint32_t cc[maxCellsPerHit]
std::set< unsigned int > keysToSave_
void preChoose(edm::Handle< edmtest::ThingCollection > tc, edm::Event const &event, edm::EventSetup const &es)
unsigned int const offsetToValue_
edm::ThinningProducer< edmtest::ThingCollection, edmtest::SlimmingThingSelector > SlimmingThingProducer
int const slimmedValueFactor_
unsigned int const offsetToThinnedKey_
edm::EDGetTokenT< TrackOfThingsCollection > const trackToken_
edm::ESGetToken< edmtest::WhatsIt, GadgetRcd > const setupToken_
unsigned int const expectedCollectionSize_
#define DEFINE_FWK_MODULE(type)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
static void fillPSetDescription(edm::ParameterSetDescription &desc)
SlimmingThingSelector(edm::ParameterSet const &pset, edm::ConsumesCollector &&cc)