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 
26 
27 
28 namespace edm {
29  class BMixingModule : public edm::EDProducer {
30  public:
32 
34  explicit BMixingModule(const edm::ParameterSet& ps);
35 
37  virtual ~BMixingModule();
38 
40  virtual void produce(edm::Event& e1, const edm::EventSetup& c);
41 
42  // Should 'averageNumber' return 0 or 1 if there is no mixing? It is the average number of
43  // *crossings*, including the hard scatter, or the average number of overlapping events?
44  // We have guessed 'overlapping events'.
45  double averageNumber() const {return input_ ? input_->averageNumber() : 0.0;}
46  // Should 'poisson' return 0 or 1 if there is no mixing? See also averageNumber above.
47  //bool poisson() const {return input_.poisson();}
48  bool poisson() const {return input_ ? input_->poisson() : 0.0 ;}
49 
50  virtual void createnewEDProduct() {std::cout << "BMixingModule::createnewEDProduct must be overwritten!" << std::endl;}
51  virtual void checkSignal(const edm::Event &e) {std::cout << "BMixingModule::checkSignal must be overwritten!" << std::endl;}
52  void merge(const int bcr, const EventPrincipalVector& vec,unsigned int worker, const edm::EventSetup& c);
53  virtual void addSignals(const edm::Event &e,const edm::EventSetup& c) {;}
54  virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId,unsigned int worker, const edm::EventSetup& c) {;}
55  virtual void setBcrOffset () {std::cout << "BMixingModule::setBcrOffset must be overwritten!" << std::endl;} //FIXME: LogWarning
56  virtual void setSourceOffset (const unsigned int s) {std::cout << "BMixingModule::setSourceOffset must be overwritten!" << std::endl;}
57  virtual void put(edm::Event &e,const edm::EventSetup& c) {;}
58  virtual void doPileUp(edm::Event &e, const edm::EventSetup& c) {std::cout << "BMixingModule::doPileUp must be overwritten!" << std::endl;}
59  virtual void setEventStartInfo(const unsigned int s) {;} //to be set in CF
60  virtual void getEventStartInfo(edm::Event & e,const unsigned int source) {;} //to be set locally
61 
62  protected:
63  void dropUnwantedBranches(std::vector<std::string> const& wantedBranches);
64  virtual void endJob();
66  static int vertexoffset;
67  bool checktof_;
68  int const minBunch_;
69  int const maxBunch_;
70  bool const mixProdStep1_;
71  bool const mixProdStep2_;
72 
73  // playback info
74  bool playback_;
75  std::vector<edm::EventID> eventIDs_;
76  std::vector<std::vector<edm::EventID> > vectorEventIDs_;
77  std::vector<int> fileSeqNrs_;
78  std::vector<unsigned int> nrEvents_;
79  const static unsigned int maxNbSources_;
80  bool doit_[4];//FIXME
81  std::vector<EventPrincipalVector> pileup_[4];//FIXME
82 
83  private:
84 
85  boost::shared_ptr<PileUp> input_;
86  boost::shared_ptr<PileUp> cosmics_;
87  boost::shared_ptr<PileUp> beamHalo_p_;
88  boost::shared_ptr<PileUp> beamHalo_m_;
89 
90  unsigned int eventId_;
91  };
92 
93 }//edm
94 
95 #endif
virtual void addPileups(const int bcr, EventPrincipal *ep, unsigned int eventId, unsigned int worker, const edm::EventSetup &c)
Definition: BMixingModule.h:54
static int vertexoffset
Definition: BMixingModule.h:66
virtual void addSignals(const edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:53
virtual void endJob()
bool const mixProdStep2_
Definition: BMixingModule.h:71
std::vector< EventPrincipalVector > pileup_[4]
Definition: BMixingModule.h:81
BMixingModule(const edm::ParameterSet &ps)
std::vector< std::vector< edm::EventID > > vectorEventIDs_
Definition: BMixingModule.h:76
bool poisson() const
Definition: BMixingModule.h:48
void merge(const int bcr, const EventPrincipalVector &vec, unsigned int worker, const edm::EventSetup &c)
virtual void put(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:57
virtual void checkSignal(const edm::Event &e)
Definition: BMixingModule.h:51
PileUp::EventPrincipalVector EventPrincipalVector
Definition: BMixingModule.h:31
VectorInputSource::EventPrincipalVector EventPrincipalVector
Definition: PileUp.h:24
virtual void setBcrOffset()
Definition: BMixingModule.h:55
static const unsigned int maxNbSources_
Definition: BMixingModule.h:79
std::vector< edm::EventID > eventIDs_
Definition: BMixingModule.h:75
std::vector< unsigned int > nrEvents_
Definition: BMixingModule.h:78
virtual void setSourceOffset(const unsigned int s)
Definition: BMixingModule.h:56
boost::shared_ptr< PileUp > cosmics_
Definition: BMixingModule.h:86
double averageNumber() const
Definition: BMixingModule.h:45
virtual void setEventStartInfo(const unsigned int s)
Definition: BMixingModule.h:59
boost::shared_ptr< PileUp > beamHalo_m_
Definition: BMixingModule.h:88
bool const mixProdStep1_
Definition: BMixingModule.h:70
virtual ~BMixingModule()
virtual void getEventStartInfo(edm::Event &e, const unsigned int source)
Definition: BMixingModule.h:60
virtual void produce(edm::Event &e1, const edm::EventSetup &c)
boost::shared_ptr< PileUp > input_
Definition: BMixingModule.h:85
tuple cout
Definition: gather_cfg.py:41
virtual void doPileUp(edm::Event &e, const edm::EventSetup &c)
Definition: BMixingModule.h:58
std::vector< int > fileSeqNrs_
Definition: BMixingModule.h:77
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
string s
Definition: asciidump.py:422
virtual void createnewEDProduct()
Definition: BMixingModule.h:50
boost::shared_ptr< PileUp > beamHalo_p_
Definition: BMixingModule.h:87
unsigned int eventId_
Definition: BMixingModule.h:90