CMS 3D CMS Logo

Lumi3DReWeighting.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_interface_Lumi3DReWeighting_h
2 #define PhysicsTools_Utilities_interface_Lumi3DReWeighting_h
3 
17 #include "TH1.h"
18 #include "TFile.h"
19 #include <cmath>
20 #include <string>
21 
22 #include <vector>
23 
24 namespace edm {
25  class EventBase;
27  public:
28  Lumi3DReWeighting(std::string generatedFile,
29  std::string dataFile,
30  std::string GenHistName,
31  std::string DataHistName,
32  std::string WeightOutputFile);
33 
34  Lumi3DReWeighting(const std::vector<float>& MC_distr,
35  const std::vector<float>& Lumi_distr,
36  std::string WeightOutputFile);
37 
39 
40  double weight3D(const edm::EventBase& e);
41 
42  double weight3D(int, int, int);
43 
44  void weight3D_set(std::string generatedFile,
45  std::string dataFile,
46  std::string GenHistName,
47  std::string DataHistName,
48  std::string WeightOutputFile);
49 
50  void weight3D_init(float Scale);
51 
52  void weight3D_init(std::string WeightFileName); // initialize from root file
53 
54  void weight3D_init(std::string MCFileName, std::string DataFileName); // initialize from root files
55 
56  protected:
62  std::shared_ptr<TFile> generatedFile_;
63  std::shared_ptr<TFile> dataFile_;
64  std::shared_ptr<TH1> weights_;
65 
66  //keep copies of normalized distributions:
67 
68  std::shared_ptr<TH1> MC_distr_;
69  std::shared_ptr<TH1> Data_distr_;
70 
71  double Weight3D_[50][50][50];
72  };
73 } // namespace edm
74 
75 #endif
double Weight3D_[50][50][50]
std::shared_ptr< TH1 > weights_
std::shared_ptr< TFile > generatedFile_
std::shared_ptr< TFile > dataFile_
double weight3D(const edm::EventBase &e)
void weight3D_set(std::string generatedFile, std::string dataFile, std::string GenHistName, std::string DataHistName, std::string WeightOutputFile)
std::shared_ptr< TH1 > Data_distr_
void weight3D_init(float Scale)
HLT enums.
std::shared_ptr< TH1 > MC_distr_