Go to the documentation of this file.00001 #ifndef BMixingModule_h
00002 #define BMixingModule_h
00003
00018 #include "boost/shared_ptr.hpp"
00019
00020 #include "FWCore/Framework/interface/EventPrincipal.h"
00021 #include "FWCore/Framework/interface/EDProducer.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 #include "FWCore/Framework/interface/Frameworkfwd.h"
00024 #include "DataFormats/Provenance/interface/EventID.h"
00025 #include "Mixing/Base/interface/PileUp.h"
00026
00027
00028 namespace edm {
00029 class BMixingModule : public edm::EDProducer {
00030 public:
00031 typedef PileUp::EventPrincipalVector EventPrincipalVector;
00032
00034 explicit BMixingModule(const edm::ParameterSet& ps);
00035
00037 virtual ~BMixingModule();
00038
00040 virtual void produce(edm::Event& e1, const edm::EventSetup& c);
00041
00042
00043
00044
00045 double averageNumber() const {return input_ ? input_->averageNumber() : 0.0;}
00046
00047
00048 bool poisson() const {return input_ ? input_->poisson() : 0.0 ;}
00049
00050 virtual void createnewEDProduct() {std::cout << "BMixingModule::createnewEDProduct must be overwritten!" << std::endl;}
00051 virtual void checkSignal(const edm::Event &e) {std::cout << "BMixingModule::checkSignal must be overwritten!" << std::endl;}
00052 void merge(const int bcr, const EventPrincipalVector& vec,unsigned int worker, const edm::EventSetup& c);
00053 virtual void addSignals(const edm::Event &e,const edm::EventSetup& c) {;}
00054 virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId,unsigned int worker, const edm::EventSetup& c) {;}
00055 virtual void setBcrOffset () {std::cout << "BMixingModule::setBcrOffset must be overwritten!" << std::endl;}
00056 virtual void setSourceOffset (const unsigned int s) {std::cout << "BMixingModule::setSourceOffset must be overwritten!" << std::endl;}
00057 virtual void put(edm::Event &e,const edm::EventSetup& c) {;}
00058 virtual void doPileUp(edm::Event &e, const edm::EventSetup& c) {std::cout << "BMixingModule::doPileUp must be overwritten!" << std::endl;}
00059 virtual void setEventStartInfo(const unsigned int s) {;}
00060 virtual void getEventStartInfo(edm::Event & e,const unsigned int source) {;}
00061
00062 protected:
00063 void dropUnwantedBranches(std::vector<std::string> const& wantedBranches);
00064 virtual void endJob();
00065 int bunchSpace_;
00066 static int vertexoffset;
00067 bool checktof_;
00068 int const minBunch_;
00069 int const maxBunch_;
00070 bool const mixProdStep1_;
00071 bool const mixProdStep2_;
00072
00073
00074 bool playback_;
00075 std::vector<edm::EventID> eventIDs_;
00076 std::vector<std::vector<edm::EventID> > vectorEventIDs_;
00077 std::vector<int> fileSeqNrs_;
00078 std::vector<unsigned int> nrEvents_;
00079 const static unsigned int maxNbSources_;
00080 bool doit_[4];
00081 std::vector<EventPrincipalVector> pileup_[4];
00082 std::vector< float > TrueNumInteractions_[4];
00083
00084 private:
00085
00086 boost::shared_ptr<PileUp> input_;
00087 boost::shared_ptr<PileUp> cosmics_;
00088 boost::shared_ptr<PileUp> beamHalo_p_;
00089 boost::shared_ptr<PileUp> beamHalo_m_;
00090
00091 unsigned int eventId_;
00092 };
00093
00094 }
00095
00096 #endif