Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:11:34

0001 // ----------------------------------------------------------------------
0002 //
0003 // ResonanceStructure.hh
0004 // Author:  Lynn Garren
0005 //
0006 // ResonanceStructure contains the minimum information for a Breit-Wigner
0007 // distribution about a given mass.
0008 // ----------------------------------------------------------------------
0009 #ifndef RESONANCESTRUCTURE_HH
0010 #define RESONANCESTRUCTURE_HH
0011 
0012 #include <algorithm>    // swap()
0013 
0014 #include "HepPDT/Measurement.hh"
0015 
0016 namespace HepPDT {
0017 
0018 //! The ResonanceStructure class is holds mass and width information.
0019 
0020 ///
0021 /// \class ResonanceStructure
0022 /// \author Lynn Garren
0023 ///
0024 /// ResonanceStructure contains the minimum information for a Breit-Wigner
0025 /// distribution about a given mass.
0026 ///
0027 class ResonanceStructure  {
0028 
0029 public:
0030 
0031   // ---  birth/death:
0032   //
0033   /// construct from mass and total width
0034   ResonanceStructure( Measurement mass = Measurement(),
0035                       Measurement width = Measurement(),
0036                       double min = 0., double max = 0. );
0037   virtual ~ResonanceStructure();
0038 
0039   // ---  copying:
0040   //
0041   ResonanceStructure( const ResonanceStructure & orig );
0042   ResonanceStructure& operator= ( const ResonanceStructure & rhs );
0043   void swap ( ResonanceStructure & other );
0044 
0045   // ---  accessors:
0046   //
0047   /// get the mass
0048   Measurement   const & mass()         const { return itsMass; }
0049   /// get the total width
0050   Measurement   const & totalWidth()   const { return itsTotalWidth; }
0051   /// calculate lifetime from total width
0052   Measurement   lifetime()             const;
0053   /// lower cutoff of allowed width values
0054   double        lowerCutoff()          const { return itsLowerCutoff; }
0055   /// upper cutoff of allowed width values
0056   double        upperCutoff()          const { return itsUpperCutoff; }
0057 
0058   // ---  mutators:
0059   //
0060   /// change the mass
0061   void  setMass( Measurement const & mass )        {  itsMass = mass; }
0062   /// change the total width
0063   void  setTotalWidth( Measurement const & width ) {  itsTotalWidth = width; }
0064   /// change the total width using a lifetime
0065   void  setTotalWidthFromLifetime( Measurement const & lt );
0066   /// change the lower cutoff of allowed width values
0067   void  setLowerCutoff( double cut )               {  itsLowerCutoff = cut; }
0068   /// change the upper cutoff of allowed width values
0069   void  setUpperCutoff( double cut )               {  itsUpperCutoff = cut; }
0070 
0071 private:
0072 
0073   // ---  class-specific data:
0074   //
0075   Measurement   itsMass;
0076   Measurement   itsTotalWidth;
0077   double        itsLowerCutoff;
0078   double        itsUpperCutoff;
0079 
0080 };  // ResonanceStructure
0081 
0082 inline
0083 void swap( ResonanceStructure & first, ResonanceStructure & second )  {
0084   first.swap( second );
0085 }
0086 
0087 }   // HepPDT
0088 
0089 #endif // RESONANCESTRUCTURE_HH