CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
28 
29 //
30 // class declaration
31 //
32 
33 class GenXSecAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns,edm::one::WatchLuminosityBlocks>{
34 
35 
36 public:
37  explicit GenXSecAnalyzer(const edm::ParameterSet&);
39  const double final_xsec_value() const {return xsec_.value();}
40  const double final_xsec_error() const {return xsec_.error();}
41 
42 private:
43 
44  virtual void beginJob() override;
45  virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
46  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
47  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
48  virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
49  virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
50  virtual void endJob() override;
51  // computation of cross section after matching and before HepcFilter and GenFilter
53  // combination of cross section from different MCs after matching (could be either before or after HepcFilter and GenFilter)
54  void combine(GenLumiInfoProduct::XSec&, double&, const GenLumiInfoProduct::XSec&, const double&);
55  void combine(double&, double&, double&, const double&, const double&, const double &);
56 
60 
61  // ----------member data --------------------------
62 
63  int nMCs_;
64 
66 
67  // for weight before GenFilter and HepMCFilter and before matching
70 
71  // for weight after GenFilter and HepMCFilter and after matching
72  double totalWeight_;
74 
75  // combined cross sections before HepMCFilter and GenFilter
77 
78  // final combined cross sections
80 
81  // GenLumiInfo before HepMCFilter and GenFilter, this is used
82  // for computation
84 
85  // statistics from additional generator filter, for computation
86  // reset for each run
88 
89  // statistics from HepMC filter, for computation
91 
92  // statistics from additional generator filter, for print-out only
94 
95  // statistics from HepMC filter, for print-out only
97 
98 
99  // the vector/map size is the number of LHE processes + 1
100  // needed only for printouts, not used for computation
101  // only printed out when combining the same physics process
102  // uncertainty-averaged cross sections before matching
103  std::vector<GenLumiInfoProduct::XSec> xsecBeforeMatching_;
104  // uncertainty-averaged cross sections after matching
105  std::vector<GenLumiInfoProduct::XSec> xsecAfterMatching_;
106  // statistics from jet matching
107  std::map<int, GenFilterInfo> jetMatchEffStat_;
108 
109 
110  // the following vectors all have the same size
111  // LHE or Pythia/Herwig cross section of previous luminosity block
112  // vector size = number of processes, used for computation
113  std::map<int, GenLumiInfoProduct::XSec> previousLumiBlockLHEXSec_;
114 
115  // LHE or Pythia/Herwig combined cross section of current luminosity block
116  // updated for each luminosity block, initialized in every run
117  // used for computation
118  std::map<int, GenLumiInfoProduct::XSec> currentLumiBlockLHEXSec_;
119 
120 
121 
122 };
123 
124 #endif
std::vector< GenLumiInfoProduct::XSec > xsecBeforeMatching_
std::map< int, GenFilterInfo > jetMatchEffStat_
virtual void endJob() override
void combine(GenLumiInfoProduct::XSec &, double &, const GenLumiInfoProduct::XSec &, const double &)
edm::EDGetTokenT< GenFilterInfo > hepMCFilterInfoToken_
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
virtual 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
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
virtual void beginJob() override
virtual 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_
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
GenLumiInfoProduct::XSec xsecPreFilter_
Definition: Run.h:41
GenLumiInfoProduct product_