CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DataFormats/ParticleFlowReco/src/PFTrajectoryPoint.cc

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