CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BMixingModule.h
Go to the documentation of this file.
1 #ifndef BMixingModule_h
2 #define BMixingModule_h
3 
18 #include "boost/shared_ptr.hpp"
19 
28 
29 namespace edm {
30  class BMixingModule : public edm::EDProducer {
31  public:
33  explicit BMixingModule(const edm::ParameterSet& ps);
34 
36  virtual ~BMixingModule();
37 
39  virtual void produce(edm::Event& e1, const edm::EventSetup& c);
40 
41  virtual void beginRun(edm::Run & r, const edm::EventSetup & setup);
43 
44  // to be overloaded by dependent class
45  virtual void reload(const edm::EventSetup & setup){};
46 
47  // Should 'averageNumber' return 0 or 1 if there is no mixing? It is the average number of
48  // *crossings*, including the hard scatter, or the average number of overlapping events?
49  // We have guessed 'overlapping events'.
50  double averageNumber() const {return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
51  // Should 'poisson' return 0 or 1 if there is no mixing? See also averageNumber above.
52  bool poisson() const {return inputSources_[0] ? inputSources_[0]->poisson() : 0.0 ;}
53 
54  virtual void createnewEDProduct() {std::cout << "BMixingModule::createnewEDProduct must be overwritten!" << std::endl;}
55  virtual void checkSignal(const edm::Event &e) {std::cout << "BMixingModule::checkSignal must be overwritten!" << std::endl;}
56  virtual void addSignals(const edm::Event &e,const edm::EventSetup& c) {;}
57  virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId,unsigned int worker, const edm::EventSetup& c) {;}
58  virtual void setBcrOffset () {std::cout << "BMixingModule::setBcrOffset must be overwritten!" << std::endl;} //FIXME: LogWarning
59  virtual void setSourceOffset (const unsigned int s) {std::cout << "BMixingModule::setSourceOffset must be overwritten!" << std::endl;}
60  virtual void put(edm::Event &e,const edm::EventSetup& c) {;}
61  virtual void doPileUp(edm::Event &e, const edm::EventSetup& c) {std::cout << "BMixingModule::doPileUp must be overwritten!" << std::endl;}
62  virtual void setEventStartInfo(const unsigned int s) {;} //to be set in CF
63  virtual void getEventStartInfo(edm::Event & e,const unsigned int source) {;} //to be set locally
64 
65  protected:
66  void dropUnwantedBranches(std::vector<std::string> const& wantedBranches);
67  virtual void endJob();
68  // std::string type_;
70  static int vertexoffset;
71  bool checktof_;
72  int minBunch_;
73  int maxBunch_;
74  bool const mixProdStep1_;
75  bool const mixProdStep2_;
76 
77  bool readDB_;
78  bool playback_;
79  const static unsigned int maxNbSources_;
80  std::vector<std::string> sourceNames_;
81  bool doit_[4];//FIXME
82  std::vector< float > TrueNumInteractions_;
83 
84  unsigned int eventId_;
85 
86  // input, cosmics, beamhalo_plus, beamhalo_minus
87  std::vector<boost::shared_ptr<PileUp> > inputSources_;
88 
89  void update(edm::EventSetup const&);
91  };
92 
93 }//edm
94 
95 #endif
edm::ESWatcher< MixingRcd > parameterWatcher_
Definition: BMixingModule.h:90
virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId, unsigned int worker, const edm::EventSetup &c)
Definition: BMixingModule.h:57
static int vertexoffset
Definition: BMixingModule.h:70
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:56
virtual void endJob()
bool const mixProdStep2_
Definition: BMixingModule.h:75
virtual void beginRun(edm::Run &r, const edm::EventSetup &setup)
std::vector< float > TrueNumInteractions_
Definition: BMixingModule.h:82
BMixingModule(const edm::ParameterSet &ps)
bool poisson() const
Definition: BMixingModule.h:52
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:60
virtual void checkSignal(const edm::Event &e)
Definition: BMixingModule.h:55
virtual void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
virtual void setBcrOffset()
Definition: BMixingModule.h:58
static const unsigned int maxNbSources_
Definition: BMixingModule.h:79
virtual void setSourceOffset(const unsigned int s)
Definition: BMixingModule.h:59
virtual void reload(const edm::EventSetup &setup)
Definition: BMixingModule.h:45
double averageNumber() const
Definition: BMixingModule.h:50
virtual void setEventStartInfo(const unsigned int s)
Definition: BMixingModule.h:62
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:87
bool const mixProdStep1_
Definition: BMixingModule.h:74
virtual ~BMixingModule()
virtual void getEventStartInfo(edm::Event &e, const unsigned int source)
Definition: BMixingModule.h:63
virtual void produce(edm::Event &e1, const edm::EventSetup &c)
tuple cout
Definition: gather_cfg.py:121
virtual void doPileUp(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:61
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
std::vector< std::string > sourceNames_
Definition: BMixingModule.h:80
void update(edm::EventSetup const &)
virtual void createnewEDProduct()
Definition: BMixingModule.h:54
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Definition: Run.h:33
unsigned int eventId_
Definition: BMixingModule.h:84