CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HiEvtPlaneFlatten Class Reference

#include <HiEvtPlaneFlatten.h>

Public Member Functions

Double_t bounds (Double_t ang)
 
Double_t bounds2 (Double_t ang)
 
void Fill (double psi, double vtx, int centbin)
 
double GetCnt (int bin)
 
int GetCutIndx (int centbin, double vtx, int iord)
 
double GetFlatPsi (double psi, double vtx, double cent)
 
int GetHBins ()
 
double GetX (int bin)
 
double GetY (int bin)
 
 HiEvtPlaneFlatten ()
 
void Init (int order, int ncentbins, const int centbinCompression, std::string tag, int vord)
 
void SetXDB (int indx, double val)
 
void SetYDB (int indx, double val)
 
 ~HiEvtPlaneFlatten ()
 

Private Attributes

int centbinComp
 
double delvtx
 
double flatCnt [MAXCUT]
 
double flatX [MAXCUT]
 
double flatXDB [MAXCUT]
 
double flatY [MAXCUT]
 
double flatYDB [MAXCUT]
 
int hbins
 
int hcentbins
 
int hOrder
 
double minvtx
 
int nvtxbins
 
double pi
 
int vorder
 

Detailed Description

Definition at line 44 of file HiEvtPlaneFlatten.h.

Constructor & Destructor Documentation

HiEvtPlaneFlatten::HiEvtPlaneFlatten ( )
inlineexplicit

Definition at line 47 of file HiEvtPlaneFlatten.h.

References delvtx, hcentbins, hOrder, minvtx, nvtxbins, Pi, pi, and vorder.

48  {
49  pi = TMath::Pi();
50  hcentbins = 1;
51  hOrder = 20;
52  vorder = 2; //sets order of event plane
53  minvtx = -25;
54  delvtx = 5;
55  nvtxbins = 10;
56  }
const double Pi
HiEvtPlaneFlatten::~HiEvtPlaneFlatten ( )
inline

Definition at line 117 of file HiEvtPlaneFlatten.h.

117 {}

Member Function Documentation

Double_t HiEvtPlaneFlatten::bounds ( Double_t  ang)
inline

Definition at line 124 of file HiEvtPlaneFlatten.h.

References pi.

Referenced by GetFlatPsi().

124  {
125  if(ang<-pi) ang+=2.*pi;
126  if(ang>pi) ang-=2.*pi;
127  return ang;
128  }
Double_t HiEvtPlaneFlatten::bounds2 ( Double_t  ang)
inline

Definition at line 129 of file HiEvtPlaneFlatten.h.

References pi, and vorder.

Referenced by GetFlatPsi().

129  {
130  double range = pi/(double) vorder;
131  if(ang<-range) ang+=2*range;
132  if(ang>range) ang-=2*range;
133  return ang;
134  }
void HiEvtPlaneFlatten::Fill ( double  psi,
double  vtx,
int  centbin 
)
inline

Definition at line 89 of file HiEvtPlaneFlatten.h.

References funct::cos(), flatCnt, flatX, flatY, GetCutIndx(), hOrder, gen::k, funct::sin(), and vorder.

