13 vector<reco::TransientTrack> newtrks;
16 for (vector<reco::TransientTrack>::const_iterator
i =
trks.begin();
i !=
trks.end(); ++
i) {
18 newtrks.push_back(*
i);
35 vector<reco::TransientTrack> newrfs;
37 vector<reco::TransientTrack>::const_iterator origtrkiter =
trks.begin();
38 for (vector<reco::TransientTrack>::const_iterator
i = oldrfs.begin();
i != oldrfs.end(); ++
i) {
45 ret.refittedTracks(newrfs);
48 if (
ret.refittedTracks().size() >
ret.originalTracks().size()) {
49 edm::LogError(
"AdaptiveVertexReconstructor") <<
"More refitted tracks than original tracks!";
56 set<reco::TransientTrack>& remainingtrks,
62 const vector<reco::TransientTrack>& origtrks = newvtx.
originalTracks();
63 for (vector<reco::TransientTrack>::const_iterator
i = origtrks.begin();
i != origtrks.end(); ++
i) {
66 remainingtrks.erase(*
i);
72 : thePrimaryFitter(nullptr), theSecondaryFitter(nullptr), theMinWeight(min_weight), theWeightThreshold(0.001) {
121 : thePrimaryFitter(nullptr), theSecondaryFitter(nullptr), theMinWeight(0.5), theWeightThreshold(0.001) {
133 primcut =
m.getParameter<
double>(
"primcut");
134 primT =
m.getParameter<
double>(
"primT");
135 primr =
m.getParameter<
double>(
"primr");
136 seccut =
m.getParameter<
double>(
"seccut");
137 secT =
m.getParameter<
double>(
"secT");
138 secr =
m.getParameter<
double>(
"secr");
141 smoothing =
m.getParameter<
bool>(
"smoothing");
151 return vertices(vector<reco::TransientTrack>(),
t,
s,
false,
true);
155 const vector<reco::TransientTrack>&
tracks,
165 const vector<reco::TransientTrack>&
tracks,
168 bool usespot)
const {
169 vector<TransientVertex>
ret;
170 set<reco::TransientTrack> remainingtrks;
172 copy(
tracks.begin(),
tracks.end(), inserter(remainingtrks, remainingtrks.begin()));
175 unsigned int n_tracks = remainingtrks.size();
179 while (remainingtrks.size() > 1) {
189 vector<reco::TransientTrack> fittrks;
190 fittrks.reserve(remainingtrks.size());
192 copy(remainingtrks.begin(), remainingtrks.end(), back_inserter(fittrks));
195 if ((
ret.empty()) && has_primaries) {
197 copy(primaries.begin(), primaries.end(), back_inserter(fittrks));
199 if ((
ret.empty()) && usespot) {
200 tmpvtx = fitter->
vertex(fittrks,
s);
202 tmpvtx = fitter->
vertex(fittrks);
205 ret.push_back(newvtx);
207 if (n_tracks == remainingtrks.size()) {
211 LogDebug(
"AdaptiveVertexReconstructor") <<
"no tracks in vertex. trying again without beamspot constraint!";
214 LogDebug(
"AdaptiveVertexReconstructor")
215 <<
"all tracks (" << n_tracks <<
") would be recycled for next fit. Trying with low threshold!";
216 erase(newvtx, remainingtrks, 1.
e-5);
217 if (n_tracks == remainingtrks.size()) {
218 LogDebug(
"AdaptiveVertexReconstructor") <<
"low threshold didnt help! " 219 <<
"Discontinue procedure!";
225 n_tracks = remainingtrks.size();
236 vector<TransientVertex>
ret;
237 for (vector<TransientVertex>::const_iterator
i = old.begin();
i != old.end(); ++
i) {
238 if (!(
i->hasTrackWeight())) {
247 for (TransientVertex::TransientTrackToFloatMap::const_iterator
w = wm.begin();
w != wm.end(); ++
w) {
AdaptiveVertexReconstructor(float primcut=2.0, float seccut=6.0, float minweight=0.5, bool smoothing=false)
float totalChiSquared() const
std::vector< TransientVertex > cleanUpVertices(const std::vector< TransientVertex > &) const
ret
prodAgent to be discontinued
~AdaptiveVertexReconstructor() override
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
AdaptiveVertexFitter * thePrimaryFitter
Log< level::Error, false > LogError
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
float degreesOfFreedom() const
void setupFitters(float primcut, float primT, float primr, float seccut, float secT, float secr, bool smoothing)
GlobalPoint priorPosition() const
void setWeightThreshold(float w)
VertexState const & vertexState() const
std::vector< reco::TransientTrack > const & originalTracks() const
AdaptiveVertexFitter * theSecondaryFitter
void erase(const TransientVertex &newvtx, std::set< reco::TransientTrack > &remainingtrks, float w) const
GlobalError priorError() const
auto const & tracks
cannot be loose
bool hasRefittedTracks() const
TransientVertex cleanUp(const TransientVertex &old) const
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &v) const override
float trackWeight(const reco::TransientTrack &track) const
std::vector< reco::TransientTrack > const & refittedTracks() const