1 #ifndef RecoJets_JetCharge_JetCharge_H
2 #define RecoJets_JetCharge_JetCharge_H
12 #include <Math/VectorUtil.h>
13 #include <Math/Rotation3D.h>
14 #include <Math/RotationZ.h>
15 #include <Math/RotationY.h>
35 template<
typename T,
typename C>
37 template<
typename T,
typename C>
39 template<
typename T,
typename IT>
50 template<
typename T,
typename IT>
52 double num = 0.0, den = 0.0;
53 for (
IT it = begin; it !=
end ; ++it) {
57 num += w * obj.charge();
59 return (den > 0.0 ? num/den : 0.0);
62 template<
typename T,
typename C>
64 typedef typename C::const_iterator
IT;
65 return JetCharge::chargeFromValIterator<T,IT>(lv, vec.begin(), vec.end());
68 template<
typename T,
typename C>
70 typedef typename C::const_iterator
IT;
71 double num = 0.0, den = 0.0;
72 for (IT it = vec.begin(),
end = vec.end(); it !=
end ; ++it) {
76 num += w * obj->charge();
78 return (den > 0.0 ? num/den : 0.0);
89 ret = ROOT::Math::VectorUtil::DeltaR(lv.Vect(), obj.momentum());
93 ret = lv.Vect().Dot(obj.momentum())/(lv.P() * obj.p());
102 return (
exp_ == 1.0 ? ret : (ret > 0 ?
double charge(const LorentzVector &lv, const reco::TrackCollection &vec) const
double chargeFromRef(const LorentzVector &lv, const C &vec) const
math::XYZTLorentzVector LorentzVector
std::vector< Track > TrackCollection
collection of Tracks
JetCharge(Variable var, double exponent=1.0)
reco::Particle::Vector Vector
reco::Particle::LorentzVector LorentzVector
std::vector< LinkConnSpec >::const_iterator IT
double chargeFromVal(const LorentzVector &lv, const C &vec) const
double chargeFromValIterator(const LorentzVector &lv, const IT &begin, const IT &end) const
double getWeight(const LorentzVector &lv, const T &obj) const
math::XYZVector Vector
point in the space
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Power< A, B >::type pow(const A &a, const B &b)