Bug Summary

File:libraries/AMPTOOLS_AMPS/TwoPitdist.cc
Location:line 78, column 11
Description:Value stored to 'Thetapipi' during its initialization is never read

Annotated Source Code

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 "IUAmpTools/Kinematics.h"
14#include "AMPTOOLS_AMPS/TwoPitdist.h"
15
16// Class modeled after BreitWigner amplitude function provided for examples with AmpTools.
17// Dependence of swave 2pi cross section on W (mass of 2pi system) Elton 4/17/2017
18// Version for sigma f0(500) production Elton 9/9/2018
19// Pealed off exponential dependence assuming it factorizes from the W dependence.
20
21TwoPitdist::TwoPitdist( const vector< string >& args ) :
22UserAmplitude< TwoPitdist >( args )
23{
24
25 assert( args.size() == 5 )((args.size() == 5) ? static_cast<void> (0) : __assert_fail
("args.size() == 5", "libraries/AMPTOOLS_AMPS/TwoPitdist.cc"
, 25, __PRETTY_FUNCTION__))
;
26 Bslope = AmpParameter( args[0] );
27 Bgen = AmpParameter( args[1] );
28 mtmax = AmpParameter( args[2] );
29 m_daughters = pair< string, string >( args[3], args[4] ); // specify indices of pions in event
30
31 // need to register any free parameters so the framework knows about them
32 registerParameter( Bslope );
33 registerParameter( Bgen );
34 registerParameter( mtmax );
35
36 // make sure the input variables look reasonable
37 // assert( ( Bgen >= 1 ) && ( Bslope >= Bgen ) ); // Make sure generated value is lower than actual.
38 assert( ( Bgen >= 1 ) && ( Bslope >= 1 ) )((( Bgen >= 1 ) && ( Bslope >= 1 )) ? static_cast
<void> (0) : __assert_fail ("( Bgen >= 1 ) && ( Bslope >= 1 )"
, "libraries/AMPTOOLS_AMPS/TwoPitdist.cc", 38, __PRETTY_FUNCTION__
))
;
39 assert( mtmax > 0)((mtmax > 0) ? static_cast<void> (0) : __assert_fail
("mtmax > 0", "libraries/AMPTOOLS_AMPS/TwoPitdist.cc", 39
, __PRETTY_FUNCTION__))
;
40}
41
42complex< GDouble >
43TwoPitdist::calcAmplitude( GDouble** pKin ) const
44{
45 TLorentzVector P1, P2, Ptot, Ptemp, Precoil;
46
47 for( unsigned int i = 0; i < m_daughters.first.size(); ++i ){
48
49 string num; num += m_daughters.first[i];
50 int index = atoi(num.c_str());
51 Ptemp.SetPxPyPzE( pKin[index][1], pKin[index][2],
52 pKin[index][3], pKin[index][0] ); // pi+ is index 1
53 P1 += Ptemp;
54 Ptot += Ptemp;
55
56 /* cout << " 1i=" << i << " num=" << num << " index=" << index << " P1.M=" << P1.M() << endl;
57 P1.Print();
58 Ptot.Print();*/
59 }
60
61 for( unsigned int i = 0; i < m_daughters.second.size(); ++i ){
62
63 string num; num += m_daughters.second[i];
64 int index = atoi(num.c_str());
65 Ptemp.SetPxPyPzE( pKin[index][1], pKin[index][2],
66 pKin[index][3], pKin[index][0] ); // pi- is index 2
67 P2 += Ptemp;
68 Ptot += Ptemp;
69
70 /* cout << " 2i=" << i << " num=" << num << " index=" << index << " P2.M=" << P2.M() << endl;
71 P2.Print();
72 Ptot.Print();*/
73 }
74
75 /*GDouble Wpipi = Ptot.M();
76 GDouble mass1 = P1.M();
77 GDouble mass2 = P2.M();*/
78 GDouble Thetapipi = Ptot.Theta()*180./PI3.141592653589793;
Value stored to 'Thetapipi' during its initialization is never read
79
80 // get momentum transfer
81 Precoil.SetPxPyPzE (pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0]); // Recoil is particle 3
82 GDouble Et = Precoil.E();
83 GDouble Mt = Precoil.M();
84 GDouble t = -2*Precoil.M()*(Et - Mt);
85 complex<GDouble> RealOne(1,0);
86 complex<GDouble> ImagOne(0,1);
87 complex<GDouble> Arel;
88
89 Arel = sqrt(exp(Bslope*t)/exp(Bgen*t)) * RealOne; // Divide out generated exponential. This must be the same as in GammaZToXYZ.cc. Return sqrt(exp^Bt)
90 if (-t > mtmax) Arel = 0; // eliminate events at high t with large weights
91
92 // if (Thetapipi > 1.5) cout << " TwoPitdist" << " Thetapipi=" << Thetapipi << " Bslope=" << Bslope << " Bgen=" << Bgen << " t=" << t << " Re(Arel)=" << real(Arel) << " imag(Arel)=" << imag(Arel) << endl;
93 return( Arel );
94}
95
96void
97TwoPitdist::updatePar( const AmpParameter& par ){
98
99 // could do expensive calculations here on parameter updates
100
101}
102
103