Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:32

0001 #ifndef FastSimulation_PileUpProducer_PUEvent_h
0002 #define FastSimulation_PileUpProducer_PUEvent_h
0003 
0004 #include <vector>
0005 
0006 class PUEvent {
0007 public:
0008   PUEvent() {}
0009   void reset() {
0010     PUParticles_.clear();
0011     PUMinBiasEvts_.clear();
0012   }
0013 
0014   class PUParticle {
0015   public:
0016     PUParticle() : px(0.), py(0.), pz(0.), mass(0.), id(0) {}
0017     float px;
0018     float py;
0019     float pz;
0020     float mass;
0021     int id;
0022   };
0023 
0024   class PUMinBiasEvt {
0025   public:
0026     PUMinBiasEvt() : first(0), size(0) {}
0027     unsigned first;
0028     unsigned size;
0029   };
0030 
0031   void addPUParticle(const PUParticle& ptc) { PUParticles_.push_back(ptc); }
0032 
0033   void addPUMinBiasEvt(const PUMinBiasEvt& idx) { PUMinBiasEvts_.push_back(idx); }
0034 
0035   const std::vector<PUEvent::PUParticle>& thePUParticles() { return PUParticles_; }
0036 
0037   const std::vector<PUEvent::PUMinBiasEvt>& thePUMinBiasEvts() { return PUMinBiasEvts_; }
0038 
0039   unsigned nParticles() const { return PUParticles_.size(); }
0040 
0041   unsigned nMinBias() const { return PUMinBiasEvts_.size(); }
0042 
0043 private:
0044   std::vector<PUEvent::PUParticle> PUParticles_;
0045   std::vector<PUEvent::PUMinBiasEvt> PUMinBiasEvts_;
0046 };
0047 
0048 #endif