16 using namespace l1tVertexFinder;
22 outputCollectionName_(iConfig.getParameter<std::
string>(
"l1VertexCollectionName")),
27 case Algorithm::FastHisto:
28 edm::LogInfo(
"VertexProducer") <<
"VertexProducer::Finding vertices using the FastHisto binning algorithm";
30 case Algorithm::FastHistoLooseAssociation:
32 <<
"VertexProducer::Finding vertices using the FastHistoLooseAssociation binning algorithm";
34 case Algorithm::GapClustering:
35 edm::LogInfo(
"VertexProducer") <<
"VertexProducer::Finding vertices using a gap clustering algorithm";
37 case Algorithm::AgglomerativeHierarchical:
38 edm::LogInfo(
"VertexProducer") <<
"VertexProducer::Finding vertices using a Simple Merge Clustering algorithm";
40 case Algorithm::DBSCAN:
41 edm::LogInfo(
"VertexProducer") <<
"VertexProducer::Finding vertices using a DBSCAN algorithm";
44 edm::LogInfo(
"VertexProducer") <<
"VertexProducer::Finding vertices using a PVR algorithm";
46 case Algorithm::AdaptiveVertexReconstruction:
48 <<
"VertexProducer::Finding vertices using an AdaptiveVertexReconstruction algorithm";
51 edm::LogInfo(
"VertexProducer") <<
"VertexProducer::Finding vertices using a Highest Pt Vertex algorithm";
53 case Algorithm::Kmeans:
54 edm::LogInfo(
"VertexProducer") <<
"VertexProducer::Finding vertices using a kmeans algorithm";
64 iEvent.
getByToken(l1TracksToken_, l1TracksHandle);
66 std::vector<l1tVertexFinder::L1Track> l1Tracks;
67 l1Tracks.reserve(l1TracksHandle->size());
68 for (
const auto&
track : l1TracksHandle->ptrs()) {
73 if (l1track.pt() > settings_.vx_TrackMinPt()) {
74 l1Tracks.push_back(l1track);
80 switch (settings_.vx_algo()) {
81 case Algorithm::FastHisto: {
86 case Algorithm::FastHistoLooseAssociation:
89 case Algorithm::GapClustering:
92 case Algorithm::AgglomerativeHierarchical:
95 case Algorithm::DBSCAN:
101 case Algorithm::AdaptiveVertexReconstruction:
107 case Algorithm::Kmeans:
116 std::unique_ptr<l1t::VertexCollection> lProduct(
new std::vector<l1t::Vertex>());
118 for (
const auto& vtx : vf.
vertices()) {
119 std::vector<edm::Ptr<l1t::Vertex::Track_t>> lVtxTracks;
120 lVtxTracks.reserve(vtx.tracks().size());
121 for (
const auto&
t : vtx.tracks())
122 lVtxTracks.push_back(
t->getTTTrackPtr());
123 lProduct->emplace_back(
l1t::Vertex(vtx.pt(), vtx.z0(), lVtxTracks));
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void fastHistoLooseAssociation()
High pT Vertex Algorithm.
const std::vector< RecoVertex<> > & vertices() const
Returns the z positions of the reconstructed primary vertices.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
void GapClustering()
Gap Clustering Algorithm.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void agglomerativeHierarchicalClustering()
Simple Merge Algorithm.
const std::string outputCollectionName_
void adaptiveVertexReconstruction()
Adaptive Vertex Reconstruction algorithm.
void findPrimaryVertex()
Find the primary vertex.
void fastHisto(const TrackerTopology *tTopo)
Histogramming algorithm.
VertexProducer(const edm::ParameterSet &)
Log< level::Info, false > LogInfo
void PVR()
Principal Vertex Reconstructor algorithm.
Algorithm vx_algo() const
void SortVerticesInPt()
Sort vertices in pT.
void HPV()
High pT Vertex Algorithm.
T const * product() const
trackerTopologyToken_(iC.esConsumes())
void Kmeans()
Kmeans Algorithm.
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void DBSCAN()
DBSCAN algorithm.
l1tVertexFinder::AlgoSettings settings_