◆ PixelVertexCollectionTrimmer()
PixelVertexCollectionTrimmer::PixelVertexCollectionTrimmer |
( |
const edm::ParameterSet & |
iConfig | ) |
|
|
explicit |
◆ fillDescriptions()
Definition at line 93 of file PixelVertexCollectionTrimmer.cc.
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, edm::ParameterDescriptionNode::setComment(), and parallelization::uint.
96 desc.add<
uint>(
"maxVtx", 100)->setComment(
"max output collection size (number of accepted vertices)");
97 desc.add<
double>(
"fractionSumPt2", 0.3)->setComment(
"threshold on sumPt2 fraction of the leading vertex");
98 desc.add<
double>(
"minSumPt2", 0.)->setComment(
"min sumPt2");
100 PVcomparerPSet.
add<
double>(
"track_pt_min", 1.0)->
setComment(
"min track p_T");
101 PVcomparerPSet.add<
double>(
"track_pt_max", 10.0)->setComment(
"max track p_T");
102 PVcomparerPSet.add<
double>(
"track_chi2_max", 99999.)->setComment(
"max track chi2");
103 PVcomparerPSet.add<
double>(
"track_prob_min", -1.)->setComment(
"min track prob");
105 ->setComment(
"from RecoVertex/PixelVertexFinding/python/PVClusterComparer_cfi.py");
106 descriptions.
add(
"hltPixelVertexCollectionTrimmer",
desc);
void setComment(std::string const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
◆ produce()
Definition at line 60 of file PixelVertexCollectionTrimmer.cc.
References fractionSumPt2_, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, heavyIonCSV_trainingSettings::idx, iEvent, maxVtx_, SiStripPI::min, minSumPt2_, eostools::move(), pvComparer_, jetUpdater_cfi::sort, and vtxToken_.
61 auto vtxs_trim = std::make_unique<reco::VertexCollection>();
66 edm::LogWarning(
"PixelVertexInput") <<
"Input collection of vertices is empty. Output collection will be empty.";
68 std::vector<double> foms(vtxs.size());
69 for (
size_t idx = 0;
idx < vtxs.size(); ++
idx)
72 std::vector<size_t> sortIdxs(vtxs.size());
73 std::iota(sortIdxs.begin(), sortIdxs.end(), 0);
74 std::sort(sortIdxs.begin(), sortIdxs.end(), [&](
size_t const i1,
size_t const i2) {
return foms[
i1] > foms[
i2]; });
79 for (
auto const idx : sortIdxs) {
80 if (vtxs_trim->size() >=
maxVtx_)
83 vtxs_trim->emplace_back(vtxs[
idx]);
86 if (vtxs_trim->empty())
87 edm::LogInfo(
"PixelVertexOutput") <<
"Output collection is empty.";
double const fractionSumPt2_
edm::EDGetTokenT< reco::VertexCollection > const vtxToken_
std::unique_ptr< PVClusterComparer > pvComparer_
◆ fractionSumPt2_
double const PixelVertexCollectionTrimmer::fractionSumPt2_ |
|
private |
◆ maxVtx_
uint const PixelVertexCollectionTrimmer::maxVtx_ |
|
private |
◆ minSumPt2_
double const PixelVertexCollectionTrimmer::minSumPt2_ |
|
private |
◆ pvComparer_
◆ vtxToken_