Changeset View
Changeset View
Standalone View
Standalone View
EvtGenBase/EvtSpinAmp.hh
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | public: | ||||
EvtSpinAmp operator+( const EvtSpinAmp& ) const; | EvtSpinAmp operator+( const EvtSpinAmp& ) const; | ||||
EvtSpinAmp& operator+=( const EvtSpinAmp& ); | EvtSpinAmp& operator+=( const EvtSpinAmp& ); | ||||
EvtSpinAmp operator-( const EvtSpinAmp& ) const; | EvtSpinAmp operator-( const EvtSpinAmp& ) const; | ||||
EvtSpinAmp& operator-=( const EvtSpinAmp& ); | EvtSpinAmp& operator-=( const EvtSpinAmp& ); | ||||
// Direct Product | // Direct Product | ||||
EvtSpinAmp operator*(const EvtSpinAmp&)const; | EvtSpinAmp operator*( const EvtSpinAmp& ) const; | ||||
EvtSpinAmp& operator*=( const EvtSpinAmp& ); | EvtSpinAmp& operator*=( const EvtSpinAmp& ); | ||||
EvtSpinAmp& operator*=( const EvtComplex& ); | EvtSpinAmp& operator*=( const EvtComplex& ); | ||||
EvtSpinAmp& operator/=( const EvtComplex& ); | EvtSpinAmp& operator/=( const EvtComplex& ); | ||||
// Contraction of amplitudes | // Contraction of amplitudes | ||||
void intcont( size_t, size_t ); | void intcont( size_t, size_t ); | ||||
void extcont( const EvtSpinAmp&, int, int ); | void extcont( const EvtSpinAmp&, int, int ); | ||||
// assign this value to every member in the container | // assign this value to every member in the container | ||||
void assign( const EvtComplex& val ) { _elem.assign( _elem.size(), val ); } | void assign( const EvtComplex& val ) | ||||
{ | |||||
m_elem.assign( m_elem.size(), val ); | |||||
} | |||||
// get the order of the container | // get the order of the container | ||||
size_t rank() const { return _twospin.size(); } | size_t rank() const { return m_twospin.size(); } | ||||
// get the dimension vector of the container | // get the dimension vector of the container | ||||
const vector<unsigned int>& dims() const { return _twospin; } | const vector<unsigned int>& dims() const { return m_twospin; } | ||||
// set the elements and the dimensions of the vector - useful for something | // set the elements and the dimensions of the vector - useful for something | ||||
// things eventough it is usually not the cleanest solution | // things eventough it is usually not the cleanest solution | ||||
void addspin( int twospin ) { _twospin.push_back( twospin ); } | void addspin( int twospin ) { m_twospin.push_back( twospin ); } | ||||
void setelem( const vector<EvtComplex>& elem ) { _elem = elem; } | void setelem( const vector<EvtComplex>& elem ) { m_elem = elem; } | ||||
bool iterate( vector<int>& index ) const; | bool iterate( vector<int>& index ) const; | ||||
vector<int> iterinit() const; | vector<int> iterinit() const; | ||||
bool allowed( const vector<int>& index ) const; | bool allowed( const vector<int>& index ) const; | ||||
bool iterateallowed( vector<int>& index ) const; | bool iterateallowed( vector<int>& index ) const; | ||||
vector<int> iterallowedinit() const; | vector<int> iterallowedinit() const; | ||||
private: | private: | ||||
void checkindexargs( const vector<int>& index ) const; | void checkindexargs( const vector<int>& index ) const; | ||||
void checktwospin( const vector<unsigned int>& twospin ) const; | void checktwospin( const vector<unsigned int>& twospin ) const; | ||||
int findtrueindex( const vector<int>& index ) const; | int findtrueindex( const vector<int>& index ) const; | ||||
vector<unsigned int> calctwospin( | vector<unsigned int> calctwospin( | ||||
const vector<EvtSpinType::spintype>& type ) const; | const vector<EvtSpinType::spintype>& type ) const; | ||||
vector<EvtSpinType::spintype> _type; | vector<EvtSpinType::spintype> m_type; | ||||
vector<unsigned int> _twospin; | vector<unsigned int> m_twospin; | ||||
vector<EvtComplex> _elem; | vector<EvtComplex> m_elem; | ||||
}; | }; | ||||
#endif // __EVTSPINAMP__ | #endif // __EVTSPINAMP__ |