CMS 3D CMS Logo

GenXSecAnalyzer.h
Go to the documentation of this file.
1 
2 #ifndef GENXSECANALYZER_H
3 #define GENXSECANALYZER_H
4 
5 // $Revision://
6 
7 // analyzer of a summary information product on filter efficiency for a user specified path
8 // meant for the generator filter efficiency calculation
9 
10 
11 // system include files
12 #include <memory>
13 #include <vector>
14 #include <map>
15 
16 // user include files
19 
29 
30 //
31 // class declaration
32 //
33 
34 class GenXSecAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns,edm::one::WatchLuminosityBlocks>{
35 
36 
37 public:
38  explicit GenXSecAnalyzer(const edm::ParameterSet&);
39  ~GenXSecAnalyzer() override;
40  const double final_xsec_value() const {return xsec_.value();}
41  const double final_xsec_error() const {return xsec_.error();}
42 
43 private:
44 
45  void beginJob() override;
46  void beginRun(edm::Run const&, edm::EventSetup const&) override;
47  void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
48  void analyze(const edm::Event&, const edm::EventSetup&) override;
49  void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
50  void endRun(edm::Run const&, edm::EventSetup const&) override;
51  void endJob() override;
52  // computation of cross section after matching and before HepcFilter and GenFilter
54  // combination of cross section from different MCs after matching (could be either before or after HepcFilter and GenFilter)
55  void combine(GenLumiInfoProduct::XSec&, double&, const GenLumiInfoProduct::XSec&, const double&);
56  void combine(double&, double&, double&, const double&, const double&, const double &);
57 
62 
63  // ----------member data --------------------------
64 
65  int nMCs_;
66 
68 
69  // for weight before GenFilter and HepMCFilter and before matching
72 
73  // for weight after GenFilter and HepMCFilter and after matching
74  double totalWeight_;
76 
77  // combined cross sections before HepMCFilter and GenFilter
79 
80  // final combined cross sections
82 
83  // GenLumiInfo before HepMCFilter and GenFilter, this is used
84  // for computation
86 
87  // statistics from additional generator filter, for computation
88  // reset for each run
90 
91  // statistics from HepMC filter, for computation
93 
94  // statistics from additional generator filter, for print-out only
96 
97  // statistics from HepMC filter, for print-out only
99 
100 
101  // the vector/map size is the number of LHE processes + 1
102  // needed only for printouts, not used for computation
103  // only printed out when combining the same physics process
104  // uncertainty-averaged cross sections before matching
105  std::vector<GenLumiInfoProduct::XSec> xsecBeforeMatching_;
106  // uncertainty-averaged cross sections after matching
107  std::vector<GenLumiInfoProduct::XSec> xsecAfterMatching_;
108  // statistics from jet matching
109  std::map<int, GenFilterInfo> jetMatchEffStat_;
110 
111 
112  // the following vectors all have the same size
113  // LHE or Pythia/Herwig cross section of previous luminosity block
114  // vector size = number of processes, used for computation
115  std::map<int, GenLumiInfoProduct::XSec> previousLumiBlockLHEXSec_;
116 
117  // LHE or Pythia/Herwig combined cross section of current luminosity block
118  // updated for each luminosity block, initialized in every run
119  // used for computation
120  std::map<int, GenLumiInfoProduct::XSec> currentLumiBlockLHEXSec_;
121 
122 
123 
124 };
125 
126 #endif
std::vector< GenLumiInfoProduct::XSec > xsecBeforeMatching_
std::map< int, GenFilterInfo > jetMatchEffStat_
void endJob() override
void combine(GenLumiInfoProduct::XSec &, double &, const GenLumiInfoProduct::XSec &, const double &)
edm::EDGetTokenT< GenFilterInfo > hepMCFilterInfoToken_
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
GenFilterInfo filterOnlyEffStat_
edm::EDGetTokenT< GenLumiInfoProduct > genLumiInfoToken_
const double final_xsec_error() const
std::map< int, GenLumiInfoProduct::XSec > currentLumiBlockLHEXSec_
GenLumiInfoProduct::XSec xsec_
GenFilterInfo hepMCFilterEffRun_
GenFilterInfo hepMCFilterEffStat_
const double final_xsec_value() const
void analyze(const edm::Event &, const edm::EventSetup &) override
void beginJob() override
void beginRun(edm::Run const &, edm::EventSetup const &) override
GenLumiInfoProduct::XSec compute(const GenLumiInfoProduct &)
std::map< int, GenLumiInfoProduct::XSec > previousLumiBlockLHEXSec_
GenFilterInfo filterOnlyEffRun_
edm::EDGetTokenT< GenFilterInfo > genFilterInfoToken_
double thisRunWeightPre_
GenXSecAnalyzer(const edm::ParameterSet &)
std::vector< GenLumiInfoProduct::XSec > xsecAfterMatching_
~GenXSecAnalyzer() override
void endRun(edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< LHERunInfoProduct > lheRunInfoToken_
GenLumiInfoProduct::XSec xsecPreFilter_
Definition: Run.h:44
GenLumiInfoProduct product_