CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
edm::LumiReWeighting Class Reference

#include <LumiReWeighting.h>

Public Member Functions

 LumiReWeighting (std::string generatedFile, std::string dataFile, std::string GenHistName, std::string DataHistName)
 
 LumiReWeighting (std::vector< float > MC_distr, std::vector< float > Lumi_distr)
 
 LumiReWeighting ()
 
double weight (int npv)
 
double weight (const edm::EventBase &e)
 
double weightOOT (const edm::EventBase &e)
 
void weightOOT_init ()
 

Protected Attributes

boost::shared_ptr< TFile > dataFile_
 
std::string dataFileName_
 
std::string DataHistName_
 
bool FirstWarning_
 
boost::shared_ptr< TFile > generatedFile_
 
std::string generatedFileName_
 
std::string GenHistName_
 
int OldLumiSection_
 
bool Reweight_4_2_2p2_
 
double WeightOOTPU_ [25][25]
 
boost::shared_ptr< TH1F > weights_
 

Detailed Description

Definition at line 26 of file LumiReWeighting.h.

Constructor & Destructor Documentation

LumiReWeighting::LumiReWeighting ( std::string  generatedFile,
std::string  dataFile,
std::string  GenHistName = "pileup",
std::string  DataHistName = "pileup" 
)

Definition at line 34 of file LumiReWeighting.cc.

References gather_cfg::cout, dataFile_, dataFileName_, DataHistName_, FirstWarning_, generatedFile_, generatedFileName_, GenHistName_, EnsembleCalibrationLA_cfg::NBins, OldLumiSection_, weightOOT_init(), and weights_.

37  :
38  generatedFileName_( generatedFile),
39  dataFileName_ ( dataFile ),
40  GenHistName_ ( GenHistName ),
41  DataHistName_ ( DataHistName )
42  {
43  generatedFile_ = boost::shared_ptr<TFile>( new TFile(generatedFileName_.c_str()) ); //MC distribution
44  dataFile_ = boost::shared_ptr<TFile>( new TFile(dataFileName_.c_str()) ); //Data distribution
45 
46  weights_ = boost::shared_ptr<TH1F> ( new TH1F( *(static_cast<TH1F*>(dataFile_->Get( DataHistName_.c_str() )->Clone() ))));
47 
48  // MC * data/MC = data, so the weights are data/MC:
49 
50  // normalize both histograms first
51 
52  weights_->Scale( 1.0/ weights_->Integral() );
53  weights_->SetName("lumiWeights");
54 
55  TH1F* den = dynamic_cast<TH1F*>(generatedFile_->Get( GenHistName_.c_str() ));
56 
57  den->Scale(1.0/ den->Integral());
58 
59  weights_->Divide( den ); // so now the average weight should be 1.0
60 
61  std::cout << " Lumi/Pileup Reweighting: Computed Weights per In-Time Nint " << std::endl;
62 
63  int NBins = weights_->GetNbinsX();
64 
65  for(int ibin = 1; ibin<NBins+1; ++ibin){
66  std::cout << " " << ibin-1 << " " << weights_->GetBinContent(ibin) << std::endl;
67  }
68 
69 
71 
72  FirstWarning_ = true;
73  OldLumiSection_ = -1;
74 }
std::string DataHistName_
std::string GenHistName_
boost::shared_ptr< TH1F > weights_
boost::shared_ptr< TFile > dataFile_
boost::shared_ptr< TFile > generatedFile_
std::string dataFileName_
tuple cout
Definition: gather_cfg.py:41
std::string generatedFileName_
LumiReWeighting::LumiReWeighting ( std::vector< float >  MC_distr,
std::vector< float >  Lumi_distr 
)

Definition at line 76 of file LumiReWeighting.cc.

References benchmark_cfg::cerr, gather_cfg::cout, FirstWarning_, EnsembleCalibrationLA_cfg::NBins, OldLumiSection_, weightOOT_init(), and weights_.

