CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
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
list var
if using global norm cols_to_minmax = [&#39;t_delta&#39;, &#39;t_hmaxNearP&#39;,&#39;t_emaxNearP&#39;, &#39;t_hAnnular&#39;, &#39;t_eAnnular&#39;,&#39;t_pt&#39;,&#39;t_nVtx&#39;,&#39;t_ieta&#39;,&#39;t_eHcal10&#39;, &#39;t_eHcal30&#39;,&#39;t_rhoh&#39;,&#39;t_eHcal&#39;] df[cols_to_minmax] = df[cols_to_minmax].apply(lambda x: (x - x.min()) / (x.max() - x.min()) if (x.max() - x.min() &gt; 0) else 1.0/200.0)
const_iterator end() const
last daughter const_iterator
Definition: Candidate.h:145
reco::Particle::LorentzVector LorentzVector
Definition: JetCharge.h:21
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const_iterator begin() const
first daughter const_iterator
Definition: Candidate.h:143
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector