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()));
174 unsigned int n_tracks = remainingtrks.size();
178 while (remainingtrks.size() > 1) {
187 vector<reco::TransientTrack> fittrks;
188 fittrks.reserve(remainingtrks.size());
190 copy(remainingtrks.begin(), remainingtrks.end(), back_inserter(fittrks));
193 if ((
ret.empty()) && has_primaries) {
195 copy(primaries.begin(), primaries.end(), back_inserter(fittrks));
197 if ((
ret.empty()) && usespot) {
198 tmpvtx = fitter->
vertex(fittrks,
s);
200 tmpvtx = fitter->
vertex(fittrks);
203 ret.push_back(newvtx);
205 if (n_tracks == remainingtrks.size()) {
209 LogDebug(
"AdaptiveVertexReconstructor") <<
"no tracks in vertex. trying again without beamspot constraint!";
212 LogDebug(
"AdaptiveVertexReconstructor")
213 <<
"all tracks (" << n_tracks <<
") would be recycled for next fit. Trying with low threshold!";
214 erase(newvtx, remainingtrks, 1.
e-5);
215 if (n_tracks == remainingtrks.size()) {
216 LogDebug(
"AdaptiveVertexReconstructor") <<
"low threshold didnt help! " 217 <<
"Discontinue procedure!";
223 n_tracks = remainingtrks.size();
234 vector<TransientVertex>
ret;
235 for (vector<TransientVertex>::const_iterator
i = old.begin();
i != old.end(); ++
i) {
236 if (!(
i->hasTrackWeight())) {
245 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
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