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
edm::Lumi3DReWeighting::GenHistName_
std::string GenHistName_
Definition: Lumi3DReWeighting.h:59
edm::Lumi3DReWeighting::dataFile_
std::shared_ptr< TFile > dataFile_
Definition: Lumi3DReWeighting.h:63
edm::Lumi3DReWeighting::Lumi3DReWeighting
Lumi3DReWeighting()
Definition: Lumi3DReWeighting.h:38
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Lumi3DReWeighting::weight3D_set
void weight3D_set(std::string generatedFile, std::string dataFile, std::string GenHistName, std::string DataHistName, std::string WeightOutputFile)
Definition: Lumi3DReWeighting.cc:156
edm::Lumi3DReWeighting::Weight3D_
double Weight3D_[50][50][50]
Definition: Lumi3DReWeighting.h:71
edm::Lumi3DReWeighting::DataHistName_
std::string DataHistName_
Definition: Lumi3DReWeighting.h:60
edm::Lumi3DReWeighting::generatedFileName_
std::string generatedFileName_
Definition: Lumi3DReWeighting.h:57
edm::Lumi3DReWeighting::Data_distr_
std::shared_ptr< TH1 > Data_distr_
Definition: Lumi3DReWeighting.h:69
edm::Lumi3DReWeighting::weights_
std::shared_ptr< TH1 > weights_
Definition: Lumi3DReWeighting.h:64
edm::Lumi3DReWeighting::generatedFile_
std::shared_ptr< TFile > generatedFile_
Definition: Lumi3DReWeighting.h:62
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Lumi3DReWeighting::weight3D_init
void weight3D_init(float Scale)
Definition: Lumi3DReWeighting.cc:190
edm::Lumi3DReWeighting::dataFileName_
std::string dataFileName_
Definition: Lumi3DReWeighting.h:58
edm::Lumi3DReWeighting::MC_distr_
std::shared_ptr< TH1 > MC_distr_
Definition: Lumi3DReWeighting.h:68
edm::Lumi3DReWeighting
Definition: Lumi3DReWeighting.h:26
edm::EventBase
Definition: EventBase.h:46
EventBase
edm::Lumi3DReWeighting::weightFileName_
std::string weightFileName_
Definition: Lumi3DReWeighting.h:61
edm::Lumi3DReWeighting::weight3D
double weight3D(const edm::EventBase &e)
Definition: Lumi3DReWeighting.cc:119
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37