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 #include <memory>
20 
26 
27 
28 namespace edm {
29  class BMixingModule : public edm::one::EDProducer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
30  public:
32  explicit BMixingModule(const edm::ParameterSet& ps);
33 
35  virtual ~BMixingModule();
36 
38  virtual void produce(edm::Event& e1, const edm::EventSetup& c) override;
39 
40  virtual void initializeEvent(const edm::Event& event, const edm::EventSetup& setup) {}
41 
42  // edm::Event is non-const because digitizers put their products into the Event.
44 
45  virtual void beginRun(const edm::Run& r, const edm::EventSetup& setup) override;
46  virtual void beginLuminosityBlock(const edm::LuminosityBlock& l, const edm::EventSetup& setup) override;
47 
48  virtual void endRun(const edm::Run& r, const edm::EventSetup& setup) override;
49  virtual void endLuminosityBlock(const edm::LuminosityBlock& l, const edm::EventSetup& setup) override;
50 
51  // to be overloaded by dependent class
52  virtual void reload(const edm::EventSetup & setup){};
53 
54  // Should 'averageNumber' return 0 or 1 if there is no mixing? It is the average number of
55  // *crossings*, including the hard scatter, or the average number of overlapping events?
56  // We have guessed 'overlapping events'.
57  double averageNumber() const {return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
58  // Should 'poisson' return 0 or 1 if there is no mixing? See also averageNumber above.
59  bool poisson() const {return inputSources_[0] ? inputSources_[0]->poisson() : 0.0 ;}
60 
61  virtual void createnewEDProduct();
62  virtual void checkSignal(const edm::Event &e);
63  virtual void addSignals(const edm::Event &e,const edm::EventSetup& c) {}
64  virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId,unsigned int worker, const edm::EventSetup& c) {}
65  virtual void setBcrOffset ();
66  virtual void setSourceOffset (const unsigned int s);
67  virtual void put(edm::Event &e,const edm::EventSetup& c) {}
68  virtual void doPileUp(edm::Event &e, const edm::EventSetup& c);
69 
70  protected:
72  void dropUnwantedBranches(std::vector<std::string> const& wantedBranches);
73  virtual void beginJob() override;
74  virtual void endJob() override;
75  // std::string type_;
78  bool checktof_;
79  int minBunch_;
80  int maxBunch_;
81  bool const mixProdStep1_;
82  bool const mixProdStep2_;
83 
84  bool readDB_;
85  bool playback_;
86  const static unsigned int maxNbSources_;
87  std::vector<std::string> sourceNames_;
88  bool doit_[4];//FIXME
89  std::vector< float > TrueNumInteractions_;
90 
91  unsigned int eventId_;
92 
93  // input, cosmics, beamhalo_plus, beamhalo_minus
94  std::vector<std::shared_ptr<PileUp> > inputSources_;
95 
96  void update(edm::EventSetup const&);
98  };
99 
100 }//edm
101 
102 #endif
edm::ESWatcher< MixingRcd > parameterWatcher_
Definition: BMixingModule.h:97
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:64
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:63
bool const mixProdStep2_
Definition: BMixingModule.h:82
virtual void produce(edm::Event &e1, const edm::EventSetup &c) override
virtual void finalizeEvent(edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:43
std::vector< float > TrueNumInteractions_
Definition: BMixingModule.h:89
BMixingModule(const edm::ParameterSet &ps)
virtual void checkSignal(const edm::Event &e)
bool poisson() const
Definition: BMixingModule.h:59
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:67
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:40
static const unsigned int maxNbSources_
Definition: BMixingModule.h:86
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:52
double averageNumber() const
Definition: BMixingModule.h:57
bool const mixProdStep1_
Definition: BMixingModule.h:81
virtual ~BMixingModule()
std::vector< std::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:94
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
std::vector< std::string > sourceNames_
Definition: BMixingModule.h:87
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:91