test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 { class EvtPlane {
20  public:
21  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);
22  virtual ~EvtPlane();
23  void addLevel(int level, double ang, double sumsin, double sumcos);
24  int indx() const { return indx_ ;}
25  float angle(int level=2) const { return (level>=0&&level<4)? angle_[level]:angle_[2]; }
26  float sumSin(int level=2) const { return (level>=0&&level<4)? sumSin_[level]:sumSin_[2];}
27  float sumCos(int level=2) const { return (level>=0&&level<4)? sumCos_[level]:sumCos_[2];}
28  float sumw() const { return sumw_;}
29  float sumw2() const { return sumw2_;}
30  float sumPtOrEt() const { return sumPtOrEt_;}
31  float sumPtOrEt2() const { return sumPtOrEt2_;}
32  float mult() const { return mult_;}
33  float qy(int level=2) const { return sumSin(level); }
34  float qx(int level=2) const { return sumCos(level); }
35  float q(int level=2) const { return ((pow(qx(level),2)+pow(qy(level),2))>0)? sqrt(pow(qx(level),2)+pow(qy(level),2)): 0.;}
36  float vn(int level=2) const{ return (q(level)>0 && fabs(sumw())>0)? q(level)/fabs(sumw()): 0.;}
37 
38  private:
39  int indx_;
40  float angle_[4];
41  float sumSin_[4];
42  float sumCos_[4];
43  float sumw_;
44  float sumw2_;
45  float sumPtOrEt_;
46  float sumPtOrEt2_;
47  uint mult_;
48 
49  };
50 
51  typedef std::vector<EvtPlane> EvtPlaneCollection;
52 }
53 
54 #endif
float sumSin_[4]
Definition: EvtPlane.h:41
void addLevel(int level, double ang, double sumsin, double sumcos)
Definition: EvtPlane.cc:22
virtual ~EvtPlane()
Definition: EvtPlane.cc:28
float sumw_
Definition: EvtPlane.h:43
float qy(int level=2) const
Definition: EvtPlane.h:33
float sumCos(int level=2) const
Definition: EvtPlane.h:27
float sumPtOrEt_
Definition: EvtPlane.h:45
float angle_[4]
Definition: EvtPlane.h:40
int indx() const
Definition: EvtPlane.h:24
float sumw() const
Definition: EvtPlane.h:28
float sumw2_
Definition: EvtPlane.h:44
float sumCos_[4]
Definition: EvtPlane.h:42
float sumPtOrEt2() const
Definition: EvtPlane.h:31
float mult() const
Definition: EvtPlane.h:32
float sumPtOrEt2_
Definition: EvtPlane.h:46
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< EvtPlane > EvtPlaneCollection
Definition: EvtPlane.h:51
float angle(int level=2) const
Definition: EvtPlane.h:25
float vn(int level=2) const
Definition: EvtPlane.h:36
float sumPtOrEt() const
Definition: EvtPlane.h:30
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
tuple level
Definition: testEve_cfg.py:34
float qx(int level=2) const
Definition: EvtPlane.h:34
float sumw2() const
Definition: EvtPlane.h:29
float sumSin(int level=2) const
Definition: EvtPlane.h:26
float q(int level=2) const
Definition: EvtPlane.h:35
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40