CMS 3D CMS Logo

JetCharge.cc
Go to the documentation of this file.
2 
3 double JetCharge::charge(const LorentzVector &lv, const reco::CandidateCollection &vec) const {
4  return chargeFromVal<reco::Candidate, reco::CandidateCollection>(lv, vec);
5 }
6 
7 double JetCharge::charge(const LorentzVector &lv, const reco::TrackCollection &vec) const {
8  return chargeFromVal<reco::Track, reco::TrackCollection>(lv, vec);
9 }
10 
11 double JetCharge::charge(const LorentzVector &lv, const reco::TrackRefVector &vec) const {
12  return chargeFromRef<reco::TrackRef, reco::TrackRefVector>(lv, vec);
13 }
14 
16  return chargeFromValIterator<reco::Candidate, reco::Candidate::const_iterator>(
17  parent.p4(), parent.begin(), parent.end());
18 }
19 
20 JetCharge::JetCharge(const edm::ParameterSet &iCfg) : var_(Pt), exp_(iCfg.getParameter<double>("exp")) {
21  std::string var = iCfg.getParameter<std::string>("var");
22  if (var == "Pt") {
23  var_ = Pt;
24  } else if (var == "RelPt") {
25  var_ = RelPt;
26  } else if (var == "RelEta") {
27  var_ = RelEta;
28  } else if (var == "DeltaR") {
29  var_ = DeltaR;
30  } else if (var == "Unit") {
31  var_ = Unit;
32  } else {
33  throw cms::Exception("Configuration error") << "Unknown variable " << var.c_str() << " for computing jet charge";
34  }
35 }
T getParameter(std::string const &) const
double charge(const LorentzVector &lv, const reco::TrackCollection &vec) const
Definition: JetCharge.cc:7
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
JetCharge(Variable var, double exponent=1.0)
Definition: JetCharge.h:24
Variable var_
Definition: JetCharge.h:46
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
const_iterator end() const
last daughter const_iterator
Definition: Candidate.h:146
double exp_
Definition: JetCharge.h:47
reco::Particle::LorentzVector LorentzVector
Definition: JetCharge.h:21
const_iterator begin() const
first daughter const_iterator
Definition: Candidate.h:144