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 [5000]
 
double flatX [5000]
 
double flatXDB [5000]
 
double flatY [5000]
 
double flatYDB [5000]
 
int hbins
 
int hcentbins
 
int hOrder
 
double minvtx
 
int nvtxbins
 
double pi
 
int vorder
 

Detailed Description

Definition at line 35 of file HiEvtPlaneFlatten.h.

Constructor & Destructor Documentation

HiEvtPlaneFlatten::HiEvtPlaneFlatten ( )
inlineexplicit

Definition at line 38 of file HiEvtPlaneFlatten.h.

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

39  {
40  pi = TMath::Pi();
41  hcentbins = 1;
42  hOrder = 20;
43  vorder = 2; //sets order of event plane
44  minvtx = -25;
45  delvtx = 5;
46  nvtxbins = 10;
47  }
const double Pi
HiEvtPlaneFlatten::~HiEvtPlaneFlatten ( )
inline

Definition at line 108 of file HiEvtPlaneFlatten.h.

108 {}

Member Function Documentation

Double_t HiEvtPlaneFlatten::bounds ( Double_t  ang)
inline

Definition at line 115 of file HiEvtPlaneFlatten.h.

References pi.

Referenced by GetFlatPsi().

115  {
116  if(ang<-pi) ang+=2.*pi;
117  if(ang>pi) ang-=2.*pi;
118  return ang;
119  }
Double_t HiEvtPlaneFlatten::bounds2 ( Double_t  ang)
inline

Definition at line 120 of file HiEvtPlaneFlatten.h.

References pi, and vorder.

Referenced by GetFlatPsi().

120  {
121  double range = pi/(double) vorder;
122  if(ang<-range) ang+=2*range;
123  if(ang>range) ang-=2*range;
124  return ang;
125  }
void HiEvtPlaneFlatten::Fill ( double  psi,
double  vtx,
int  centbin 
)
inline

Definition at line 80 of file HiEvtPlaneFlatten.h.

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

81  {
82  if(fabs(psi)>4 ) return;
83  for(int k = 0; k<hOrder; k++) {
84  double fsin = sin(vorder*(k+1)*psi);
85  double fcos = cos(vorder*(k+1)*psi);
86  int indx = GetCutIndx(centbin,vtx,k);
87  if(indx>=0) {
88  flatX[indx]+=fcos;
89  flatY[indx]+=fsin;
90  ++flatCnt[indx];
91  }
92  }
93  }
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
double HiEvtPlaneFlatten::GetCnt ( int  bin)
inline

Definition at line 112 of file HiEvtPlaneFlatten.h.

References newFWLiteAna::bin, and flatCnt.

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

Definition at line 68 of file HiEvtPlaneFlatten.h.

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

Referenced by Fill(), and GetFlatPsi().

69  {
70  int cut;
71  int icent = centbin/centbinComp;
72  if(icent < 0 || icent > hcentbins) return -1;
73  int ivtx = (vtx-minvtx)/delvtx;
74  if(ivtx < 0 || ivtx > nvtxbins) return -1;
75  cut = hOrder*nvtxbins*icent + hOrder*ivtx + iord;
76  if(cut<0 || cut>hbins) return -1;
77  return cut;
78  }
double HiEvtPlaneFlatten::GetFlatPsi ( double  psi,
double  vtx,
double  cent 
)
inline

Definition at line 95 of file HiEvtPlaneFlatten.h.

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

96  {
97  double correction = 0;
98  for(int k = 0; k<hOrder; k++) {
99  int indx = GetCutIndx(cent,vtx,k);
100  correction+=(2./(double)((k+1)*vorder))*(flatXDB[indx]*sin(vorder*(k+1)*psi)-flatYDB[indx]*cos(vorder*(k+1)*psi));
101  }
102  psi+=correction;
103  psi=bounds(psi);
104  psi=bounds2(psi);
105  return psi;
106  }
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
Double_t bounds(Double_t ang)
int HiEvtPlaneFlatten::GetHBins ( )
inline

Definition at line 109 of file HiEvtPlaneFlatten.h.

References hbins.

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

Definition at line 110 of file HiEvtPlaneFlatten.h.

References newFWLiteAna::bin, and flatX.

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

Definition at line 111 of file HiEvtPlaneFlatten.h.

References newFWLiteAna::bin, and flatY.

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

Definition at line 48 of file HiEvtPlaneFlatten.h.

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

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

Definition at line 113 of file HiEvtPlaneFlatten.h.

References flatXDB.

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

Definition at line 114 of file HiEvtPlaneFlatten.h.

References flatYDB.

114 {flatYDB[indx]=val;}

Member Data Documentation

int HiEvtPlaneFlatten::centbinComp
private

Definition at line 134 of file HiEvtPlaneFlatten.h.

Referenced by GetCutIndx(), and Init().

double HiEvtPlaneFlatten::delvtx
private

Definition at line 141 of file HiEvtPlaneFlatten.h.

Referenced by GetCutIndx(), and HiEvtPlaneFlatten().

double HiEvtPlaneFlatten::flatCnt[5000]
private

Definition at line 131 of file HiEvtPlaneFlatten.h.

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

double HiEvtPlaneFlatten::flatX[5000]
private

Definition at line 127 of file HiEvtPlaneFlatten.h.

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

double HiEvtPlaneFlatten::flatXDB[5000]
private

Definition at line 129 of file HiEvtPlaneFlatten.h.

Referenced by GetFlatPsi(), and SetXDB().

double HiEvtPlaneFlatten::flatY[5000]
private

Definition at line 128 of file HiEvtPlaneFlatten.h.

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

double HiEvtPlaneFlatten::flatYDB[5000]
private

Definition at line 130 of file HiEvtPlaneFlatten.h.

Referenced by GetFlatPsi(), and SetYDB().

int HiEvtPlaneFlatten::hbins
private

Definition at line 135 of file HiEvtPlaneFlatten.h.

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

int HiEvtPlaneFlatten::hcentbins
private

Definition at line 133 of file HiEvtPlaneFlatten.h.

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

int HiEvtPlaneFlatten::hOrder
private

Definition at line 132 of file HiEvtPlaneFlatten.h.

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

double HiEvtPlaneFlatten::minvtx
private

Definition at line 140 of file HiEvtPlaneFlatten.h.

Referenced by GetCutIndx(), and HiEvtPlaneFlatten().

int HiEvtPlaneFlatten::nvtxbins
private

Definition at line 139 of file HiEvtPlaneFlatten.h.

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

double HiEvtPlaneFlatten::pi
private

Definition at line 137 of file HiEvtPlaneFlatten.h.

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

int HiEvtPlaneFlatten::vorder
private

Definition at line 136 of file HiEvtPlaneFlatten.h.

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