60 cut_(iConfig.existsAs<
std::
string>(
"cut") ? iConfig.getParameter<
std::
string>(
"cut") :
""),
61 filter_(iConfig.existsAs<
bool>(
"filter") ? iConfig.getParameter<
bool>(
"filter") :
false),
62 sortDescendingBy_(iConfig.existsAs<
std::
string>(
"sortDescendingBy")
63 ? iConfig.getParameter<
std::
string>(
"sortDescendingBy")
65 sortFunction_(!sortDescendingBy_.
empty() ? sortDescendingBy_ :
"pt"),
66 maxProbes_(iConfig.existsAs<int32_t>(
"maxProbes") ? iConfig.getParameter<int32_t>(
"maxProbes") : -1),
67 probeFiller_(new
tnp::BaseTreeFiller(
"probe_tree", iConfig, consumesCollector())) {}
79 typedef std::pair<reco::CandidateBaseRef, double> Pair;
80 std::vector<Pair> selectedProbes;
81 for (
size_t i = 0;
i < probes->
size(); ++
i) {
89 sort(selectedProbes.begin(), selectedProbes.end(), [&](
auto& arg1,
auto& arg2) {
90 return arg1.second > arg2.second;
RefToBase< value_type > refAt(size_type i) const
StringObjectFunction< reco::Candidate, true > sortFunction_
The StringObjectFunction itself.
ProbeTreeProducer(const edm::ParameterSet &)
int32_t maxProbes_
The number of first probes used to fill the tree.
~ProbeTreeProducer() override
bool filter(edm::Event &, const edm::EventSetup &) override
std::unique_ptr< tnp::BaseTreeFiller > probeFiller_
The object that actually computes variables and fills the tree for the probe.
#define DEFINE_FWK_MODULE(type)
ParameterSet const & getProcessParameterSetContainingModule(ModuleDescription const &moduleDescription)
StringCutObjectSelector< reco::Candidate, true > cut_
The selector object.
ModuleDescription const & moduleDescription() const
std::string sortDescendingBy_
Name of the reco::Candidate function used for sorting.
bool filter_
Specifies whether this module should filter.
edm::View< Candidate > CandidateView
view of a collection containing candidates
edm::EDGetTokenT< reco::CandidateView > probesToken_
InputTag to the collection of all probes.