76  {
77  // no histograms for input: use vectors
78 
79  // now, make histograms out of them:
80 
81  // first, check they are the same size...
82 
83  if( MC_distr.size() != Lumi_distr.size() ){
84 
85  std::cerr <<"ERROR: LumiReWeighting: input vectors have different sizes. Quitting... \n";
86  return;
87 
88  }
89 
90  Int_t NBins = MC_distr.size();
91 
92  weights_ = boost::shared_ptr<TH1F> ( new TH1F("luminumer","luminumer",NBins,-0.5, float(NBins)-0.5) );
93  TH1F* den = new TH1F("lumidenom","lumidenom",NBins,-0.5, float(NBins)-0.5) ;
94 
95  for(int ibin = 1; ibin<NBins+1; ++ibin ) {
96  weights_->SetBinContent(ibin, Lumi_distr[ibin-1]);
97  den->SetBinContent(ibin,MC_distr[ibin-1]);
98  }
99 
100  // check integrals, make sure things are normalized
101 
102  float deltaH = weights_->Integral();
103  if(fabs(1.0 - deltaH) > 0.02 ) { //*OOPS*...
104  weights_->Scale( 1.0/ weights_->Integral() );
105  }
106  float deltaMC = den->Integral();
107  if(fabs(1.0 - deltaMC) > 0.02 ) {
108  den->Scale(1.0/ den->Integral());
109  }
110 
111  weights_->Divide( den ); // so now the average weight should be 1.0
112 
113  std::cout << " Lumi/Pileup Reweighting: Computed Weights per In-Time Nint " << std::endl;
114 
115  for(int ibin = 1; ibin<NBins+1; ++ibin){
116  std::cout << " " << ibin-1 << " " << weights_->GetBinContent(ibin) << std::endl;
117  }
118 
119  weightOOT_init();
120 
121  FirstWarning_ = true;
122  OldLumiSection_ = -1;
123 }
boost::shared_ptr< TH1F > weights_
tuple cout
Definition: gather_cfg.py:41
edm::LumiReWeighting::LumiReWeighting ( )
inline

Definition at line 35 of file LumiReWeighting.h.

35 { } ;

Member Function Documentation

double LumiReWeighting::weight ( int  npv)

Definition at line 125 of file LumiReWeighting.cc.

References newFWLiteAna::bin, and weights_.

125  {
126  int bin = weights_->GetXaxis()->FindBin( npv );
127  return weights_->GetBinContent( bin );
128 }
boost::shared_ptr< TH1F > weights_
double LumiReWeighting::weight ( const edm::EventBase e)

Definition at line 134 of file LumiReWeighting.cc.

References edm::ProcessHistory::begin(), newFWLiteAna::bin, benchmark_cfg::cerr, gather_cfg::cout, edm::ProcessHistory::end(), FirstWarning_, edm::EventBase::getByLabel(), edm::EventBase::processHistory(), edm::ProcessConfiguration::processName(), edm::ProcessConfiguration::releaseVersion(), and weights_.

134  {
135 
136  // find provenance of event objects, just to check at the job beginning if there might be an issue
137 
138  if(FirstWarning_) {
139 
140  edm::ReleaseVersion TargetRelease = edm::ReleaseVersion("\"CMSSW_4_2_2_patch2\"");
142  edm::ProcessHistory::const_iterator PHist_iter = PHist.begin();
143 
144  for(; PHist_iter<PHist.end() ;++PHist_iter) {
145  edm::ProcessConfiguration PConf = *(PHist_iter);
146  edm::ReleaseVersion Release = PConf.releaseVersion() ;
147  const std::string Process = PConf.processName();
148 
149  if((Process=="HLT") && (Release==TargetRelease)) {
150  std::cout << " **** Warning! You are using in-time-only pileup reweighting for Release " << Release << " **** " << std::endl;
151  std::cout << " **** There is a weightOOT() function available if needed **** " << std::endl;
152  }
153  }
154  // SetFirstFalse();
155  FirstWarning_ = false;
156  }
157 
158  // get pileup summary information
159 
161  e.getByLabel(edm::InputTag("addPileupInfo"), PupInfo);
162 
163  std::vector<PileupSummaryInfo>::const_iterator PVI;
164 
165  int npv = -1;
166  for(PVI = PupInfo->begin(); PVI != PupInfo->end(); ++PVI) {
167 
168  int BX = PVI->getBunchCrossing();
169 
170  if(BX == 0) {
171  npv = PVI->getPU_NumInteractions();
172  continue;
173  }
174 
175  }
176 
177  if(npv < 0) std::cerr << " no in-time beam crossing found\n! " ;
178 
179  int bin = weights_->GetXaxis()->FindBin( npv );
180 
181  return weights_->GetBinContent( bin );
182 
183 }
collection_type::const_iterator const_iterator
const_iterator begin() const
bool getByLabel(const InputTag &, Handle< T > &) const
Definition: EventBase.h:86
std::string const & processName() const
boost::shared_ptr< TH1F > weights_
virtual ProcessHistory const & processHistory() const =0
ReleaseVersion const & releaseVersion() const
std::string ReleaseVersion
Definition: ReleaseVersion.h:7
const_iterator end() const
tuple cout
Definition: gather_cfg.py:41
double LumiReWeighting::weightOOT ( const edm::EventBase e)

