PixelVertexCollectionTrimmer::PixelVertexCollectionTrimmer |
( |
const edm::ParameterSet & |
iConfig | ) |
|
|
explicit |
Definition at line 93 of file PixelVertexCollectionTrimmer.cc.
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::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 RecoPixelVertexing/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)
Definition at line 60 of file PixelVertexCollectionTrimmer.cc.
References fractionSumPt2_, edm::Event::get(), maxVtx_, SiStripPI::min, minSumPt2_, eostools::move(), edm::Event::put(), pvComparer_, 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_)
82 if (foms[idx] >= minFOM_fromFrac and foms[idx] >
minSumPt2_)
83 vtxs_trim->emplace_back(vtxs[idx]);
86 if (vtxs_trim->empty())
87 edm::LogInfo(
"PixelVertexOutput") <<
"Output collection is empty.";
double const fractionSumPt2_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool get(ProductID const &oid, Handle< PROD > &result) const
edm::EDGetTokenT< reco::VertexCollection > const vtxToken_
std::unique_ptr< PVClusterComparer > pvComparer_
double const PixelVertexCollectionTrimmer::fractionSumPt2_ |
|
private |
uint const PixelVertexCollectionTrimmer::maxVtx_ |
|
private |
double const PixelVertexCollectionTrimmer::minSumPt2_ |
|
private |