18 primaryVertexCut2_(0.0),
19 dcaPInnerHitCut2_(1000.0),
20 vertexCandidatesSize_(50),
32 cout<<
"~PFDisplacedVertexCandidateFinder - number of remaining elements: " 52 mainVertexHandle->begin()->y(),
53 mainVertexHandle->begin()->z()) :
73 for(
unsigned i=0;
i<trackh->size();
i++) {
96 if (
debug_)
cout <<
"========= Start Finding Displaced Vertex Candidates =========" << endl;
115 if(tempVertexCandidate.
isValid()) {
121 if(
debug_)
cout <<
"========= End Finding Displaced Vertex Candidates =========" << endl;
134 if(
debug_ )
cout<<
"== Start the association procedure =="<<endl;
141 link( (*last), (*next), dist, P, linktest);
156 cout<<
"link parameters " 157 <<
" *next = " << (*next).key()
158 <<
" *last = " << (*last).key()
159 <<
" dist = " << dist
160 <<
" P.x = " << P.
x()
161 <<
" P.y = " << P.
y()
162 <<
" P.z = " << P.
z()
192 if( ie == last || ie == next ) { ++ie;
continue;}
195 if( !
trackMask_[(*ie).key()] ) { ++ie;
continue;}
204 ie =
associate(next, ie, tempVertexCandidate);
210 cout<<
"**** removing element "<<endl;
217 if(
debug_ )
cout<<
"== End the association procedure ==" <<endl;
220 return iteratorToNextFreeElement;
232 if ( fabs(el1->
eta()-el2->
eta()) > 1) {dist = -1;
return;}
233 if ( el1->
pt()>2 && el2->
pt()>2 && fabs(el1->
phi()-el2->
phi()) > 1) {dist = -1;
return;}
246 vertexLinkTest = PFDisplacedVertexCandidate::LINKTEST_DCA;
250 if (dist >
dcaCut_) {dist = -1;
return;}
253 double rho2 = P.
x()*P.
x()+P.
y()*P.
y();
259 double tob_rho_limit2 = 10000;
260 double tec_z_limit = 270;
262 if ( rho2 > tob_rho_limit2) {dist = -1;
return;}
263 if ( fabs(P.
z()) > tec_z_limit) {dist = -1;
return;}
302 const vector < TrackBaseRef >& els = vertexCandidate.
elements();
305 for(
unsigned i1=0; i1<els.size(); i1++ ) {
306 for(
unsigned i2=i1+1; i2<els.size(); i2++ ) {
309 if( i1==i2 )
continue;
315 link( els[i1], els[i2], dist, P, linktest);
320 cout <<
"Setting link between elements " << i1 <<
" key " << els[i1].key()
321 <<
" and " << i2 <<
" key " << els[i2].key()
322 <<
" of dist =" << dist <<
" computed from link test " 326 if(dist >-0.5) vertexCandidate.
setLink( i1, i2, dist, P, linktest );
364 double pt = trackref->
pt();
365 double dpt = trackref->
ptError();
368 double pt_error = dpt/pt*100;
370 if (
debug_)
cout <<
" PFDisplacedVertexFinder: PFrecTrack->Track Pt= " 371 << pt <<
" dPt/Pt = " << pt_error <<
"% nChi2 = " << nChi2 << endl;
374 if (
debug_)
cout <<
" PFBlockAlgo: skip badly measured or low pt track" 375 <<
" nChi2_cut = " << 5
376 <<
" pt_cut = " << 0.2 << endl;
399 if(! out)
return out;
401 out<<
"====== Particle Flow Block Algorithm ======= ";
403 out<<
"number of unassociated elements : "<<a.
eventTracks_.size()<<endl;
406 out <<
" Tracks selection based on " << std::endl;
407 out <<
" pvtx_ = " << a.
pvtx_ << std::endl;
408 out <<
" fabs(dxy) < " << a.
dxy_ <<
" and pt < "<< a.
pt_min_prim_ << std::endl;
417 double pt = (*ie).get()->pt();
422 double innermost_radius =
sqrt(Pi.x()*Pi.x() + Pi.y()*Pi.y() + Pi.z()*Pi.z());
423 double outermost_radius =
sqrt(Po.x()*Po.x() + Po.y()*Po.y() + Po.z()*Po.z());
424 double innermost_rho =
sqrt(Pi.x()*Pi.x() + Pi.y()*Pi.y());
425 double outermost_rho =
sqrt(Po.x()*Po.x() + Po.y()*Po.y());
427 out<<
"ie = " << (*ie).key()
429 <<
" innermost hit radius = " << innermost_radius <<
" rho = " << innermost_rho
430 <<
" outermost hit radius = " << outermost_radius <<
" rho = " << outermost_rho
435 const std::unique_ptr< reco::PFDisplacedVertexCandidateCollection >&
vertexCandidates 438 if(!vertexCandidates.get() ) {
439 out<<
"vertexCandidates already transfered"<<endl;
442 out<<
"number of vertexCandidates : "<<vertexCandidates->size()<<endl;
447 ib != vertexCandidates->end();
ib++)
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.
const std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > & vertexCandidates() const
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_
-----— Members -----— ///
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)
std::vector< GlobalTrajectoryParameters > eventTrackTrajectories_
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 &)
~PFDisplacedVertexCandidateFinder()
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
std::list< reco::TrackBaseRef >::const_iterator IEC
void setLink(unsigned i1, unsigned i2, const float dist, const GlobalPoint &dcaPoint, const VertexLinkTest test=LINKTEST_DCA)
double eta() const
pseudorapidity of momentum vector
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.
GlobalPoint crossingPoint() const override
double vz() const
z coordinate of the reference point on track
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)
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.
std::list< reco::TrackBaseRef > eventTracks_
The track refs.
int charge() const
track electric charge
const std::vector< TrackBaseRef > & elements() const
std::list< reco::TrackBaseRef >::iterator IE
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