StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StProtoJet.h
1 // -*- mode: c++;-*-
2 // $Id: StProtoJet.h,v 1.16 2016/01/06 22:00:17 gdwebb Exp $
3 #ifndef StProtoJet_HH
4 #define StProtoJet_HH
5 
6 #include "AbstractFourVec.h"
7 
8 #include <iostream>
9 #include <vector>
10 #include <cmath>
11 
12 
20 class StProtoJet {
21 
22 public:
23 
24  typedef std::vector<const AbstractFourVec*> FourVecList;
25 
26  StProtoJet();
27  StProtoJet(const AbstractFourVec* particle);
28  virtual ~StProtoJet();
29 
30  unsigned int numberOfParticles() const {return _particleList.size();}
31  unsigned int size() const {return _particleList.size();}
32  const FourVecList& list() const {return _particleList;}
33 
35  double d() const {return eT()*eT();}
36 
37  void merge(const StProtoJet& protoJet);
38 
39  void add(const StProtoJet& protoJet);
40  void add(const AbstractFourVec& particle);
41 
42  void update();
43 
44  void clear();
45 
46  friend std::ostream& operator<<(std::ostream& os, const StProtoJet& j);
47 
48  //momenta
49  double pt() const { return ::sqrt(mPx*mPx + mPy*mPy); }
50  double px() const { return mPx; }
51  double py() const { return mPy; }
52  double pz() const { return mPz; }
53 
54  //angles
55  double phi() const { return atan2(mPy, mPx); }
56  double eta() const
57  {
58  double arg = tan(theta()/2.);
59  return (arg > 0) ? -::log(arg) : -999;
60  }
61 
62  //4-th component
63  double e() const { return fabs(mE); }
64  double eT() const
65  {
66  if(p() == 0.0) return 0.0;
67  return ::sqrt(e()*e()*pt()*pt()/(p()*p()));
68  }
69  double mass() const { return ::sqrt(fabs(mE*mE - p()*p() ) ); }
70 
71  //charge
72  double charge() const { return _charge; }
73  //area
74  double area() const {return mArea;}
75  void setArea(double area) { mArea = area;}
76  //area error
77  double areaError() const {return mAreaError;}
78  void setAreaError(double areaError) { mAreaError = areaError;}
79 private:
80 
81  double p() const { return ::sqrt(mPx*mPx + mPy*mPy + mPz*mPz); }
82  double theta() const { return acos( mPz/p()); }
83 
84  FourVecList _particleList;
85 
86 
87  double mPx;
88  double mPy;
89  double mPz;
90  double mE;
91  double mArea;
92  double mAreaError;
93 
94  double _charge;
95 
96 };
97 
98 
99 inline std::ostream& operator<<(std::ostream& os, const StProtoJet& j)
100 {
101  os <<"et: "<<j.eT()<<"\tphi: "<<j.phi()<<"\teta: "<<j.eta()
102  <<"\tmass: "<<j.mass()<<"\tcharge: "<<j.charge()<<"\tParticles"<< std::endl;
103  for (StProtoJet::FourVecList::const_iterator it=j._particleList.begin(); it!=j._particleList.end(); ++it) {
104  os << **it << std::endl;
105  }
106  return os;
107 }
108 
109 #endif
110 
double d() const
The d=et^2 of the protojet.
Definition: StProtoJet.h:35