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 32 of file LumiReWeighting.h.

Constructor & Destructor Documentation

reweight::PoissonMeanShifter::PoissonMeanShifter ( )
inline

Definition at line 36 of file LumiReWeighting.h.

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

Definition at line 38 of file LumiReWeighting.h.

References constexpr, JetChargeProducer_cfi::exp, and Pweight_.

38  {
39 
40  // these are the polynomial or exponential coefficients for each bin of a 25-bin sequence that
41  // convert the Distribution of the 2011 luminosity to something with a lower or higher peak luminosity.
42  // The distributions aren't quite poisson because they model luminosity decreasing during a fill. This implies that
43  // they do get wider as the mean increases, so the weights are not linear with increasing mean.
44 
45  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. };
46  constexpr double p1_minus[20] = {
47  -0.677786,
48  -0.619614,
49  -0.49465,
50  -0.357963,
51  -0.238359,
52  -0.110002,
53  0.0348629,
54  0.191263,
55  0.347648,
56  0.516615,
57  0.679646,
58  0.836673,
59  0.97764,
60  1.135,
61  1.29922,
62  1.42467,
63  1.55901,
64  1.61762,
65  1.67275,
66  1.96008
67  };
68  constexpr double p2_minus[20] = {
69  0.526164,
70  0.251816,
71  0.11049,
72  0.026917,
73  -0.0464692,
74  -0.087022,
75  -0.0931581,
76  -0.0714295,
77  -0.0331772,
78  0.0347473,
79  0.108658,
80  0.193048,
81  0.272314,
82  0.376357,
83  0.4964,
84  0.58854,
85  0.684959,
86  0.731063,
87  0.760044,
88  1.02386
89  };
90 
91  constexpr double p1_expoM[5] = {
92  1.63363e-03,
93  6.79290e-04,
94  3.69900e-04,
95  2.24349e-04,
96  9.87156e-06
97  };
98 
99  constexpr double p2_expoM[5] = {
100  2.64692,
101  3.26585,
102  3.53229,
103  4.18035,
104  5.64027
105  };
106 
107 
108  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. };
109  constexpr double p1_plus[20] = {
110  -0.739059,
111  -0.594445,
112  -0.477276,
113  -0.359707,
114  -0.233573,
115  -0.103458,
116  0.0373401,
117  0.176571,
118  0.337617,
119  0.499074,
120  0.675126,
121  0.840522,
122  1.00917,
123  1.15847,
124  1.23816,
125  1.44271,
126  1.52982,
127  1.46385,
128  1.5802,
129  0.988689
130  };
131  constexpr double p2_plus[20] = {
132  0.208068,
133  0.130033,
134  0.0850356,
135  0.0448344,
136  0.000749832,
137  -0.0331347,
138  -0.0653281,
139  -0.0746009,
140  -0.0800667,
141  -0.0527636,
142  -0.00402649,
143  0.103338,
144  0.261261,
145  0.491084,
146  0.857966,
147  1.19495,
148  1.75071,
149  2.65559,
150  3.35433,
151  5.48835
152  };
153 
154  constexpr double p1_expoP[5] = {
155  1.42463e-01,
156  4.18966e-02,
157  1.12697e-01,
158  1.66197e-01,
159  1.50768e-01
160  };
161 
162  constexpr double p2_expoP[5] = {
163  1.98758,
164  2.27217,
165  2.26799,
166  2.38455,
167  2.52428
168  };
169 
170  // initialize weights based on desired Shift
171 
172 
173 
174  for (int ibin=0;ibin<20;ibin++) {
175 
176  if( Shift < .0) {
177  Pweight_[ibin] = p0_minus[ibin] + p1_minus[ibin]*Shift + p2_minus[ibin]*Shift*Shift;
178  }
179  else {
180  Pweight_[ibin] = p0_plus[ibin] + p1_plus[ibin]*Shift + p2_plus[ibin]*Shift*Shift;
181  }
182  }
183 
184  // last few bins fit better to an exponential...
185 
186  for (int ibin=20;ibin<25;ibin++) {
187  if( Shift < 0.) {
188  Pweight_[ibin] = p1_expoM[ibin-20]*exp(p2_expoM[ibin-20]*Shift);
189  }
190  else {
191  Pweight_[ibin] = p1_expoP[ibin-20]*exp(p2_expoP[ibin-20]*Shift);
192  }
193  }
194 
195  };
#define constexpr
reweight::PoissonMeanShifter::PoissonMeanShifter ( )
inline

Definition at line 44 of file LumiReweightingStandAlone.h.

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

Definition at line 46 of file LumiReweightingStandAlone.h.

References JetChargeProducer_cfi::exp, and Pweight_.

