BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtAmpFactory< T > Class Template Referenceabstract

#include <EvtAmpFactory.hh>

Public Member Functions

 EvtAmpFactory ()
 EvtAmpFactory (const EvtAmpFactory< T > &other)
virtual ~EvtAmpFactory ()
virtual EvtAmpFactory< T > * clone () const =0
virtual void build (const EvtMultiChannelParser &parser, int nItg)
virtual void processAmp (EvtComplex c, std::vector< std::string > v, bool conj=false)=0
bool isCPModel () const
double dm () const
void setVerbose ()
EvtAmplitudeSum< T > * getAmp () const
EvtAmplitudeSum< T > * getAmpConj () const
EvtPdfSum< T > * getPC () const
EvtAmplitude< T > * getAmp (int i) const
EvtPdf< T > * getPC (int i) const
const char * compName (int i) const
EvtComplex getCoeff (int i) const
double getTermCoeff (int i) const
double getTermCoeff (int type, int i, int j) const

Protected Attributes

EvtAmplitudeSum< T > * _amp
EvtAmplitudeSum< T > * _ampConj
EvtPdfSum< T > * _pc
std::vector< std::string > _names
double _dm
bool _verbose

Detailed Description

template<class T>
class EvtAmpFactory< T >

Definition at line 31 of file EvtAmpFactory.hh.

Constructor & Destructor Documentation

◆ EvtAmpFactory() [1/2]

template<class T>
EvtAmpFactory< T >::EvtAmpFactory ( )
inline

Definition at line 33 of file EvtAmpFactory.hh.

33: _amp( 0 ), _ampConj( 0 ), _pc( 0 ), _dm( 0. ), _verbose( false ) {}
EvtPdfSum< T > * _pc
EvtAmplitudeSum< T > * _ampConj
EvtAmplitudeSum< T > * _amp

Referenced by clone(), and EvtAmpFactory().

◆ EvtAmpFactory() [2/2]

template<class T>
EvtAmpFactory< T >::EvtAmpFactory ( const EvtAmpFactory< T > & other)
inline

◆ ~EvtAmpFactory()

template<class T>
virtual EvtAmpFactory< T >::~EvtAmpFactory ( )
inlinevirtual

Definition at line 42 of file EvtAmpFactory.hh.

42 {
43 if ( _amp ) delete _amp;
44 if ( _ampConj ) delete _ampConj;
45 if ( _pc ) delete _pc;
46 }

Member Function Documentation

◆ build()

template<class T>
virtual void EvtAmpFactory< T >::build ( const EvtMultiChannelParser & parser,
int nItg )
inlinevirtual

Definition at line 50 of file EvtAmpFactory.hh.

50 {
53 _pc = new EvtPdfSum<T>();
54
55 printf( "Amplitude with %d terms\n", parser.getNAmp() );
56 int i;
57 for ( i = 0; i < parser.getNAmp(); i++ )
58 {
59
61 EvtComplex c = parser.ampCoef( i );
62 processAmp( c, v );
63 }
64
65 printf( "Conj. amplitude with %d terms\n", parser.getNAmpConj() );
66 for ( i = 0; i < parser.getNAmpConj(); i++ )
67 {
68
70 EvtComplex c = parser.ampConjCoef( i );
71 processAmp( c, v, true );
72 }
73
74 printf( "Calculating pole compensator integrals %d steps\n", nItg );
75 if ( nItg > 0 ) _pc->getItg( nItg );
76
77 printf( "End build\n" );
78 }
virtual void processAmp(EvtComplex c, std::vector< std::string > v, bool conj=false)=0

Referenced by EvtPto3P::createFactory().

◆ clone()

template<class T>
virtual EvtAmpFactory< T > * EvtAmpFactory< T >::clone ( ) const
pure virtual

Implemented in EvtPto3PAmpFactory.

◆ compName()

template<class T>
const char * EvtAmpFactory< T >::compName ( int i) const
inline

Definition at line 92 of file EvtAmpFactory.hh.

92{ return _names[i].c_str(); }
std::vector< std::string > _names

◆ dm()

template<class T>
double EvtAmpFactory< T >::dm ( ) const
inline

Definition at line 83 of file EvtAmpFactory.hh.

83{ return _dm; }

◆ getAmp() [1/2]

template<class T>
EvtAmplitudeSum< T > * EvtAmpFactory< T >::getAmp ( ) const
inline

