HepMC Reference Documentation

HepMC

HeavyIon.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 #ifndef HEPMC_HEAVY_ION_H
00003 #define HEPMC_HEAVY_ION_H
00004 
00006 // garren@fnal.gov, February 2006
00007 //
00008 // Additional information storage for Heavy Ion generators
00010 //
00011 //      int   Ncoll_hard          // Number of hard scatterings
00012 //      int   Npart_proj          // Number of projectile participants
00013 //      int   Npart_targ          // Number of target participants
00014 //      int   Ncoll               // Number of NN (nucleon-nucleon) collisions
00015 //      int   N_Nwounded_collisions        // Number of N-Nwounded collisions
00016 //      int   Nwounded_N_collisions        // Number of Nwounded-N collisons
00017 //      int   Nwounded_Nwounded_collisions // Number of Nwounded-Nwounded collisions
00018 //      int   spectator_neutrons           // Number of spectator neutrons
00019 //      int   spectator_protons            // Number of spectator protons
00020 //      float impact_parameter        // Impact Parameter(fm) of collision
00021 //      float event_plane_angle       // Azimuthal angle of event plane
00022 //      float eccentricity            // eccentricity of participating nucleons
00023 //                                        in the transverse plane 
00024 //                                        (as in phobos nucl-ex/0510031) 
00025 //      float sigma_inel_NN           // nucleon-nucleon inelastic 
00026 //                                        (including diffractive) cross-section
00027 //
00029 // Feb. 17, 2006: adjust names according to suggestions from Heavy Ion users
00030 // Feb.  7, 2006: first pass at making method names consistent with existing
00031 //                HepMC code
00033 
00034 namespace HepMC {
00035 
00036 
00038 
00045 class HeavyIon {
00046 
00047 public:
00048   // ---  birth/death:
00049   //
00051   HeavyIon()
00052     : m_Ncoll_hard(0), 
00053       m_Npart_proj(0),
00054       m_Npart_targ(0),
00055       m_Ncoll(0),
00056       m_spectator_neutrons(0),
00057       m_spectator_protons(0),
00058       m_N_Nwounded_collisions(0),
00059       m_Nwounded_N_collisions(0),
00060       m_Nwounded_Nwounded_collisions(0),
00061       m_impact_parameter(0),
00062       m_event_plane_angle(0),
00063       m_eccentricity(0),
00064       m_sigma_inel_NN(0)
00065     {}
00066 
00068   HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
00069                    int nnw=0, int nwn=0, int nwnw=0, 
00070                    float im=0., float pl=0., float ec=0., float s=0. );
00071 
00072   ~HeavyIon() {}
00073     
00074   // ---  copying:
00075   //
00076   HeavyIon( HeavyIon const & orig );    
00077   HeavyIon &  operator = ( HeavyIon const & rhs ); 
00078   void swap( HeavyIon & other );        
00079 
00080   // ---  equivalence:
00081   //
00082   bool    operator==( const HeavyIon& ) const; 
00083   bool    operator!=( const HeavyIon& ) const; 
00084 
00085   // ---  accessors:
00087     int   Ncoll_hard()                   const { return m_Ncoll_hard; }
00089     int   Npart_proj()                   const { return m_Npart_proj; }
00091     int   Npart_targ()                   const { return m_Npart_targ; }
00093     int   Ncoll()                        const { return m_Ncoll; }
00095     int   spectator_neutrons()           const { return m_spectator_neutrons; }
00097     int   spectator_protons()            const { return m_spectator_protons; }
00099     int   N_Nwounded_collisions()        const { return m_N_Nwounded_collisions; }
00101     int   Nwounded_N_collisions()        const { return m_Nwounded_N_collisions; }
00103     int   Nwounded_Nwounded_collisions() const { return m_Nwounded_Nwounded_collisions; }
00105     float impact_parameter()             const { return m_impact_parameter; }
00107     float event_plane_angle()            const { return m_event_plane_angle; }
00110     float eccentricity()                 const { return m_eccentricity;  }
00112     float sigma_inel_NN()                const { return m_sigma_inel_NN; }
00113 
00115     bool  is_valid()                     const;
00116 
00117   // ---  mutators:
00119     void   set_Ncoll_hard(const int &i)              { m_Ncoll_hard=i; }
00121     void   set_Npart_proj(const int &i)              { m_Npart_proj=i; }
00123     void   set_Npart_targ(const int &i)              { m_Npart_targ=i; }
00125     void   set_Ncoll(const int &i)                   { m_Ncoll=i; }
00127     void   set_spectator_neutrons(const int &i)      { m_spectator_neutrons=i; }
00129     void   set_spectator_protons(const int &i)       { m_spectator_protons=i; }
00131     void   set_N_Nwounded_collisions(const int &i)   { m_N_Nwounded_collisions=i; }
00133     void   set_Nwounded_N_collisions(const int &i)   { m_Nwounded_N_collisions=i; }
00135     void   set_Nwounded_Nwounded_collisions(const int &i) 
00136                                           { m_Nwounded_Nwounded_collisions=i; }
00138     void   set_impact_parameter(const float &f)      { m_impact_parameter=f; }
00140     void   set_event_plane_angle(const float &f)     { m_event_plane_angle=f; }
00142     void   set_eccentricity(const float &f)          { m_eccentricity=f;  }
00144     void   set_sigma_inel_NN(const float &f)         { m_sigma_inel_NN=f; }
00145 
00146 private: // data members
00147     int   m_Ncoll_hard; 
00148     int   m_Npart_proj; 
00149     int   m_Npart_targ;
00150     int   m_Ncoll;
00151     int   m_spectator_neutrons;
00152     int   m_spectator_protons;
00153     int   m_N_Nwounded_collisions;
00154     int   m_Nwounded_N_collisions;
00155     int   m_Nwounded_Nwounded_collisions;
00156     float m_impact_parameter;
00157     float m_event_plane_angle;
00158     float m_eccentricity; 
00159     float m_sigma_inel_NN;
00160 
00161 };
00162 
00163 // Free Functions
00164 
00166 std::ostream & operator << (std::ostream &, HeavyIon const *);
00168 std::istream & operator >> (std::istream &, HeavyIon *);
00169 
00170 // inline operators
00178 inline HeavyIon::HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
00179                    int nnw, int nwn, int nwnw, 
00180                    float im, float pl, float ec, float s )
00181     : m_Ncoll_hard(nh), 
00182       m_Npart_proj(np),
00183       m_Npart_targ(nt),
00184       m_Ncoll(nc),
00185       m_spectator_neutrons(ns),
00186       m_spectator_protons(nsp),
00187       m_N_Nwounded_collisions(nnw),
00188       m_Nwounded_N_collisions(nwn),
00189       m_Nwounded_Nwounded_collisions(nwnw),
00190       m_impact_parameter(im),
00191       m_event_plane_angle(pl),
00192       m_eccentricity(ec),
00193       m_sigma_inel_NN(s)
00194    {}
00195 
00196 inline HeavyIon::HeavyIon( HeavyIon const & orig )
00197     : m_Ncoll_hard(orig.m_Ncoll_hard), 
00198       m_Npart_proj(orig.m_Npart_proj),
00199       m_Npart_targ(orig.m_Npart_targ),
00200       m_Ncoll(orig.m_Ncoll),
00201       m_spectator_neutrons(orig.m_spectator_neutrons),
00202       m_spectator_protons(orig.m_spectator_protons),
00203       m_N_Nwounded_collisions(orig.m_N_Nwounded_collisions),
00204       m_Nwounded_N_collisions(orig.m_Nwounded_N_collisions),
00205       m_Nwounded_Nwounded_collisions(orig.m_Nwounded_Nwounded_collisions),
00206       m_impact_parameter(orig.m_impact_parameter),
00207       m_event_plane_angle(orig.m_event_plane_angle),
00208       m_eccentricity(orig.m_eccentricity),
00209       m_sigma_inel_NN(orig.m_sigma_inel_NN)
00210    {}
00211 
00212 inline HeavyIon &  HeavyIon::operator = ( HeavyIon const & rhs ) 
00213 {
00214   HeavyIon temp( rhs );
00215   swap( temp );
00216   return *this;
00217 }
00218 
00219 inline void HeavyIon::swap( HeavyIon & other ) 
00220 {
00221   std::swap(m_Ncoll_hard, other.m_Ncoll_hard); 
00222   std::swap(m_Npart_proj, other.m_Npart_proj);
00223   std::swap(m_Npart_targ, other.m_Npart_targ);
00224   std::swap(m_Ncoll, other.m_Ncoll);
00225   std::swap(m_N_Nwounded_collisions, other.m_N_Nwounded_collisions);
00226   std::swap(m_Nwounded_N_collisions, other.m_Nwounded_N_collisions);
00227   std::swap(m_Nwounded_Nwounded_collisions, other.m_Nwounded_Nwounded_collisions);
00228   std::swap(m_spectator_neutrons, other.m_spectator_neutrons);
00229   std::swap(m_spectator_protons, other.m_spectator_protons);
00230   std::swap(m_impact_parameter, other.m_impact_parameter);
00231   std::swap(m_event_plane_angle, other.m_event_plane_angle);
00232   std::swap(m_eccentricity, other.m_eccentricity);
00233   std::swap(m_sigma_inel_NN, other.m_sigma_inel_NN);
00234 }
00235 
00236 inline bool    HeavyIon::operator==( const HeavyIon& a ) const
00237 {
00239     return ( a.Ncoll_hard() == this->Ncoll_hard() 
00240              && a.Npart_proj() == this->Npart_proj() 
00241              && a.Npart_targ() == this->Npart_targ() 
00242              && a.Ncoll() == this->Ncoll() 
00243              && a.N_Nwounded_collisions() == this->N_Nwounded_collisions() 
00244              && a.Nwounded_N_collisions() == this->Nwounded_N_collisions() 
00245              && a.Nwounded_Nwounded_collisions() == this->Nwounded_Nwounded_collisions() 
00246              && a.spectator_neutrons() == this->spectator_neutrons() 
00247              && a.spectator_protons() == this->spectator_protons() 
00248              && a.impact_parameter() == this->impact_parameter() 
00249              && a.event_plane_angle() == this->event_plane_angle()
00250              && a.eccentricity() == this->eccentricity() 
00251              && a.sigma_inel_NN() == this->sigma_inel_NN() );
00252 }
00253 
00254 inline bool    HeavyIon::operator!=( const HeavyIon& a ) const
00255 {
00257     return !( a == *this );
00258 }
00259 
00260 inline bool  HeavyIon::is_valid() const
00261 {
00262     if( m_Ncoll_hard != 0 ) return true;
00263     if( m_Npart_proj != 0 ) return true;
00264     if( m_Npart_targ != 0 ) return true;
00265     if( m_Ncoll != 0 ) return true;
00266     if( m_spectator_neutrons != 0 ) return true;
00267     if( m_spectator_protons != 0 ) return true;
00268     if( m_N_Nwounded_collisions != 0 ) return true;
00269     if( m_Nwounded_N_collisions != 0 ) return true;
00270     if( m_Nwounded_Nwounded_collisions != 0 ) return true;
00271     if( m_impact_parameter != 0 ) return true;
00272     if( m_event_plane_angle != 0 ) return true;
00273     if( m_eccentricity != 0 ) return true;
00274     if( m_sigma_inel_NN != 0 ) return true;
00275     return false;
00276 }
00277 
00278 } // HepMC
00279 
00280 #endif  // HEPMC_HEAVY_ION_H

Generated on Thu Jan 7 13:10:15 2010 for HepMC by  doxygen 1.4.7