Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:29:37

0001 #ifndef gen_HEPMCFILTERDRIVER_H
0002 #define gen_HEPMCFILTERDRIVER_H
0003 
0004 // J.Bendavid
0005 //class to select a HepMCFilter to run with multiple hadronization attempts
0006 //inside HadronizerFilter
0007 
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0009 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0010 #include "SimDataFormats/GeneratorProducts/interface/GenFilterInfo.h"
0011 
0012 //
0013 // class declaration
0014 //
0015 
0016 class BaseHepMCFilter;
0017 
0018 class HepMCFilterDriver {
0019 public:
0020   HepMCFilterDriver(const edm::ParameterSet&);
0021   ~HepMCFilterDriver();
0022 
0023   bool filter(const HepMC::GenEvent* evt, double weight = 1.);
0024   void statistics() const;
0025   void resetStatistics();
0026 
0027   unsigned int numEventsPassPos() const { return numEventsPassPos_; }
0028   unsigned int numEventsPassNeg() const { return numEventsPassNeg_; }
0029   unsigned int numEventsTotalPos() const { return numEventsTotalPos_; }
0030   unsigned int numEventsTotalNeg() const { return numEventsTotalNeg_; }
0031   double sumpass_w() const { return sumpass_w_; }
0032   double sumpass_w2() const { return sumpass_w2_; }
0033   double sumtotal_w() const { return sumtotal_w_; }
0034   double sumtotal_w2() const { return sumtotal_w2_; }
0035 
0036 private:
0037   BaseHepMCFilter* filter_;
0038   unsigned int numEventsPassPos_;
0039   unsigned int numEventsPassNeg_;
0040   unsigned int numEventsTotalPos_;
0041   unsigned int numEventsTotalNeg_;
0042   double sumpass_w_;
0043   double sumpass_w2_;
0044   double sumtotal_w_;
0045   double sumtotal_w2_;
0046 };
0047 #endif