CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/DataFormats/JetReco/src/JPTJet.cc

Go to the documentation of this file.
00001 // JPTJet.cc
00002 // Fedor Ratnikov UMd
00003 // $Id: JPTJet.cc,v 1.2 2010/03/08 21:02:20 kodolova Exp $
00004 #include <sstream>
00005 
00006 #include "FWCore/Utilities/interface/Exception.h"
00007 #include "DataFormats/RecoCandidate/interface/RecoCaloTowerCandidate.h"
00008 
00009 //Own header file
00010 #include "DataFormats/JetReco/interface/JPTJet.h"
00011 
00012 using namespace reco;
00013 
00014 JPTJet::JPTJet (const LorentzVector& fP4, const Point& fVertex, 
00015                 const Specific& fSpecific, const Jet::Constituents& fConstituents 
00016                 )
00017   : Jet (fP4, fVertex),
00018     mspecific (fSpecific)
00019 {}
00020 
00021 JPTJet::JPTJet (const LorentzVector& fP4, 
00022                 const Specific& fSpecific, const Jet::Constituents& fConstituents 
00023                 )
00024   : Jet (fP4, Point(0,0,0)),
00025     mspecific (fSpecific)
00026 {}
00027 
00028 
00029 JPTJet* JPTJet::clone () const {
00030   return new JPTJet (*this);
00031 }
00032 
00033 bool JPTJet::overlap( const Candidate & ) const {
00034   return false;
00035 }
00036 
00037 
00038 void JPTJet::printJet () const {
00039   std::cout <<  " Raw Calo jet " <<getCaloJetRef()->et()<<" "<<getCaloJetRef()->eta()<<" "<<getCaloJetRef()->phi()
00040       << "    JPTJet specific:" << std::endl
00041       << "      chargedhadrons energy: " << chargedHadronEnergy () << std::endl
00042       << "      charged multiplicity: " << chargedMultiplicity () << std::endl;
00043   std::cout << "      JPTCandidate constituents:" << std::endl;
00044   std::cout<< " Number of pions: "<< getPionsInVertexInCalo().size()+getPionsInVertexOutCalo().size()<<std::endl;
00045   std::cout<< " Number of muons: "<< getMuonsInVertexInCalo().size()+getMuonsInVertexOutCalo().size()<<std::endl;
00046   std::cout<< " Number of Electrons: "<< getElecsInVertexInCalo().size()+getElecsInVertexOutCalo().size()<<std::endl;
00047   
00048 }
00049 
00050 std::string JPTJet::print () const {
00051   std::ostringstream out;
00052   out << Jet::print () // generic jet info
00053       << "    JPTJet specific:" << std::endl
00054       << "      chargedhadrons energy: " << chargedHadronEnergy () << std::endl
00055       << "      charged: " << chargedMultiplicity () << std::endl;
00056   out << "      JPTCandidate constituents:" << std::endl;
00057 
00058   out<< " Number of pions: "<< getPionsInVertexInCalo().size()+getPionsInVertexOutCalo().size()<<std::endl;
00059   out<< " Number of muons: "<< getMuonsInVertexInCalo().size()+getMuonsInVertexOutCalo().size()<<std::endl;
00060   out<< " Number of Electrons: "<< getElecsInVertexInCalo().size()+getElecsInVertexOutCalo().size()<<std::endl;
00061   
00062   return out.str ();
00063 }