CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DataFormats/JetReco/src/GenericJet.cc

Go to the documentation of this file.
00001 // GenericJet.cc
00002 // Fedor Ratnikov, UMd
00003 // $Id: GenericJet.cc,v 1.3 2007/05/03 21:13:18 fedor Exp $
00004 
00005 #include <sstream>
00006 
00007 //Own header file
00008 #include "DataFormats/JetReco/interface/GenericJet.h"
00009 
00010 using namespace reco;
00011 
00012 GenericJet::GenericJet (const LorentzVector& fP4, 
00013                         const Point& fVertex, 
00014                         const std::vector<CandidateBaseRef>& fConstituents)
00015   :  CompositeRefBaseCandidate (0, fP4, fVertex)
00016 {
00017   for (unsigned i = 0; i < fConstituents.size (); i++) addDaughter (fConstituents [i]);
00018 }
00019 
00020 int GenericJet::nConstituents () const {
00021   return numberOfDaughters();
00022 }
00023 
00024 std::string GenericJet::print () const {
00025   std::ostringstream out;
00026   out << "GenericJet p/px/py/pz/pt: " << p() << '/' << px () << '/' << py() << '/' << pz() << '/' << pt() << std::endl
00027       << "    eta/phi: " << eta () << '/' << phi () << std::endl
00028       << "    # of constituents: " << nConstituents () << std::endl;
00029   out << "    No Constituents details available for this version" << std::endl;
00030   return out.str ();
00031 }