Definition at line 87 of file EvtAmpFactory.hh.

87{ return _amp; }

◆ getAmp() [2/2]

template<class T>
EvtAmplitude< T > * EvtAmpFactory< T >::getAmp ( int i) const
inline

Definition at line 90 of file EvtAmpFactory.hh.

90{ return _amp->getTerm( i ); }

◆ getAmpConj()

template<class T>
EvtAmplitudeSum< T > * EvtAmpFactory< T >::getAmpConj ( ) const
inline

Definition at line 88 of file EvtAmpFactory.hh.

88{ return _ampConj; }

◆ getCoeff()

template<class T>
EvtComplex EvtAmpFactory< T >::getCoeff ( int i) const
inline

Definition at line 94 of file EvtAmpFactory.hh.

94{ return _amp->c( i ); }

◆ getPC() [1/2]

template<class T>
EvtPdfSum< T > * EvtAmpFactory< T >::getPC ( ) const
inline

Definition at line 89 of file EvtAmpFactory.hh.

89{ return _pc; }

◆ getPC() [2/2]

template<class T>
EvtPdf< T > * EvtAmpFactory< T >::getPC ( int i) const
inline

Definition at line 91 of file EvtAmpFactory.hh.

91{ return _pc->getPdf( i ); }

◆ getTermCoeff() [1/2]

template<class T>
double EvtAmpFactory< T >::getTermCoeff ( int i) const
inline

Definition at line 96 of file EvtAmpFactory.hh.

96{ return abs2( _amp->c( i ) ); }
double abs2(const EvtComplex &c)

◆ getTermCoeff() [2/2]

template<class T>
double EvtAmpFactory< T >::getTermCoeff ( int type,
int i,
int j ) const
inline

Definition at line 97 of file EvtAmpFactory.hh.

97 {
98 switch ( type )
99 {
100
101 case 0: return 2 * real( _amp->c( i ) * conj( _amp->c( j ) ) ); // posre
102 case 1: return -2 * real( _amp->c( i ) * conj( _amp->c( j ) ) ); // negre
103 case 2: return -2 * imag( _amp->c( i ) * conj( _amp->c( j ) ) ); // posim
104 case 3: return 2 * imag( _amp->c( i ) * conj( _amp->c( j ) ) ); // negim
105 default: assert( 0 );
106 }
107 }
double imag(const EvtComplex &c)

◆ isCPModel()

template<class T>
bool EvtAmpFactory< T >::isCPModel ( ) const
inline

Definition at line 82 of file EvtAmpFactory.hh.

82{ return ( _ampConj->nTerms() > 0 ? true : false ); }

◆ processAmp()

template<class T>
virtual void EvtAmpFactory< T >::processAmp ( EvtComplex c,
std::vector< std::string > v,
bool conj = false )
pure virtual

Implemented in EvtPto3PAmpFactory.

Referenced by build().

◆ setVerbose()

template<class T>
void EvtAmpFactory< T >::setVerbose ( )
inline

Definition at line 85 of file EvtAmpFactory.hh.

85{ _verbose = true; }

Member Data Documentation

◆ _amp

template<class T>
EvtAmplitudeSum<T>* EvtAmpFactory< T >::_amp
protected

◆ _ampConj

template<class T>
EvtAmplitudeSum<T>* EvtAmpFactory< T >::_ampConj
protected

◆ _dm

template<class T>
double EvtAmpFactory< T >::_dm
protected

Definition at line 115 of file EvtAmpFactory.hh.

Referenced by dm(), EvtAmpFactory(), and EvtAmpFactory().

◆ _names

template<class T>
std::vector<std::string> EvtAmpFactory< T >::_names
protected

Definition at line 113 of file EvtAmpFactory.hh.

Referenced by compName().

◆ _pc

template<class T>
EvtPdfSum<T>* EvtAmpFactory< T >::_pc
protected

Definition at line 112 of file EvtAmpFactory.hh.

Referenced by build(), EvtAmpFactory(), EvtAmpFactory(), getPC(), getPC(), and ~EvtAmpFactory().

◆ _verbose

template<class T>
bool EvtAmpFactory< T >::_verbose
protected

Definition at line 116 of file EvtAmpFactory.hh.

Referenced by EvtAmpFactory(), EvtAmpFactory(), and setVerbose().


The documentation for this class was generated from the following file: