File: | libraries/AMPTOOLS_AMPS/TwoPiW_brokenetas.cc |
Location: | line 84, column 11 |
Description: | Value stored to 't' during its initialization is never read |
1 | |
2 | #include <cassert> |
3 | #include <iostream> |
4 | #include <string> |
5 | #include <complex> |
6 | #include <cstdlib> |
7 | |
8 | #include "TLorentzVector.h" |
9 | |
10 | #include "barrierFactor.h" |
11 | #include "breakupMomentum.h" |
12 | |
13 | #include "particleType.h" |
14 | |
15 | #include "IUAmpTools/Kinematics.h" |
16 | #include "AMPTOOLS_AMPS/TwoPiW_brokenetas.h" |
17 | |
18 | // Class modeled after BreitWigner amplitude function provided for examples with AmpTools. |
19 | // Dependence of swave 2pi cross section on W (mass of 2pi system) Elton 4/17/2017 |
20 | // Version for sigma f0(500) production Elton 9/9/2018 |
21 | // Simple version for broken etas (3pi0 reconstructed as 2pi0) Elton 5/7/2020 |
22 | |
23 | TwoPiW_brokenetas::TwoPiW_brokenetas( const vector< string >& args ) : |
24 | UserAmplitude< TwoPiW_brokenetas >( args ) |
25 | { |
26 | |
27 | assert( args.size() == 4 )((args.size() == 4) ? static_cast<void> (0) : __assert_fail ("args.size() == 4", "libraries/AMPTOOLS_AMPS/TwoPiW_brokenetas.cc" , 27, __PRETTY_FUNCTION__)); |
28 | m_par1 = AmpParameter( args[0] ); |
29 | m_par2 = AmpParameter( args[1] ); |
30 | m_daughters = pair< string, string >( args[2], args[3] ); |
31 | |
32 | // need to register any free parameters so the framework knows about them |
33 | // for brokenetas, parameters are Gmean and Gsigma of the Gaussian in GeV |
34 | registerParameter( m_par1 ); |
35 | registerParameter( m_par2 ); |
36 | |
37 | // make sure the input variables look reasonable |
38 | // assert( ( m_orbitL >= 0 ) && ( m_orbitL <= 4 ) ); |
39 | } |
40 | |
41 | complex< GDouble > |
42 | TwoPiW_brokenetas::calcAmplitude( GDouble** pKin ) const |
43 | { |
44 | TLorentzVector P1, P2, Ptot, Ptemp, Precoil; |
45 | |
46 | for( unsigned int i = 0; i < m_daughters.first.size(); ++i ){ |
47 | |
48 | string num; num += m_daughters.first[i]; |
49 | int index = atoi(num.c_str()); |
50 | Ptemp.SetPxPyPzE( pKin[index][1], pKin[index][2], |
51 | pKin[index][3], pKin[index][0] ); // pi+ is index 1 |
52 | P1 += Ptemp; |
53 | Ptot += Ptemp; |
54 | |
55 | /* cout << " 1i=" << i << " num=" << num << " index=" << index << " P1.M=" << P1.M() << endl; |
56 | P1.Print(); |
57 | Ptot.Print();*/ |
58 | } |
59 | |
60 | for( unsigned int i = 0; i < m_daughters.second.size(); ++i ){ |
61 | |
62 | string num; num += m_daughters.second[i]; |
63 | int index = atoi(num.c_str()); |
64 | Ptemp.SetPxPyPzE( pKin[index][1], pKin[index][2], |
65 | pKin[index][3], pKin[index][0] ); // pi- is index 2 |
66 | P2 += Ptemp; |
67 | Ptot += Ptemp; |
68 | |
69 | /* cout << " 2i=" << i << " num=" << num << " index=" << index << " P2.M=" << P2.M() << endl; |
70 | P2.Print(); |
71 | Ptot.Print();*/ |
72 | } |
73 | |
74 | Double_t Eg = pKin[0][0]; // incident photon energy |
75 | GDouble Wpipi = Ptot.M(); |
76 | GDouble mass1 = P1.M(); |
77 | GDouble mass2 = P2.M(); |
78 | |
79 | // get momentum transfer |
80 | Precoil.SetPxPyPzE (pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0]); // Recoil is particle 3 |
81 | // next three lines commented out, unused variables |
82 | GDouble Et = Precoil.E(); |
83 | GDouble Mt = Precoil.M(); |
84 | GDouble t = -2*Precoil.M()*(Et - Mt); |
Value stored to 't' during its initialization is never read | |
85 | |
86 | complex<GDouble> ImagOne(0,1); |
87 | complex<GDouble> Aw; |
88 | GDouble Gmean= m_par1; |
89 | GDouble Gsigma=m_par2; |
90 | GDouble ImPart=0; |
91 | |
92 | Aw = exp( -(Wpipi-Gmean)*(Wpipi-Gmean)/(2*Gsigma*Gsigma)) + ImPart*ImagOne; |
93 | |
94 | Aw = isfinite(real(Aw)) && isfinite(imag(Aw))? Aw : 0; // protect against infitinites |
95 | |
96 | if (Wpipi < mass1+mass2) Aw = 0; |
97 | |
98 | // cout << "TwoPiW_brokenetas: calcAmplitude: 2pi mass=" << Wpipi << " Eg=" << Eg << " t=" << t << " Gmean=" << Gmean << " Gsigma=" << Gsigma << " AwNorm=" << std::norm(Aw) << " AwPhase=" << std::arg(Aw) << endl; |
99 | |
100 | return( Aw ); |
101 | } |
102 | |
103 | void |
104 | TwoPiW_brokenetas::updatePar( const AmpParameter& par ){ |
105 | |
106 | // could do expensive calculations here on parameter updates |
107 | |
108 | } |
109 | |
110 |