CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Namespaces | Functions
HPSPFTau.h File Reference
#include "DataFormats/L1TParticleFlow/interface/PFCandidate.h"
#include "DataFormats/JetReco/interface/CaloJet.h"
#include "DataFormats/Candidate/interface/LeafCandidate.h"
#include "DataFormats/Candidate/interface/Particle.h"
#include "DataFormats/L1TCorrelator/interface/TkPrimaryVertex.h"
#include <ostream>

Go to the source code of this file.

Classes

class  l1t::HPSPFTau
 

Namespaces

 l1t
 delete x;
 

Functions

std::ostream & operator<< (std::ostream &os, const l1t::HPSPFTau &l1PFTau)
 print to stream More...
 
void printPFCand (ostream &os, const l1t::PFCandidate &l1PFCand, const l1t::TkPrimaryVertexRef &primaryVertex)
 
void printPFCand (ostream &os, const l1t::PFCandidate &l1PFCand, float primaryVertexZ)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const l1t::HPSPFTau l1PFTau 
)

print to stream

void printPFCand ( ostream &  os,
const l1t::PFCandidate l1PFCand,
const l1t::TkPrimaryVertexRef primaryVertex 
)

Definition at line 63 of file HPSPFTau.cc.

References edm::Ref< C, T, F >::isNonnull(), and printPFCand().

Referenced by L1HPSPFTauBuilder::addL1PFCandidates(), operator<<(), printPFCand(), and L1HPSPFTauBuilder::setL1PFTauSeed().

63  {
64  float primaryVertexZ = (primaryVertex.isNonnull()) ? primaryVertex->zvertex() : 0.;
65  printPFCand(os, l1PFCand, primaryVertexZ);
66 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
void printPFCand(ostream &os, const l1t::PFCandidate &l1PFCand, const l1t::TkPrimaryVertexRef &primaryVertex)
Definition: HPSPFTau.cc:63
void printPFCand ( ostream &  os,
const l1t::PFCandidate l1PFCand,
float  primaryVertexZ 
)

Definition at line 68 of file HPSPFTau.cc.

References reco::LeafCandidate::charge(), l1t::PFCandidate::ChargedHadron, l1t::PFCandidate::Electron, reco::LeafCandidate::eta(), l1t::PFCandidate::id(), reco::LeafCandidate::mass(), l1t::PFCandidate::Muon, l1t::PFCandidate::NeutralHadron, l1t::PFCandidate::pfTrack(), reco::LeafCandidate::phi(), l1t::PFCandidate::Photon, reco::LeafCandidate::pt(), and AlCaHLTBitMon_QueryRunRegistry::string.

68  {
69  std::string typeString;
70  if (l1PFCand.id() == l1t::PFCandidate::ChargedHadron)
71  typeString = "PFChargedHadron";
72  else if (l1PFCand.id() == l1t::PFCandidate::Electron)
73  typeString = "PFElectron";
74  else if (l1PFCand.id() == l1t::PFCandidate::NeutralHadron)
75  typeString = "PFNeutralHadron";
76  else if (l1PFCand.id() == l1t::PFCandidate::Photon)
77  typeString = "PFPhoton";
78  else if (l1PFCand.id() == l1t::PFCandidate::Muon)
79  typeString = "PFMuon";
80  else
81  typeString = "N/A";
82  os << " " << typeString << " with pT = " << l1PFCand.pt() << ", eta = " << l1PFCand.eta()
83  << ", phi = " << l1PFCand.phi() << ","
84  << " mass = " << l1PFCand.mass() << ", charge = " << l1PFCand.charge();
85  if (l1PFCand.charge() != 0 && primaryVertexZ != 0.) {
86  os << " (dz = " << std::fabs(l1PFCand.pfTrack()->vertex().z() - primaryVertexZ) << ")";
87  }
88  os << std::endl;
89 }
double pt() const final
transverse momentum
ParticleType id() const
Definition: PFCandidate.h:34
const PFTrackRef & pfTrack() const
Definition: PFCandidate.h:36
double mass() const final
mass
double phi() const final
momentum azimuthal angle
int charge() const final
electric charge
double eta() const final
momentum pseudorapidity