Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef FastSimulation_MaterialEffects_NUEvent_h
0002 #define FastSimulation_MaterialEffects_NUEvent_h
0003 
0004 #include <vector>
0005 
0006 class NUEvent {
0007 public:
0008   NUEvent() {}
0009   void reset() {
0010     NUParticles_.clear();
0011     NUInteractions_.clear();
0012   }
0013 
0014   class NUParticle {
0015   public:
0016     NUParticle() : 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 NUInteraction {
0025   public:
0026     NUInteraction() : first(0), last(0) {}
0027     unsigned first;
0028     unsigned last;
0029   };
0030 
0031   void addNUParticle(const NUParticle& ptc) { NUParticles_.push_back(ptc); }
0032 
0033   void addNUInteraction(const NUInteraction& idx) { NUInteractions_.push_back(idx); }
0034 
0035   const std::vector<NUEvent::NUParticle>& theNUParticles() { return NUParticles_; }
0036 
0037   const std::vector<NUEvent::NUInteraction>& theNUInteractions() { return NUInteractions_; }
0038 
0039   unsigned nParticles() const { return NUParticles_.size(); }
0040 
0041   unsigned nInteractions() const { return NUInteractions_.size(); }
0042 
0043 private:
0044   std::vector<NUEvent::NUParticle> NUParticles_;
0045   std::vector<NUEvent::NUInteraction> NUInteractions_;
0046 };
0047 
0048 #endif