File indexing completed on 2024-04-06 12:04:52
0001 #include "DataFormats/ParticleFlowReco/interface/PFBlockElementCluster.h"
0002 #include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
0003 #include "DataFormats/Common/interface/Ref.h"
0004 #include "Math/Vector3D.h"
0005
0006 #include <iomanip>
0007
0008 using namespace reco;
0009 using namespace std;
0010
0011 void PFBlockElementCluster::Dump(ostream& out, const char* tab) const {
0012 if (!out)
0013 return;
0014
0015
0016 ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>, ROOT::Math::DefaultCoordinateSystemTag> clusterPos(
0017 clusterRef_->position().X(), clusterRef_->position().Y(), clusterRef_->position().Z());
0018
0019 clusterPos = clusterPos.Unit();
0020 double E = clusterRef_->energy();
0021 clusterPos *= E;
0022 double ET = sqrt(clusterPos.X() * clusterPos.X() + clusterPos.Y() * clusterPos.Y());
0023
0024 out << setprecision(3);
0025 out << tab << setw(7) << "layer=" << setw(3) << clusterRef_->layer();
0026 out << setiosflags(ios::right);
0027 out << setiosflags(ios::fixed);
0028 out << setw(4) << ", ET =" << setw(7) << ET;
0029 out << setw(4) << ", E =" << setw(7) << E;
0030 out << " (eta,phi,z)= (";
0031 out << clusterRef_->position().Eta() << ",";
0032 out << clusterRef_->position().Phi() << ",";
0033 out << clusterRef_->position().Z() << ")";
0034 out << resetiosflags(ios::right | ios::fixed);
0035 }