8 PFDisplacedVertex::PFDisplacedVertex() :
Vertex(), vertexType_(
ANY), primaryDirection_(0, 0, 0) {}
13 const Track& refTrack,
43 for (
size_t i = 0;
i < refitTrks.size();
i++) {
44 if (fabs(refitTrks[
i].
pt() - refittedTrack.
pt()) < 1.
e-5) {
59 primaryDirection_ /= (
sqrt(primaryDirection_.Mag2()) + 1
e-10);
79 return "CONVERSION_LOOSE";
81 return "CONVERTED_BREMM";
85 return "LAMBDA_DECAY";
87 return "LAMBDABAR_DECAY";
91 return "KMINUS_DECAY";
93 return "KPLUS_DECAY_LOOSE";
95 return "KMINUS_DECAY_LOOSE";
110 if (massHypo.find(
"PI") != string::npos)
112 else if (massHypo.find(
"KAON") != string::npos)
114 else if (massHypo.find(
"LAMBDA") != string::npos)
116 else if (massHypo.find(
"MASSLESS") != string::npos)
118 else if (massHypo.find(
"CUSTOM") != string::npos)
121 return momentum(mHypo, T, useRefitted, mass);
179 if (p_in.Mag2() < 1
e-10)
181 return acos(p_in.Dot(p_out) /
sqrt(p_in.Mag2() * p_out.Mag2())) /
TMath::Pi() * 180.0;
191 p_in = momentumPrim.Vect() /
sqrt(momentumPrim.Vect().Mag2() + 1
e-10);
201 double pion_mass2 = 0.0194;
203 double kaon_mass2 = 0.2476;
205 double lambda_mass2 = 1.267;
209 else if (massHypo ==
M_KAON)
218 cout <<
"Warning: undefined mass hypothesis" << endl;
227 out <<
"==================== This is a Displaced Vertex type " <<
nameVertexType() <<
" ===============" << endl;
229 out <<
" Vertex chi2 = " <<
chi2() <<
" ndf = " <<
ndof() <<
" normalised chi2 = " <<
normalizedChi2() << endl;
231 out <<
" The vertex Fitted Position is: x = " <<
position().x() <<
" y = " <<
position().y()
234 out <<
"\t--- Structure --- " << endl;
239 vector<PFDisplacedVertex::VertexTrackType> trackType =
trackTypes();
240 for (
unsigned i = 0;
i < pattern.size();
i++) {
241 out <<
"track " <<
i <<
" type = " << trackType[
i] <<
" nHit BeforeVtx = " << pattern[
i].first.first
242 <<
" AfterVtx = " << pattern[
i].second.first <<
" MissHit BeforeVtx = " << pattern[
i].first.second
243 <<
" AfterVtx = " << pattern[
i].second.second << endl;
250 out <<
"Primary P:\t E " << mom_prim.E() <<
"\tPt = " << mom_prim.Pt() <<
"\tPz = " << mom_prim.Pz()
251 <<
"\tM = " << mom_prim.M() <<
"\tEta = " << mom_prim.Eta() <<
"\tPhi = " << mom_prim.Phi() << endl;
253 out <<
"Secondary P:\t E " << mom_sec.E() <<
"\tPt = " << mom_sec.Pt() <<
"\tPz = " << mom_sec.Pz()
254 <<
"\tM = " << mom_sec.M() <<
"\tEta = " << mom_sec.Eta() <<
"\tPhi = " << mom_sec.Phi() << endl;
260 out <<
" Angle_io = " <<
angle_io() <<
" deg" << endl << endl;
const double getMass2(M_Hypo, double) const
Get the mass with a given hypothesis.
const int nKindTracks(VertexTrackType) const
Common tool used to get the number of tracks of a given Kind.
const double angle_io() const
void setPrimaryDirection(const math::XYZPoint &pvtx)
TrackBaseRef originalTrack(const Track &refTrack) const
double y() const
y coordinate
const math::XYZTLorentzVector secondaryMomentum(std::string massHypo="PI", bool useRefitted=true, double mass=0.0) const
const int totalCharge() const
Total Charge.
void add(Ref const &r, float w=1.0)
add a reference to a Track
void Dump(std::ostream &out=std::cout) const
cout function
const std::vector< PFTrackHitFullInfo > trackHitFullInfos() const
const Vector & momentum() const
track momentum vector
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const std::vector< Track > & refittedTracks() const
Returns the container of refitted tracks.
const Point & position() const
position
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const bool isThereKindTracks(VertexTrackType) const
---—— TOOLS --------—— ///
void addElement(const TrackBaseRef &r, const Track &refTrack, const PFTrackHitFullInfo &hitInfo, VertexTrackType trackType=T_NOT_FROM_VERTEX, float w=1.0)
Add a new track to the vertex.
std::vector< PFTrackHitFullInfo > trackHitFullInfos_
Information on the distance between track's hits and the Vertex.
double pt() const
track transverse momentum
const int nPrimaryTracks() const
Number of primary tracks was identified.
double chi2() const
chi-squares
double z() const
z coordinate
const std::vector< VertexTrackType > trackTypes() const
const math::XYZVector primaryDirection() const
Primary Direction.
size_t tracksSize() const
number of tracks
VertexType vertexType_
--—— MEMBERS --—— ///
const size_t trackPosition(const reco::TrackBaseRef &originalTrack) const
double x() const
x coordinate
PFDisplacedVertex()
Default constructor.
std::pair< PFTrackHitInfo, PFTrackHitInfo > PFTrackHitFullInfo
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
const math::XYZTLorentzVector primaryMomentum(std::string massHypo="PI", bool useRefitted=true, double mass=0.0) const
Momentum of primary or merged track calculated with a mass hypothesis.
std::vector< VertexTrackType > trackTypes_
Types of the tracks associated to the vertex.
std::pair< OmniClusterRef, TrackingParticleRef > P
const math::XYZTLorentzVector momentum(std::string, VertexTrackType, bool, double mass) const
Common tool to calculate the momentum vector of tracks with a given Kind.
math::XYZVector primaryDirection_
void cleanTracks()
Clean the tracks collection and all the associated collections.
Track refittedTrack(const TrackBaseRef &track) const
std::string nameVertexType() const
const int nMergedTracks() const
Number of merged tracks was identified.
double normalizedChi2() const
chi-squared divided by n.d.o.f.
const int nSecondaryTracks() const
Number of secondary tracks was identified.
M_Hypo
Mass hypothesis enum.
const int nTracks() const
Number of tracks.