Skip to content

Commit

Permalink
further operations
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlange6 authored and mandrenguyen committed Apr 29, 2024
1 parent 19b47c7 commit 0938409
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ void DisplacedRegionSeedingVertexProducer::produce(edm::StreamID streamID,
}

const auto pseudoROIPred = [](const DisplacedVertexCluster &a) { return !a.valid(); };
auto remove_it = std::remove_if(pseudoROIs.begin(), pseudoROIs.end(), pseudoROIPred);
pseudoROIs.erase(remove_it, pseudoROIs.end());
auto remove_invalid = std::remove_if(pseudoROIs.begin(), pseudoROIs.end(), pseudoROIPred);

// Remove invalid ROIs.
const auto roiPred = [&](const DisplacedVertexCluster &roi) {
Expand All @@ -175,16 +174,16 @@ void DisplacedRegionSeedingVertexProducer::produce(edm::StreamID streamID,
return true;
return false;
};
auto remove_it2 = std::remove_if(pseudoROIs.begin(), pseudoROIs.end(), roiPred);
pseudoROIs.erase(remove_it2, pseudoROIs.end());
auto remove_pred = std::remove_if(pseudoROIs.begin(), remove_invalid, roiPred);

auto nearRegionsOfInterest = make_unique<vector<reco::Vertex> >();
auto farRegionsOfInterest = make_unique<vector<reco::Vertex> >();

constexpr std::array<double, 6> errorA{{1.0, 0.0, 1.0, 0.0, 0.0, 1.0}};
static const reco::Vertex::Error errorRegion(errorA.begin(), errorA.end(), true, true);

for (const auto &roi : pseudoROIs) {
for (auto it = pseudoROIs.begin(); it != remove_pred; ++it) {
auto const &roi = *it;
const auto &x(roi.centerOfMass());
if ((x - bs).rho() < nearThreshold_)
nearRegionsOfInterest->emplace_back(reco::Vertex::Point(roi.centerOfMass()), errorRegion);
Expand Down

0 comments on commit 0938409

Please sign in to comment.