CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GenFilterEfficiencyAnalyzer.cc
Go to the documentation of this file.
2 #include <iostream>
3 
5  genFilterInfoToken_(consumes<GenFilterInfo,edm::InLumi>(pset.getParameter<edm::InputTag>("genFilterInfoTag"))),
6  totalGenFilterInfo_(0,0,0,0,0.,0.,0.,0.)
7 {
8 }
9 
11 {
12 }
13 
14 void
16 {
17 }
18 
19 // ------------ method called once each job just after ending the event loop ------------
20 
21 void
23 
25  iLumi.getByToken(genFilterInfoToken_, genFilter);
26 
27  std::cout << "Lumi section " << iLumi.id() << std::endl;
28 
29  std::cout << "N total = " << genFilter->sumWeights() << " N passed = " << genFilter->sumPassWeights() << " N failed = " << genFilter->sumFailWeights() << std::endl;
30  std::cout << "Generator filter efficiency = " << genFilter->filterEfficiency(-1) << " +- " << genFilter->filterEfficiencyError(-1) << std::endl;
32 
33 }
34 
35 void
37 
38  std::cout << "Total events = " << totalGenFilterInfo_.sumWeights()
39  << " Passed events = " << totalGenFilterInfo_.sumPassWeights() << std::endl;
40  std::cout << "Filter efficiency = " << totalGenFilterInfo_.filterEfficiency(-1)
41  << " +- " << totalGenFilterInfo_.filterEfficiencyError(-1) << std::endl;
42 
43 }
LuminosityBlockID id() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double filterEfficiency(int idwtup=+3) const
GenFilterEfficiencyAnalyzer(const edm::ParameterSet &)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< GenFilterInfo > genFilterInfoToken_
bool mergeProduct(GenFilterInfo const &other)
double sumPassWeights() const
Definition: GenFilterInfo.h:34
double filterEfficiencyError(int idwtup=+3) const
tuple cout
Definition: gather_cfg.py:121
double sumWeights() const
Definition: GenFilterInfo.h:40