Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:20:01

0001 
0002 /***********************************************************************
0003 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
0004 *                                                                      *
0005 * This file is part of EvtGen.                                         *
0006 *                                                                      *
0007 * EvtGen is free software: you can redistribute it and/or modify       *
0008 * it under the terms of the GNU General Public License as published by *
0009 * the Free Software Foundation, either version 3 of the License, or    *
0010 * (at your option) any later version.                                  *
0011 *                                                                      *
0012 * EvtGen is distributed in the hope that it will be useful,            *
0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
0015 * GNU General Public License for more details.                         *
0016 *                                                                      *
0017 * You should have received a copy of the GNU General Public License    *
0018 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
0019 ***********************************************************************/
0020 
0021 #ifndef EVTAMP_HH
0022 #define EVTAMP_HH
0023 
0024 #include "EvtGenBase/EvtComplex.hh"
0025 #include "EvtGenBase/EvtPatches.hh"
0026 
0027 class EvtSpinDensity;
0028 class EvtId;
0029 
0030 class EvtAmp {
0031   public:
0032     EvtAmp();
0033     EvtAmp( const EvtAmp& amp );
0034 
0035     void init( EvtId p, int ndaug, EvtId* daug );
0036 
0037     void setAmp( int* ind, const EvtComplex& amp );
0038 
0039     const EvtComplex& getAmp( int* ind ) const;
0040 
0041     EvtSpinDensity getSpinDensity();
0042 
0043     EvtSpinDensity contract( int i, const EvtAmp& a );
0044     EvtAmp contract( int i, const EvtSpinDensity& rho );
0045 
0046     //sum over the i:th daugther of a1 and contract with parent of a2
0047     EvtAmp contract( int i, const EvtAmp& a1, const EvtAmp& a2 );
0048 
0049     EvtSpinDensity getForwardSpinDensity( EvtSpinDensity* rho_list, int k );
0050     EvtSpinDensity getBackwardSpinDensity( EvtSpinDensity* rho_list );
0051 
0052     EvtAmp& operator=( const EvtAmp& amp );
0053 
0054     /**
0055   * sets the amplitudes calculated in the decay objects
0056   */
0057     void vertex( const EvtComplex& amp );
0058 
0059     /**
0060   * sets the amplitudes calculated in the decay objects
0061   */
0062     void vertex( int i1, const EvtComplex& amp );
0063 
0064     /**
0065   * sets the amplitudes calculated in the decay objects
0066   */
0067     void vertex( int i1, int i2, const EvtComplex& amp );
0068 
0069     /**
0070   * sets the amplitudes calculated in the decay objects
0071   */
0072     void vertex( int i1, int i2, int i3, const EvtComplex& amp );
0073 
0074     /**
0075   * sets the amplitudes calculated in the decay objects
0076   */
0077     void vertex( int* i1, const EvtComplex& amp );
0078 
0079     void dump();
0080 
0081   private:
0082     friend class EvtDecayAmp;
0083     friend class EvtKstarstargamma;
0084 
0085     void setNDaug( int n );
0086     void setNState( int parent_states, int* daug_states );
0087 
0088     // the amplitudes
0089     EvtComplex _amp[125];
0090 
0091     // the number of daughters
0092     int _ndaug;
0093 
0094     // the number of states of the parent
0095     int _pstates;
0096 
0097     // number of states of the daughter
0098     int dstates[10];
0099 
0100     // the nontrivial index of the daughter
0101     int _dnontrivial[10];
0102 
0103     // number of nontrivial daugts+parent
0104     int _nontrivial;
0105 
0106     // compact nstates
0107     int _nstate[5];
0108 };
0109 
0110 #endif