CMS 3D CMS Logo

PUEvent.h
Go to the documentation of this file.
1 #ifndef FastSimulation_PileUpProducer_PUEvent_h
2 #define FastSimulation_PileUpProducer_PUEvent_h
3 
4 #include <vector>
5 
6 class PUEvent {
7 public:
8  PUEvent() {}
9  void reset() {
10  PUParticles_.clear();
11  PUMinBiasEvts_.clear();
12  }
13 
14  class PUParticle {
15  public:
16  PUParticle() : px(0.), py(0.), pz(0.), mass(0.), id(0) {}
17  float px;
18  float py;
19  float pz;
20  float mass;
21  int id;
22  };
23 
24  class PUMinBiasEvt {
25  public:
26  PUMinBiasEvt() : first(0), size(0) {}
27  unsigned first;
28  unsigned size;
29  };
30 
31  void addPUParticle(const PUParticle& ptc) { PUParticles_.push_back(ptc); }
32 
33  void addPUMinBiasEvt(const PUMinBiasEvt& idx) { PUMinBiasEvts_.push_back(idx); }
34 
35  const std::vector<PUEvent::PUParticle>& thePUParticles() { return PUParticles_; }
36 
37  const std::vector<PUEvent::PUMinBiasEvt>& thePUMinBiasEvts() { return PUMinBiasEvts_; }
38 
39  unsigned nParticles() const { return PUParticles_.size(); }
40 
41  unsigned nMinBias() const { return PUMinBiasEvts_.size(); }
42 
43 private:
44  std::vector<PUEvent::PUParticle> PUParticles_;
45  std::vector<PUEvent::PUMinBiasEvt> PUMinBiasEvts_;
46 };
47 
48 #endif
const std::vector< PUEvent::PUMinBiasEvt > & thePUMinBiasEvts()
Definition: PUEvent.h:37
void addPUMinBiasEvt(const PUMinBiasEvt &idx)
Definition: PUEvent.h:33
PUEvent()
Definition: PUEvent.h:8
const std::vector< PUEvent::PUParticle > & thePUParticles()
Definition: PUEvent.h:35
unsigned nParticles() const
Definition: PUEvent.h:39
std::vector< PUEvent::PUParticle > PUParticles_
Definition: PUEvent.h:44
void addPUParticle(const PUParticle &ptc)
Definition: PUEvent.h:31
void reset()
Definition: PUEvent.h:9
std::vector< PUEvent::PUMinBiasEvt > PUMinBiasEvts_
Definition: PUEvent.h:45
Definition: PUEvent.h:6
unsigned nMinBias() const
Definition: PUEvent.h:41