File indexing completed on 2024-04-06 12:30:26
0001 #ifndef SimG4Core_TmpSimEvent_H
0002 #define SimG4Core_TmpSimEvent_H
0003
0004 #include "SimG4Core/Notification/interface/TmpSimTrack.h"
0005 #include "SimG4Core/Notification/interface/TmpSimVertex.h"
0006
0007 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0008 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
0009
0010 #include "HepMC/GenEvent.h"
0011
0012 #include <vector>
0013
0014 class TmpSimEvent {
0015 public:
0016 TmpSimEvent();
0017 ~TmpSimEvent();
0018 void load(edm::SimTrackContainer&) const;
0019 void load(edm::SimVertexContainer&) const;
0020 unsigned int nTracks() const { return g4tracks_.size(); }
0021 unsigned int nVertices() const { return g4vertices_.size(); }
0022 unsigned int nGenParts() const { return hepMCEvent_->particles_size(); }
0023 void setHepEvent(const HepMC::GenEvent* r) { hepMCEvent_ = r; }
0024 const HepMC::GenEvent* hepEvent() const { return hepMCEvent_; }
0025 void setWeight(float w) { weight_ = w; }
0026 float weight() const { return weight_; }
0027 void collisionPoint(const math::XYZTLorentzVectorD& v) { collisionPoint_ = v; }
0028 const math::XYZTLorentzVectorD& collisionPoint() const { return collisionPoint_; }
0029 void nparam(int n) { nparam_ = n; }
0030 const int nparam() const { return nparam_; }
0031 void param(const std::vector<float>& p) { param_ = p; }
0032 const std::vector<float>& param() const { return param_; }
0033 void addTrack(TmpSimTrack* t) { g4tracks_.push_back(t); }
0034 void addVertex(TmpSimVertex* v) { g4vertices_.push_back(v); }
0035
0036
0037
0038 void clear();
0039
0040 private:
0041 const HepMC::GenEvent* hepMCEvent_{nullptr};
0042 float weight_{0.f};
0043 math::XYZTLorentzVectorD collisionPoint_{math::XYZTLorentzVectorD(0., 0., 0., 0.)};
0044 int nparam_{0};
0045 std::vector<float> param_;
0046 std::vector<TmpSimTrack*> g4tracks_;
0047 std::vector<TmpSimVertex*> g4vertices_;
0048 };
0049
0050 #endif