00001 #include "DataFormats/ParticleFlowReco/interface/PFTrajectoryPoint.h" 00002 00003 using namespace reco; 00004 00005 PFTrajectoryPoint::PFTrajectoryPoint() : 00006 isTrackerLayer_(false), 00007 detId_(-1), 00008 layer_(-1) {} 00009 00010 00011 PFTrajectoryPoint::PFTrajectoryPoint(int detId, 00012 int layer, 00013 const math::XYZPoint& posxyz, 00014 const math::XYZTLorentzVector& momentum) : 00015 isTrackerLayer_(false), 00016 detId_(detId), 00017 layer_(layer), 00018 posxyz_(posxyz), 00019 momentum_(momentum) 00020 { 00021 if (detId) isTrackerLayer_ = true; 00022 posrep_.SetCoordinates(posxyz_.Rho(), posxyz_.Eta(), posxyz_.Phi()); 00023 } 00024 00025 00026 PFTrajectoryPoint::PFTrajectoryPoint(const PFTrajectoryPoint& other) : 00027 isTrackerLayer_(other.isTrackerLayer_), 00028 detId_(other.detId_), 00029 layer_(other.layer_), 00030 posxyz_(other.posxyz_), 00031 posrep_(other.posrep_), 00032 momentum_(other.momentum_) { } 00033 00034 00035 PFTrajectoryPoint::~PFTrajectoryPoint() 00036 {} 00037 00038 00039 bool PFTrajectoryPoint::operator==(const reco::PFTrajectoryPoint& other) const { 00040 if( posxyz_ == other.posxyz_ && 00041 momentum_ == other.momentum_ ) return true; 00042 else return false; 00043 } 00044 00045 std::ostream& reco::operator<<(std::ostream& out, 00046 const reco::PFTrajectoryPoint& trajPoint) { 00047 if(!out) return out; 00048 00049 const math::XYZPoint& posxyz = trajPoint.position(); 00050 00051 out<<"Traj point id = "<<trajPoint.detId() 00052 <<", layer = "<<trajPoint.layer() 00053 <<", Eta,Phi = "<<posxyz.Eta()<<","<<posxyz.Phi() 00054 <<", X,Y = "<<posxyz.X()<<","<<posxyz.Y() 00055 <<", R,Z = "<<posxyz.Rho()<<","<<posxyz.Z() 00056 <<", E,Pt = "<<trajPoint.momentum().E()<<","<<trajPoint.momentum().Pt(); 00057 00058 return out; 00059 }