CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Thrust.h
Go to the documentation of this file.
1 #ifndef CandUtils_Thrust_h
2 #define CandUtils_Thrust_h
3 
38 #include <vector>
39 
40 class Thrust {
41 public:
45  template<typename const_iterator>
46  Thrust(const_iterator begin, const_iterator end) :
47  thrust_(0), axis_(0, 0, 0), pSum_(0),
48  n_(end - begin), p_(n_) {
49  if (n_ == 0) return;
50  std::vector<const reco::Candidate*> cands;
51  for(const_iterator i = begin; i != end; ++i) {
52  cands.push_back(&*i);
53  }
54  init(cands);
55  }
57  double thrust() const { return thrust_; }
59  const Vector& axis() const { return axis_; }
60 
61 private:
62  double thrust_;
64  double pSum_;
65  const unsigned int n_;
66  std::vector<Vector> p_;
67 
68  struct ThetaPhi {
69  ThetaPhi(double t, double p) : theta( t ), phi( p ) { }
70  double theta, phi;
71  };
72  double thrust(const Vector & theAxis) const;
73  ThetaPhi initialAxis() const;
75  Vector axis(double theta, double phi) const;
76  Vector axis(const ThetaPhi & tp) const {
77  return axis(tp.theta, tp.phi);
78  }
79  void parabola(double & a, double & b, double & c,
80  const Vector &, const Vector &, const Vector &) const;
81  void init(const std::vector<const reco::Candidate*>&);
82 };
83 
84 #endif
int i
Definition: DBlmapReader.cc:9
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:28
Thrust(const_iterator begin, const_iterator end)
constructor from first and last iterators
Definition: Thrust.h:46
const Vector & axis() const
thrust axis (with magnitude = 1)
Definition: Thrust.h:59
double phi
Definition: Thrust.h:70
ThetaPhi initialAxis() const
Definition: Thrust.cc:17
double theta
Definition: Thrust.h:70
Geom::Theta< T > theta() const
double pSum_
Definition: Thrust.h:64
math::XYZVector Vector
spatial vector
Definition: Thrust.h:43
ThetaPhi(double t, double p)
Definition: Thrust.h:69
double thrust_
Definition: Thrust.h:62
const unsigned int n_
Definition: Thrust.h:65
std::vector< Vector > p_
Definition: Thrust.h:66
double thrust() const
thrust value (in the range [0.5, 1.0])
Definition: Thrust.h:57
#define end
Definition: vmac.h:38
Vector axis(const ThetaPhi &tp) const
Definition: Thrust.h:76
Definition: Thrust.h:40
Vector axis_
Definition: Thrust.h:63
ThetaPhi finalAxis(ThetaPhi) const
Definition: Thrust.cc:64
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
double b
Definition: hdecay.h:120
#define begin
Definition: vmac.h:31
double a
Definition: hdecay.h:121
void parabola(double &a, double &b, double &c, const Vector &, const Vector &, const Vector &) const
Definition: Thrust.cc:127
void init(const std::vector< const reco::Candidate * > &)
Definition: Thrust.cc:7
Definition: DDAxes.h:10