CMS 3D CMS Logo

UEParameters.cc
Go to the documentation of this file.
1 
3 
4 UEParameters::UEParameters(const std::vector<float> *v, int nn, int neta) : v_(v), nn_(nn), neta_(neta) {
6  new boost::const_multi_array_ref<float, 4>(&(*v)[0], boost::extents[neta][nreduced_particle_flow_id][nn][2]);
7 }
8 
9 void UEParameters::get_fourier(double &re, double &im, size_t n, size_t eta, int type) const {
10  re = 0;
11  im = 0;
12 
13  if (type < 0) {
14  for (size_t i = 0; i < nreduced_particle_flow_id; i++) {
15  re += (*parameters_)[eta][i][n][0];
16  im += (*parameters_)[eta][i][n][1];
17  }
18  } else {
19  re = (*parameters_)[eta][type][n][0];
20  im = (*parameters_)[eta][type][n][1];
21  }
22 }
23 
24 double UEParameters::get_sum_pt(int eta, int type) const {
25  double re;
26  double im;
27 
28  get_fourier(re, im, 0, eta, type);
29 
30  // There is no imaginary part
31  return re;
32 }
33 
34 double UEParameters::get_vn(int n, int eta, int type) const {
35  if (n < 0) {
36  return NAN;
37  } else if (n == 0) {
38  return 1;
39  }
40 
41  double re;
42  double im;
43 
44  get_fourier(re, im, n, eta, type);
45 
46  return sqrt(re * re + im * im) / get_sum_pt(eta, type);
47 }
48 
49 double UEParameters::get_psin(int n, int eta, int type) const {
50  if (n <= 0) {
51  return 0;
52  }
53 
54  double re;
55  double im;
56 
57  get_fourier(re, im, n, eta, type);
58 
59  return atan2(im, re) / n;
60 }
neta
const int neta
Definition: CMTRawAnalyzer.h:423
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
UEParameters::get_sum_pt
double get_sum_pt(int eta, int type=-1) const
Definition: UEParameters.cc:24
findQualityFiles.v
v
Definition: findQualityFiles.py:179
UEParameters::nreduced_particle_flow_id
static const size_t nreduced_particle_flow_id
Definition: UEParameters.h:8
PVValHelper::eta
Definition: PVValidationHelpers.h:69
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
UEParameters::get_vn
double get_vn(int n, int eta, int type=-1) const
Definition: UEParameters.cc:34
UEParameters::get_fourier
void get_fourier(double &re, double &im, size_t n, size_t eta, int type=-1) const
Definition: UEParameters.cc:9
groupFilesInBlocks.nn
nn
Definition: groupFilesInBlocks.py:150
UEParameters::UEParameters
UEParameters(const std::vector< float > *v, int nn, int neta)
Definition: UEParameters.cc:4
type
type
Definition: HCALResponse.h:21
UEParameters::parameters_
boost::const_multi_array_ref< float, 4 > * parameters_
Definition: UEParameters.h:12
UEParameters.h
UEParameters::get_psin
double get_psin(int n, int eta, int type=-1) const
Definition: UEParameters.cc:49