CMS 3D CMS Logo

EvtPlane.h
Go to the documentation of this file.
1 
2 //
3 // Levels:
4 //
5 // 0 Neither recentering nor flattening is done. The final weights are applied.
6 // 1 The sums over the sines and cosines are recentered.
7 // 2 Final results including both recentering and flattening. Default if the level is not specified.
8 // 3 Calculation where all weights are set to unity.
9 //
10 //
11 
12 #ifndef DataFormats_EvtPlane_h
13 #define DataFormats_EvtPlane_h
14 
15 #include <vector>
16 #include <string>
17 #include <cmath>
18 
19 namespace reco {
20  class EvtPlane {
21  public:
22  EvtPlane(int epindx = 0,
23  int level = 2,
24  double planeA = 0,
25  double sumSin = 0,
26  double sumCos = 0,
27  double sumw = 0,
28  double sumw2 = 0,
29  double pe = 0,
30  double pe2 = 0,
31  uint mult = 0);
32  virtual ~EvtPlane();
33  void addLevel(int level, double ang, double sumsin, double sumcos);
34  int indx() const { return indx_; }
35  float angle(int level = 2) const { return (level >= 0 && level < 4) ? angle_[level] : angle_[2]; }
36  float sumSin(int level = 2) const { return (level >= 0 && level < 4) ? sumSin_[level] : sumSin_[2]; }
37  float sumCos(int level = 2) const { return (level >= 0 && level < 4) ? sumCos_[level] : sumCos_[2]; }
38  float sumw() const { return sumw_; }
39  float sumw2() const { return sumw2_; }
40  float sumPtOrEt() const { return sumPtOrEt_; }
41  float sumPtOrEt2() const { return sumPtOrEt2_; }
42  float mult() const { return mult_; }
43  float qy(int level = 2) const { return sumSin(level); }
44  float qx(int level = 2) const { return sumCos(level); }
45  float q(int level = 2) const {
46  return ((pow(qx(level), 2) + pow(qy(level), 2)) > 0) ? sqrt(pow(qx(level), 2) + pow(qy(level), 2)) : 0.;
47  }
48  float vn(int level = 2) const { return (q(level) > 0 && fabs(sumw()) > 0) ? q(level) / fabs(sumw()) : 0.; }
49 
50  private:
51  int indx_;
52  float angle_[4];
53  float sumSin_[4];
54  float sumCos_[4];
55  float sumw_;
56  float sumw2_;
57  float sumPtOrEt_;
58  float sumPtOrEt2_;
60  };
61 
62  typedef std::vector<EvtPlane> EvtPlaneCollection;
63 } // namespace reco
64 
65 #endif
float sumSin_[4]
Definition: EvtPlane.h:53
void addLevel(int level, double ang, double sumsin, double sumcos)
Definition: EvtPlane.cc:24
virtual ~EvtPlane()
Definition: EvtPlane.cc:30
float sumCos(int level=2) const
Definition: EvtPlane.h:37
float sumw_
Definition: EvtPlane.h:55
float qx(int level=2) const
Definition: EvtPlane.h:44
float q(int level=2) const
Definition: EvtPlane.h:45
float sumPtOrEt_
Definition: EvtPlane.h:57
int indx() const
Definition: EvtPlane.h:34
float sumPtOrEt2() const
Definition: EvtPlane.h:41
float angle_[4]
Definition: EvtPlane.h:52
constexpr int pow(int x)
Definition: conifer.h:24
float sumSin(int level=2) const
Definition: EvtPlane.h:36
float sumw2_
Definition: EvtPlane.h:56
float sumCos_[4]
Definition: EvtPlane.h:54
float sumPtOrEt2_
Definition: EvtPlane.h:58
float vn(int level=2) const
Definition: EvtPlane.h:48
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< EvtPlane > EvtPlaneCollection
Definition: EvtPlane.h:62
float sumPtOrEt() const
Definition: EvtPlane.h:40
float sumw2() const
Definition: EvtPlane.h:39
float qy(int level=2) const
Definition: EvtPlane.h:43
fixed size matrix
float angle(int level=2) const
Definition: EvtPlane.h:35
EvtPlane(int epindx=0, int level=2, double planeA=0, double sumSin=0, double sumCos=0, double sumw=0, double sumw2=0, double pe=0, double pe2=0, uint mult=0)
Definition: EvtPlane.cc:5
float mult() const
Definition: EvtPlane.h:42
float sumw() const
Definition: EvtPlane.h:38