CMS 3D CMS Logo

PFSuperCluster.cc
Go to the documentation of this file.
4 
5 using namespace std;
6 using namespace reco;
7 
8 PFSuperCluster::PFSuperCluster(const edm::PtrVector<reco::PFCluster>& clusters) : clusters_(clusters) {}
9 
12  clusters_.clear();
13 }
14 
17  clusters_ = other.clusters_;
18 
19  return *this;
20 }
21 
22 std::ostream& reco::operator<<(std::ostream& out, const PFSuperCluster& cluster) {
23  if (!out)
24  return out;
25 
26  const math::XYZPoint& pos = cluster.position();
27  const PFCluster::REPPoint& posrep = cluster.positionREP();
28  const std::vector<reco::PFRecHitFraction>& fracs = cluster.recHitFractions();
29 
30  out << "PFSuperCluster "
31  << ", clusters: " << cluster.clusters().size() << ", layer: " << cluster.layer() << "\tE = " << cluster.energy()
32  << "\tXYZ: " << pos.X() << "," << pos.Y() << "," << pos.Z() << " | "
33  << "\tREP: " << posrep.Rho() << "," << posrep.Eta() << "," << posrep.Phi() << " | " << fracs.size() << " rechits";
34 
35  for (unsigned i = 0; i < fracs.size(); i++) {
36  // PFRecHit is not available, print the detID
37  if (!fracs[i].recHitRef().isAvailable())
38  out << cluster.printHitAndFraction(i) << ", ";
39  else
40  out << fracs[i] << ", ";
41  }
42 
43  return out;
44 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
size_type size() const
Size of the RefVector.
Definition: PtrVectorBase.h:75
std::string printHitAndFraction(unsigned i) const
print hitAndFraction
Definition: CaloCluster.cc:15
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
Particle flow cluster, see clustering algorithm in PFSuperClusterAlgo.
const std::vector< reco::PFRecHitFraction > & recHitFractions() const
vector of rechit fractions
Definition: PFCluster.h:65
PFCluster & operator=(const PFCluster &)
Definition: PFCluster.cc:63
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:56
const REPPoint & positionREP() const
cluster position: rho, eta, phi
Definition: PFCluster.h:92
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
const edm::PtrVector< reco::PFCluster > & clusters() const
vector of clusters
double energy() const
cluster energy
Definition: PFCluster.h:74
void reset()
resets clusters parameters
Definition: PFCluster.cc:17
edm::PtrVector< reco::PFCluster > clusters_
vector of clusters
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void clear()
Clear the PtrVector.
Definition: PtrVectorBase.h:81
fixed size matrix
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
Definition: PFCluster.h:48
PFSuperCluster & operator=(const PFSuperCluster &)
void reset()
resets clusters parameters