215 RefToBaseLess<Track> > TransientTrackMap;
230 unsigned int bsCovSrc[7] = { 0, };
231 double sigmaZ = 0.0, beamWidth = 0.0;
235 bsCovSrc[3] = bsCovSrc[4] = bsCovSrc[5] = bsCovSrc[6] = 1;
236 sigmaZ = beamSpot->sigmaZ();
237 beamWidth = beamSpot->BeamWidthX();
242 bsCovSrc[0] = bsCovSrc[1] = 2;
243 bsCovSrc[3] = bsCovSrc[4] = bsCovSrc[5] = 1;
244 sigmaZ = beamSpot->sigmaZ();
248 bsCovSrc[0] = bsCovSrc[1] = bsCovSrc[2] = 2;
260 std::auto_ptr<ConfigurableVertexReconstructor> vertexReco;
261 std::auto_ptr<GhostTrackVertexFinder> vertexRecoGT;
273 TransientTrackMap primariesMap;
277 std::auto_ptr<SecondaryVertexTagInfoCollection>
278 tagInfos(
new SecondaryVertexTagInfoCollection);
280 for(TrackIPTagInfoCollection::const_iterator iterJets =
281 trackIPTagInfos->begin(); iterJets != trackIPTagInfos->end();
283 std::vector<SecondaryVertexTagInfo::IndexedTrackData> trackData;
286 const Vertex &pv = *iterJets->primaryVertex();
288 std::set<TransientTrack> primaries;
292 TransientTrackMap::iterator
pos =
293 primariesMap.lower_bound(*iter);
295 if (pos != primariesMap.end() &&
297 primaries.insert(pos->second);
299 TransientTrack track =
302 primariesMap.insert(pos,
303 std::make_pair(*iter, track));
304 primaries.insert(track);
315 std::vector<std::size_t> indices =
320 const std::vector<TrackIPTagInfo::TrackIPData> &ipData =
321 iterJets->impactParameterData();
325 std::vector<TransientTrack> fitTracks;
326 std::vector<GhostTrackState> gtStates;
327 std::auto_ptr<GhostTrackPrediction> gtPred;
330 *iterJets->ghostTrack()));
332 for(
unsigned int i = 0;
i < indices.size();
i++) {
338 trackData.back().first = indices[
i];
345 trackData.back().second.svStatus =
346 SecondaryVertexTagInfo::TrackData::trackSelected;
350 TransientTrackMap::const_iterator pos =
353 TransientTrack fitTrack;
354 if (pos != primariesMap.end()) {
355 primaries.erase(pos->second);
356 fitTrack = pos->second;
358 fitTrack = trackBuilder->build(trackRef);
359 fitTracks.push_back(fitTrack);
361 trackData.back().second.svStatus =
362 SecondaryVertexTagInfo::TrackData::trackUsedForVertexFit;
367 ipData[indices[
i]].closestToGhostTrack;
368 gtState.linearize(*gtPred,
true,
369 gtPred->lambda(pos));
370 gtState.setWeight(ipData[indices[i]].ghostTrackWeight);
371 gtStates.push_back(gtState);
382 iterJets->ghostTrack()->px(),
383 iterJets->ghostTrack()->py(),
384 iterJets->ghostTrack()->pz()),
387 iterJets->ghostTrack()->chi2(),
388 iterJets->ghostTrack()->ndof()));
393 std::vector<reco::Vertex> extAssoCollection;
394 std::vector<TransientVertex> fittedSVs;
395 std::vector<SecondaryVertex> SVs;
400 fittedSVs = vertexRecoGT->vertices(
403 fittedSVs = vertexReco->vertices(fitTracks);
408 fittedSVs = vertexRecoGT->vertices(
409 pv, *beamSpot, *ghostTrack);
411 fittedSVs = vertexReco->vertices(fitTracks,
419 for(
unsigned int i = 0; i < 7; i++) {
420 unsigned int covSrc = bsCovSrc[
i];
421 for(
unsigned int j = 0;
j < 7;
j++) {
423 if (!covSrc || bsCovSrc[
j] != covSrc)
425 else if (covSrc == 1)
426 v = beamSpot->covariance(i,
j);
435 beamSpot.
isValid() ? beamSpot->dxdz() : 0.,
436 beamSpot.
isValid() ? beamSpot->dydz() : 0.,
440 fittedSVs = vertexRecoGT->vertices(
441 pv, bs, *ghostTrack);
443 fittedSVs = vertexReco->vertices(fitTracks, bs);
447 std::vector<TransientTrack> primaries_(
448 primaries.begin(), primaries.end());
450 fittedSVs = vertexRecoGT->vertices(
451 pv, *beamSpot, primaries_,
454 fittedSVs = vertexReco->vertices(
455 primaries_, fitTracks,
463 std::remove_copy_if(boost::make_transform_iterator(
464 fittedSVs.begin(), svBuilder),
465 boost::make_transform_iterator(
466 fittedSVs.end(), svBuilder),
467 std::back_inserter(SVs),
472 for(
size_t iExtSv = 0; iExtSv < extSecVertex->size(); iExtSv++){
473 const reco::Vertex & extVertex = (*extSecVertex)[iExtSv];
480 extAssoCollection.push_back( extVertex );
483 std::remove_copy_if(boost::make_transform_iterator( extAssoCollection.begin(), svBuilder),
484 boost::make_transform_iterator(extAssoCollection.end(), svBuilder),
485 std::back_inserter(SVs),
496 extAssoCollection.clear();
502 std::vector<SecondaryVertexTagInfo::VertexData> svData;
504 svData.resize(vtxIndices.size());
505 for(
unsigned int idx = 0;
idx < vtxIndices.size();
idx++) {
508 svData[
idx].vertex = sv;
511 svData[
idx].direction =
527 if (pos == trackRefs.
end() ) {
530 <<
"Could not find track from secondary "
531 "vertex in original tracks."
535 trackData[
index].second.svStatus =
537 ((
unsigned int)SecondaryVertexTagInfo::TrackData::trackAssociatedToVertex +
idx);
546 trackData, svData, SVs.size(),
547 TrackIPTagInfoRef(trackIPTagInfos,
548 iterJets - trackIPTagInfos->begin())));
math::Error< dimension >::type CovarianceMatrix
reco::Vertex::Point convertPos(const GlobalPoint &p)
T getParameter(std::string const &) const
trackRef_iterator tracks_end() const
last iterator over tracks
VertexFilter vertexFilter
Measurement1D dist3d() const
double y() const
y coordinate
const edm::InputTag trackIPTagInfoLabel
reco::Vertex::Error convertError(const GlobalError &ge)
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
const_iterator end() const
Termination of iteration.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const Point & position() const
position
TrackIPTagInfo::SortCriteria sortCriterium
const_iterator begin() const
Initialize an iterator over the RefVector.
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
edm::ParameterSet vtxRecoPSet
double z() const
y coordinate
ConstraintType constraint
Measurement1D dist2d() const
TrackSelector trackSelector
edm::InputTag extSVCollection
double x() const
x coordinate
std::pair< unsigned int, TrackData > IndexedTrackData
edm::InputTag beamSpotTag
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
math::XYZTLorentzVectorD p4(float mass=0.13957018, float minWeight=0.5) const
Returns the four momentum of the sum of the tracks, assuming the given mass for the decay products...
virtual Vector momentum() const GCC11_FINAL
spatial momentum vector
Error error() const
return SMatrix
double deltaR(const Vector1 &v1, const Vector2 &v2)
VertexSorting vertexSorting
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
trackRef_iterator tracks_begin() const
first iterator over tracks
static GhostTrackVertexFinder::FitType getGhostTrackFitType(const std::string &name)
Global3DVector GlobalVector