test
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 namespace edm {
28  namespace MixingCache {
29  struct Config {
30  Config(edm::ParameterSet const& pset, unsigned int maxNbSources);
32  int minBunch_;
33  int maxBunch_;
34  bool playback_;
35  std::vector<std::string> sourceNames_;
36  std::vector<std::shared_ptr<PileUpConfig>> inputConfigs_;
37  };
38  }
39 
40  class BMixingModule : public stream::EDProducer<GlobalCache<MixingCache::Config>> {
41  public:
43  explicit BMixingModule(const edm::ParameterSet& ps, MixingCache::Config const* globalConf);
44 
46  virtual ~BMixingModule();
47 
49  virtual void produce(edm::Event& e1, const edm::EventSetup& c) override;
50 
51  virtual void initializeEvent(const edm::Event& event, const edm::EventSetup& setup) {}
52 
53  // edm::Event is non-const because digitizers put their products into the Event.
55 
56  virtual void beginRun(const edm::Run& r, const edm::EventSetup& setup) override;
57  virtual void beginLuminosityBlock(const edm::LuminosityBlock& l, const edm::EventSetup& setup) override;
58 
59  virtual void endRun(const edm::Run& r, const edm::EventSetup& setup) override;
60  virtual void endLuminosityBlock(const edm::LuminosityBlock& l, const edm::EventSetup& setup) override;
61 
62  static std::unique_ptr<MixingCache::Config> initializeGlobalCache(edm::ParameterSet const&);
64 
65  // to be overloaded by dependent class
66  virtual void reload(const edm::EventSetup & setup){};
67 
68  // Should 'averageNumber' return 0 or 1 if there is no mixing? It is the average number of
69  // *crossings*, including the hard scatter, or the average number of overlapping events?
70  // We have guessed 'overlapping events'.
71  double averageNumber() const {return inputSources_[0] ? inputSources_[0]->averageNumber() : 0.0; }
72  // Should 'poisson' return 0 or 1 if there is no mixing? See also averageNumber above.
73  bool poisson() const {return inputSources_[0] ? inputSources_[0]->poisson() : 0.0 ;}
74 
75  virtual void createnewEDProduct();
76  virtual void checkSignal(const edm::Event &e);
77  virtual void addSignals(const edm::Event &e,const edm::EventSetup& c) {}
78  virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId,unsigned int worker, const edm::EventSetup& c) {}
79  virtual void setBcrOffset ();
80  virtual void setSourceOffset (const unsigned int s);
81  virtual void put(edm::Event &e,const edm::EventSetup& c) {}
82  virtual void doPileUp(edm::Event &e, const edm::EventSetup& c);
83 
84  protected:
86  void dropUnwantedBranches(std::vector<std::string> const& wantedBranches);
87  virtual void beginStream(edm::StreamID) override;
88  virtual void endStream() override;
89  // std::string type_;
92  bool checktof_;
93  int minBunch_;
94  int maxBunch_;
95  bool const mixProdStep1_;
96  bool const mixProdStep2_;
97 
98  bool readDB_;
99  bool playback_;
100  const static unsigned int maxNbSources_;
101  bool doit_[4];//FIXME
102  std::vector< float > TrueNumInteractions_;
103 
104  unsigned int eventId_;
105 
106  // input, cosmics, beamhalo_plus, beamhalo_minus
107  std::vector<std::shared_ptr<PileUp>> inputSources_;
108 
109  void update(edm::EventSetup const&);
111  };
112 
113 }//edm
114 
115 #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:78
static std::unique_ptr< MixingCache::Config > initializeGlobalCache(edm::ParameterSet const &)
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:77
bool const mixProdStep2_
Definition: BMixingModule.h:96
virtual void produce(edm::Event &e1, const edm::EventSetup &c) override
virtual void finalizeEvent(edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:54
std::vector< std::string > sourceNames_
Definition: BMixingModule.h:35
std::vector< float > TrueNumInteractions_
virtual void checkSignal(const edm::Event &e)
virtual void endStream() override
bool poisson() const
Definition: BMixingModule.h:73
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:81
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 doPileUp(edm::Event &e, const edm::EventSetup &c)
virtual void initializeEvent(const edm::Event &event, const edm::EventSetup &setup)
Definition: BMixingModule.h:51
Config(edm::ParameterSet const &pset, unsigned int maxNbSources)
virtual void beginStream(edm::StreamID) override
static const unsigned int maxNbSources_
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 reload(const edm::EventSetup &setup)
Definition: BMixingModule.h:66
double averageNumber() const
Definition: BMixingModule.h:71
Float e1
Definition: deltaR.h:20
bool const mixProdStep1_
Definition: BMixingModule.h:95
virtual ~BMixingModule()
std::vector< std::shared_ptr< PileUp > > inputSources_
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
virtual void beginLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
void update(edm::EventSetup const &)
std::vector< std::shared_ptr< PileUpConfig > > inputConfigs_
Definition: BMixingModule.h:36
static void globalEndJob(MixingCache::Config *)
Definition: BMixingModule.h:63
void setupPileUpEvent(const edm::EventSetup &setup)
virtual void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &setup) override
Definition: Run.h:43
unsigned int eventId_
BMixingModule(const edm::ParameterSet &ps, MixingCache::Config const *globalConf)