Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:24

0001 // GenericJet.cc
0002 // Fedor Ratnikov, UMd
0003 
0004 #include <sstream>
0005 
0006 //Own header file
0007 #include "DataFormats/JetReco/interface/GenericJet.h"
0008 
0009 using namespace reco;
0010 
0011 GenericJet::GenericJet(const LorentzVector& fP4,
0012                        const Point& fVertex,
0013                        const std::vector<CandidateBaseRef>& fConstituents)
0014     : CompositeRefBaseCandidate(0, fP4, fVertex) {
0015   for (unsigned i = 0; i < fConstituents.size(); i++)
0016     addDaughter(fConstituents[i]);
0017 }
0018 
0019 int GenericJet::nConstituents() const { return numberOfDaughters(); }
0020 
0021 std::string GenericJet::print() const {
0022   std::ostringstream out;
0023   out << "GenericJet p/px/py/pz/pt: " << p() << '/' << px() << '/' << py() << '/' << pz() << '/' << pt() << std::endl
0024       << "    eta/phi: " << eta() << '/' << phi() << std::endl
0025       << "    # of constituents: " << nConstituents() << std::endl;
0026   out << "    No Constituents details available for this version" << std::endl;
0027   return out.str();
0028 }