Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // JPTJet.cc
0002 // Fedor Ratnikov UMd
0003 #include <sstream>
0004 
0005 #include "FWCore/Utilities/interface/Exception.h"
0006 #include "DataFormats/RecoCandidate/interface/RecoCaloTowerCandidate.h"
0007 
0008 //Own header file
0009 #include "DataFormats/JetReco/interface/JPTJet.h"
0010 
0011 using namespace reco;
0012 
0013 JPTJet::JPTJet(const LorentzVector& fP4,
0014                const Point& fVertex,
0015                const Specific& fSpecific,
0016                const Jet::Constituents& fConstituents)
0017     : Jet(fP4, fVertex), mspecific(fSpecific) {}
0018 
0019 JPTJet::JPTJet(const LorentzVector& fP4, const Specific& fSpecific, const Jet::Constituents& fConstituents)
0020     : Jet(fP4, Point(0, 0, 0)), mspecific(fSpecific) {}
0021 
0022 JPTJet* JPTJet::clone() const { return new JPTJet(*this); }
0023 
0024 bool JPTJet::overlap(const Candidate&) const { return false; }
0025 
0026 void JPTJet::printJet() const {
0027   std::cout << " Raw Calo jet " << getCaloJetRef()->et() << " " << getCaloJetRef()->eta() << " "
0028             << getCaloJetRef()->phi() << "    JPTJet specific:" << std::endl
0029             << "      charged multiplicity: " << chargedMultiplicity() << std::endl;
0030   std::cout << "      JPTCandidate constituents:" << std::endl;
0031   std::cout << " Number of pions: " << getPionsInVertexInCalo().size() + getPionsInVertexOutCalo().size() << std::endl;
0032   std::cout << " Number of muons: " << getMuonsInVertexInCalo().size() + getMuonsInVertexOutCalo().size() << std::endl;
0033   std::cout << " Number of Electrons: " << getElecsInVertexInCalo().size() + getElecsInVertexOutCalo().size()
0034             << std::endl;
0035 }
0036 
0037 std::string JPTJet::print() const {
0038   std::ostringstream out;
0039   out << Jet::print()  // generic jet info
0040       << "    JPTJet specific:" << std::endl
0041       << "      charged: " << chargedMultiplicity() << std::endl;
0042   out << "      JPTCandidate constituents:" << std::endl;
0043 
0044   out << " Number of pions: " << getPionsInVertexInCalo().size() + getPionsInVertexOutCalo().size() << std::endl;
0045   out << " Number of muons: " << getMuonsInVertexInCalo().size() + getMuonsInVertexOutCalo().size() << std::endl;
0046   out << " Number of Electrons: " << getElecsInVertexInCalo().size() + getElecsInVertexOutCalo().size() << std::endl;
0047 
0048   return out.str();
0049 }