Definition at line 947 of file LumiReWeighting.cc.

References edm::ProcessHistory::begin(), newFWLiteAna::bin, benchmark_cfg::cerr, gather_cfg::cout, edm::ProcessHistory::end(), FirstWarning_, edm::EventBase::getByLabel(), edm::EventBase::luminosityBlock(), OldLumiSection_, edm::EventBase::processHistory(), edm::ProcessConfiguration::processName(), edm::ProcessConfiguration::releaseVersion(), Reweight_4_2_2p2_, WeightOOTPU_, and weights_.

947  {
948 
949 
950  static double Correct_Weights2011[25] = { // residual correction to match lumi spectrum
951  5.30031,
952  2.07903,
953  1.40729,
954  1.27687,
955  1.0702,
956  0.902094,
957  0.902345,
958  0.931449,
959  0.78202,
960  0.824686,
961  0.837735,
962  0.910261,
963  1.01394,
964  1.1599,
965  1.12778,
966  1.58423,
967  1.78868,
968  1.58296,
969  2.3291,
970  3.86641,
971  0,
972  0,
973  0,
974  0,
975  0
976  };
977 
978  //int Run = e.run();
979  int LumiSection = e.luminosityBlock();
980 
981  // do some caching here, attempt to catch file boundaries
982 
983  if(LumiSection != OldLumiSection_) {
984 
985  Reweight_4_2_2p2_ = false;
986 
987  static edm::ReleaseVersion TargetRelease = edm::ReleaseVersion("\"CMSSW_4_2_2_patch2\"");
989  edm::ProcessHistory::const_iterator PHist_iter = PHist.begin();
990 
991  // check to see if we need to do the special out-of-time poisson weighting for CMSSW_4_2_2_patch2 MC:
992 
993  for(; PHist_iter<PHist.end() ;++PHist_iter) {
994  edm::ProcessConfiguration PConf = *(PHist_iter);
995  edm::ReleaseVersion Release = PConf.releaseVersion() ;
996  const std::string Process = PConf.processName();
997 
998  if((Process=="HLT") && (Release==TargetRelease)) {
999 
1000  Reweight_4_2_2p2_ = true;
1001 
1002  if(FirstWarning_) {
1003 
1004  std::cout << " **** Warning: Out-of-time pileup reweighting appropriate for Release " << Release << " **** " << std::endl;
1005  std::cout << " **** will be applied **** " << std::endl;
1006 
1007  FirstWarning_ = false;
1008  }
1009  }
1010  }
1011  OldLumiSection_ = LumiSection;
1012  }
1013 
1014  // find the pileup summary information
1015 
1017  e.getByLabel(edm::InputTag("addPileupInfo"), PupInfo);
1018 
1019  std::vector<PileupSummaryInfo>::const_iterator PVI;
1020 
1021  int npv = -1;
1022  int npv50ns = -1;
1023 
1024  for(PVI = PupInfo->begin(); PVI != PupInfo->end(); ++PVI) {
1025 
1026  int BX = PVI->getBunchCrossing();
1027 
1028  if(BX == 0) {
1029  npv = PVI->getPU_NumInteractions();
1030  }
1031 
1032  if(BX == 1) {
1033  npv50ns = PVI->getPU_NumInteractions();
1034  }
1035 
1036  }
1037 
1038  // Note: for the "uncorrelated" out-of-time pileup, reweighting is only done on the 50ns
1039  // "late" bunch (BX=+1), since that is basically the only one that matters in terms of
1040  // energy deposition.
1041 
1042  if(npv < 0) {
1043  std::cerr << " no in-time beam crossing found\n! " ;
1044  std::cerr << " Returning event weight=0\n! ";
1045  return 0.;
1046  }
1047  if(npv50ns < 0) {
1048  std::cerr << " no out-of-time beam crossing found\n! " ;
1049  std::cerr << " Returning event weight=0\n! ";
1050  return 0.;
1051  }
1052 
1053  int bin = weights_->GetXaxis()->FindBin( npv );
1054 
1055  double inTimeWeight = weights_->GetBinContent( bin );
1056 
1057  double TotalWeight = 1.0;
1058 
1059  if(Reweight_4_2_2p2_) {
1060  TotalWeight = inTimeWeight * WeightOOTPU_[bin-1][npv50ns] * Correct_Weights2011[bin-1];
1061  }
1062  else {
1063  TotalWeight = inTimeWeight;
1064  }
1065 
1066  return TotalWeight;
1067 
1068 }
collection_type::const_iterator const_iterator
const_iterator begin() const
double WeightOOTPU_[25][25]
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
bool getByLabel(const InputTag &, Handle< T > &) const
Definition: EventBase.h:86
std::string const & processName() const
boost::shared_ptr< TH1F > weights_
virtual ProcessHistory const & processHistory() const =0
ReleaseVersion const & releaseVersion() const
std::string ReleaseVersion
Definition: ReleaseVersion.h:7
const_iterator end() const
tuple cout
Definition: gather_cfg.py:41
void LumiReWeighting::weightOOT_init ( )

