/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtSpinAmp.hh

Go to the documentation of this file.
00001 #ifndef __EVTSPINAMP_HH__
00002 #define __EVTSPINAMP_HH__
00003 
00004 #include "EvtGenBase/EvtSpinType.hh"
00005 #include "EvtGenBase/EvtComplex.hh"
00006 
00007 #include <vector>
00008 using std::vector;
00009 
00010 #include <cstdarg>
00011 
00012 class EvtSpinAmp;
00013 EvtSpinAmp operator*( const EvtComplex&, const EvtSpinAmp& );
00014 EvtSpinAmp operator*( const EvtSpinAmp&, const EvtComplex& );
00015 EvtSpinAmp operator/( const EvtSpinAmp&, const EvtComplex& );
00016 
00017 class EvtSpinAmp
00018 {
00019 
00020     friend EvtSpinAmp operator*( const EvtComplex&, const EvtSpinAmp& );
00021     friend EvtSpinAmp operator*( const EvtSpinAmp&, const EvtComplex& );
00022     friend EvtSpinAmp operator/( const EvtSpinAmp&, const EvtComplex& );
00023     friend std::ostream& operator<< ( std::ostream&, const EvtSpinAmp& );
00024     
00025 public:
00026 
00027     EvtSpinAmp( ) {};
00028     EvtSpinAmp( const vector<EvtSpinType::spintype>& twospin );
00029     EvtSpinAmp( const vector<EvtSpinType::spintype>& twospin, const EvtComplex& val );
00030     EvtSpinAmp( const vector<EvtSpinType::spintype>& twospin, const vector<EvtComplex>& elem );
00031     EvtSpinAmp( const EvtSpinAmp & );
00032 
00033     ~EvtSpinAmp( ) {};
00034     
00035     // Input to the index functions are twice the magnetic quantum number
00036     EvtComplex& operator()( const vector<int>& ); 
00037     const EvtComplex& operator()( const vector<int>& ) const; 
00038     EvtComplex& operator()( int, ... );
00039     const EvtComplex& operator()( int, ... ) const;
00040 
00041     EvtSpinAmp& operator=( const EvtSpinAmp& );
00042 
00043     EvtSpinAmp operator+( const EvtSpinAmp& ) const;
00044     EvtSpinAmp& operator+=( const EvtSpinAmp& );
00045 
00046     EvtSpinAmp operator-( const EvtSpinAmp& ) const;
00047     EvtSpinAmp& operator-=( const EvtSpinAmp& );
00048 
00049     // Direct Product
00050     EvtSpinAmp operator*( const EvtSpinAmp& ) const;
00051     EvtSpinAmp& operator*=( const EvtSpinAmp& );
00052     
00053     EvtSpinAmp& operator*=( const EvtComplex& );
00054     EvtSpinAmp& operator/=( const EvtComplex& );
00055 
00056     // Contraction of amplitudes
00057     void intcont( int, int );
00058     void extcont( const EvtSpinAmp &, int, int );
00059     
00060     // assign this value to every member in the container
00061     void assign( const EvtComplex & val ) { _elem.assign( _elem.size(), val ); }
00062     
00063     // get the order of the container
00064     int rank( ) const { return _twospin.size(); }
00065 
00066     // get the dimension vector of the container
00067     const vector<int> & dims( ) const { return _twospin; } 
00068     
00069     // set the elements and the dimensions of the vector - useful for something
00070     // things eventough it is usually not the cleanest solution
00071     void addspin( int twospin ) { _twospin.push_back( twospin ); }
00072     void setelem( const vector<EvtComplex> &elem ) { _elem = elem; }
00073 
00074     bool iterate( vector<int>& index ) const;
00075     vector<int> iterinit() const;
00076 
00077     bool allowed( const vector<int>& index ) const;
00078     bool iterateallowed( vector<int>& index) const;
00079     vector<int> iterallowedinit() const;
00080 
00081 private:
00082 
00083     void checkindexargs( const vector<int>& index ) const;
00084     void checktwospin( const vector<int>& twospin ) const;
00085     int findtrueindex( const vector<int>& index ) const;
00086     vector<int> calctwospin( const vector<EvtSpinType::spintype>& type ) const;
00087 
00088     vector<EvtSpinType::spintype> _type;
00089     vector<int> _twospin;
00090     vector<EvtComplex> _elem;
00091 };
00092 
00093 #endif // __EVTSPINAMP__

Generated on Tue Nov 29 23:12:15 2016 for BOSS_7.0.2 by  doxygen 1.4.7