Go to the documentation of this file.00001 #ifndef BMixingModule_h
00002 #define BMixingModule_h
00003
00018 #include <vector>
00019
00020 #include "boost/shared_ptr.hpp"
00021
00022 #include "FWCore/Framework/interface/EDProducer.h"
00023 #include "FWCore/Framework/interface/Frameworkfwd.h"
00024 #include "Mixing/Base/interface/PileUp.h"
00025 #include "FWCore/Framework/interface/ESWatcher.h"
00026 #include "CondFormats/DataRecord/interface/MixingRcd.h"
00027
00028
00029 namespace edm {
00030 class BMixingModule : public edm::EDProducer {
00031 public:
00033 explicit BMixingModule(const edm::ParameterSet& ps);
00034
00036 virtual ~BMixingModule();
00037
00039 virtual void produce(edm::Event& e1, const edm::EventSetup& c) override;
00040
00041 virtual void initializeEvent(const edm::Event& event, const edm::EventSetup& setup) {}
00042
00043
00044 virtual void finalizeEvent(edm::Event& event, const edm::EventSetup& setup) {}
00045
00046 virtual void beginRun(const edm::Run& r, const edm::EventSetup& setup) override;
00047 virtual void beginLuminosityBlock(const edm::LuminosityBlock& l, const edm::EventSetup& setup) override;
00048
00049 virtual void endRun(const edm::Run& r, const edm::EventSetup& setup) override {}
00050 virtual void endLuminosityBlock(const edm::LuminosityBlock& l, const edm::EventSetup& setup) override {}
00051
00052
00053 virtual void reload(const edm::EventSetup & setup){};
00054
00055
00056
00057
00058 double averageNumber() const {return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
00059
00060 bool poisson() const {return inputSources_[0] ? inputSources_[0]->poisson() : 0.0 ;}
00061
00062 virtual void createnewEDProduct() {std::cout << "BMixingModule::createnewEDProduct must be overwritten!" << std::endl;}
00063 virtual void checkSignal(const edm::Event &e) {std::cout << "BMixingModule::checkSignal must be overwritten!" << std::endl;}
00064 virtual void addSignals(const edm::Event &e,const edm::EventSetup& c) {;}
00065 virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId,unsigned int worker, const edm::EventSetup& c) {;}
00066 virtual void setBcrOffset () {std::cout << "BMixingModule::setBcrOffset must be overwritten!" << std::endl;}
00067 virtual void setSourceOffset (const unsigned int s) {std::cout << "BMixingModule::setSourceOffset must be overwritten!" << std::endl;}
00068 virtual void put(edm::Event &e,const edm::EventSetup& c) {;}
00069 virtual void doPileUp(edm::Event &e, const edm::EventSetup& c) {std::cout << "BMixingModule::doPileUp must be overwritten!" << std::endl;}
00070 virtual void setEventStartInfo(const unsigned int s) {;}
00071 virtual void getEventStartInfo(edm::Event & e,const unsigned int source) {;}
00072
00073 protected:
00074 void dropUnwantedBranches(std::vector<std::string> const& wantedBranches);
00075 virtual void endJob();
00076
00077 int bunchSpace_;
00078 static int vertexoffset;
00079 bool checktof_;
00080 int minBunch_;
00081 int maxBunch_;
00082 bool const mixProdStep1_;
00083 bool const mixProdStep2_;
00084
00085 bool readDB_;
00086 bool playback_;
00087 const static unsigned int maxNbSources_;
00088 std::vector<std::string> sourceNames_;
00089 bool doit_[4];
00090 std::vector< float > TrueNumInteractions_;
00091
00092 unsigned int eventId_;
00093
00094
00095 std::vector<boost::shared_ptr<PileUp> > inputSources_;
00096
00097 void update(edm::EventSetup const&);
00098 edm::ESWatcher<MixingRcd> parameterWatcher_;
00099 };
00100
00101 }
00102
00103 #endif