00001 #ifndef BMixingModule_h 00002 #define BMixingModule_h 00003 00018 #include "boost/shared_ptr.hpp" 00019 00020 #include "FWCore/Framework/interface/EDProducer.h" 00021 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00022 #include "FWCore/Framework/interface/Frameworkfwd.h" 00023 #include "DataFormats/Provenance/interface/EventID.h" 00024 #include "Mixing/Base/interface/PileUp.h" 00025 00026 00027 namespace edm { 00028 class BMixingModule : public edm::EDProducer { 00029 public: 00030 typedef PileUp::EventPrincipalVector EventPrincipalVector; 00031 00033 explicit BMixingModule(const edm::ParameterSet& ps); 00034 00036 virtual ~BMixingModule(); 00037 00039 virtual void produce(edm::Event& e1, const edm::EventSetup& c); 00040 00041 // Should 'averageNumber' return 0 or 1 if there is no mixing? It is the average number of 00042 // *crossings*, including the hard scatter, or the average number of overlapping events? 00043 // We have guessed 'overlapping events'. 00044 double averageNumber() const {return input_ ? input_->averageNumber() : 0.0;} 00045 // Should 'poisson' return 0 or 1 if there is no mixing? See also averageNumber above. 00046 //bool poisson() const {return input_.poisson();} 00047 bool poisson() const {return input_ ? input_->poisson() : 0.0 ;} 00048 00049 virtual void createnewEDProduct() {std::cout << "BMixingModule::createnewEDProduct must be overwritten!" << std::endl;} 00050 void merge(const int bcr, const EventPrincipalVector& vec,unsigned int worker); 00051 virtual void addSignals(const edm::Event &e) {;} 00052 virtual void addPileups(const int bcr, edm::Event*, unsigned int eventId,unsigned int worker) {;} 00053 virtual void setBcrOffset () {std::cout << "BMixingModule::setBcrOffset must be overwritten!" << std::endl;} //FIXME: LogWarning 00054 virtual void setSourceOffset (const unsigned int s) {std::cout << "BMixingModule::setSourceOffset must be overwritten!" << std::endl;} 00055 virtual void put(edm::Event &e) {;} 00056 virtual void doPileUp(edm::Event &e) {std::cout << "BMixingModule::doPileUp must be overwritten!" << std::endl;} 00057 virtual void setEventStartInfo(const unsigned int s) {;} //to be set in CF 00058 virtual void getEventStartInfo(edm::Event & e,const unsigned int source) {;} //to be set locally 00059 00060 protected: 00061 void dropUnwantedBranches(std::vector<std::string> const& wantedBranches); 00062 virtual void endJob(); 00063 int bunchSpace_; 00064 static int vertexoffset; 00065 bool checktof_; 00066 int const minBunch_; 00067 int const maxBunch_; 00068 00069 // playback info 00070 bool playback_; 00071 std::vector<edm::EventID> eventIDs_; 00072 std::vector<int> fileSeqNrs_; 00073 std::vector<unsigned int> nrEvents_; 00074 const static unsigned int maxNbSources_; 00075 bool doit_[5];//FIXME 00076 std::vector<EventPrincipalVector> pileup_[5];//FIXME 00077 00078 private: 00079 00080 boost::shared_ptr<PileUp> input_; 00081 boost::shared_ptr<PileUp> cosmics_; 00082 boost::shared_ptr<PileUp> beamHalo_p_; 00083 boost::shared_ptr<PileUp> beamHalo_m_; 00084 boost::shared_ptr<PileUp> fwdDet_; 00085 ModuleDescription md_; 00086 00087 unsigned int eventId_; 00088 }; 00089 00090 }//edm 00091 00092 #endif