22 :
reco::
Jet(fP4, fVertex, fConstituents)
48 throw cms::Exception(
"TrackRef unavailable") <<
"TrackJet consituent track not in the event.";
51 throw cms::Exception(
"Invalid Constituent") <<
"TrackJet constituent is not of RecoChargedRefCandidate type";
61 std::vector <edm::Ptr<reco::Track> >
result;
62 for (
unsigned i = 0;
i < numberOfDaughters ();
i++) result.push_back (track (
i));
70 charge += ida->charge();
72 this->setCharge(charge);
92 std::ostringstream
out;
94 <<
" TrackJet specific:" << std::endl;
95 if (primaryVertex().
get()) {
96 out <<
" Associated PV:"
97 <<
" x=" << primaryVertex()->x()
98 <<
" y=" << primaryVertex()->y()
99 <<
" z=" << primaryVertex()->z() << std::endl;
101 out <<
" Associated PV not available on the event" << std::endl;
103 std::vector<edm::Ptr<reco::Track> > thetracks =
tracks();
104 for (
unsigned i = 0;
i < thetracks.size ();
i++) {
105 if (thetracks[
i].
get ()) {
107 <<
" px=" << thetracks[
i]->px()
108 <<
" py=" << thetracks[
i]->py()
109 <<
" pz=" << thetracks[
i]->pz()
110 <<
" eta=" << thetracks[
i]->eta()
111 <<
" phi=" << thetracks[
i]->phi() << std::endl;
114 out <<
" #" <<
i <<
" track is not available in the event" << std::endl;
Base class for all types of Jets.
TrackJet()
Default constructor.
std::vector< Constituent > Constituents
bool isNonnull() const
Checks for non-null.
T const * get() const
Returns C++ pointer to the item.
virtual std::string print() const
Print object.
void setPrimaryVertex(const reco::VertexRef &vtx)
set associated primary vertex
key_type key() const
Accessor for product key.
virtual bool overlap(const Candidate &dummy) const
Polymorphic overlap.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
math::XYZPoint Point
point in the space
ProductID id() const
Accessor for product ID.
const reco::VertexRef primaryVertex() const
get associated primary vertex
std::vector< edm::Ptr< reco::Track > > tracks() const
Return pointers to all track costituents.
virtual std::string print() const
Print object.
T const * get() const
Returns C++ pointer to the item.
int Charge
electric charge type
virtual edm::Ptr< reco::Track > track(size_t i) const
Return Ptr to the track costituent.
reco::TrackRef const & track() const
virtual TrackJet * clone() const
Polymorphic clone.
void resetCharge()
calculate and set the charge by adding up the constituting track charges