90  {
91  if(fabs(psi)>4 ) return;
92  for(int k = 0; k<hOrder; k++) {
93  double fsin = sin(vorder*(k+1)*psi);
94  double fcos = cos(vorder*(k+1)*psi);
95  int indx = GetCutIndx(centbin,vtx,k);
96  if(indx>=0) {
97  flatX[indx]+=fcos;
98  flatY[indx]+=fsin;
99  ++flatCnt[indx];
100  }
101  }
102  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
int GetCutIndx(int centbin, double vtx, int iord)
std::map< std::string, int, std::less< std::string > > psi
double flatX[MAXCUT]
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int k[5][pyjets_maxn]
double flatY[MAXCUT]
double flatCnt[MAXCUT]
double HiEvtPlaneFlatten::GetCnt ( int  bin)
inline

Definition at line 121 of file HiEvtPlaneFlatten.h.

References newFWLiteAna::bin, and flatCnt.

121 {return flatCnt[bin];}
double flatCnt[MAXCUT]
int HiEvtPlaneFlatten::GetCutIndx ( int  centbin,
double  vtx,
int  iord 
)
inline

Definition at line 77 of file HiEvtPlaneFlatten.h.

References centbinComp, GOODCOLL_filter_cfg::cut, delvtx, hbins, hcentbins, hOrder, minvtx, and nvtxbins.

Referenced by Fill(), and GetFlatPsi().

78  {
79  int cut;
80  int icent = centbin/centbinComp;
81  if(icent < 0 || icent > hcentbins) return -1;
82  int ivtx = (vtx-minvtx)/delvtx;
83  if(ivtx < 0 || ivtx > nvtxbins) return -1;
84  cut = hOrder*nvtxbins*icent + hOrder*ivtx + iord;
85  if(cut<0 || cut>hbins) return -1;
86  return cut;
87  }
double HiEvtPlaneFlatten::GetFlatPsi ( double  psi,
double  vtx,
double  cent 
)
inline

Definition at line 104 of file HiEvtPlaneFlatten.h.

References bounds(), bounds2(), funct::cos(), flatXDB, flatYDB, GetCutIndx(), hOrder, gen::k, funct::sin(), and vorder.

105  {
106  double correction = 0;
107  for(int k = 0; k<hOrder; k++) {
108  int indx = GetCutIndx(cent,vtx,k);
109  correction+=(2./(double)((k+1)*vorder))*(flatXDB[indx]*sin(vorder*(k+1)*psi)-flatYDB[indx]*cos(vorder*(k+1)*psi));
110  }
111  psi+=correction;
112  psi=bounds(psi);
113  psi=bounds2(psi);
114  return psi;
115  }
double flatXDB[MAXCUT]
Double_t bounds2(Double_t ang)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
int GetCutIndx(int centbin, double vtx, int iord)
std::map< std::string, int, std::less< std::string > > psi
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int k[5][pyjets_maxn]
Double_t bounds(Double_t ang)
double flatYDB[MAXCUT]
int HiEvtPlaneFlatten::GetHBins ( )
inline

Definition at line 118 of file HiEvtPlaneFlatten.h.

References hbins.

118 {return hbins;}
double HiEvtPlaneFlatten::GetX ( int  bin)
inline

Definition at line 119 of file HiEvtPlaneFlatten.h.

References newFWLiteAna::bin, and flatX.

119 {return flatX[bin];}
double flatX[MAXCUT]
double HiEvtPlaneFlatten::GetY ( int  bin)
inline

Definition at line 120 of file HiEvtPlaneFlatten.h.

References newFWLiteAna::bin, and flatY.

120 {return flatY[bin];}
double flatY[MAXCUT]
void HiEvtPlaneFlatten::Init ( int  order,
int  ncentbins,
const int  centbinCompression,
std::string  tag,
int  vord 
)
inline

Definition at line 57 of file HiEvtPlaneFlatten.h.

References centbinComp, gather_cfg::cout, flatCnt, flatX, flatY, hbins, hcentbins, hOrder, i, MAXCUT, nvtxbins, and vorder.

58  {
59  hOrder = order; //order of flattening
60  vorder = vord; //1(v1), 2(v2), 3(v3), 4(v4)
61  hcentbins = ncentbins;
62  centbinComp = centbinCompression;
63  if(hcentbins<=0) hcentbins = 1;
65  if(hbins>MAXCUT) {
66  std::cout<<"Too many cuts for flattening calculation. RESET to deaults"<<std::endl;
67  hcentbins = 1;
68  hOrder = 21;
69  }
70  for(int i = 0; i<hbins; i++) {
71  flatX[i]=0;
72  flatY[i]=0;
73  flatCnt[i]=0;
74  }
75  }
int i
Definition: DBlmapReader.cc:9
double flatX[MAXCUT]
double flatY[MAXCUT]
double flatCnt[MAXCUT]
tuple cout
Definition: gather_cfg.py:121
#define MAXCUT
void HiEvtPlaneFlatten::SetXDB ( int  indx,
double  val 
)
inline

Definition at line 122 of file HiEvtPlaneFlatten.h.

References flatXDB.

122 {flatXDB[indx]=val;}
double flatXDB[MAXCUT]
void HiEvtPlaneFlatten::SetYDB ( int  indx,
double  val 
)
inline

Definition at line 123 of file HiEvtPlaneFlatten.h.

References flatYDB.

123 {flatYDB[indx]=val;}
double flatYDB[MAXCUT]

Member Data Documentation

int HiEvtPlaneFlatten::centbinComp
private

Definition at line 143 of file HiEvtPlaneFlatten.h.

Referenced by GetCutIndx(), and Init().

double HiEvtPlaneFlatten::delvtx
private

Definition at line 150 of file HiEvtPlaneFlatten.h.

Referenced by GetCutIndx(), and HiEvtPlaneFlatten().

double HiEvtPlaneFlatten::flatCnt[MAXCUT]
private

Definition at line 140 of file HiEvtPlaneFlatten.h.

Referenced by Fill(), GetCnt(), and Init().

double HiEvtPlaneFlatten::flatX[MAXCUT]
private

Definition at line 136 of file HiEvtPlaneFlatten.h.

Referenced by Fill(), GetX(), and Init().

double HiEvtPlaneFlatten::flatXDB[MAXCUT]
private

Definition at line 138 of file HiEvtPlaneFlatten.h.

Referenced by GetFlatPsi(), and SetXDB().

double HiEvtPlaneFlatten::flatY[MAXCUT]
private

Definition at line 137 of file HiEvtPlaneFlatten.h.

Referenced by Fill(), GetY(), and Init().

double HiEvtPlaneFlatten::flatYDB[MAXCUT]
private

Definition at line 139 of file HiEvtPlaneFlatten.h.

Referenced by GetFlatPsi(), and SetYDB().

int HiEvtPlaneFlatten::hbins
private

Definition at line 144 of file HiEvtPlaneFlatten.h.

Referenced by GetCutIndx(), GetHBins(), and Init().

int HiEvtPlaneFlatten::hcentbins
private

Definition at line 142 of file HiEvtPlaneFlatten.h.

Referenced by GetCutIndx(), HiEvtPlaneFlatten(), and Init().

int HiEvtPlaneFlatten::hOrder
private

Definition at line 141 of file HiEvtPlaneFlatten.h.

Referenced by Fill(), GetCutIndx(), GetFlatPsi(), HiEvtPlaneFlatten(), and Init().

double HiEvtPlaneFlatten::minvtx
private

Definition at line 149 of file HiEvtPlaneFlatten.h.

Referenced by GetCutIndx(), and HiEvtPlaneFlatten().

int HiEvtPlaneFlatten::nvtxbins
private

Definition at line 148 of file HiEvtPlaneFlatten.h.

Referenced by GetCutIndx(), HiEvtPlaneFlatten(), and Init().

double HiEvtPlaneFlatten::pi
private

Definition at line 146 of file HiEvtPlaneFlatten.h.

Referenced by bounds(), bounds2(), and HiEvtPlaneFlatten().

int HiEvtPlaneFlatten::vorder
private

Definition at line 145 of file HiEvtPlaneFlatten.h.

Referenced by bounds2(), Fill(), GetFlatPsi(), HiEvtPlaneFlatten(), and Init().