CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
reweight::PoissonMeanShifter Class Reference

#include <LumiReWeighting.h>

Public Member Functions

 PoissonMeanShifter ()
 
 PoissonMeanShifter (float Shift)
 
 PoissonMeanShifter ()
 
 PoissonMeanShifter (float Shift)
 
double ShiftWeight (int ibin)
 
double ShiftWeight (float pvnum)
 
double ShiftWeight (int ibin)
 
double ShiftWeight (float pvnum)
 

Private Attributes

double Pweight_ [25]
 

Detailed Description

Definition at line 31 of file LumiReWeighting.h.

Constructor & Destructor Documentation

reweight::PoissonMeanShifter::PoissonMeanShifter ( )
inline

Definition at line 33 of file LumiReWeighting.h.

33 {};
reweight::PoissonMeanShifter::PoissonMeanShifter ( float  Shift)
inline

Definition at line 35 of file LumiReWeighting.h.

References constexpr, JetChargeProducer_cfi::exp, and Pweight_.

35  {
36  // these are the polynomial or exponential coefficients for each bin of a 25-bin sequence that
37  // convert the Distribution of the 2011 luminosity to something with a lower or higher peak luminosity.
38  // The distributions aren't quite poisson because they model luminosity decreasing during a fill. This implies that
39  // they do get wider as the mean increases, so the weights are not linear with increasing mean.
40 
41  constexpr double p0_minus[20] = {1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
42  constexpr double p1_minus[20] = {-0.677786, -0.619614, -0.49465, -0.357963, -0.238359, -0.110002, 0.0348629,
43  0.191263, 0.347648, 0.516615, 0.679646, 0.836673, 0.97764, 1.135,
44  1.29922, 1.42467, 1.55901, 1.61762, 1.67275, 1.96008};
45  constexpr double p2_minus[20] = {0.526164, 0.251816, 0.11049, 0.026917, -0.0464692, -0.087022, -0.0931581,
46  -0.0714295, -0.0331772, 0.0347473, 0.108658, 0.193048, 0.272314, 0.376357,
47  0.4964, 0.58854, 0.684959, 0.731063, 0.760044, 1.02386};
48 
49  constexpr double p1_expoM[5] = {1.63363e-03, 6.79290e-04, 3.69900e-04, 2.24349e-04, 9.87156e-06};
50 
51  constexpr double p2_expoM[5] = {2.64692, 3.26585, 3.53229, 4.18035, 5.64027};
52 
53  constexpr double p0_plus[20] = {1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
54  constexpr double p1_plus[20] = {-0.739059, -0.594445, -0.477276, -0.359707, -0.233573, -0.103458, 0.0373401,
55  0.176571, 0.337617, 0.499074, 0.675126, 0.840522, 1.00917, 1.15847,
56  1.23816, 1.44271, 1.52982, 1.46385, 1.5802, 0.988689};
57  constexpr double p2_plus[20] = {0.208068, 0.130033, 0.0850356, 0.0448344, 0.000749832,
58  -0.0331347, -0.0653281, -0.0746009, -0.0800667, -0.0527636,
59  -0.00402649, 0.103338, 0.261261, 0.491084, 0.857966,
60  1.19495, 1.75071, 2.65559, 3.35433, 5.48835};
61 
62  constexpr double p1_expoP[5] = {1.42463e-01, 4.18966e-02, 1.12697e-01, 1.66197e-01, 1.50768e-01};
63 
64  constexpr double p2_expoP[5] = {1.98758, 2.27217, 2.26799, 2.38455, 2.52428};
65 
66  // initialize weights based on desired Shift
67 
68  for (int ibin = 0; ibin < 20; ibin++) {
69  if (Shift < .0) {
70  Pweight_[ibin] = p0_minus[ibin] + p1_minus[ibin] * Shift + p2_minus[ibin] * Shift * Shift;
71  } else {
72  Pweight_[ibin] = p0_plus[ibin] + p1_plus[ibin] * Shift + p2_plus[ibin] * Shift * Shift;
73  }
74  }
75 
76  // last few bins fit better to an exponential...
77 
78  for (int ibin = 20; ibin < 25; ibin++) {
79  if (Shift < 0.) {
80  Pweight_[ibin] = p1_expoM[ibin - 20] * exp(p2_expoM[ibin - 20] * Shift);
81  } else {
82  Pweight_[ibin] = p1_expoP[ibin - 20] * exp(p2_expoP[ibin - 20] * Shift);
83  }
84  }
85  };
#define constexpr
reweight::PoissonMeanShifter::PoissonMeanShifter ( )
inline

Definition at line 40 of file LumiReweightingStandAlone.h.

40 {};
reweight::PoissonMeanShifter::PoissonMeanShifter ( float  Shift)
inline

Definition at line 42 of file LumiReweightingStandAlone.h.

References JetChargeProducer_cfi::exp, and Pweight_.

42  {
43  // these are the polynomial or exponential coefficients for each bin of a 25-bin sequence that
44  // convert the Distribution of the 2011 luminosity to something with a lower or higher peak luminosity.
45  // The distributions aren't quite poisson because they model luminosity decreasing during a fill. This implies that
46  // they do get wider as the mean increases, so the weights are not linear with increasing mean.
47 
48  static const double p0_minus[20] = {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
49  1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
50  static const double p1_minus[20] = {-0.677786, -0.619614, -0.49465, -0.357963, -0.238359, -0.110002, 0.0348629,
51  0.191263, 0.347648, 0.516615, 0.679646, 0.836673, 0.97764, 1.135,
52  1.29922, 1.42467, 1.55901, 1.61762, 1.67275, 1.96008};
53  static const double p2_minus[20] = {
54  0.526164, 0.251816, 0.11049, 0.026917, -0.0464692, -0.087022, -0.0931581, -0.0714295, -0.0331772, 0.0347473,
55  0.108658, 0.193048, 0.272314, 0.376357, 0.4964, 0.58854, 0.684959, 0.731063, 0.760044, 1.02386};
56 
57  static const double p1_expoM[5] = {1.63363e-03, 6.79290e-04, 3.69900e-04, 2.24349e-04, 9.87156e-06};
58 
59  static const double p2_expoM[5] = {2.64692, 3.26585, 3.53229, 4.18035, 5.64027};
60 
61  static const double p0_plus[20] = {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
62  1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
63  static const double p1_plus[20] = {-0.739059, -0.594445, -0.477276, -0.359707, -0.233573, -0.103458, 0.0373401,
64  0.176571, 0.337617, 0.499074, 0.675126, 0.840522, 1.00917, 1.15847,
65  1.23816, 1.44271, 1.52982, 1.46385, 1.5802, 0.988689};
66  static const double p2_plus[20] = {0.208068, 0.130033, 0.0850356, 0.0448344, 0.000749832,
67  -0.0331347, -0.0653281, -0.0746009, -0.0800667, -0.0527636,
68  -0.00402649, 0.103338, 0.261261, 0.491084, 0.857966,
69  1.19495, 1.75071, 2.65559, 3.35433, 5.48835};
70 
71  static const double p1_expoP[5] = {1.42463e-01, 4.18966e-02, 1.12697e-01, 1.66197e-01, 1.50768e-01};
72 
73  static const double p2_expoP[5] = {1.98758, 2.27217, 2.26799, 2.38455, 2.52428};
74 
75  // initialize weights based on desired Shift
76 
77  for (int ibin = 0; ibin < 20; ibin++) {
78  if (Shift < .0) {
79  Pweight_[ibin] = p0_minus[ibin] + p1_minus[ibin] * Shift + p2_minus[ibin] * Shift * Shift;
80  } else {
81  Pweight_[ibin] = p0_plus[ibin] + p1_plus[ibin] * Shift + p2_plus[ibin] * Shift * Shift;
82  }
83  }
84 
85  // last few bins fit better to an exponential...
86 
87  for (int ibin = 20; ibin < 25; ibin++) {
88  if (Shift < 0.) {
89  Pweight_[ibin] = p1_expoM[ibin - 20] * exp(p2_expoM[ibin - 20] * Shift);
90  } else {
91  Pweight_[ibin] = p1_expoP[ibin - 20] * exp(p2_expoP[ibin - 20] * Shift);
92  }
93  }
94  };

Member Function Documentation

double reweight::PoissonMeanShifter::ShiftWeight ( int  ibin)
inline

Definition at line 87 of file LumiReWeighting.h.

References Pweight_.

87  {
88  if (ibin < 25 && ibin >= 0) {
89  return Pweight_[ibin];
90  } else {
91  return 0;
92  }
93  };
double reweight::PoissonMeanShifter::ShiftWeight ( float  pvnum)
inline

Definition at line 95 of file LumiReWeighting.h.

References Pweight_, and ShiftWeight().

Referenced by ShiftWeight().

95 { return ShiftWeight(int(pvnum)); };
double reweight::PoissonMeanShifter::ShiftWeight ( int  ibin)
inline

Definition at line 96 of file LumiReweightingStandAlone.h.

References Pweight_.

96  {
97  if (ibin < 25 && ibin >= 0) {
98  return Pweight_[ibin];
99  } else {
100  return 0;
101  }
102  };
double reweight::PoissonMeanShifter::ShiftWeight ( float  pvnum)
inline

Definition at line 104 of file LumiReweightingStandAlone.h.

References createfilelist::int, and Pweight_.

104  {
105  int ibin = int(pvnum);
106 
107  if (ibin < 25 && ibin >= 0) {
108  return Pweight_[ibin];
109  } else {
110  return 0;
111  }
112  };

Member Data Documentation

double reweight::PoissonMeanShifter::Pweight_
private

Definition at line 95 of file LumiReWeighting.h.

Referenced by PoissonMeanShifter(), and ShiftWeight().