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