CLHEP/HepPDT/QQChannel.hh

00001 // $Id: QQChannel.hh,v 1.5 2002/04/18 20:15:27 garren Exp $
00002 // ----------------------------------------------------------------------
00003 //
00004 // QQChannel.hh
00005 // Author: Lynn Garren
00006 // 
00007 // ----------------------------------------------------------------------
00008 #ifndef QQCHANNEL_HH
00009 #define QQCHANNEL_HH
00010 
00011 #include "CLHEP/config/CLHEP.h"
00012 #include <string>
00013 #include <vector>
00014 
00015 #include "CLHEP/config/sstream.h"
00016 #include "CLHEP/HepPDT/QQStructs.hh"
00017 
00018 namespace HepPDT {
00019 
00024 struct QQhelicity {
00025   // normally HELICITY has 3 values, but the documentation allows for more
00026   double           prob;
00027   std::vector<int> hel;
00028 };
00029 
00034 struct QQAngularHelicity {
00035   int     hel;
00036   double  a0;
00037   double  a1;
00038   double  a2;
00039   double  a3;
00040   double  a4;
00041   double  a5;
00042   double  a6;
00043 };
00044 
00049 struct QQmatrix {
00050   double  a;
00051   double  b;
00052   double  c;
00053 };
00054 
00059 class QQChannel  {
00060 
00061 public:
00062 
00063   typedef std::vector<std::string>       SringVect;
00064   typedef std::vector<QQhelicity>        HelVect;
00065   typedef std::vector<QQAngularHelicity> AngHelVect;
00066 
00067   // -- constructors
00068   QQChannel();
00069   ~QQChannel();
00070 
00071   // ---  copying:
00072   //
00073   void  swap ( QQChannel & rhs );
00074   QQChannel( const QQChannel & orig );
00075   QQChannel & operator = ( const QQChannel & rhs );
00076 
00077   // --- mutators
00078   //
00079   void addDaughter( std::string nm )           { itsDaughters.push_back( nm ); }
00080   void addHelicity( QQhelicity hel )           { itsHelicity.push_back( hel ); }
00081   void addAngHelicity( QQAngularHelicity hel ) { itsAngularHelicity.push_back( hel ); }
00082   void setMatrixCode( std::string & m )        { itsMatrixCode = m; }
00083   void setBranchingFraction( double bf )       { itsBranchingFraction = bf; }
00084   void setSinPhi( double s )                   { itsSinPhi = s; }
00085   void setMatrix( QQmatrix m )                 { itsMatrix = m; }
00086   void setCPTag( )                             { itsCPTag = true; }
00087   void clear();
00088   void addHelicity( std::istringstream & thisline );
00089   void addAngHelicity( std::istringstream & thisline );
00090   void parse( std::istringstream & thisline );
00091 
00092   // --- accessors
00093   //
00094   bool              cpt( )               const { return itsCPTag; }
00095   std::string       matrixCode( )        const { return itsMatrixCode; }
00096   double            branchingFraction( ) const { return itsBranchingFraction; }
00097   double            sinPhi( )            const { return itsSinPhi; }
00098   std::string       daughter( int i )    const { return itsDaughters[i]; }
00099   QQhelicity        helicity( int i )    const { return itsHelicity[i]; }
00100   QQAngularHelicity angHelicity( int i ) const { return itsAngularHelicity[i]; }
00101   int               sizeDtr()            const { return itsDaughters.size(); }
00102   int               sizeHel()            const { return itsHelicity.size(); }
00103   int               sizeAngHel()         const { return itsAngularHelicity.size(); }
00104   
00105   void write( std::ostream & os ) const;        // intended for diagnostic use
00106 
00107 
00108 private:
00109 
00110   std::string itsMatrixCode;
00111   double      itsBranchingFraction;
00112   double      itsSinPhi;
00113   QQmatrix    itsMatrix;
00114   SringVect   itsDaughters;
00115   HelVect     itsHelicity;
00116   AngHelVect  itsAngularHelicity;
00117   bool        itsCPTag;
00118 
00119 };  // QQChannel
00120 
00121 inline void swap( QQChannel & first, QQChannel & second ) {
00122   first.swap( second );
00123 }
00124 
00125 }  // namespace HepPDT
00126 
00127 #endif // QQCHANNEL_HH

Class Library for High Energy Physics (version 1.8)