CMS 3D CMS Logo

PFBlockElementCluster.cc

Go to the documentation of this file.
00001 #include "DataFormats/ParticleFlowReco/interface/PFBlockElementCluster.h"
00002 #include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
00003 #include "DataFormats/Common/interface/Ref.h" 
00004 #include "Math/Vector3D.h"
00005 
00006 #include <iomanip>
00007 
00008 using namespace reco;
00009 using namespace std;
00010 
00011 void PFBlockElementCluster::Dump(ostream& out, 
00012                                  const char* tab ) const {
00013   
00014   if(! out ) return;
00015   // need to convert the math::XYZPoint data member of the PFCluster class=
00016   // to a displacement vector: 
00017   ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D<double> , ROOT::Math::DefaultCoordinateSystemTag > 
00018     clusterPos( clusterRef_->position().X(), clusterRef_->position().Y(),clusterRef_->position().Z() );
00019 
00020   clusterPos = clusterPos.Unit();
00021   double E = clusterRef_->energy();
00022   clusterPos *= E;
00023   double ET = sqrt (clusterPos.X()*clusterPos.X() + clusterPos.Y()*clusterPos.Y());
00024 
00025   out << setprecision(3);
00026   out << tab<<setw(7)<<"layer="<<setw(3)<<clusterRef_->layer();
00027   out << setiosflags(ios::right);
00028   out << setiosflags(ios::fixed);
00029   out << setw(4) <<", ET =" << setw(7) << ET;
00030   out << setw(4) <<", E ="  << setw(7) << E;
00031   out << " (eta,phi)= (";
00032   out << clusterRef_->position().Eta()<<",";
00033   out << clusterRef_->position().Phi()<<")";
00034   out << resetiosflags(ios::right|ios::fixed);
00035 }

Generated on Tue Jun 9 17:31:23 2009 for CMSSW by  doxygen 1.5.4