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 // system include files
11 #include <memory>
12 #include <vector>
13 #include <map>
14 
15 // user include files
18 
28 
29 //
30 // class declaration
31 //
32 
33 class GenXSecAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
34 public:
35  explicit GenXSecAnalyzer(const edm::ParameterSet &);
36  ~GenXSecAnalyzer() override;
37  const double final_xsec_value() const { return xsec_.value(); }
38  const double final_xsec_error() const { return xsec_.error(); }
39 
40 private:
41  void beginJob() override;
42  void beginRun(edm::Run const &, edm::EventSetup const &) override;
43  void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
44  void analyze(const edm::Event &, const edm::EventSetup &) override;
45  void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
46  void endRun(edm::Run const &, edm::EventSetup const &) override;
47  void endJob() override;
48  // computation of cross section after matching and before HepcFilter and GenFilter
50  // combination of cross section from different MCs after matching (could be either before or after HepcFilter and GenFilter)
51  void combine(GenLumiInfoProduct::XSec &, double &, const GenLumiInfoProduct::XSec &, const double &);
52  void combine(double &, double &, double &, const double &, const double &, const double &);
53 
58 
59  // ----------member data --------------------------
60 
61  int nMCs_;
62 
64 
65  // for weight before GenFilter and HepMCFilter and before matching
68 
69  // for weight after GenFilter and HepMCFilter and after matching
70  double totalWeight_;
72 
73  // combined cross sections before HepMCFilter and GenFilter
75 
76  // final combined cross sections
78 
79  // GenLumiInfo before HepMCFilter and GenFilter, this is used
80  // for computation
82 
83  // statistics from additional generator filter, for computation
84  // reset for each run
86 
87  // statistics from HepMC filter, for computation
89 
90  // statistics from additional generator filter, for print-out only
92 
93  // statistics from HepMC filter, for print-out only
95 
96  // the vector/map size is the number of LHE processes + 1
97  // needed only for printouts, not used for computation
98  // only printed out when combining the same physics process
99  // uncertainty-averaged cross sections before matching
100  std::vector<GenLumiInfoProduct::XSec> xsecBeforeMatching_;
101  // uncertainty-averaged cross sections after matching
102  std::vector<GenLumiInfoProduct::XSec> xsecAfterMatching_;
103  // statistics from jet matching
104  std::map<int, GenFilterInfo> jetMatchEffStat_;
105 
106  // the following vectors all have the same size
107  // LHE or Pythia/Herwig cross section of previous luminosity block
108  // vector size = number of processes, used for computation
109  std::map<int, GenLumiInfoProduct::XSec> previousLumiBlockLHEXSec_;
110 
111  // LHE or Pythia/Herwig combined cross section of current luminosity block
112  // updated for each luminosity block, initialized in every run
113  // used for computation
114  std::map<int, GenLumiInfoProduct::XSec> currentLumiBlockLHEXSec_;
115 };
116 
117 #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:45
GenLumiInfoProduct product_