9 PFDisplacedVertex::PFDisplacedVertex() :
Vertex(),
11 primaryDirection_(0,0,0)
16 primaryDirection_(0,0,0)
41 vector <VertexTrackType>::const_iterator iter =
63 for (
size_t i = 0;
i < refitTrks.size();
i++){
64 if ( fabs(refitTrks[
i].pt() - refittedTrack.
pt()) < 1.
e-5 ){
83 primaryDirection_ /= (
sqrt(primaryDirection_.Mag2())+1
e-10);
90 case ANY:
return "ANY";
91 case FAKE:
return "FAKE";
92 case LOOPER:
return "LOOPER";
93 case NUCL:
return "NUCL";
118 if (massHypo.find(
"PI")!=string::npos) mHypo =
M_PION;
119 else if (massHypo.find(
"KAON")!=string::npos) mHypo =
M_KAON;
120 else if (massHypo.find(
"LAMBDA")!=string::npos) mHypo =
M_LAMBDA;
121 else if (massHypo.find(
"MASSLESS")!=string::npos) mHypo =
M_MASSLESS;
122 else if (massHypo.find(
"CUSTOM")!=string::npos) mHypo =
M_CUSTOM;
124 return momentum(mHypo, T, useRefitted, mass);
132 const double m2 =
getMass2(massHypo, mass);
196 if (p_in.Mag2() < 1
e-10)
return -1;
197 return acos(p_in.Dot(p_out)/
sqrt(p_in.Mag2()*p_out.Mag2()))/
TMath::Pi()*180.0;
210 momentumPrim.E() > momentumSec.E()){
211 p_in = momentumPrim.Vect()/
sqrt(momentumPrim.Vect().Mag2()+1
e-10);
224 double pion_mass2 = 0.0194;
226 double kaon_mass2 = 0.2476;
228 double lambda_mass2 = 1.267;
230 if (massHypo ==
M_PION)
return pion_mass2;
231 else if (massHypo ==
M_KAON)
return kaon_mass2;
232 else if (massHypo ==
M_LAMBDA)
return lambda_mass2;
234 else if (massHypo ==
M_CUSTOM)
return mass*mass;
236 cout <<
"Warning: undefined mass hypothesis" << endl;
245 out <<
"==================== This is a Displaced Vertex type " <<
248 out <<
" Vertex chi2 = " <<
chi2() <<
" ndf = " <<
ndof()<<
" normalised chi2 = " <<
normalizedChi2()<< endl;
250 out <<
" The vertex Fitted Position is: x = " <<
position().x()
256 out<<
"\t--- Structure --- " << endl;
257 out<<
"Number of tracks: " <<
nTracks()
263 vector <PFDisplacedVertex::VertexTrackType> trackType =
trackTypes();
264 for (
unsigned i = 0;
i < pattern.size();
i++){
266 <<
" type = " << trackType[
i]
267 <<
" nHit BeforeVtx = " << pattern[
i].first.first
268 <<
" AfterVtx = " << pattern[
i].second.first
269 <<
" MissHit BeforeVtx = " << pattern[
i].first.second
270 <<
" AfterVtx = " << pattern[
i].second.second
278 out <<
"Primary P:\t E " << mom_prim.E()
279 <<
"\tPt = " << mom_prim.Pt()
280 <<
"\tPz = " << mom_prim.Pz()
281 <<
"\tM = " << mom_prim.M()
282 <<
"\tEta = " << mom_prim.Eta()
283 <<
"\tPhi = " << mom_prim.Phi() << endl;
285 out <<
"Secondary P:\t E " << mom_sec.E()
286 <<
"\tPt = " << mom_sec.Pt()
287 <<
"\tPz = " << mom_sec.Pz()
288 <<
"\tM = " << mom_sec.M()
289 <<
"\tEta = " << mom_sec.Eta()
290 <<
"\tPhi = " << mom_sec.Phi() << endl;
298 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 Vector & momentum() const
track momentum vector
const double angle_io() const
void setPrimaryDirection(const math::XYZPoint &pvtx)
const std::vector< PFTrackHitFullInfo > trackHitFullInfos() const
TrackBaseRef originalTrack(const Track &refTrack) const
Track refittedTrack(const TrackBaseRef &track) 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 Dump(std::ostream &out=std::cout) const
cout function
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.
double pt() const
track transverse momentum
const int nPrimaryTracks() const
Number of primary tracks was identified.
double chi2() const
chi-squares
double z() const
y coordinate
const std::vector< VertexTrackType > trackTypes() const
const math::XYZVector primaryDirection() const
Primary Direction.
VertexType vertexType_
--—— MEMBERS --—— ///
const size_t trackPosition(const reco::TrackBaseRef &originalTrack) const
void add(const TrackBaseRef &r, float w=1.0)
add a reference to a Track
double x() const
x coordinate
PFDisplacedVertex()
Default constructor.
std::vector< PFTrackHitFullInfo > trackHitFullInfos_
Information on the distance between track's hits and the Vertex.
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.
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.
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
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.
size_t tracksSize() const
number of tracks
std::vector< VertexTrackType > trackTypes_
Types of the tracks associated to the vertex.
const int nTracks() const
Number of tracks.