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 <vector>
19 
20 #include "boost/shared_ptr.hpp"
21 
27 
28 
29 namespace edm {
30  class BMixingModule : public edm::one::EDProducer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
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) override;
40 
41  virtual void initializeEvent(const edm::Event& event, const edm::EventSetup& setup) {}
42 
43  // edm::Event is non-const because digitizers put their products into the Event.
45 
46  virtual void beginRun(const edm::Run& r, const edm::EventSetup& setup) override;
47  virtual void beginLuminosityBlock(const edm::LuminosityBlock& l, const edm::EventSetup& setup) override;
48 
49  virtual void endRun(const edm::Run& r, const edm::EventSetup& setup) override;
50  virtual void endLuminosityBlock(const edm::LuminosityBlock& l, const edm::EventSetup& setup) override;
51 
52  // to be overloaded by dependent class
53  virtual void reload(const edm::EventSetup & setup){};
54 
55  // Should 'averageNumber' return 0 or 1 if there is no mixing? It is the average number of
56  // *crossings*, including the hard scatter, or the average number of overlapping events?
57  // We have guessed 'overlapping events'.
58  double averageNumber() const {return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
59  // Should 'poisson' return 0 or 1 if there is no mixing? See also averageNumber above.
60  bool poisson() const {return inputSources_[0] ? inputSources_[0]->poisson() : 0.0 ;}
61 
62  virtual void createnewEDProduct();
63  virtual void checkSignal(const edm::Event &e);
64  virtual void addSignals(const edm::Event &e,const edm::EventSetup& c) {;}
65  virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId,unsigned int worker, const edm::EventSetup& c) {;}
66  virtual void setBcrOffset ();
67  virtual void setSourceOffset (const unsigned int s);
68  virtual void put(edm::Event &e,const edm::EventSetup& c) {;}
69  virtual void doPileUp(edm::Event &e, const edm::EventSetup& c);
70  virtual void setEventStartInfo(const unsigned int s) {;} //to be set in CF
71  virtual void getEventStartInfo(edm::Event & e,const unsigned int source) {;} //to be set locally
72 
73  protected:
75  void dropUnwantedBranches(std::vector<std::string> const& wantedBranches);
76  virtual void beginJob() override;
77  virtual void endJob() override;
78  // std::string type_;
81  bool checktof_;
82  int minBunch_;
83  int maxBunch_;
84  bool const mixProdStep1_;
85  bool const mixProdStep2_;
86 
87  bool readDB_;
88  bool playback_;
89  const static unsigned int maxNbSources_;
90  std::vector<std::string> sourceNames_;
91  bool doit_[4];//FIXME
92  std::vector< float > TrueNumInteractions_;
93 
94  unsigned int eventId_;
95 
96  // input, cosmics, beamhalo_plus, beamhalo_minus
97  std::vector<boost::shared_ptr<PileUp> > inputSources_;
98 
99  void update(edm::EventSetup const&);
101  };
102 
103 }//edm
104 
105 #endif
edm::ESWatcher< MixingRcd > parameterWatcher_
virtual void beginRun(const edm::Run &r, const edm::EventSetup &setup) override
virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId, unsigned int worker, const edm::EventSetup &c)
Definition: BMixingModule.h:65
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:64
static std::string const source("source")
bool const mixProdStep2_
Definition: BMixingModule.h:85
virtual void produce(edm::Event &e1, const edm::EventSetup &c) override
virtual void finalizeEvent(edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:44
std::vector< float > TrueNumInteractions_
Definition: BMixingModule.h:92
BMixingModule(const edm::ParameterSet &ps)
virtual void checkSignal(const edm::Event &e)
bool poisson() const
Definition: BMixingModule.h:60
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:68
virtual void endRun(const edm::Run &r, const edm::EventSetup &setup) override
virtual void setBcrOffset()
virtual void createnewEDProduct()
virtual void setSourceOffset(const unsigned int s)
virtual void endJob() override
virtual void doPileUp(edm::Event &e, const edm::EventSetup &c)
virtual void initializeEvent(const edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:41
static const unsigned int maxNbSources_
Definition: BMixingModule.h:89
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual void beginJob() override
virtual void reload(const edm::EventSetup &setup)
Definition: BMixingModule.h:53
double averageNumber() const
Definition: BMixingModule.h:58
virtual void setEventStartInfo(const unsigned int s)
Definition: BMixingModule.h:70
std::vector< boost::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:97
bool const mixProdStep1_
Definition: BMixingModule.h:84
virtual ~BMixingModule()
virtual void getEventStartInfo(edm::Event &e, const unsigned int source)
Definition: BMixingModule.h:71
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
std::vector< std::string > sourceNames_
Definition: BMixingModule.h:90
virtual void beginLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
void update(edm::EventSetup const &)
void setupPileUpEvent(const edm::EventSetup &setup)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
virtual void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
Definition: Run.h:41
unsigned int eventId_
Definition: BMixingModule.h:94