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 }
JetCharge::var_
Variable var_
Definition: JetCharge.h:46
edm::RefVector< TrackCollection >
JetCharge::JetCharge
JetCharge(Variable var, double exponent=1.0)
Definition: JetCharge.h:24
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
JetCharge::DeltaR
Definition: JetCharge.h:20
JetCharge::charge
double charge(const LorentzVector &lv, const reco::TrackCollection &vec) const
Definition: JetCharge.cc:7
JetCharge::RelEta
Definition: JetCharge.h:20
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
JetCharge.h
JetCharge::Pt
Definition: JetCharge.h:20
JetCharge::LorentzVector
reco::Particle::LorentzVector LorentzVector
Definition: JetCharge.h:21
reco::Candidate
Definition: Candidate.h:27
JetCharge::RelPt
Definition: JetCharge.h:20
JetCharge::Unit
Definition: JetCharge.h:20
Exception
Definition: hltDiff.cc:246
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
class-composition.parent
parent
Definition: class-composition.py:88
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::OwnVector
Definition: OwnVector.h:24