CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DataFormats/ParticleFlowReco/src/PFSuperCluster.cc

Go to the documentation of this file.
00001 #include "DataFormats/ParticleFlowReco/interface/PFSuperCluster.h"
00002 #include "DataFormats/GeometryVector/interface/Pi.h"
00003 #include "DataFormats/Common/interface/PtrVector.h"
00004 
00005 
00006 using namespace std;
00007 using namespace reco;
00008 
00009 PFSuperCluster::PFSuperCluster(const edm::PtrVector<reco::PFCluster>& clusters):
00010 clusters_(clusters)
00011 {  
00012 }
00013 
00014 void PFSuperCluster::reset() {
00015   
00016   PFCluster::reset();
00017   clusters_.clear();
00018 
00019 }
00020 
00021 PFSuperCluster& PFSuperCluster::operator=(const PFSuperCluster& other) {
00022 
00023   PFCluster::operator=((PFCluster)other); 
00024   clusters_ = other.clusters_;
00025 
00026   return *this;
00027 }
00028 
00029 
00030 std::ostream& reco::operator<<(std::ostream& out, 
00031                                const PFSuperCluster& cluster) {
00032   
00033   if(!out) return out;
00034 
00035   const math::XYZPoint&  pos = cluster.position();
00036   const PFCluster::REPPoint&  posrep = cluster.positionREP();
00037   const std::vector< reco::PFRecHitFraction >& fracs =
00038     cluster.recHitFractions();
00039 
00040   out<<"PFSuperCluster "
00041      <<", clusters: "<<cluster.clusters().size()
00042      <<", layer: "<<cluster.layer()
00043      <<"\tE = "<<cluster.energy()
00044      <<"\tXYZ: "
00045      <<pos.X()<<","<<pos.Y()<<","<<pos.Z()<<" | "
00046      <<"\tREP: "
00047      <<posrep.Rho()<<","<<posrep.Eta()<<","<<posrep.Phi()<<" | "
00048      <<fracs.size()<<" rechits";
00049 
00050   for(unsigned i=0; i<fracs.size(); i++) {
00051     // PFRecHit is not available, print the detID
00052     if( !fracs[i].recHitRef().isAvailable() )
00053       out<<cluster.printHitAndFraction(i)<<", ";
00054     else
00055       out<<fracs[i]<<", ";
00056   }
00057 
00058   
00059   return out;
00060 }