18 primaryVertexCut2_(0.0),
19 dcaPInnerHitCut2_(1000.0),
20 vertexCandidatesSize_(50),
28 cout <<
"~PFDisplacedVertexCandidateFinder - number of remaining elements: " <<
eventTracks_.size() << endl;
43 mainVertexHandle->begin()->x(), mainVertexHandle->begin()->y(), mainVertexHandle->begin()->z())
62 for (
unsigned i = 0;
i < trackh->size();
i++) {
82 cout <<
"========= Start Finding Displaced Vertex Candidates =========" << endl;
100 if (tempVertexCandidate.
isValid()) {
107 cout <<
"========= End Finding Displaced Vertex Candidates =========" << endl;
114 cout <<
"== Start the association procedure ==" << endl;
121 link((*last), (*next), dist, P, linktest);
126 cout <<
"link failed" << endl;
135 cout <<
"link parameters " 136 <<
" *next = " << (*next).key() <<
" *last = " << (*last).key() <<
" dist = " << dist
137 <<
" P.x = " << P.
x() <<
" P.y = " << P.
y() <<
" P.z = " << P.
z() << endl;
144 cout <<
"adding to block element " << (*next).key() << endl;
160 if (ie == last || ie == next) {
173 cout <<
"calling associate " << (*next).key() <<
" & " << (*ie).key() << endl;
175 ie =
associate(next, ie, tempVertexCandidate);
180 cout <<
"**** removing element " << endl;
188 cout <<
"== End the association procedure ==" << endl;
191 return iteratorToNextFreeElement;
199 if (fabs(el1->
eta() - el2->
eta()) > 1) {
203 if (el1->
pt() > 2 && el2->
pt() > 2 && fabs(el1->
phi() - el2->
phi()) > 1) {
218 vertexLinkTest = PFDisplacedVertexCandidate::LINKTEST_DCA;
227 double rho2 = P.
x() * P.
x() + P.
y() * P.
y();
236 double tob_rho_limit2 = 10000;
237 double tec_z_limit = 270;
239 if (rho2 > tob_rho_limit2) {
243 if (fabs(P.
z()) > tec_z_limit) {
279 const vector<TrackBaseRef>& els = vertexCandidate.
elements();
282 for (
unsigned i1 = 0;
i1 < els.size();
i1++) {
283 for (
unsigned i2 =
i1 + 1;
i2 < els.size();
i2++) {
292 link(els[
i1], els[
i2], dist, P, linktest);
296 cout <<
"Setting link between elements " << i1 <<
" key " << els[
i1].key() <<
" and " << i2 <<
" key " 297 << els[
i2].key() <<
" of dist =" << dist <<
" computed from link test " << linktest << endl;
301 vertexCandidate.
setLink(i1, i2, dist, P, linktest);
322 double pt = trackref->
pt();
323 double dpt = trackref->
ptError();
326 double pt_error = dpt / pt * 100;
329 cout <<
" PFDisplacedVertexFinder: PFrecTrack->Track Pt= " << pt <<
" dPt/Pt = " << pt_error
330 <<
"% nChi2 = " << nChi2 << endl;
333 cout <<
" PFBlockAlgo: skip badly measured or low pt track" 334 <<
" nChi2_cut = " << 5 <<
" pt_cut = " << 0.2 << endl;
349 out <<
"====== Particle Flow Block Algorithm ======= ";
351 out <<
"number of unassociated elements : " << a.
eventTracks_.size() << endl;
354 out <<
" Tracks selection based on " << std::endl;
355 out <<
" pvtx_ = " << a.
pvtx_ << std::endl;
356 out <<
" fabs(dxy) < " << a.
dxy_ <<
" and pt < " << a.
pt_min_prim_ << std::endl;
362 double pt = (*ie).get()->pt();
367 double innermost_radius =
sqrt(Pi.x() * Pi.x() + Pi.y() * Pi.y() + Pi.z() * Pi.z());
368 double outermost_radius =
sqrt(Po.x() * Po.x() + Po.y() * Po.y() + Po.z() * Po.z());
369 double innermost_rho =
sqrt(Pi.x() * Pi.x() + Pi.y() * Pi.y());
370 double outermost_rho =
sqrt(Po.x() * Po.x() + Po.y() * Po.y());
372 out <<
"ie = " << (*ie).key() <<
" pt = " << pt <<
" innermost hit radius = " << innermost_radius
373 <<
" rho = " << innermost_rho <<
" outermost hit radius = " << outermost_radius <<
" rho = " << outermost_rho
379 if (!vertexCandidates.get()) {
380 out <<
"vertexCandidates already transfered" << endl;
382 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
void link(const reco::TrackBaseRef &el1, const reco::TrackBaseRef &el2, double &dist, GlobalPoint &P, reco::PFDisplacedVertexCandidate::VertexLinkTest &linktest)
Check whether 2 elements are linked and fill the link parameters.
double z0() const
z coordinate
std::vector< PFDisplacedVertexCandidate > PFDisplacedVertexCandidateCollection
collection of PFDisplacedVertexCandidate objects
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_
double phi() const
azimuthal angle of momentum vector
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 setLink(unsigned i1, unsigned i2, const float dist, const GlobalPoint &dcaPoint, const VertexLinkTest test=LINKTEST_DCA)
double eta() const
pseudorapidity of momentum vector
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.
T const * get() const
Returns C++ pointer to the item.
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_
-----— Members -----— ///
GlobalPoint crossingPoint() const override
double vz() const
z coordinate of the reference point on track
std::vector< GlobalTrajectoryParameters > eventTrackTrajectories_
reco::PFDisplacedVertexCandidateCollection::const_iterator IBC
float distance() const override
XYZPointD XYZPoint
point in space with cartesian internal representation
std::pair< OmniClusterRef, TrackingParticleRef > P
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 y0() const
y coordinate
double primaryVertexCut2_
Do not reconstruct vertices wich are too close to the beam pipe.
int charge() const
track electric charge
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
bool debug_
if true, debug printouts activated
double vx() const
x coordinate of the reference point on track
unsigned vertexCandidatesSize_
PFDisplacedVertexCandidateFinder()
double x0() const
x coordinate