Definition at line 185 of file LumiReWeighting.cc.

References WeightOOTPU_.

Referenced by LumiReWeighting().

185  {
186 
187  // The following are poisson distributions with different means, where the maximum
188  // of the function has been normalized to weight 1.0
189  // These are used to reweight the out-of-time pileup to match the in-time distribution.
190  // The total event weight is the product of the in-time weight, the out-of-time weight,
191  // and a residual correction to fix the distortions caused by the fact that the out-of-time
192  // distribution is not flat.
193 
194  static double weight_24[25] = {
195  0,
196  0,
197  0,
198  0,
199  2.46277e-06,
200  2.95532e-05,
201  0.000104668,
202  0.000401431,
203  0.00130034,
204  0.00342202,
205  0.00818132,
206  0.0175534,
207  0.035784,
208  0.0650836,
209  0.112232,
210  0.178699,
211  0.268934,
212  0.380868,
213  0.507505,
214  0.640922,
215  0.768551,
216  0.877829,
217  0.958624,
218  0.99939,
219  1
220  };
221 
222  static double weight_23[25] = {
223  0,
224  1.20628e-06,
225  1.20628e-06,
226  2.41255e-06,
227  1.20628e-05,
228  6.39326e-05,
229  0.000252112,
230  0.000862487,
231  0.00244995,
232  0.00616527,
233  0.0140821,
234  0.0293342,
235  0.0564501,
236  0.100602,
237  0.164479,
238  0.252659,
239  0.36268,
240  0.491427,
241  0.627979,
242  0.75918,
243  0.873185,
244  0.957934,
245  0.999381,
246  1,
247  0.957738
248  };
249 
250  static double weight_22[25] = {
251  0,
252  0,
253  0,
254  5.88636e-06,
255  3.0609e-05,
256  0.000143627,
257  0.000561558,
258  0.00173059,
259  0.00460078,
260  0.0110616,
261  0.0238974,
262  0.0475406,
263  0.0875077,
264  0.148682,
265  0.235752,
266  0.343591,
267  0.473146,
268  0.611897,
269  0.748345,
270  0.865978,
271  0.953199,
272  0.997848,
273  1,
274  0.954245,
275  0.873688
276  };
277 
278  static double weight_21[25] = {
279  0,
280  0,
281  1.15381e-06,
282  8.07665e-06,
283  7.1536e-05,
284  0.000280375,
285  0.00107189,
286  0.00327104,
287  0.00809396,
288  0.0190978,
289  0.0401894,
290  0.0761028,
291  0.13472,
292  0.216315,
293  0.324649,
294  0.455125,
295  0.598241,
296  0.739215,
297  0.861866,
298  0.953911,
299  0.998918,
300  1,
301  0.956683,
302  0.872272,
303  0.76399
304  };
305 
306 
307  static double weight_20[25] = {
308  0,
309  0,
310  1.12532e-06,
311  2.58822e-05,
312  0.000145166,
313  0.000633552,
314  0.00215048,
315  0.00592816,
316  0.0145605,
317  0.0328367,
318  0.0652649,
319  0.11893,
320  0.19803,
321  0.305525,
322  0.436588,
323  0.581566,
324  0.727048,
325  0.8534,
326  0.949419,
327  0.999785,
328  1,
329  0.953008,
330  0.865689,
331  0.753288,
332  0.62765
333  };
334  static double weight_19[25] = {
335  0,
336  0,
337  1.20714e-05,
338  5.92596e-05,
339  0.000364337,
340  0.00124994,
341  0.00403953,
342  0.0108149,
343  0.025824,
344  0.0544969,
345  0.103567,
346  0.17936,
347  0.283532,
348  0.416091,
349  0.562078,
350  0.714714,
351  0.846523,
352  0.947875,
353  1,
354  0.999448,
355  0.951404,
356  0.859717,
357  0.742319,
358  0.613601,
359  0.48552
360  };
361 
362  static double weight_18[25] = {
363  0,
364  3.20101e-06,
365  2.88091e-05,
366  0.000164319,
367  0.000719161,
368  0.00250106,
369  0.00773685,
370  0.0197513,
371  0.0443693,
372  0.0885998,
373  0.159891,
374  0.262607,
375  0.392327,
376  0.543125,
377  0.69924,
378  0.837474,
379  0.943486,
380  0.998029,
381  1,
382  0.945937,
383  0.851807,
384  0.729309,
385  0.596332,
386  0.467818,
387  0.350434
388  };
389 
390 
391  static double weight_17[25] = {
392  1.03634e-06,
393  7.25437e-06,
394  4.97443e-05,
395  0.000340956,
396  0.00148715,
397  0.00501485,
398  0.0143067,
399  0.034679,
400  0.0742009,
401  0.140287,
402  0.238288,
403  0.369416,
404  0.521637,
405  0.682368,
406  0.828634,
407  0.939655,
408  1,
409  0.996829,
410  0.94062,
411  0.841575,
412  0.716664,
413  0.582053,
414  0.449595,
415  0.331336,
416  0.234332
417  };
418 
419 
420  static double weight_16[25] = {
421  4.03159e-06,
422  2.41895e-05,
423  0.000141106,
424  0.00081942,
425  0.00314565,
426  0.00990662,
427  0.026293,
428  0.0603881,
429  0.120973,
430  0.214532,
431  0.343708,
432  0.501141,
433  0.665978,
434  0.820107,
435  0.938149,
436  1,
437  0.99941,
438  0.940768,
439  0.837813,
440  0.703086,
441  0.564023,
442  0.42928,
443  0.312515,
444  0.216251,
445  0.14561
446  };
447 
448 
449  static double weight_15[25] = {
450  9.76084e-07,
451  5.07564e-05,
452  0.000303562,
453  0.00174036,
454  0.00617959,
455  0.0188579,
456  0.047465,
457  0.101656,
458  0.189492,
459  0.315673,
460  0.474383,
461  0.646828,
462  0.809462,
463  0.934107,
464  0.998874,
465  1,
466  0.936163,
467  0.827473,
468  0.689675,
469  0.544384,
470  0.40907,
471  0.290648,
472  0.198861,
473  0.12951,
474  0.0808051
475  };
476 
477 
478  static double weight_14[25] = {
479  1.13288e-05,
480  0.000124617,
481  0.000753365,
482  0.00345056,
483  0.0123909,
484  0.0352712,
485  0.0825463,
486  0.16413,
487  0.287213,
488  0.44615,
489  0.625826,
490  0.796365,
491  0.930624,
492  0.999958,
493  1,
494  0.934414,
495  0.816456,
496  0.672939,
497  0.523033,
498  0.386068,
499  0.269824,
500  0.180342,
501  0.114669,
502  0.0698288,
503  0.0406496
504  };
505 
506 
507  static double weight_13[25] = {
508  2.54296e-05,
509  0.000261561,
510  0.00167018,
511  0.00748083,
512  0.0241308,
513  0.0636801,
514  0.138222,
515  0.255814,
516  0.414275,
517  0.600244,
518  0.779958,
519  0.92256,
520  0.999155,
521  1,
522  0.927126,
523  0.804504,
524  0.651803,
525  0.497534,
526  0.35976,
527  0.245834,
528  0.160904,
529  0.0991589,
530  0.0585434,
531  0.0332437,
532  0.0180159
533  };
534 
535  static double weight_12[25] = {
536  5.85742e-05,
537  0.000627706,
538  0.00386677,
539  0.0154068,
540  0.0465892,
541  0.111683,
542  0.222487,
543  0.381677,
544  0.5719,
545  0.765001,
546  0.915916,
547  1,
548  0.999717,
549  0.921443,
550  0.791958,
551  0.632344,
552  0.475195,
553  0.334982,
554  0.223666,
555  0.141781,
556  0.0851538,
557  0.048433,
558  0.0263287,
559  0.0133969,
560  0.00696683
561  };
562 
563 
564  static double weight_11[25] = {
565  0.00015238,
566  0.00156064,
567  0.00846044,
568  0.0310939,
569  0.0856225,
570  0.187589,
571  0.343579,
572  0.541892,
573  0.74224,
574  0.909269,
575  0.998711,
576  1,
577  0.916889,
578  0.77485,
579  0.608819,
580  0.447016,
581  0.307375,
582  0.198444,
583  0.121208,
584  0.070222,
585  0.0386492,
586  0.0201108,
587  0.0100922,
588  0.00484937,
589  0.00222458
590  };
591 
592  static double weight_10[25] = {
593  0.000393044,
594  0.00367001,
595  0.0179474,
596  0.060389,
597  0.151477,
598  0.302077,
599  0.503113,
600  0.720373,
601  0.899568,
602  1,
603  0.997739,
604  0.909409,
605  0.75728,
606  0.582031,
607  0.415322,
608  0.277663,
609  0.174147,
610  0.102154,
611  0.0566719,
612  0.0298642,
613  0.0147751,
614  0.00710995,
615  0.00319628,
616  0.00140601,
617  0.000568796
618  };
619 
620 
621  static double weight_9[25] = {
622  0.00093396,
623  0.00854448,
624  0.0380306,
625  0.113181,
626  0.256614,
627  0.460894,
628  0.690242,
629  0.888781,
630  1,
631  0.998756,
632  0.899872,
633  0.735642,
634  0.552532,
635  0.382726,
636  0.246114,
637  0.147497,
638  0.0825541,
639  0.0441199,
640  0.0218157,
641  0.0103578,
642  0.00462959,
643  0.0019142,
644  0.000771598,
645  0.000295893,
646  0.000111529
647  };
648 
649 
650  static double weight_8[25] = {
651  0.00240233,
652  0.0192688,
653  0.0768653,
654  0.205008,
655  0.410958,
656  0.65758,
657  0.875657,
658  0.999886,
659  1,
660  0.889476,
661  0.711446,
662  0.517781,
663  0.345774,
664  0.212028,
665  0.121208,
666  0.0644629,
667  0.0324928,
668  0.0152492,
669  0.00673527,
670  0.0028547,
671  0.00117213,
672  0.000440177,
673  0.000168471,
674  5.80689e-05,
675  1.93563e-05
676  };
677 
678  static double weight_7[25] = {
679  0.00617233,
680  0.0428714,
681  0.150018,
682  0.350317,
683  0.612535,
684  0.856525,
685  0.999923,
686  1,
687  0.87544,
688  0.679383,
689  0.478345,
690  0.303378,
691  0.176923,
692  0.0950103,
693  0.0476253,
694  0.0222211,
695  0.00972738,
696  0.00392962,
697  0.0015258,
698  0.000559168,
699  0.000183928,
700  6.77983e-05,
701  1.67818e-05,
702  7.38398e-06,
703  6.71271e-07
704  };
705 
706  static double weight_6[25] = {
707  0.0154465,
708  0.0923472,
709  0.277322,
710  0.55552,
711  0.833099,
712  0.999035,
713  1,
714  0.855183,
715  0.641976,
716  0.428277,
717  0.256804,
718  0.139798,
719  0.0700072,
720  0.0321586,
721  0.0137971,
722  0.00544756,
723  0.00202316,
724  0.000766228,
725  0.000259348,
726  8.45836e-05,
727  1.80362e-05,
728  8.70713e-06,
729  3.73163e-06,
730  6.21938e-07,
731  0
732  };
733 
734 
735  static double weight_5[25] = {
736  0.0382845,
737  0.191122,
738  0.478782,
739  0.797314,
740  1,
741  0.997148,
742  0.831144,
743  0.59461,
744  0.371293,
745  0.205903,
746  0.103102,
747  0.0471424,
748  0.0194997,
749  0.00749415,
750  0.00273709,
751  0.000879189,
752  0.000286049,
753  0.000102364,
754  1.70606e-05,
755  3.98081e-06,
756  2.27475e-06,
757  0,
758  0,
759  0,
760  0
761  };
762 
763 
764  static double weight_4[25] = {
765  0.0941305,
766  0.373824,
767  0.750094,
768  1,
769  0.997698,
770  0.800956,
771  0.532306,
772  0.304597,
773  0.152207,
774  0.0676275,
775  0.0270646,
776  0.00975365,
777  0.00326077,
778  0.00101071,
779  0.000301781,
780  7.41664e-05,
781  1.58563e-05,
782  3.58045e-06,
783  1.02299e-06,
784  0,
785  5.11493e-07,
786  0,
787  0,
788  0,
789  0
790  };
791 
792 
793  static double weight_3[25] = {
794  0.222714,
795  0.667015,
796  1,
797  0.999208,
798  0.750609,
799  0.449854,
800  0.224968,
801  0.0965185,
802  0.0361225,
803  0.012084,
804  0.00359618,
805  0.000977166,
806  0.000239269,
807  6.29422e-05,
808  1.16064e-05,
809  1.78559e-06,
810  0,
811  4.46398e-07,
812  0,
813  0,
814  0,
815  0,
816  0,
817  0,
818  0
819  };
820 
821  static double weight_2[25] = {
822  0.499541,
823  0.999607,
824  1,
825  0.666607,
826  0.333301,
827  0.13279,
828  0.0441871,
829  0.0127455,
830  0.00318434,
831  0.00071752,
832  0.000132204,
833  2.69578e-05,
834  5.16999e-06,
835  2.21571e-06,
836  0,
837  0,
838  0,
839  0,
840  0,
841  0,
842  0,
843  0,
844  0,
845  0,
846  0
847  };
848 
849  static double weight_1[25] = {
850  0.999165,
851  1,
852  0.499996,
853  0.166868,
854  0.0414266,
855  0.00831053,
856  0.00137472,
857  0.000198911,
858  2.66302e-05,
859  2.44563e-06,
860  2.71737e-07,
861  2.71737e-07,
862  0,
863  0,
864  0,
865  0,
866  0,
867  0,
868  0,
869  0,
870  0,
871  0,
872  0,
873  0,
874  0
875  };
876 
877  static double weight_0[25] = {
878  1,
879  0,
880  0,
881  0,
882  0,
883  0,
884  0,
885  0,
886  0,
887  0,
888  0,
889  0,
890  0,
891  0,
892  0,
893  0,
894  0,
895  0,
896  0,
897  0,
898  0,
899  0,
900  0,
901  0,
902  0
903  };
904 
905  //WeightOOTPU_ = {0};
906 
907  double* WeightPtr = 0;
908 
909  for(int iint = 0; iint<25; ++iint){
910  if(iint ==0) WeightPtr = weight_0;
911  if(iint ==1) WeightPtr = weight_1;
912  if(iint ==2) WeightPtr = weight_2;
913  if(iint ==3) WeightPtr = weight_3;
914  if(iint ==4) WeightPtr = weight_4;
915  if(iint ==5) WeightPtr = weight_5;
916  if(iint ==6) WeightPtr = weight_6;
917  if(iint ==7) WeightPtr = weight_7;
918  if(iint ==8) WeightPtr = weight_8;
919  if(iint ==9) WeightPtr = weight_9;
920  if(iint ==10) WeightPtr = weight_10;
921  if(iint ==11) WeightPtr = weight_11;
922  if(iint ==12) WeightPtr = weight_12;
923  if(iint ==13) WeightPtr = weight_13;
924  if(iint ==14) WeightPtr = weight_14;
925  if(iint ==15) WeightPtr = weight_15;
926  if(iint ==16) WeightPtr = weight_16;
927  if(iint ==17) WeightPtr = weight_17;
928  if(iint ==18) WeightPtr = weight_18;
929  if(iint ==19) WeightPtr = weight_19;
930  if(iint ==20) WeightPtr = weight_20;
931  if(iint ==21) WeightPtr = weight_21;
932  if(iint ==22) WeightPtr = weight_22;
933  if(iint ==23) WeightPtr = weight_23;
934  if(iint ==24) WeightPtr = weight_24;
935 
936  for(int ibin = 0; ibin<25; ++ibin){
937  WeightOOTPU_[iint][ibin] = *(WeightPtr+ibin);
938  }
939  }
940 
941 }
double WeightOOTPU_[25][25]

