20 primaryVertexCut2_(0.0),
21 dcaPInnerHitCut2_(1000.0),
22 vertexCandidatesSize_(50),
28 LogDebug(
"PFDisplacedVertexCandidateFinder")
29 <<
"~PFDisplacedVertexCandidateFinder - number of remaining elements: " <<
eventTracks_.size();
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 ==";
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();
162 LogDebug(
"PFDisplacedVertexCandidateFinder") <<
"calling associate " << (*next).key() <<
" & " << (*ie).key();
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();
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;
344 out <<
" nChi2 < " <<
a.nChi2_max_ <<
" and pt < " <<
a.pt_min_ << 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
367 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()