hepmc - Rev 31

Subversion Repositories:
Rev:
  1. //--------------------------------------------------------------------------
  2. #ifndef HEPMC_HEAVY_ION_H
  3. #define HEPMC_HEAVY_ION_H
  4.  
  5. //////////////////////////////////////////////////////////////////////////
  6. // garren@fnal.gov, February 2006
  7. //
  8. // Additional information storage for Heavy Ion generators
  9. //////////////////////////////////////////////////////////////////////////
  10. //
  11. //      int   Ncoll_hard          // Number of hard scatterings
  12. //      int   Npart_proj          // Number of projectile participants
  13. //      int   Npart_targ          // Number of target participants
  14. //      int   Ncoll               // Number of NN (nucleon-nucleon) collisions
  15. //      int   N_Nwounded_collisions        // Number of N-Nwounded collisions
  16. //      int   Nwounded_N_collisions        // Number of Nwounded-N collisons
  17. //      int   Nwounded_Nwounded_collisions // Number of Nwounded-Nwounded collisions
  18. //      int   spectator_neutrons           // Number of spectators neutrons
  19. //      int   spectator_protons            // Number of spectators protons
  20. //      float impact_parameter        // Impact Parameter(fm) of collision
  21. //      float event_plane_angle       // Azimuthal angle of event plane
  22. //      float eccentricity            // eccentricity of participating nucleons
  23. //                                        in the transverse plane
  24. //                                        (as in phobos nucl-ex/0510031)
  25. //      float sigma_inel_NN           // nucleon-nucleon inelastic
  26. //                                        (including diffractive) cross-section
  27. //
  28. //////////////////////////////////////////////////////////////////////////
  29. // Feb. 17, 2006: adjust names according to suggestions from Heavy Ion users
  30. // Feb.  7, 2006: first pass at making method names consistent with existing
  31. //                HepMC code
  32. //////////////////////////////////////////////////////////////////////////
  33.  
  34. namespace HepMC {
  35.  
  36. class HeavyIon {
  37.  
  38. public:
  39.   // ---  birth/death:
  40.   //
  41.   HeavyIon()
  42.     : m_Ncoll_hard(0),
  43.       m_Npart_proj(0),
  44.       m_Npart_targ(0),
  45.       m_Ncoll(0),
  46.       m_spectator_neutrons(0),
  47.       m_spectator_protons(0),
  48.       m_N_Nwounded_collisions(0),
  49.       m_Nwounded_N_collisions(0),
  50.       m_Nwounded_Nwounded_collisions(0),
  51.       m_impact_parameter(0),
  52.       m_event_plane_angle(0),
  53.       m_eccentricity(0),
  54.       m_sigma_inel_NN(0)
  55.     {}
  56.  
  57.   inline HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
  58.                    int nnw, int nwn, int nwnw,
  59.                    float im, float pl, float ec, float s );
  60.  
  61.   ~HeavyIon() {}
  62.    
  63.   // ---  copying:
  64.   //
  65.   inline HeavyIon( HeavyIon const & orig );
  66.   inline HeavyIon &  operator = ( HeavyIon const & rhs );
  67.   inline void swap( HeavyIon & other );
  68.  
  69.   // ---  equivalence:
  70.   //
  71.   inline bool    operator==( const HeavyIon& ) const;
  72.   inline bool    operator!=( const HeavyIon& ) const;
  73.  
  74.   // ---  accessors:
  75.     int   Ncoll_hard()                   const { return m_Ncoll_hard; }
  76.     int   Npart_proj()                   const { return m_Npart_proj; }
  77.     int   Npart_targ()                   const { return m_Npart_targ; }
  78.     int   Ncoll()                        const { return m_Ncoll; }
  79.     int   spectator_neutrons()           const { return m_spectator_neutrons; }
  80.     int   spectator_protons()            const { return m_spectator_protons; }
  81.     int   N_Nwounded_collisions()        const { return m_N_Nwounded_collisions; }
  82.     int   Nwounded_N_collisions()        const { return m_Nwounded_N_collisions; }
  83.     int   Nwounded_Nwounded_collisions() const { return m_Nwounded_Nwounded_collisions; }
  84.     float impact_parameter()             const { return m_impact_parameter; }
  85.     float event_plane_angle()            const { return m_event_plane_angle; }
  86.     float eccentricity()                 const { return m_eccentricity;  }
  87.     float sigma_inel_NN()                const { return m_sigma_inel_NN; }
  88.  
  89.   // ---  mutators:
  90.     void   set_Ncoll_hard(const int &i)              { m_Ncoll_hard=i; }
  91.     void   set_Npart_proj(const int &i)              { m_Npart_proj=i; }
  92.     void   set_Npart_targ(const int &i)              { m_Npart_targ=i; }
  93.     void   set_Ncoll(const int &i)                   { m_Ncoll=i; }
  94.     void   set_spectator_neutrons(const int &i)      { m_spectator_neutrons=i; }
  95.     void   set_spectator_protons(const int &i)       { m_spectator_protons=i; }
  96.     void   set_N_Nwounded_collisions(const int &i)   { m_N_Nwounded_collisions=i; }
  97.     void   set_Nwounded_N_collisions(const int &i)   { m_Nwounded_N_collisions=i; }
  98.     void   set_Nwounded_Nwounded_collisions(const int &i)
  99.                                           { m_Nwounded_Nwounded_collisions=i; }
  100.     void   set_impact_parameter(const float &f)      { m_impact_parameter=f; }
  101.     void   set_event_plane_angle(const float &f)     { m_event_plane_angle=f; }
  102.     void   set_eccentricity(const float &f)          { m_eccentricity=f;  }
  103.     void   set_sigma_inel_NN(const float &f)         { m_sigma_inel_NN=f; }
  104.  
  105. private: // data members
  106.     int   m_Ncoll_hard;
  107.     int   m_Npart_proj;
  108.     int   m_Npart_targ;
  109.     int   m_Ncoll;
  110.     int   m_spectator_neutrons;
  111.     int   m_spectator_protons;
  112.     int   m_N_Nwounded_collisions;
  113.     int   m_Nwounded_N_collisions;
  114.     int   m_Nwounded_Nwounded_collisions;
  115.     float m_impact_parameter;
  116.     float m_event_plane_angle;
  117.     float m_eccentricity;
  118.     float m_sigma_inel_NN;
  119.  
  120. };
  121.  
  122. // inline operators
  123. HeavyIon::HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
  124.                    int nnw=0, int nwn=0, int nwnw=0,
  125.                    float im=0., float pl=0., float ec=0., float s=0. )
  126.     : m_Ncoll_hard(nh),
  127.       m_Npart_proj(np),
  128.       m_Npart_targ(nt),
  129.       m_Ncoll(nc),
  130.       m_spectator_neutrons(ns),
  131.       m_spectator_protons(nsp),
  132.       m_N_Nwounded_collisions(nnw),
  133.       m_Nwounded_N_collisions(nwn),
  134.       m_Nwounded_Nwounded_collisions(nwnw),
  135.       m_impact_parameter(im),
  136.       m_event_plane_angle(pl),
  137.       m_eccentricity(ec),
  138.       m_sigma_inel_NN(s)
  139.    {}
  140.  
  141. HeavyIon::HeavyIon( HeavyIon const & orig )
  142.     : m_Ncoll_hard(orig.m_Ncoll_hard),
  143.       m_Npart_proj(orig.m_Npart_proj),
  144.       m_Npart_targ(orig.m_Npart_targ),
  145.       m_Ncoll(orig.m_Ncoll),
  146.       m_spectator_neutrons(orig.m_spectator_neutrons),
  147.       m_spectator_protons(orig.m_spectator_protons),
  148.       m_N_Nwounded_collisions(orig.m_N_Nwounded_collisions),
  149.       m_Nwounded_N_collisions(orig.m_Nwounded_N_collisions),
  150.       m_Nwounded_Nwounded_collisions(orig.m_Nwounded_Nwounded_collisions),
  151.       m_impact_parameter(orig.m_impact_parameter),
  152.       m_event_plane_angle(orig.m_event_plane_angle),
  153.       m_eccentricity(orig.m_eccentricity),
  154.       m_sigma_inel_NN(orig.m_sigma_inel_NN)
  155.    {}
  156.  
  157. HeavyIon &  HeavyIon::operator = ( HeavyIon const & rhs )
  158. {
  159.   HeavyIon temp( rhs );
  160.   swap( temp );
  161.   return *this;
  162. }
  163.  
  164. void HeavyIon::swap( HeavyIon & other )
  165. {
  166.   std::swap(m_Ncoll_hard, other.m_Ncoll_hard);
  167.   std::swap(m_Npart_proj, other.m_Npart_proj);
  168.   std::swap(m_Npart_targ, other.m_Npart_targ);
  169.   std::swap(m_Ncoll, other.m_Ncoll);
  170.   std::swap(m_N_Nwounded_collisions, other.m_N_Nwounded_collisions);
  171.   std::swap(m_Nwounded_N_collisions, other.m_Nwounded_N_collisions);
  172.   std::swap(m_Nwounded_Nwounded_collisions, other.m_Nwounded_Nwounded_collisions);
  173.   std::swap(m_spectator_neutrons, other.m_spectator_neutrons);
  174.   std::swap(m_spectator_protons, other.m_spectator_protons);
  175.   std::swap(m_impact_parameter, other.m_impact_parameter);
  176.   std::swap(m_event_plane_angle, other.m_event_plane_angle);
  177.   std::swap(m_eccentricity, other.m_eccentricity);
  178.   std::swap(m_sigma_inel_NN, other.m_sigma_inel_NN);
  179. }
  180.  
  181. bool    HeavyIon::operator==( const HeavyIon& a ) const
  182. {
  183.     return ( a.Ncoll_hard() == this->Ncoll_hard()
  184.              && a.Npart_proj() == this->Npart_proj()
  185.              && a.Npart_targ() == this->Npart_targ()
  186.              && a.Ncoll() == this->Ncoll()
  187.              && a.N_Nwounded_collisions() == this->N_Nwounded_collisions()
  188.              && a.Nwounded_N_collisions() == this->Nwounded_N_collisions()
  189.              && a.Nwounded_Nwounded_collisions() == this->Nwounded_Nwounded_collisions()
  190.              && a.spectator_neutrons() == this->spectator_neutrons()
  191.              && a.spectator_protons() == this->spectator_protons()
  192.              && a.impact_parameter() == this->impact_parameter()
  193.              && a.event_plane_angle() == this->event_plane_angle()
  194.              && a.eccentricity() == this->eccentricity()
  195.              && a.sigma_inel_NN() == this->sigma_inel_NN() );
  196. }
  197.  
  198. bool    HeavyIon::operator!=( const HeavyIon& a ) const
  199. {
  200.     return !( a == *this );
  201. }
  202.  
  203. } // HepMC
  204.  
  205. #endif  // HEPMC_HEAVY_ION_H
  206.