Member Data Documentation

boost::shared_ptr<TFile> edm::LumiReWeighting::dataFile_
protected

Definition at line 52 of file LumiReWeighting.h.

Referenced by LumiReWeighting().

std::string edm::LumiReWeighting::dataFileName_
protected

Definition at line 48 of file LumiReWeighting.h.

Referenced by LumiReWeighting().

std::string edm::LumiReWeighting::DataHistName_
protected

Definition at line 50 of file LumiReWeighting.h.

Referenced by LumiReWeighting().

bool edm::LumiReWeighting::FirstWarning_
protected

Definition at line 59 of file LumiReWeighting.h.

Referenced by LumiReWeighting(), weight(), and weightOOT().

boost::shared_ptr<TFile> edm::LumiReWeighting::generatedFile_
protected

Definition at line 51 of file LumiReWeighting.h.

Referenced by LumiReWeighting().

std::string edm::LumiReWeighting::generatedFileName_
protected

Definition at line 47 of file LumiReWeighting.h.

Referenced by LumiReWeighting().

std::string edm::LumiReWeighting::GenHistName_
protected

Definition at line 49 of file LumiReWeighting.h.

Referenced by LumiReWeighting().

int edm::LumiReWeighting::OldLumiSection_
protected

Definition at line 57 of file LumiReWeighting.h.

Referenced by LumiReWeighting(), and weightOOT().

bool edm::LumiReWeighting::Reweight_4_2_2p2_
protected

Definition at line 58 of file LumiReWeighting.h.

Referenced by weightOOT().

double edm::LumiReWeighting::WeightOOTPU_[25][25]
protected

Definition at line 55 of file LumiReWeighting.h.

Referenced by weightOOT(), and weightOOT_init().

boost::shared_ptr<TH1F> edm::LumiReWeighting::weights_
protected

Definition at line 53 of file LumiReWeighting.h.

Referenced by LumiReWeighting(), weight(), and weightOOT().