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  virtual void setEventStartInfo(const unsigned int s) {;} //to be set in CF
70  virtual void getEventStartInfo(edm::Event & e,const unsigned int source) {;} //to be set locally
71 
72  protected:
74  void dropUnwantedBranches(std::vector<std::string> const& wantedBranches);
75  virtual void beginJob() override;
76  virtual void endJob() override;
77  // std::string type_;
80  bool checktof_;
81  int minBunch_;
82  int maxBunch_;
83  bool const mixProdStep1_;
84  bool const mixProdStep2_;
85 
86  bool readDB_;
87  bool playback_;
88  const static unsigned int maxNbSources_;
89  std::vector<std::string> sourceNames_;
90  bool doit_[4];//FIXME
91  std::vector< float > TrueNumInteractions_;
92 
93  unsigned int eventId_;
94 
95  // input, cosmics, beamhalo_plus, beamhalo_minus
96  std::vector<std::shared_ptr<PileUp> > inputSources_;
97 
98  void update(edm::EventSetup const&);
100  };
101 
102 }//edm
103 
104 #endif
edm::ESWatcher< MixingRcd > parameterWatcher_
Definition: BMixingModule.h:99
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
static std::string const source("source")
bool const mixProdStep2_
Definition: BMixingModule.h:84
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:91
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:88
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
virtual void setEventStartInfo(const unsigned int s)
Definition: BMixingModule.h:69
bool const mixProdStep1_
Definition: BMixingModule.h:83
virtual ~BMixingModule()
std::vector< std::shared_ptr< PileUp > > inputSources_
Definition: BMixingModule.h:96
virtual void getEventStartInfo(edm::Event &e, const unsigned int source)
Definition: BMixingModule.h:70
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
std::vector< std::string > sourceNames_
Definition: BMixingModule.h:89
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:93