21 std::cout <<
"TrackClusterizerInZ: algorithm=gap, zSeparation=" << zSep << std::endl;
28 vector<reco::TransientTrack> tks =
tracks;
30 vector<vector<reco::TransientTrack> >
clusters;
35 stable_sort(tks.begin(), tks.end(), recTrackLessZ);
38 vector<reco::TransientTrack>::const_iterator it = tks.begin();
39 vector<reco::TransientTrack> currentCluster;
40 currentCluster.push_back(*it);
43 for (; it != tks.end(); it++) {
44 double zPrev = currentCluster.back().stateAtBeamLine().trackStateAtPCA().position().z();
45 double zCurr = (*it).stateAtBeamLine().trackStateAtPCA().position().z();
47 if (
abs(zCurr - zPrev) < zSeparation()) {
49 currentCluster.push_back(*it);
52 clusters.push_back(currentCluster);
53 currentCluster.clear();
54 currentCluster.push_back(*it);
59 clusters.push_back(currentCluster);
65 desc.
add<
double>(
"zSeparation", 1.0);
T getUntrackedParameter(std::string const &, T const &) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
GapClusterizerInZ(const edm::ParameterSet &conf)
auto const & tracks
cannot be loose
TrajectoryStateClosestToBeamLine stateAtBeamLine() const
float zSeparation() const
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
FTS const & trackStateAtPCA() const
GlobalPoint position() const
T getParameter(std::string const &) const
static void fillPSetDescription(edm::ParameterSetDescription &desc)
std::vector< std::vector< reco::TransientTrack > > clusterize(const std::vector< reco::TransientTrack > &tracks) const override