46  {
47 
48  // these are the polynomial or exponential coefficients for each bin of a 25-bin sequence that
49  // convert the Distribution of the 2011 luminosity to something with a lower or higher peak luminosity.
50  // The distributions aren't quite poisson because they model luminosity decreasing during a fill. This implies that
51  // they do get wider as the mean increases, so the weights are not linear with increasing mean.
52 
53  static const double p0_minus[20] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
54  static const double p1_minus[20] = {
55  -0.677786,
56  -0.619614,
57  -0.49465,
58  -0.357963,
59  -0.238359,
60  -0.110002,
61  0.0348629,
62  0.191263,
63  0.347648,
64  0.516615,
65  0.679646,
66  0.836673,
67  0.97764,
68  1.135,
69  1.29922,
70  1.42467,
71  1.55901,
72  1.61762,
73  1.67275,
74  1.96008
75  };
76  static const double p2_minus[20] = {
77  0.526164,
78  0.251816,
79  0.11049,
80  0.026917,
81  -0.0464692,
82  -0.087022,
83  -0.0931581,
84  -0.0714295,
85  -0.0331772,
86  0.0347473,
87  0.108658,
88  0.193048,
89  0.272314,
90  0.376357,
91  0.4964,
92  0.58854,
93  0.684959,
94  0.731063,
95  0.760044,
96  1.02386
97  };
98 
99  static const double p1_expoM[5] = {
100  1.63363e-03,
101  6.79290e-04,
102  3.69900e-04,
103  2.24349e-04,
104  9.87156e-06
105  };
106 
107  static const double p2_expoM[5] = {
108  2.64692,
109  3.26585,
110  3.53229,
111  4.18035,
112  5.64027
113  };
114 
115 
116  static const double p0_plus[20] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
117  static const double p1_plus[20] = {
118  -0.739059,
119  -0.594445,
120  -0.477276,
121  -0.359707,
122  -0.233573,
123  -0.103458,
124  0.0373401,
125  0.176571,
126  0.337617,
127  0.499074,
128  0.675126,
129  0.840522,
130  1.00917,
131  1.15847,
132  1.23816,
133  1.44271,
134  1.52982,
135  1.46385,
136  1.5802,
137  0.988689
138  };
139  static const double p2_plus[20] = {
140  0.208068,
141  0.130033,
142  0.0850356,
143  0.0448344,
144  0.000749832,
145  -0.0331347,
146  -0.0653281,
147  -0.0746009,
148  -0.0800667,
149  -0.0527636,
150  -0.00402649,
151  0.103338,
152  0.261261,
153  0.491084,
154  0.857966,
155  1.19495,
156  1.75071,
157  2.65559,
158  3.35433,
159  5.48835
160  };
161 
162  static const double p1_expoP[5] = {
163  1.42463e-01,
164  4.18966e-02,
165  1.12697e-01,
166  1.66197e-01,
167  1.50768e-01
168  };
169 
170  static const double p2_expoP[5] = {
171  1.98758,
172  2.27217,
173  2.26799,
174  2.38455,
175  2.52428
176  };
177 
178  // initialize weights based on desired Shift
179 
180 
181 
182  for (int ibin=0;ibin<20;ibin++) {
183 
184  if( Shift < .0) {
185  Pweight_[ibin] = p0_minus[ibin] + p1_minus[ibin]*Shift + p2_minus[ibin]*Shift*Shift;
186  }
187  else {
188  Pweight_[ibin] = p0_plus[ibin] + p1_plus[ibin]*Shift + p2_plus[ibin]*Shift*Shift;
189  }
190  }
191 
192  // last few bins fit better to an exponential...
193 
194  for (int ibin=20;ibin<25;ibin++) {
195  if( Shift < 0.) {
196  Pweight_[ibin] = p1_expoM[ibin-20]*exp(p2_expoM[ibin-20]*Shift);
197  }
198  else {
199  Pweight_[ibin] = p1_expoP[ibin-20]*exp(p2_expoP[ibin-20]*Shift);
200  }
201  }
202 
203  };

Member Function Documentation

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

Definition at line 197 of file LumiReWeighting.h.

References Pweight_.

Referenced by ShiftWeight().

197  {
198  if(ibin<25 && ibin>=0) { return Pweight_[ibin]; }
199  else { return 0;}
200 
201  };
double reweight::PoissonMeanShifter::ShiftWeight ( float  pvnum)
inline

Definition at line 203 of file LumiReWeighting.h.

References ShiftWeight().

203  {
204  return ShiftWeight(int(pvnum));
205  };
double reweight::PoissonMeanShifter::ShiftWeight ( int  ibin)
inline

Definition at line 205 of file LumiReweightingStandAlone.h.

References Pweight_.

205  {
206 
207  if(ibin<25 && ibin>=0) { return Pweight_[ibin]; }
208  else { return 0;}
209 
210  };
double reweight::PoissonMeanShifter::ShiftWeight ( float  pvnum)
inline

Definition at line 212 of file LumiReweightingStandAlone.h.

References createfilelist::int, and Pweight_.

212  {
213 
214  int ibin = int(pvnum);
215 
216  if(ibin<25 && ibin>=0) { return Pweight_[ibin]; }
217  else { return 0;}
218 
219  };

Member Data Documentation

double reweight::PoissonMeanShifter::Pweight_
private

Definition at line 205 of file LumiReWeighting.h.

Referenced by PoissonMeanShifter(), and ShiftWeight().