LCOV - code coverage report
Current view: top level - TEvtGen/HepMC - HeavyIon.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 70 0.0 %
Date: 2016-06-14 17:26:59 Functions: 0 33 0.0 %

          Line data    Source code
       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 spectator neutrons
      19             : //      int   spectator_protons            // Number of spectator 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             : 
      37             : //! The HeavyIon class stores information about heavy ions
      38             : 
      39             : ///
      40             : /// \class  HeavyIon
      41             : /// HepMC::HeavyIon provides
      42             : /// additional information storage for Heavy Ion generators in GenEvent.
      43             : /// Creation and use of this information is optional. 
      44             : ///
      45             : class HeavyIon {
      46             : 
      47             : public:
      48             :   // ---  birth/death:
      49             :   //
      50             :   /// default constructor
      51             :   HeavyIon()
      52           0 :     : m_Ncoll_hard(0), 
      53           0 :       m_Npart_proj(0),
      54           0 :       m_Npart_targ(0),
      55           0 :       m_Ncoll(0),
      56           0 :       m_spectator_neutrons(0),
      57           0 :       m_spectator_protons(0),
      58           0 :       m_N_Nwounded_collisions(0),
      59           0 :       m_Nwounded_N_collisions(0),
      60           0 :       m_Nwounded_Nwounded_collisions(0),
      61           0 :       m_impact_parameter(0),
      62           0 :       m_event_plane_angle(0),
      63           0 :       m_eccentricity(0),
      64           0 :       m_sigma_inel_NN(0)
      65           0 :     {}
      66             : 
      67             :   /// The first 6 values must be provided.
      68             :   HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
      69             :                    int nnw=0, int nwn=0, int nwnw=0, 
      70             :                    float im=0., float pl=0., float ec=0., float s=0. );
      71             : 
      72           0 :   ~HeavyIon() {}
      73             :     
      74             :   // ---  copying:
      75             :   //
      76             :   HeavyIon( HeavyIon const & orig );        //!< copy constructor
      77             :   HeavyIon &  operator = ( HeavyIon const & rhs ); //!< make a copy
      78             :   void swap( HeavyIon & other );    //!< swap two HeavyIon objects
      79             : 
      80             :   // ---  equivalence:
      81             :   //
      82             :   bool    operator==( const HeavyIon& ) const; //!< check for equality
      83             :   bool    operator!=( const HeavyIon& ) const; //!< check for inequality
      84             : 
      85             :   // ---  accessors:
      86             :     /// Number of hard scatterings
      87           0 :     int   Ncoll_hard()                   const { return m_Ncoll_hard; }
      88             :     /// Number of projectile participants
      89           0 :     int   Npart_proj()                   const { return m_Npart_proj; }
      90             :     /// Number of target participants
      91           0 :     int   Npart_targ()                   const { return m_Npart_targ; }
      92             :     /// Number of NN (nucleon-nucleon) collisions
      93           0 :     int   Ncoll()                        const { return m_Ncoll; }
      94             :     /// Number of spectator neutrons
      95           0 :     int   spectator_neutrons()           const { return m_spectator_neutrons; }
      96             :     /// Number of spectator protons
      97           0 :     int   spectator_protons()            const { return m_spectator_protons; }
      98             :     /// Number of N-Nwounded collisions
      99           0 :     int   N_Nwounded_collisions()        const { return m_N_Nwounded_collisions; }
     100             :     /// Number of Nwounded-N collisons
     101           0 :     int   Nwounded_N_collisions()        const { return m_Nwounded_N_collisions; }
     102             :     /// Number of Nwounded-Nwounded collisions
     103           0 :     int   Nwounded_Nwounded_collisions() const { return m_Nwounded_Nwounded_collisions; }
     104             :     /// Impact Parameter(in fm) of collision
     105           0 :     float impact_parameter()             const { return m_impact_parameter; }
     106             :     /// Azimuthal angle of event plane
     107           0 :     float event_plane_angle()            const { return m_event_plane_angle; }
     108             :     /// eccentricity of participating nucleons in the transverse plane 
     109             :     /// (as in phobos nucl-ex/0510031)
     110           0 :     float eccentricity()                 const { return m_eccentricity;  }
     111             :     /// nucleon-nucleon inelastic (including diffractive) cross-section
     112           0 :     float sigma_inel_NN()                const { return m_sigma_inel_NN; }
     113             : 
     114             :     /// verify that the instance contains non-zero information
     115             :     bool  is_valid()                     const;
     116             : 
     117             :   // ---  mutators:
     118             :     /// set number of hard scatterings
     119           0 :     void   set_Ncoll_hard(const int &i)              { m_Ncoll_hard=i; }
     120             :     /// set number of projectile participants
     121           0 :     void   set_Npart_proj(const int &i)              { m_Npart_proj=i; }
     122             :     /// set number of target participants
     123           0 :     void   set_Npart_targ(const int &i)              { m_Npart_targ=i; }
     124             :     /// set number of NN (nucleon-nucleon) collisions
     125           0 :     void   set_Ncoll(const int &i)                   { m_Ncoll=i; }
     126             :     /// set number of spectator neutrons
     127           0 :     void   set_spectator_neutrons(const int &i)      { m_spectator_neutrons=i; }
     128             :     /// set number of spectator protons
     129           0 :     void   set_spectator_protons(const int &i)       { m_spectator_protons=i; }
     130             :     /// set number of N-Nwounded collisions
     131           0 :     void   set_N_Nwounded_collisions(const int &i)   { m_N_Nwounded_collisions=i; }
     132             :     /// set number of Nwounded-N collisons
     133           0 :     void   set_Nwounded_N_collisions(const int &i)   { m_Nwounded_N_collisions=i; }
     134             :     /// set number of Nwounded-Nwounded collisions
     135             :     void   set_Nwounded_Nwounded_collisions(const int &i) 
     136           0 :                                           { m_Nwounded_Nwounded_collisions=i; }
     137             :     /// set Impact Parameter in fm
     138           0 :     void   set_impact_parameter(const float &f)      { m_impact_parameter=f; }
     139             :     /// set azimuthal angle of event plane
     140           0 :     void   set_event_plane_angle(const float &f)     { m_event_plane_angle=f; }
     141             :     /// set eccentricity of participating nucleons in the transverse plane 
     142           0 :     void   set_eccentricity(const float &f)          { m_eccentricity=f;  }
     143             :     /// set nucleon-nucleon inelastic cross-section
     144           0 :     void   set_sigma_inel_NN(const float &f)         { m_sigma_inel_NN=f; }
     145             : 
     146             : private: // data members
     147             :     int   m_Ncoll_hard; 
     148             :     int   m_Npart_proj; 
     149             :     int   m_Npart_targ;
     150             :     int   m_Ncoll;
     151             :     int   m_spectator_neutrons;
     152             :     int   m_spectator_protons;
     153             :     int   m_N_Nwounded_collisions;
     154             :     int   m_Nwounded_N_collisions;
     155             :     int   m_Nwounded_Nwounded_collisions;
     156             :     float m_impact_parameter;
     157             :     float m_event_plane_angle;
     158             :     float m_eccentricity; 
     159             :     float m_sigma_inel_NN;
     160             : 
     161             : };
     162             : 
     163             : // Free Functions
     164             : 
     165             : /// Write the contents of HeavyIon to an output stream.
     166             : std::ostream & operator << (std::ostream &, HeavyIon const *);
     167             : /// Read the contents of HeavyIon from an input stream.
     168             : std::istream & operator >> (std::istream &, HeavyIon *);
     169             : 
     170             : // inline operators
     171             :   /// Required members are
     172             :   /// the number of hard scatterings,
     173             :   /// the number of projectile participants.
     174             :   /// the number of target participants.
     175             :   /// the number of nucleon-nucleon collisions,
     176             :   /// the number of spectator neutrons, and
     177             :   /// the number of spectator protons.
     178             : inline HeavyIon::HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
     179             :                    int nnw, int nwn, int nwnw, 
     180             :                    float im, float pl, float ec, float s )
     181             :     : m_Ncoll_hard(nh), 
     182             :       m_Npart_proj(np),
     183             :       m_Npart_targ(nt),
     184             :       m_Ncoll(nc),
     185             :       m_spectator_neutrons(ns),
     186             :       m_spectator_protons(nsp),
     187             :       m_N_Nwounded_collisions(nnw),
     188             :       m_Nwounded_N_collisions(nwn),
     189             :       m_Nwounded_Nwounded_collisions(nwnw),
     190             :       m_impact_parameter(im),
     191             :       m_event_plane_angle(pl),
     192             :       m_eccentricity(ec),
     193             :       m_sigma_inel_NN(s)
     194             :    {}
     195             : 
     196             : inline HeavyIon::HeavyIon( HeavyIon const & orig )
     197           0 :     : m_Ncoll_hard(orig.m_Ncoll_hard), 
     198           0 :       m_Npart_proj(orig.m_Npart_proj),
     199           0 :       m_Npart_targ(orig.m_Npart_targ),
     200           0 :       m_Ncoll(orig.m_Ncoll),
     201           0 :       m_spectator_neutrons(orig.m_spectator_neutrons),
     202           0 :       m_spectator_protons(orig.m_spectator_protons),
     203           0 :       m_N_Nwounded_collisions(orig.m_N_Nwounded_collisions),
     204           0 :       m_Nwounded_N_collisions(orig.m_Nwounded_N_collisions),
     205           0 :       m_Nwounded_Nwounded_collisions(orig.m_Nwounded_Nwounded_collisions),
     206           0 :       m_impact_parameter(orig.m_impact_parameter),
     207           0 :       m_event_plane_angle(orig.m_event_plane_angle),
     208           0 :       m_eccentricity(orig.m_eccentricity),
     209           0 :       m_sigma_inel_NN(orig.m_sigma_inel_NN)
     210           0 :    {}
     211             : 
     212             : inline HeavyIon &  HeavyIon::operator = ( HeavyIon const & rhs ) 
     213             : {
     214             :   HeavyIon temp( rhs );
     215             :   swap( temp );
     216             :   return *this;
     217             : }
     218             : 
     219             : inline void HeavyIon::swap( HeavyIon & other ) 
     220             : {
     221             :   std::swap(m_Ncoll_hard, other.m_Ncoll_hard); 
     222             :   std::swap(m_Npart_proj, other.m_Npart_proj);
     223             :   std::swap(m_Npart_targ, other.m_Npart_targ);
     224             :   std::swap(m_Ncoll, other.m_Ncoll);
     225             :   std::swap(m_N_Nwounded_collisions, other.m_N_Nwounded_collisions);
     226             :   std::swap(m_Nwounded_N_collisions, other.m_Nwounded_N_collisions);
     227             :   std::swap(m_Nwounded_Nwounded_collisions, other.m_Nwounded_Nwounded_collisions);
     228             :   std::swap(m_spectator_neutrons, other.m_spectator_neutrons);
     229             :   std::swap(m_spectator_protons, other.m_spectator_protons);
     230             :   std::swap(m_impact_parameter, other.m_impact_parameter);
     231             :   std::swap(m_event_plane_angle, other.m_event_plane_angle);
     232             :   std::swap(m_eccentricity, other.m_eccentricity);
     233             :   std::swap(m_sigma_inel_NN, other.m_sigma_inel_NN);
     234             : }
     235             : 
     236             : inline bool    HeavyIon::operator==( const HeavyIon& a ) const
     237             : {
     238             :     /// equality requires that each member match
     239             :     return ( a.Ncoll_hard() == this->Ncoll_hard() 
     240             :              && a.Npart_proj() == this->Npart_proj() 
     241             :              && a.Npart_targ() == this->Npart_targ() 
     242             :              && a.Ncoll() == this->Ncoll() 
     243             :              && a.N_Nwounded_collisions() == this->N_Nwounded_collisions() 
     244             :              && a.Nwounded_N_collisions() == this->Nwounded_N_collisions() 
     245             :              && a.Nwounded_Nwounded_collisions() == this->Nwounded_Nwounded_collisions() 
     246             :              && a.spectator_neutrons() == this->spectator_neutrons() 
     247             :              && a.spectator_protons() == this->spectator_protons() 
     248             :              && a.impact_parameter() == this->impact_parameter() 
     249             :              && a.event_plane_angle() == this->event_plane_angle()
     250             :              && a.eccentricity() == this->eccentricity() 
     251             :              && a.sigma_inel_NN() == this->sigma_inel_NN() );
     252             : }
     253             : 
     254             : inline bool    HeavyIon::operator!=( const HeavyIon& a ) const
     255             : {
     256             :     /// any nonmatching member generates inequality
     257             :     return !( a == *this );
     258             : }
     259             : 
     260             : inline bool  HeavyIon::is_valid() const
     261             : {
     262           0 :     if( m_Ncoll_hard != 0 ) return true;
     263           0 :     if( m_Npart_proj != 0 ) return true;
     264           0 :     if( m_Npart_targ != 0 ) return true;
     265           0 :     if( m_Ncoll != 0 ) return true;
     266           0 :     if( m_spectator_neutrons != 0 ) return true;
     267           0 :     if( m_spectator_protons != 0 ) return true;
     268           0 :     if( m_N_Nwounded_collisions != 0 ) return true;
     269           0 :     if( m_Nwounded_N_collisions != 0 ) return true;
     270           0 :     if( m_Nwounded_Nwounded_collisions != 0 ) return true;
     271           0 :     if( m_impact_parameter != 0 ) return true;
     272           0 :     if( m_event_plane_angle != 0 ) return true;
     273           0 :     if( m_eccentricity != 0 ) return true;
     274           0 :     if( m_sigma_inel_NN != 0 ) return true;
     275           0 :     return false;
     276           0 : }
     277             : 
     278             : } // HepMC
     279             : 
     280             : #endif  // HEPMC_HEAVY_ION_H

Generated by: LCOV version 1.11