4 #include "DataFormats/TestObjects/interface/Thing.h" 5 #include "DataFormats/TestObjects/interface/TrackOfDSVThings.h" 29 bool choose(
unsigned int iIndex, edmtest::Thing
const& iItem)
const;
43 : trackToken_(
cc.consumes<TrackOfDSVThingsCollection>(
pset.getParameter<
edm::
InputTag>(
"trackTag"))),
44 keysToSave_(
pset.getParameter<
bool>(
"thinnedRefSetIgnoreInvalidParentRef")
47 offsetToValue_(
pset.getParameter<unsigned
int>(
"offsetToValue")),
48 expectedDetSets_(
pset.getParameter<unsigned
int>(
"expectedDetSets")),
49 expectedDetSetSize_(
pset.getParameter<unsigned
int>(
"expectedDetSetSize")),
50 slimmedValueFactor_(
pset.getParameter<
int>(
"slimmedValueFactor")) {}
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);
58 desc.add<
bool>(
"thinnedRefSetIgnoreInvalidParentRef",
false);
72 throw cms::Exception(
"TestFailure") <<
"ThinningDSVThingSelector::preChoose, number of DetSets = " << tc->size()
75 for (
auto const& ds : *tc) {
78 <<
"ThinningDSVThingSelector::preChoose, number of elements in DetSet with id " << ds.id() <<
" = " 88 if (static_cast<unsigned>(iItem.a % 10) !=
static_cast<unsigned>(expected % 10)) {
89 throw cms::Exception(
"TestFailure") <<
"ThinningDSVThingSelector::choose, item content = " << iItem.a
90 <<
" index = " << iIndex <<
" expected " << expected;
unsigned int const expectedDetSetSize_
uint32_t cc[maxCellsPerHit]
bool contains(unsigned int key) const
unsigned int const offsetToValue_
#define DEFINE_FWK_MODULE(type)
edm::ThinnedRefSet< edmNew::DetSetVector< Thing > > keysToSave_
unsigned int const expectedDetSets_
static void fillPSetDescription(edm::ParameterSetDescription &desc)
int const slimmedValueFactor_
ThinningDSVThingSelector(edm::ParameterSet const &pset, edm::ConsumesCollector &&cc)
void preChoose(edm::Handle< edmNew::DetSetVector< Thing >> tc, edm::Event const &event, edm::EventSetup const &es)
edm::EDGetTokenT< TrackOfDSVThingsCollection > const trackToken_
bool choose(unsigned int iIndex, edmtest::Thing const &iItem) const
Filler fill(RefProd< C > thinned, edm::EDProductGetter const &prodGetter)