Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // ----------------------------------------------------------------------
0002 //
0003 // QQChannel.hh
0004 // Author: Lynn Garren
0005 // 
0006 // Temporary holding tank for QQ decay channels
0007 // information must be collected from multiple input lines
0008 // 
0009 // ----------------------------------------------------------------------
0010 #ifndef QQCHANNEL_HH
0011 #define QQCHANNEL_HH
0012 
0013 #include <string>
0014 #include <vector>
0015 #include <sstream>
0016 
0017 namespace HepPDT {
0018 
0019 //! QQhelicity is a temporary holder for QQ decay information
0020 
0021 /// QQ decay helicity information
0022 struct QQhelicity {
0023   /// normally HELICITY has 3 values, but the documentation allows for more
0024   double           prob;
0025   std::vector<int> hel;
0026 };
0027 
0028 /// QQ decay angular helicity information
0029 struct QQAngularHelicity {
0030   int     hel;
0031   double  a0;
0032   double  a1;
0033   double  a2;
0034   double  a3;
0035   double  a4;
0036   double  a5;
0037   double  a6;
0038 };
0039 
0040 /// QQ decay matrix information
0041 struct QQmatrix {
0042   double  a;
0043   double  b;
0044   double  c;
0045 };
0046 
0047 //! QQChannel is a temporary holder for QQ decay information
0048 
0049 ///
0050 /// \class QQChannel
0051 /// \author Lynn Garren
0052 ///
0053 /// Temporarily keep QQ decay information in this class and convert it 
0054 /// when we finish inputing QQ information.
0055 ///
0056 class QQChannel  {
0057 
0058 public:
0059 
0060   typedef std::vector<std::string>       SringVect;
0061   typedef std::vector<QQhelicity>        HelVect;
0062   typedef std::vector<QQAngularHelicity> AngHelVect;
0063 
0064   // -- constructors
0065   QQChannel();
0066   ~QQChannel();
0067 
0068   // ---  copying:
0069   //
0070   void  swap ( QQChannel & rhs );
0071   QQChannel( const QQChannel & orig );
0072   QQChannel & operator = ( const QQChannel & rhs );
0073 
0074   // --- mutators
0075   //
0076   /// add a decay particle to the list
0077   void addDaughter( std::string nm )           { itsDaughters.push_back( nm ); }
0078   /// add helicity information
0079   void addHelicity( QQhelicity hel )           { itsHelicity.push_back( hel ); }
0080   /// add angular helicity information
0081   void addAngHelicity( QQAngularHelicity hel ) { itsAngularHelicity.push_back( hel ); }
0082   /// change the decay matrix code
0083   void setMatrixCode( std::string & m )        { itsMatrixCode = m; }
0084   /// change the branching fraction
0085   void setBranchingFraction( double bf )       { itsBranchingFraction = bf; }
0086   /// change sin(phi)
0087   void setSinPhi( double s )                   { itsSinPhi = s; }
0088   /// change the decay matrix information
0089   void setMatrix( QQmatrix m )                 { itsMatrix = m; }
0090   /// change the CPT tag
0091   void setCPTag( )                             { itsCPTag = true; }
0092   /// clear this channel
0093   void clear();
0094   /// add helicity information
0095   void addHelicity( std::istringstream & thisline );
0096   /// add angular helicity information
0097   void addAngHelicity( std::istringstream & thisline );
0098   /// parse a QQ decay channel line
0099   void parse( std::istringstream & thisline );
0100 
0101   // --- accessors
0102   //
0103   /// get the CPT tag
0104   bool              cpt( )               const { return itsCPTag; }
0105   /// get the matrix code
0106   std::string       matrixCode( )        const { return itsMatrixCode; }
0107   /// get the branching fraction
0108   double            branchingFraction( ) const { return itsBranchingFraction; }
0109   /// get sin(phi)
0110   double            sinPhi( )            const { return itsSinPhi; }
0111   /// get the name of this daughter
0112   std::string       daughter( int i )    const { return itsDaughters[i]; }
0113   /// get helicity information
0114   QQhelicity        helicity( int i )    const { return itsHelicity[i]; }
0115   /// get angular helicity information
0116   QQAngularHelicity angHelicity( int i ) const { return itsAngularHelicity[i]; }
0117   /// how many decay particles in this channel?
0118   int               sizeDtr()            const { return itsDaughters.size(); }
0119   /// how many helicity entries in this channel?
0120   int               sizeHel()            const { return itsHelicity.size(); }
0121   /// how many angular helicity entries in this channel?
0122   int               sizeAngHel()         const { return itsAngularHelicity.size(); }
0123   
0124   /// use for diagnostics
0125   void write( std::ostream & os ) const;    // intended for diagnostic use
0126 
0127 
0128 private:
0129 
0130   std::string itsMatrixCode;
0131   double      itsBranchingFraction;
0132   double      itsSinPhi;
0133   QQmatrix    itsMatrix;
0134   SringVect   itsDaughters;
0135   HelVect     itsHelicity;
0136   AngHelVect  itsAngularHelicity;
0137   bool        itsCPTag;
0138 
0139 };  // QQChannel
0140 
0141 inline void swap( QQChannel & first, QQChannel & second ) {
0142   first.swap( second );
0143 }
0144 
0145 }  // namespace HepPDT
0146 
0147 #endif // QQCHANNEL_HH