![]() |
![]() |
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: 00032 explicit BMixingModule(const edm::ParameterSet& ps); 00033 00035 virtual ~BMixingModule(); 00036 00038 virtual void produce(edm::Event& e1, const edm::EventSetup& c); 00039 00040 // Should 'averageNumber' return 0 or 1 if there is no mixing? It is the average number of 00041 // *crossings*, including the hard scatter, or the average number of overlapping events? 00042 // We have guessed 'overlapping events'. 00043 double averageNumber() const {return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; } 00044 // Should 'poisson' return 0 or 1 if there is no mixing? See also averageNumber above. 00045 bool poisson() const {return inputSources_[0] ? inputSources_[0]->poisson() : 0.0 ;} 00046 00047 virtual void createnewEDProduct() {std::cout << "BMixingModule::createnewEDProduct must be overwritten!" << std::endl;} 00048 virtual void checkSignal(const edm::Event &e) {std::cout << "BMixingModule::checkSignal must be overwritten!" << std::endl;} 00049 virtual void addSignals(const edm::Event &e,const edm::EventSetup& c) {;} 00050 virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId,unsigned int worker, const edm::EventSetup& c) {;} 00051 virtual void setBcrOffset () {std::cout << "BMixingModule::setBcrOffset must be overwritten!" << std::endl;} //FIXME: LogWarning 00052 virtual void setSourceOffset (const unsigned int s) {std::cout << "BMixingModule::setSourceOffset must be overwritten!" << std::endl;} 00053 virtual void put(edm::Event &e,const edm::EventSetup& c) {;} 00054 virtual void doPileUp(edm::Event &e, const edm::EventSetup& c) {std::cout << "BMixingModule::doPileUp must be overwritten!" << std::endl;} 00055 virtual void setEventStartInfo(const unsigned int s) {;} //to be set in CF 00056 virtual void getEventStartInfo(edm::Event & e,const unsigned int source) {;} //to be set locally 00057 00058 protected: 00059 void dropUnwantedBranches(std::vector<std::string> const& wantedBranches); 00060 virtual void endJob(); 00061 int bunchSpace_; 00062 static int vertexoffset; 00063 bool checktof_; 00064 int const minBunch_; 00065 int const maxBunch_; 00066 bool const mixProdStep1_; 00067 bool const mixProdStep2_; 00068 00069 bool playback_; 00070 const static unsigned int maxNbSources_; 00071 std::vector<std::string> sourceNames_; 00072 bool doit_[4];//FIXME 00073 std::vector< float > TrueNumInteractions_; 00074 00075 unsigned int eventId_; 00076 00077 // input, cosmics, beamhalo_plus, beamhalo_minus 00078 std::vector<boost::shared_ptr<PileUp> > inputSources_; 00079 00080 }; 00081 00082 }//edm 00083 00084 #endif