CMS 3D CMS Logo

Thrust.h
Go to the documentation of this file.
1 #ifndef CandUtils_Thrust_h
2 #define CandUtils_Thrust_h
3 
36 #include <vector>
37 
38 class Thrust {
39 public:
43  template <typename const_iterator>
44  Thrust(const_iterator begin, const_iterator end) : thrust_(0), axis_(0, 0, 0), pSum_(0), n_(end - begin), p_(n_) {
45  if (n_ == 0)
46  return;
47  std::vector<const reco::Candidate *> cands;
48  for (const_iterator i = begin; i != end; ++i) {
49  cands.push_back(&*i);
50  }
51  init(cands);
52  }
54  double thrust() const { return thrust_; }
56  const Vector &axis() const { return axis_; }
57 
58 private:
59  double thrust_;
61  double pSum_;
62  const unsigned int n_;
63  std::vector<Vector> p_;
64 
65  struct ThetaPhi {
66  ThetaPhi(double t, double p) : theta(t), phi(p) {}
67  double theta, phi;
68  };
69  double thrust(const Vector &theAxis) const;
70  ThetaPhi initialAxis() const;
72  Vector axis(double theta, double phi) const;
73  Vector axis(const ThetaPhi &tp) const { return axis(tp.theta, tp.phi); }
74  void parabola(double &a, double &b, double &c, const Vector &, const Vector &, const Vector &) const;
75  void init(const std::vector<const reco::Candidate *> &);
76 };
77 
78 #endif
Thrust::Thrust
Thrust(const_iterator begin, const_iterator end)
constructor from first and last iterators
Definition: Thrust.h:44
Thrust::thrust_
double thrust_
Definition: Thrust.h:59
mps_fire.i
i
Definition: mps_fire.py:428
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Thrust::axis_
Vector axis_
Definition: Thrust.h:60
Vector
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
Thrust::ThetaPhi::phi
double phi
Definition: Thrust.h:67
Thrust::thrust
double thrust() const
thrust value (in the range [0.5, 1.0])
Definition: Thrust.h:54
Thrust::pSum_
double pSum_
Definition: Thrust.h:61
mps_fire.end
end
Definition: mps_fire.py:242
Thrust::p_
std::vector< Vector > p_
Definition: Thrust.h:63
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
Thrust::Vector
math::XYZVector Vector
spatial vector
Definition: Thrust.h:41
b
double b
Definition: hdecay.h:118
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15205
Thrust::finalAxis
ThetaPhi finalAxis(ThetaPhi) const
Definition: Thrust.cc:67
a
double a
Definition: hdecay.h:119
Thrust::initialAxis
ThetaPhi initialAxis() const
Definition: Thrust.cc:16
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
Thrust::n_
const unsigned int n_
Definition: Thrust.h:62
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
Thrust::ThetaPhi::theta
double theta
Definition: Thrust.h:67
DDAxes::phi
Thrust::parabola
void parabola(double &a, double &b, double &c, const Vector &, const Vector &, const Vector &) const
Definition: Thrust.cc:135
Thrust
Definition: Thrust.h:38
Thrust::ThetaPhi
Definition: Thrust.h:65
Candidate.h
Thrust::axis
Vector axis(const ThetaPhi &tp) const
Definition: Thrust.h:73
Vector3D.h
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
Thrust::ThetaPhi::ThetaPhi
ThetaPhi(double t, double p)
Definition: Thrust.h:66
Thrust::axis
const Vector & axis() const
thrust axis (with magnitude = 1)
Definition: Thrust.h:56
Thrust::init
void init(const std::vector< const reco::Candidate * > &)
Definition: Thrust.cc:6