13 vector<reco::TransientTrack> newtrks;
15 static const float minweight = 1.e-8;
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) {
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) {
73 setupFitters(primcut, 256., 0.25, seccut, 256., 0.25, smoothing);
84 float primcut,
float primT,
float primr,
float seccut,
float secT,
float secr,
bool smoothing) {
121 : thePrimaryFitter(nullptr), theSecondaryFitter(nullptr), theMinWeight(0.5), theWeightThreshold(0.001) {
124 bool smoothing =
false;
146 setupFitters(primcut, primT, primr, seccut, secT, secr, smoothing);
151 return vertices(vector<reco::TransientTrack>(), t, s,
false,
true);
155 const vector<reco::TransientTrack>&
tracks,
157 return vertices(primaries, tracks, s,
true,
true);
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)
tuple ret
prodAgent to be discontinued
GlobalError priorError() const
TransientVertex cleanUp(const TransientVertex &old) const
~AdaptiveVertexReconstructor() override
float totalChiSquared() const
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
auto const & tracks
cannot be loose
AdaptiveVertexFitter * thePrimaryFitter
bool hasRefittedTracks() const
Log< level::Error, false > LogError
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
void setupFitters(float primcut, float primT, float primr, float seccut, float secT, float secr, bool smoothing)
void setWeightThreshold(float w)
std::vector< reco::TransientTrack > const & originalTracks() const
float degreesOfFreedom() const
char const * what() const noexceptoverride
std::vector< TransientVertex > cleanUpVertices(const std::vector< TransientVertex > &) const
AdaptiveVertexFitter * theSecondaryFitter
float trackWeight(const reco::TransientTrack &track) const
T getParameter(std::string const &) const
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &v) const override
GlobalPoint priorPosition() const
std::vector< reco::TransientTrack > const & refittedTracks() const
void erase(const TransientVertex &newvtx, std::set< reco::TransientTrack > &remainingtrks, float w) const
VertexState const & vertexState() const
TransientTrackToFloatMap weightMap() const