// -*- C++ -*- #ifndef __SCHOOL_EVENT_H__ #define __SCHOOL_EVENT_H__ 1 #include "lorentzvector.h" // std includes #include namespace school { // flavors enum flavor_type {nuebar = -12, positron, topbar=-6, bottombar, charmbar, strangebar, upbar, downbar, gluon, up, down, strange, charm, bottom, top, electron = 11, nue }; // structure for representing incoming and outgoing particles struct particle { // flavor of the particle int flavor; // momentum of the particle lorentzvector momentum; }; class event { public: double xa; double xb; private: std::vector _M_array; public: // constructor (we have always two incomming + the n outgoing) explicit event(unsigned int n=1u) : _M_array(n+2) {} // copy event(const event&) = default; event& operator=(const event&) = default; // dectructor ~event() = default; // element access particle& operator[](int k) { return _M_array[k+1];} const particle& operator[](int k) const { return _M_array[k+1];} // iterators typedef std::vector::iterator iterator; typedef std::vector::const_iterator const_iterator; iterator begin() {return _M_array.begin();} const_iterator begin() const {return _M_array.begin();} iterator end() {return _M_array.end();} const_iterator end() const {return _M_array.end();} // resize void resize(unsigned int n) { _M_array.resize(n+2);} // structual information unsigned int number_of_outgoings() const { return _M_array.size()-2;} }; // I/O operators std::ostream& operator<<(std::ostream&, const event&); /* Generate the hadronic event */ double generate_event(event&, double); } #endif