21 primaryVertexCut2_(0.0),
22 dcaPInnerHitCut2_(1000.0),
23 vertexCandidatesSize_(50),
29 LogDebug(
"PFDisplacedVertexCandidateFinder")
30 <<
"~PFDisplacedVertexCandidateFinder - number of remaining elements: " <<
eventTracks_.size();
44 mainVertexHandle->begin()->x(), mainVertexHandle->begin()->y(), mainVertexHandle->begin()->z())
63 for (
unsigned i = 0;
i < trackh->size();
i++) {
83 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"========= Start Finding Displaced Vertex Candidates =========";
99 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"elements=" << tempVertexCandidate.
elements().size();
102 if (tempVertexCandidate.
isValid()) {
108 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"========= End Finding Displaced Vertex Candidates =========";
113 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"== Start the association procedure ==";
122 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"link failed";
127 LogDebug(
"PFDisplacedVertexCandidateFinder")
128 <<
"adding element " << (*next).key() <<
" to PFDisplacedVertexCandidate with " 129 << tempVertexCandidate.
elements().size() <<
" elements";
133 LogDebug(
"PFDisplacedVertexCandidateFinder")
134 <<
"link parameters " 135 <<
" *next = " << (*next).key() <<
" *last = " << (*last).key() <<
" dist = " << crossingPoint
136 <<
" P.x = " << crossingPoint.
x() <<
" P.y = " << crossingPoint.
y() <<
" P.z = " << crossingPoint.
z();
140 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"adding to block element " << (*next).key();
163 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"calling associate " << (*next).key() <<
" & " << (*ie).key();
167 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"**** removing element ";
171 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"== End the association procedure ==";
173 return iteratorToNextFreeElement;
182 const auto iel1 = el1.
key();
183 const auto iel2 = el2.
key();
208 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"link iel1=" << iel1 <<
" iel2=" << iel2 <<
" dist=" << dist;
211 vertexLinkTest = PFDisplacedVertexCandidate::LINKTEST_DCA;
220 double rho2 = crossingPoint.
x() * crossingPoint.
x() + crossingPoint.
y() * crossingPoint.
y();
229 double tob_rho_limit2 = 10000;
230 double tec_z_limit = 270;
232 if (rho2 > tob_rho_limit2) {
236 if (
std::abs(crossingPoint.
z()) > tec_z_limit) {
272 const vector<TrackBaseRef>& els = vertexCandidate.
elements();
275 for (
unsigned i1 = 0;
i1 < els.size();
i1++) {
276 for (
unsigned i2 =
i1 + 1;
i2 < els.size();
i2++) {
285 link(els[
i1], els[
i2], dist, crossingPoint, linktest);
286 LogDebug(
"PFDisplacedVertexCandidateFinder")
287 <<
"Setting link between elements " <<
i1 <<
" key " << els[
i1].key() <<
" and " <<
i2 <<
" key " 288 << els[
i2].key() <<
" of dist =" << dist <<
" computed from link test " << linktest;
291 vertexCandidate.
setLink(
i1,
i2, dist, crossingPoint, linktest);
312 double pt = trackref->
pt();
313 double dpt = trackref->
ptError();
316 double pt_error = dpt /
pt * 100;
318 LogDebug(
"PFDisplacedVertexCandidateFinder")
319 <<
" PFDisplacedVertexFinder: PFrecTrack->Track Pt= " <<
pt <<
" dPt/Pt = " << pt_error <<
"% nChi2 = " << nChi2;
321 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
" PFBlockAlgo: skip badly measured or low pt track" 322 <<
" nChi2_cut = " << 5 <<
" pt_cut = " << 0.2;
337 out <<
"====== Particle Flow Block Algorithm ======= ";
339 out <<
"number of unassociated elements : " <<
a.eventTracks_.size() << endl;
342 out <<
" Tracks selection based on " << std::endl;
343 out <<
" pvtx_ = " <<
a.pvtx_ << std::endl;
344 out <<
" std::abs(dxy) < " <<
a.dxy_ <<
" and pt < " <<
a.pt_min_prim_ << std::endl;
345 out <<
" nChi2 < " <<
a.nChi2_max_ <<
" and pt < " <<
a.pt_min_ << std::endl;
350 double pt = (*ie).get()->pt();
355 double innermost_radius =
sqrt(
Pi.x() *
Pi.x() +
Pi.y() *
Pi.y() +
Pi.z() *
Pi.z());
356 double outermost_radius =
sqrt(Po.x() * Po.x() + Po.y() * Po.y() + Po.z() * Po.z());
357 double innermost_rho =
sqrt(
Pi.x() *
Pi.x() +
Pi.y() *
Pi.y());
358 double outermost_rho =
sqrt(Po.x() * Po.x() + Po.y() * Po.y());
360 out <<
"ie = " << (*ie).key() <<
" pt = " <<
pt <<
" innermost hit radius = " << innermost_radius
361 <<
" rho = " << innermost_rho <<
" outermost hit radius = " << outermost_radius <<
" rho = " << outermost_rho
368 out <<
"vertexCandidates already transfered" << 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
GlobalTrajectoryParameters getGlobalTrajectoryParameters(const reco::Track *) const
--—— TOOLS --—— //
A block of tracks linked together.
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
const std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > & vertexCandidates() const
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)
TwoTrackMinimumDistance theMinimum_
bool isValid() const
A Vertex Candidate is valid if it has at least two tracks.
GlobalPoint crossingPoint() const override
friend std::ostream & operator<<(std::ostream &, const PFDisplacedVertexCandidateFinder &)
std::list< reco::TrackBaseRef > eventTracks_
The track refs.
~PFDisplacedVertexCandidateFinder()
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
double x0() const
x coordinate
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.
double pt() const
track transverse momentum
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_
edm::soa::AddColumns_t< EtaPhiTable, std::tuple< col::Pt > > PtEtaPhiTable
double dcaCut_
–— Algo parameters for the vertex finder -— ///
Abs< T >::type abs(const T &t)
double y0() const
y coordinate
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_
-----— Members -----— ///
const std::vector< TrackBaseRef > & elements() const
std::vector< GlobalTrajectoryParameters > eventTrackTrajectories_
reco::PFDisplacedVertexCandidateCollection::const_iterator IBC
XYZPointD XYZPoint
point in space with cartesian internal representation
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
bool isSelected(const reco::TrackBaseRef &trackref)
double z0() const
z coordinate
std::list< reco::TrackBaseRef >::const_iterator IEC
static int position[264][3]
void packLinks(reco::PFDisplacedVertexCandidate &vertexCandidate)
T const * get() const
Returns C++ pointer to the item.
void findDisplacedVertexCandidates()
-----— Main function which find vertices -----— ///
double primaryVertexCut2_
Do not reconstruct vertices wich are too close to the beam pipe.
float distance() const override
bool goodPtResolution(const reco::TrackBaseRef &trackref) const
Quality Criterion on the Pt resolution to select a Track.
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
unsigned vertexCandidatesSize_
PFDisplacedVertexCandidateFinder()