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())+1e-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() < 1e-10)
return -1;
197 return acos(p_in.Dot(p_out)/
sqrt(p_in.Mag2()*p_out.Mag2()))/
TMath::Pi()*180.0;
212 momentumPrim.E() > momentumSec.E()){
213 p_in = momentumPrim.Vect()/
sqrt(momentumPrim.Vect().Mag2()+1e-10);
226 double pion_mass2 = 0.0194;
228 double kaon_mass2 = 0.2476;
230 double lambda_mass2 = 1.267;
232 if (massHypo ==
M_PION)
return pion_mass2;
233 else if (massHypo ==
M_KAON)
return kaon_mass2;
234 else if (massHypo ==
M_LAMBDA)
return lambda_mass2;
236 else if (massHypo ==
M_CUSTOM)
return mass*mass;
238 cout <<
"Warning: undefined mass hypothesis" << endl;
247 out <<
"==================== This is a Displaced Vertex type " <<
250 out <<
" Vertex chi2 = " <<
chi2() <<
" ndf = " <<
ndof()<<
" normalised chi2 = " <<
normalizedChi2()<< endl;
252 out <<
" The vertex Fitted Position is: x = " <<
position().x()
258 out<<
"\t--- Structure --- " << endl;
259 out<<
"Number of tracks: " <<
nTracks()
265 vector <PFDisplacedVertex::VertexTrackType> trackType =
trackTypes();
266 for (
unsigned i = 0;
i < pattern.size();
i++){
268 <<
" type = " << trackType[
i]
269 <<
" nHit BeforeVtx = " << pattern[
i].first.first
270 <<
" AfterVtx = " << pattern[
i].second.first
271 <<
" MissHit BeforeVtx = " << pattern[
i].first.second
272 <<
" AfterVtx = " << pattern[
i].second.second
280 out <<
"Primary P:\t E " << mom_prim.E()
281 <<
"\tPt = " << mom_prim.Pt()
282 <<
"\tPz = " << mom_prim.Pz()
283 <<
"\tM = " << mom_prim.M()
284 <<
"\tEta = " << mom_prim.Eta()
285 <<
"\tPhi = " << mom_prim.Phi() << endl;
287 out <<
"Secondary P:\t E " << mom_sec.E()
288 <<
"\tPt = " << mom_sec.Pt()
289 <<
"\tPz = " << mom_sec.Pz()
290 <<
"\tM = " << mom_sec.M()
291 <<
"\tEta = " << mom_sec.Eta()
292 <<
"\tPhi = " << mom_sec.Phi() << endl;
300 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.