Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#include "DataFormats/ParticleFlowReco/interface/PFBlockElementSuperCluster.h"
#include "DataFormats/EgammaReco/interface/SuperCluster.h"
#include "DataFormats/Common/interface/Ref.h"
#include "Math/Vector3D.h"

#include <iomanip>

using namespace reco;
using namespace std;

void PFBlockElementSuperCluster::Dump(ostream& out, const char* tab) const {
  if (!out)
    return;
  // need to convert the math::XYZPoint data member of the PFCluster class=
  // to a displacement vector:
  ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>, ROOT::Math::DefaultCoordinateSystemTag> clusterPos(
      superClusterRef_->position().X(), superClusterRef_->position().Y(), superClusterRef_->position().Z());

  clusterPos = clusterPos.Unit();
  double E = superClusterRef_->energy();
  clusterPos *= E;
  double ET = sqrt(clusterPos.X() * clusterPos.X() + clusterPos.Y() * clusterPos.Y());

  out << setprecision(3);
  out << setiosflags(ios::right);
  out << setiosflags(ios::fixed);
  out << setw(4) << ", ET =" << setw(7) << ET;
  out << setw(4) << ", E =" << setw(7) << E;
  out << " (eta,phi,z)= (";
  out << superClusterRef_->position().Eta() << ",";
  out << superClusterRef_->position().Phi() << ",";
  out << superClusterRef_->position().Z() << ")";
  out << resetiosflags(ios::right | ios::fixed);
}