00001 00015 #ifndef MCTRAJECTORY_HH 00016 #define MCTRAJECTORY_HH 00017 00018 #include "data_base.hh" 00019 #include <set> 00020 #include <TVector3.h> 00021 #include <TLorentzVector.h> 00022 00023 namespace larlight { 00029 class mcstep { 00030 00031 public: 00032 00033 mcstep() {}; 00034 00035 mcstep(const TLorentzVector& p, const TLorentzVector& m) 00036 : _position(p), 00037 _momentum(m) 00038 {} 00039 00040 virtual ~mcstep(){} 00041 00042 const TLorentzVector& Momentum() const {return _momentum;} 00043 00044 const TLorentzVector& Position() const {return _position;} 00045 00046 Double_t X() const {return _position.X(); } 00047 Double_t Y() const {return _position.Y(); } 00048 Double_t Z() const {return _position.Z(); } 00049 Double_t T() const {return _position.T(); } 00050 Double_t Px() const {return _momentum.Px(); } 00051 Double_t Py() const {return _momentum.Py(); } 00052 Double_t Pz() const {return _momentum.Pz(); } 00053 Double_t E() const {return _momentum.E(); } 00054 00055 void SetPosition(const TLorentzVector& v) { _position=v; }; 00056 void SetMomentum(const TLorentzVector& v) { _momentum=v; }; 00057 00058 protected: 00059 00060 TLorentzVector _position; 00061 TLorentzVector _momentum; 00062 00064 ClassDef(mcstep,1) 00066 00067 }; 00068 00074 class mctrajectory : public std::vector<larlight::mcstep>, 00075 public data_base { 00076 00077 public: 00078 00079 mctrajectory(DATA::DATA_TYPE type=DATA::MCTrajectory); 00080 00081 virtual ~mctrajectory(){} 00082 00084 virtual void clear_data() {data_base::clear_data(); clear();} 00085 00087 void push_back(const larlight::mcstep& step){ std::vector<larlight::mcstep>::push_back(step);} 00088 00089 void push_back(const TLorentzVector p, 00090 const TLorentzVector m) 00091 { std::vector<larlight::mcstep>::push_back(larlight::mcstep(p,m));} 00092 00093 private: 00094 00096 ClassDef(mctrajectory,1) 00098 00099 }; 00100 00101 } 00102 #endif 00103 // end of doxygen group