20 primaryVertexCut2_(0.0),
21 dcaPInnerHitCut2_(1000.0),
22 vertexCandidatesSize_(50),
28 LogDebug(
"PFDisplacedVertexCandidateFinder")
29 <<
"~PFDisplacedVertexCandidateFinder - number of remaining elements: " <<
eventTracks_.size();
35 ?
math::XYZPoint(beamSpotHandle->x0(), beamSpotHandle->y0(), beamSpotHandle->z0())
43 mainVertexHandle->begin()->x(), mainVertexHandle->begin()->y(), mainVertexHandle->begin()->z())
62 for (
unsigned i = 0;
i < trackh->size();
i++) {
82 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"========= Start Finding Displaced Vertex Candidates =========";
98 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"elements=" << tempVertexCandidate.
elements().size();
101 if (tempVertexCandidate.
isValid()) {
107 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"========= End Finding Displaced Vertex Candidates =========";
112 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"== Start the association procedure ==";
118 link(*last, *next, dist, crossingPoint, linktest);
121 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"link failed";
126 LogDebug(
"PFDisplacedVertexCandidateFinder")
127 <<
"adding element " << (*next).key() <<
" to PFDisplacedVertexCandidate with "
128 << tempVertexCandidate.
elements().size() <<
" elements";
132 LogDebug(
"PFDisplacedVertexCandidateFinder")
133 <<
"link parameters "
134 <<
" *next = " << (*next).key() <<
" *last = " << (*last).key() <<
" dist = " << crossingPoint
135 <<
" P.x = " << crossingPoint.
x() <<
" P.y = " << crossingPoint.
y() <<
" P.z = " << crossingPoint.
z();
139 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"adding to block element " << (*next).key();
151 if (ie == last || ie == next) {
157 if (!trackMask_[(*ie).key()]) {
162 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"calling associate " << (*next).key() <<
" & " << (*ie).key();
163 ie =
associate(next, ie, tempVertexCandidate);
166 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"**** removing element ";
170 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"== End the association procedure ==";
172 return iteratorToNextFreeElement;
181 const auto iel1 = el1.
key();
182 const auto iel2 = el2.
key();
194 if (pt1 > 2 && pt2 > 2 &&
std::abs(phi1 - phi2) > 1) {
207 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"link iel1=" << iel1 <<
" iel2=" << iel2 <<
" dist=" << dist;
210 vertexLinkTest = PFDisplacedVertexCandidate::LINKTEST_DCA;
219 double rho2 = crossingPoint.
x() * crossingPoint.
x() + crossingPoint.
y() * crossingPoint.
y();
228 double tob_rho_limit2 = 10000;
229 double tec_z_limit = 270;
231 if (rho2 > tob_rho_limit2) {
235 if (
std::abs(crossingPoint.
z()) > tec_z_limit) {
271 const vector<TrackBaseRef>& els = vertexCandidate.
elements();
274 for (
unsigned i1 = 0; i1 < els.size(); i1++) {
275 for (
unsigned i2 = i1 + 1; i2 < els.size(); i2++) {
284 link(els[i1], els[i2], dist, crossingPoint, linktest);
285 LogDebug(
"PFDisplacedVertexCandidateFinder")
286 <<
"Setting link between elements " << i1 <<
" key " << els[i1].key() <<
" and " << i2 <<
" key "
287 << els[i2].key() <<
" of dist =" << dist <<
" computed from link test " << linktest;
290 vertexCandidate.
setLink(i1, i2, dist, crossingPoint, linktest);
311 double pt = trackref->
pt();
312 double dpt = trackref->
ptError();
315 double pt_error = dpt / pt * 100;
317 LogDebug(
"PFDisplacedVertexCandidateFinder")
318 <<
" PFDisplacedVertexFinder: PFrecTrack->Track Pt= " << pt <<
" dPt/Pt = " << pt_error <<
"% nChi2 = " << nChi2;
320 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
" PFBlockAlgo: skip badly measured or low pt track"
321 <<
" nChi2_cut = " << 5 <<
" pt_cut = " << 0.2;
336 out <<
"====== Particle Flow Block Algorithm ======= ";
338 out <<
"number of unassociated elements : " << a.
eventTracks_.size() << endl;
341 out <<
" Tracks selection based on " << std::endl;
342 out <<
" pvtx_ = " << a.
pvtx_ << std::endl;
343 out <<
" std::abs(dxy) < " << a.
dxy_ <<
" and pt < " << a.
pt_min_prim_ << std::endl;
349 double pt = (*ie).get()->pt();
354 double innermost_radius =
sqrt(Pi.x() * Pi.x() + Pi.y() * Pi.y() + Pi.z() * Pi.z());
355 double outermost_radius =
sqrt(Po.x() * Po.x() + Po.y() * Po.y() + Po.z() * Po.z());
356 double innermost_rho =
sqrt(Pi.x() * Pi.x() + Pi.y() * Pi.y());
357 double outermost_rho =
sqrt(Po.x() * Po.x() + Po.y() * Po.y());
359 out <<
"ie = " << (*ie).key() <<
" pt = " << pt <<
" innermost hit radius = " << innermost_radius
360 <<
" rho = " << innermost_rho <<
" outermost hit radius = " << outermost_radius <<
" rho = " << outermost_rho
366 if (!vertexCandidates.get()) {
367 out <<
"vertexCandidates already transfered" << endl;
369 out <<
"number of vertexCandidates : " << vertexCandidates->size() << endl;
void setInput(const edm::Handle< reco::TrackCollection > &trackh, const MagneticField *magField)
void addElement(const TrackBaseRef)
add a track Reference to the current Candidate
std::vector< PFDisplacedVertexCandidate > PFDisplacedVertexCandidateCollection
collection of PFDisplacedVertexCandidate objects
edm::soa::AddColumns_t< EtaPhiTable, std::tuple< col::Pt >> PtEtaPhiTable
A block of tracks linked together.
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
GlobalTrajectoryParameters getGlobalTrajectoryParameters(const reco::Track *) const
--—— TOOLS --—— //
IE associate(IE next, IE last, reco::PFDisplacedVertexCandidate &tempVertexCandidate)
--—— Different steps of the finder algorithm --—— ///
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
const std::vector< TrackBaseRef > & elements() const
TwoTrackMinimumDistance theMinimum_
GlobalPoint crossingPoint() const override
const Vector & momentum() const
track momentum vector
friend std::ostream & operator<<(std::ostream &, const PFDisplacedVertexCandidateFinder &)
const std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > & vertexCandidates() const
std::list< reco::TrackBaseRef > eventTracks_
The track refs.
~PFDisplacedVertexCandidateFinder()
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
void link(const reco::TrackBaseRef &el1, const reco::TrackBaseRef &el2, double &dist, GlobalPoint &crossing_point, reco::PFDisplacedVertexCandidate::VertexLinkTest &linktest)
Check whether 2 elements are linked and fill the link parameters.
edm::soa::PtEtaPhiTable track_table_
void setLink(unsigned i1, unsigned i2, const float dist, const GlobalPoint &dcaPoint, const VertexLinkTest test=LINKTEST_DCA)
std::list< reco::TrackBaseRef >::iterator IE
const MagneticField * magField_
double dcaCut_
–— Algo parameters for the vertex finder -— ///
double pt() const
track transverse momentum
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
bool isValid() const
A Vertex Candidate is valid if it has at least two tracks.
Abs< T >::type abs(const T &t)
T const * get() const
Returns C++ pointer to the item.
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_
-----— Members -----— ///
double vz() const
z coordinate of the reference point on track
std::vector< GlobalTrajectoryParameters > eventTrackTrajectories_
reco::PFDisplacedVertexCandidateCollection::const_iterator IBC
XYZPointD XYZPoint
point in space with cartesian internal representation
bool goodPtResolution(const reco::TrackBaseRef &trackref) const
Quality Criterion on the Pt resolution to select a Track.
bool isSelected(const reco::TrackBaseRef &trackref)
std::list< reco::TrackBaseRef >::const_iterator IEC
double vy() const
y coordinate of the reference point on track
static int position[264][3]
void packLinks(reco::PFDisplacedVertexCandidate &vertexCandidate)
void findDisplacedVertexCandidates()
-----— Main function which find vertices -----— ///
double primaryVertexCut2_
Do not reconstruct vertices wich are too close to the beam pipe.
int charge() const
track electric charge
float distance() const override
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
double vx() const
x coordinate of the reference point on track
unsigned vertexCandidatesSize_
PFDisplacedVertexCandidateFinder()