From a6670d176466877046ae39c6e3576c100af5b77f Mon Sep 17 00:00:00 2001 From: Niklas Herrmann Date: Thu, 2 Jul 2026 12:07:49 -0400 Subject: [PATCH 1/5] Add amplitudes for rho_minus Delta_plusplus --- .../AMPTOOLS_AMPS/DeltaAngles_Rho.cc | 176 +++ src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h | 75 ++ .../GPUDeltaAngles_Rho_kernel.cu | 52 + ...GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu | 207 ++++ ...PiAngles_Delta_DoubleSDMEs_unpol_kernel.cu | 118 ++ .../GPUTwoPiAngles_Delta_factorized_kernel.cu | 107 ++ .../GPUTwoPiAngles_Delta_kernel.cu | 52 + .../GPUTwoPiAngles_Delta_upperv_kernel.cu | 51 + .../GPUTwoPiAngles_only_upperv_kernel.cu | 51 + .../AMPTOOLS_AMPS/TwoPiAngles_Delta.cc | 205 ++++ .../AMPTOOLS_AMPS/TwoPiAngles_Delta.h | 82 ++ .../TwoPiAngles_Delta_DoubleSDMEs.cc | 499 ++++++++ .../TwoPiAngles_Delta_DoubleSDMEs.h | 166 +++ .../TwoPiAngles_Delta_DoubleSDMEs_unpol.cc | 343 ++++++ .../TwoPiAngles_Delta_DoubleSDMEs_unpol.h | 109 ++ .../TwoPiAngles_Delta_factorized.cc | 333 ++++++ .../TwoPiAngles_Delta_factorized.h | 97 ++ .../TwoPiAngles_Delta_only_upperv.cc | 198 ++++ .../TwoPiAngles_Delta_only_upperv.h | 79 ++ .../TwoPiDeltaPlotGenerator.cc | 288 +++++ .../AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h | 78 ++ src/programs/AmplitudeAnalysis/SConscript | 2 +- src/programs/AmplitudeAnalysis/fit/fit.cc | 12 + .../AmplitudeAnalysis/fitMPI/fitMPI.cc | 12 + .../twopidelta_plotter/SConscript | 23 + .../twopidelta_plotter/twopidelta_plotter.cc | 1049 +++++++++++++++++ 26 files changed, 4463 insertions(+), 1 deletion(-) create mode 100755 src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.cc create mode 100755 src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h create mode 100755 src/libraries/AMPTOOLS_AMPS/GPUDeltaAngles_Rho_kernel.cu create mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu create mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel.cu create mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_factorized_kernel.cu create mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_kernel.cu create mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_upperv_kernel.cu create mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_only_upperv_kernel.cu create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.cc create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.h create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.cc create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.cc create mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h create mode 100755 src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.cc create mode 100755 src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h create mode 100755 src/programs/AmplitudeAnalysis/twopidelta_plotter/SConscript create mode 100755 src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc diff --git a/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.cc b/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.cc new file mode 100755 index 000000000..f3b717992 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.cc @@ -0,0 +1,176 @@ +#include +#include +#include +#include +#include + +#include "TLorentzVector.h" +#include "TLorentzRotation.h" + +#include "IUAmpTools/Kinematics.h" +#include "AMPTOOLS_AMPS/DeltaAngles_Rho.h" +#include "AMPTOOLS_AMPS/clebschGordan.h" +#include "AMPTOOLS_AMPS/wignerD.h" + +DeltaAngles_Rho::DeltaAngles_Rho( const vector< string >& args ) : +UserAmplitude< DeltaAngles_Rho >( args ) +{ + assert( args.size() == 12 || args.size() == 11 ); + + delta_rho011 = AmpParameter( args[0] ); + delta_rho031 = AmpParameter( args[1] ); + delta_rho03m1 = AmpParameter( args[2] ); + + delta_rho111 = AmpParameter( args[3] ); + delta_rho133 = AmpParameter( args[4] ); + delta_rho131 = AmpParameter( args[5] ); + delta_rho13m1 = AmpParameter( args[6] ); + + delta_rho231 = AmpParameter( args[7] ); + delta_rho23m1 = AmpParameter( args[8] ); + + frame = string( args[9] ); // choose between Gottfried Jackson (GJ) and helicity (Hel) frame + + // need to register any free parameters so the framework knows about them + registerParameter( delta_rho011 ); + registerParameter( delta_rho031 ); + registerParameter( delta_rho03m1 ); + + registerParameter( delta_rho111 ); + registerParameter( delta_rho133 ); + registerParameter( delta_rho131 ); + registerParameter( delta_rho13m1 ); + + registerParameter( delta_rho231 ); + registerParameter( delta_rho23m1 ); + + std::cout<< "number of arguments:" < +DeltaAngles_Rho::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { + + GDouble sinSqTheta = userVars[kSinSqTheta]; +// GDouble cosSqTheta = userVars[kCosSqTheta]; + GDouble sin2Theta = userVars[kSin2Theta]; + GDouble phi = userVars[kPhi]; + GDouble cosTheta = userVars[kCosTheta]; + GDouble bigPhi = userVars[kBigPhi]; + GDouble Pgamma = userVars[kPgamma]; + + //SDMEs for 3/2- -> 1/2+ + 0- (doi.org/10.1103/PhysRevC.96.025208) + + GDouble W = 3.*(0.5 - delta_rho011)*sinSqTheta + delta_rho011*(1.+3.*cosTheta*cosTheta) - 2.*TMath::Sqrt(3.)*delta_rho031*cos(phi)*sin2Theta - 2.*TMath::Sqrt(3.)*delta_rho03m1*cos(2.*phi)*sinSqTheta; + + W -= Pgamma*cos(2.*bigPhi) * (3.*delta_rho133*sinSqTheta + delta_rho111*(1.+3.*cosTheta*cosTheta) - 2.*TMath::Sqrt(3.)*delta_rho131*cos(phi)*sin2Theta - 2.*TMath::Sqrt(3.)*delta_rho13m1*cos(2.*phi)*sinSqTheta); + + W -= Pgamma*sin(2.*bigPhi) * (2.*TMath::Sqrt(3.)*delta_rho231*sin(phi)*sin2Theta + 2.*TMath::Sqrt(3.)*delta_rho23m1*sin(2.*phi)*sinSqTheta); + + W *= 1./(4.*PI); + + + +// return W; + return complex< GDouble > ( sqrt(fabs(W)) ); +} + +void +DeltaAngles_Rho::calcUserVars( GDouble** pKin, GDouble* userVars ) const { + + TLorentzVector target ( 0, 0, 0, 0.9382720813); + TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); + TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); + TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); + TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); + TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); + + TLorentzVector recoil = p2 + p3; + + TLorentzVector resonance = proton + p1; + TLorentzRotation resonanceBoost( -resonance.BoostVector() ); + + TLorentzVector target_res = resonanceBoost * target; + TLorentzVector beam_res = resonanceBoost * beam; + TLorentzVector recoil_res = resonanceBoost * recoil; + TLorentzVector p1_res = resonanceBoost * p1; + + // normal to the production plane + // choose Gottfried-Jackson frame: z-axis along target direction in baryon rest frame + TVector3 y = (beam_res.Vect().Unit().Cross(recoil_res.Vect().Unit())).Unit(); + TVector3 z = target_res.Vect().Unit(); + + // TVector3 y = (target_res.Vect().Unit().Cross(recoil_res.Vect().Unit())).Unit(); + // TVector3 z = target_res.Vect().Unit(); + TVector3 x = y.Cross(z).Unit(); + + TVector3 angles( (p1_res.Vect()).Dot(x), + (p1_res.Vect()).Dot(y), + (p1_res.Vect()).Dot(z) ); + + GDouble phi = angles.Phi(); + GDouble cosTheta = angles.CosTheta(); + + GDouble sinSqTheta = sin(angles.Theta())*sin(angles.Theta()); + // GDouble cosSqTheta = cos(angles.Theta())*cos(angles.Theta()); + GDouble sin2Theta = sin(2.*angles.Theta()); + + + TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); // beam polarization vector in lab + GDouble Phi = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); + //Phi = Phi > 0? Phi : Phi + 3.14159; + + // polarization BeamProperties + GDouble Pgamma=polFraction; + + if(polAngle == -1) + Pgamma = 0.; + + //angles in the helicity frame: + TVector3 z_hel = -recoil_res.Vect().Unit(); + TVector3 y_hel = (beam_res.Vect().Cross(recoil_res.Vect())).Unit(); + TVector3 x_hel = (y_hel.Cross(z_hel)).Unit(); + + TVector3 p1_hel(p1_res.Vect().Dot(x_hel),p1_res.Vect().Dot(y_hel),p1_res.Vect().Dot(z_hel)); + + GDouble phi_hel = p1_hel.Phi(); + GDouble cosTheta_hel = p1_hel.CosTheta(); + + GDouble sinSqTheta_hel = sin(p1_hel.Theta())*sin(p1_hel.Theta()); + // GDouble cosSqTheta_hel = cos(p2_hel.Theta())*cos(p2_hel.Theta()); + GDouble sin2Theta_hel = sin(2.*p1_hel.Theta()); + + if(frame=="Hel"){ + userVars[kCosTheta] = cosTheta_hel; + userVars[kSinSqTheta] = sinSqTheta_hel; + userVars[kSin2Theta] = sin2Theta_hel; + userVars[kPhi] = phi_hel; + } + else{ + userVars[kCosTheta] = cosTheta; + userVars[kSinSqTheta] = sinSqTheta; + userVars[kSin2Theta] = sin2Theta; + userVars[kPhi] = phi; + } + + userVars[kPgamma] = Pgamma; + userVars[kBigPhi] = Phi; + +} + +#ifdef GPU_ACCELERATION +void +DeltaAngles_Rho::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { + + GPUDeltaAngles_Rho_exec( dimGrid, dimBlock, GPU_AMP_ARGS, + delta_rho011, delta_rho031, delta_rho03m1, delta_rho111, delta_rho133, delta_rho131, delta_rho13m1, delta_rho231, delta_rho23m1, polAngle ); +} + +#endif // GPU_ACCELERATION diff --git a/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h b/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h new file mode 100755 index 000000000..afacce7b2 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h @@ -0,0 +1,75 @@ +#if !defined(DELTAANGLES_RHO) +#define DELTAANGLES_RHO + +#include "IUAmpTools/Amplitude.h" +#include "IUAmpTools/UserAmplitude.h" +#include "IUAmpTools/AmpParameter.h" +#include "GPUManager/GPUCustomTypes.h" + +#include "TH1D.h" + +#include +#include +#include + + + +using std::complex; +using namespace std; + +#ifdef GPU_ACCELERATION +void GPUDeltaAngles_Rho_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble delta_rho011, GDouble delta_rho031, GDouble delta_rho03m1, + GDouble delta_rho111, GDouble delta_rho133, GDouble delta_rho131, GDouble delta_rho13m1, + GDouble delta_rho231, GDouble delta_rho23m1, GDouble polAngle ); +#endif // GPU_ACCELERATION + +class Kinematics; + +class DeltaAngles_Rho : public UserAmplitude< DeltaAngles_Rho > +{ + +public: + + DeltaAngles_Rho() : UserAmplitude< DeltaAngles_Rho >() { }; + DeltaAngles_Rho( const vector< string >& args ); + + enum UserVars { kPgamma = 0, kCosTheta, kSinSqTheta, kSin2Theta, kBigPhi, kPhi, kNumUserVars }; + unsigned int numUserVars() const { return kNumUserVars; } + + string name() const { return "DeltaAngles_Rho"; } + + complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; + void calcUserVars( GDouble** pKin, GDouble* userVars ) const; + + bool needsUserVarsOnly() const { return true; } + +#ifdef GPU_ACCELERATION + + void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; + bool isGPUEnabled() const { return true; } + +#endif // GPU_ACCELERATION + +private: + + AmpParameter delta_rho011; + AmpParameter delta_rho031; + AmpParameter delta_rho03m1; + + AmpParameter delta_rho111; + AmpParameter delta_rho133; + AmpParameter delta_rho131; + AmpParameter delta_rho13m1; + + AmpParameter delta_rho231; + AmpParameter delta_rho23m1; + + GDouble polFraction=0.; + GDouble polAngle=-1; + TH1D *polFrac_vs_E; + string frame; + +}; + +#endif \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/GPUDeltaAngles_Rho_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUDeltaAngles_Rho_kernel.cu new file mode 100755 index 000000000..5d16f80b8 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/GPUDeltaAngles_Rho_kernel.cu @@ -0,0 +1,52 @@ +#include + +#include "GPUManager/GPUCustomTypes.h" +#include "GPUManager/CUDA-Complex.cuh" + +#include "AMPTOOLS_AMPS/breakupMomentum.cuh" +#include "AMPTOOLS_AMPS/barrierFactor.cuh" + +#include "GPUUtils/wignerD.cuh" +#include "GPUUtils/clebsch.cuh" + +/////////////////////////////////////////////////////////////////////////////// +__global__ void +GPUDeltaAngles_Rho_kernel( GPU_AMP_PROTO, GDouble delta_rho011, GDouble delta_rho031, GDouble delta_rho03m1, + GDouble delta_rho111, GDouble delta_rho133, GDouble delta_rho131, GDouble delta_rho13m1, + GDouble delta_rho231, GDouble delta_rho23m1, GDouble polAngle ) +{ + int iEvent = GPU_THIS_EVENT; + + GDouble Pgamma = GPU_UVARS(0); + GDouble cosTheta = GPU_UVARS(1); + GDouble sinSqTheta = GPU_UVARS(2); + GDouble sin2Theta = GPU_UVARS(3); + GDouble bigPhi = GPU_UVARS(4); + GDouble phi = GPU_UVARS(5); + + GDouble W = 3.0*(0.5 - delta_rho011)*sinSqTheta + delta_rho011*(1.0 + 3.0*cosTheta*cosTheta) - 2.0*sqrt(3.0)*delta_rho031*cos(phi)*sin2Theta - 2.0*sqrt(3.0)*delta_rho03m1*cos(2.0*phi)*sinSqTheta; + + W -= Pgamma*cos(2.0*bigPhi)*(3.0*delta_rho133*sinSqTheta + delta_rho111*(1.0 + 3.0*cosTheta*cosTheta) - 2.0*sqrt(3.0)*delta_rho131*cos(phi)*sin2Theta - 2.0*sqrt(3.0)*delta_rho13m1*cos(2.0*phi)*sinSqTheta); + + W -= Pgamma*sin(2.0*bigPhi)*(2.0*sqrt(3.0)*delta_rho231*sin(phi)*sin2Theta + 2.0*sqrt(3.0)*delta_rho23m1*sin(2.0*phi)*sinSqTheta); + + W *= 1.0/(4.0*PI); + + WCUComplex amp = { sqrt( fabs( W ) ), 0 }; + + pcDevAmp[iEvent] = amp; + +} + +void +GPUDeltaAngles_Rho_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble delta_rho011, GDouble delta_rho031, GDouble delta_rho03m1, + GDouble delta_rho111, GDouble delta_rho133, GDouble delta_rho131, GDouble delta_rho13m1, + GDouble delta_rho231, GDouble delta_rho23m1, GDouble polAngle ) + +{ + + GPUDeltaAngles_Rho_kernel<<< dimGrid, dimBlock >>> + ( GPU_AMP_ARGS, delta_rho011, delta_rho031, delta_rho03m1, delta_rho111, delta_rho133, delta_rho131, delta_rho13m1, delta_rho231, delta_rho23m1, polAngle ); + +} \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu new file mode 100755 index 000000000..fff00b50e --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu @@ -0,0 +1,207 @@ + +#include + +#include "GPUManager/GPUCustomTypes.h" +#include "GPUManager/CUDA-Complex.cuh" + + +__global__ void +// +GPUTwoPiAngles_Delta_DoubleSDMEs_kernel( GPU_AMP_PROTO, + //order is like the appearing order in the paper + //Wmm + GDouble r00_33_0, //GDouble r00_11_0, + GDouble r11_33_0, GDouble r11_11_0, + GDouble r1m1_33_0, GDouble r1m1_11_0, + GDouble r10_33_0, GDouble r10_11_0, + + //Wbar + GDouble r00_31_0, GDouble r00_3m1_0, + GDouble r11_31_0, GDouble r11_3m1_0, + GDouble r1m1_31_0, GDouble r1m1_3m1_0, + GDouble r10_31_0, GDouble r10_3m1_0, + + //Wtil + GDouble rt1m1_31_0, GDouble rt1m1_3m1_0, + GDouble rt10_31_0, GDouble rt10_3m1_0, + // //alpha = 1 (same structure) + GDouble r00_33_1, GDouble r00_11_1, + GDouble r11_33_1, GDouble r11_11_1, + GDouble r1m1_33_1, GDouble r1m1_11_1, + GDouble r10_33_1, GDouble r10_11_1, + GDouble r00_31_1, GDouble r00_3m1_1, + GDouble r11_31_1, GDouble r11_3m1_1, + GDouble r1m1_31_1, GDouble r1m1_3m1_1, + GDouble r10_31_1, GDouble r10_3m1_1, + GDouble rt1m1_31_1, GDouble rt1m1_3m1_1, + GDouble rt10_31_1, GDouble rt10_3m1_1, + //alpha = 2 (different structure) + GDouble rt00_31_2, GDouble rt00_3m1_2, + GDouble rt11_31_2, GDouble rt11_3m1_2, + GDouble r1m1_33_2, GDouble r1m1_11_2, + GDouble r1m1_31_2, GDouble r1m1_3m1_2, + GDouble rt1m1_31_2, GDouble rt1m1_3m1_2, + GDouble r10_33_2, GDouble r10_11_2, + GDouble r10_31_2, GDouble r10_3m1_2, + GDouble rt10_31_2, GDouble rt10_3m1_2 +) + { + + int iEvent = GPU_THIS_EVENT; + + // here we need to be careful to index the user-defined + // data with the proper integer corresponding to the + // enumeration in the C++ header file + + + GDouble Pgamma = GPU_UVARS(0); + GDouble cosTheta_pim = GPU_UVARS(1); + GDouble sinSqTheta_pim = GPU_UVARS(2); + GDouble sin2Theta_pim = GPU_UVARS(3); + GDouble phi_pim = GPU_UVARS(4); + GDouble cosTheta_proton = GPU_UVARS(5); + GDouble sinSqTheta_proton = GPU_UVARS(6); + GDouble sin2Theta_proton = GPU_UVARS(7); + GDouble phi_proton = GPU_UVARS(8); + GDouble bigPhi = GPU_UVARS(9); + // flag for pol (0.0 = no pol, 1.0 = pol) + + GDouble sinSqTh = sinSqTheta_proton; + GDouble sin2Th = sin2Theta_proton; + GDouble cosSqTh = 1.0 - sinSqTh; + + GDouble cphi = cos(phi_proton); + GDouble sphi = sin(phi_proton); + GDouble c2phi = cos(2.0 * phi_proton); + GDouble s2phi = sin(2.0 * phi_proton); + + GDouble sinSqThPi = sinSqTheta_pim; + GDouble sin2ThPi = sin2Theta_pim; + GDouble cosSqThPi = 1.0 - sinSqThPi; + + GDouble cphiPi = cos(phi_pim); + GDouble sphiPi = sin(phi_pim); + GDouble c2phiPi = cos(2.0 * phi_pim); + GDouble s2phiPi = sin(2.0 * phi_pim); + + GDouble r00_11_0 = 0.5 - r00_33_0 - 2.0 * r11_11_0 - 2.0 * r11_33_0; + + GDouble W00_0 = r00_33_0 * sinSqTh + r00_11_0 * (1.0/3.0 + cosSqTh); + GDouble Wb00_0 = (2.0 / sqrt(3.0)) * (r00_31_0 * cphi * sin2Th + r00_3m1_0 * c2phi * sinSqTh); + + GDouble W11_0 = r11_33_0 * sinSqTh + r11_11_0 * (1.0/3.0 + cosSqTh); + GDouble Wb11_0 = (2.0 / sqrt(3.0)) * (r11_31_0 * cphi * sin2Th + r11_3m1_0 * c2phi * sinSqTh); + + GDouble W1m1_0 = r1m1_33_0 * sinSqTh + r1m1_11_0 * (1.0/3.0 + cosSqTh); + GDouble Wb1m1_0 = (2.0 / sqrt(3.0)) * (r1m1_31_0 * cphi * sin2Th + r1m1_3m1_0 * c2phi * sinSqTh); + GDouble Wt1m1_0 = (2.0 / sqrt(3.0)) * (rt1m1_31_0 * sphi * sin2Th + rt1m1_3m1_0 * s2phi * sinSqTh); + + GDouble W10_0 = r10_33_0 * sinSqTh + r10_11_0 * (1.0/3.0 + cosSqTh); + GDouble Wb10_0 = (2.0 / sqrt(3.0)) * (r10_31_0 * cphi * sin2Th + r10_3m1_0 * c2phi * sinSqTh); + GDouble Wt10_0 = (2.0 / sqrt(3.0)) * (rt10_31_0 * sphi * sin2Th + rt10_3m1_0 * s2phi * sinSqTh); + GDouble W0 = cosSqThPi * (W00_0 - Wb00_0) + sinSqThPi * (W11_0 - Wb11_0) - sinSqThPi * (c2phiPi * (W1m1_0 - Wb1m1_0) + s2phiPi * Wt1m1_0) - sqrt(2.0) * sin2ThPi * (cphiPi * (W10_0 - Wb10_0) + sphiPi * Wt10_0); + //alpha = 1 (same structure) + GDouble W00_1 = r00_33_1 * sinSqTh + r00_11_1 * (1.0/3.0 + cosSqTh); + GDouble Wb00_1 = (2.0 / sqrt(3.0)) * (r00_31_1 * cphi * sin2Th + r00_3m1_1 * c2phi * sinSqTh); + + GDouble W11_1 = r11_33_1 * sinSqTh + r11_11_1 * (1.0/3.0 + cosSqTh); + GDouble Wb11_1 = (2.0 / sqrt(3.0)) * (r11_31_1 * cphi * sin2Th + r11_3m1_1 * c2phi * sinSqTh); + + GDouble W1m1_1 = r1m1_33_1 * sinSqTh + r1m1_11_1 * (1.0/3.0 + cosSqTh); + GDouble Wb1m1_1 = (2.0 / sqrt(3.0)) * (r1m1_31_1 * cphi * sin2Th + r1m1_3m1_1 * c2phi * sinSqTh); + GDouble Wt1m1_1 = (2.0 / sqrt(3.0)) * (rt1m1_31_1 * sphi * sin2Th + rt1m1_3m1_1 * s2phi * sinSqTh); + + GDouble W10_1 = r10_33_1 * sinSqTh + r10_11_1 * (1.0/3.0 + cosSqTh); + GDouble Wb10_1 = (2.0 / sqrt(3.0)) * (r10_31_1 * cphi * sin2Th + r10_3m1_1 * c2phi * sinSqTh); + GDouble Wt10_1 = (2.0 / sqrt(3.0)) * (rt10_31_1 * sphi * sin2Th + rt10_3m1_1 * s2phi * sinSqTh); + + GDouble W1 =cosSqThPi * (W00_1 - Wb00_1) + sinSqThPi * (W11_1 - Wb11_1) - sinSqThPi * (c2phiPi * (W1m1_1 - Wb1m1_1) + s2phiPi * Wt1m1_1) - sqrt(2.0) * sin2ThPi * (cphiPi * (W10_1 - Wb10_1) + sphiPi * Wt10_1); + + // alpha = 2 (different structure) + GDouble Wt00_2 = (2.0 / sqrt(3.0)) * (rt00_31_2 * sphi * sin2Th + rt00_3m1_2 * s2phi * sinSqTh); + GDouble Wt11_2 = (2.0 / sqrt(3.0)) * (rt11_31_2 * sphi * sin2Th + rt11_3m1_2 * s2phi * sinSqTh); + + GDouble W1m1_2 = r1m1_33_2 * sinSqTh + r1m1_11_2 * (1.0/3.0 + cosSqTh); + GDouble Wb1m1_2 = (2.0 / sqrt(3.0)) * (r1m1_31_2 * cphi * sin2Th + r1m1_3m1_2 * c2phi * sinSqTh); + GDouble Wt1m1_2 = (2.0 / sqrt(3.0)) * (rt1m1_31_2 * sphi * sin2Th + rt1m1_3m1_2 * s2phi * sinSqTh); + + GDouble W10_2 = r10_33_2 * sinSqTh + r10_11_2 * (1.0/3.0 + cosSqTh); + GDouble Wb10_2 = (2.0 / sqrt(3.0)) * (r10_31_2 * cphi * sin2Th + r10_3m1_2 * c2phi * sinSqTh); + GDouble Wt10_2 = (2.0 / sqrt(3.0)) * (rt10_31_2 * sphi * sin2Th + rt10_3m1_2 * s2phi * sinSqTh); + GDouble W2 = cosSqThPi * Wt00_2+ sinSqThPi * Wt11_2+ sinSqThPi * (s2phiPi * (W1m1_2 - Wb1m1_2) - c2phiPi * Wt1m1_2) + sqrt(2.0) * sin2ThPi * (sphiPi * (W10_2 - Wb10_2) + cphiPi * Wt10_2); // 19.05 change sign of cphiPi * Wt10_2 + + GDouble Wpol = W0 - Pgamma * cos(2.0 * bigPhi) * W1 - Pgamma * sin(2.0 * bigPhi) * W2; + + WCUComplex amp = { sqrt(fabs(Wpol)), 0.0 }; + pcDevAmp[iEvent] = amp; + +} + + +void +GPUTwoPiAngles_Delta_DoubleSDMEs_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble r00_33_0, //GDouble r00_11_0, + GDouble r11_33_0, GDouble r11_11_0, + GDouble r1m1_33_0, GDouble r1m1_11_0, + GDouble r10_33_0, GDouble r10_11_0, + GDouble r00_31_0, GDouble r00_3m1_0, + GDouble r11_31_0, GDouble r11_3m1_0, + GDouble r1m1_31_0, GDouble r1m1_3m1_0, + GDouble r10_31_0, GDouble r10_3m1_0, + GDouble rt1m1_31_0, GDouble rt1m1_3m1_0, + GDouble rt10_31_0, GDouble rt10_3m1_0, + GDouble r00_33_1, GDouble r00_11_1, + GDouble r11_33_1, GDouble r11_11_1, + GDouble r1m1_33_1, GDouble r1m1_11_1, + GDouble r10_33_1, GDouble r10_11_1, + GDouble r00_31_1, GDouble r00_3m1_1, + GDouble r11_31_1, GDouble r11_3m1_1, + GDouble r1m1_31_1, GDouble r1m1_3m1_1, + GDouble r10_31_1, GDouble r10_3m1_1, + GDouble rt1m1_31_1, GDouble rt1m1_3m1_1, + GDouble rt10_31_1, GDouble rt10_3m1_1, + GDouble rt00_31_2, GDouble rt00_3m1_2, + GDouble rt11_31_2, GDouble rt11_3m1_2, + GDouble r1m1_33_2, GDouble r1m1_11_2, + GDouble r1m1_31_2, GDouble r1m1_3m1_2, + GDouble rt1m1_31_2, GDouble rt1m1_3m1_2, + GDouble r10_33_2, GDouble r10_11_2, + GDouble r10_31_2, GDouble r10_3m1_2, + GDouble rt10_31_2, GDouble rt10_3m1_2 +) +{ + + GPUTwoPiAngles_Delta_DoubleSDMEs_kernel<<< dimGrid, dimBlock >>> + ( GPU_AMP_ARGS, + r00_33_0, //r00_11_0, + r11_33_0, r11_11_0, + r1m1_33_0, r1m1_11_0, + r10_33_0, r10_11_0, + r00_31_0, r00_3m1_0, + r11_31_0, r11_3m1_0, + r1m1_31_0, r1m1_3m1_0, + r10_31_0, r10_3m1_0, + rt1m1_31_0, rt1m1_3m1_0, + rt10_31_0, rt10_3m1_0, + r00_33_1, r00_11_1, + r11_33_1, r11_11_1, + r1m1_33_1, r1m1_11_1, + r10_33_1, r10_11_1, + r00_31_1, r00_3m1_1, + r11_31_1, r11_3m1_1, + r1m1_31_1, r1m1_3m1_1, + r10_31_1, r10_3m1_1, + rt1m1_31_1, rt1m1_3m1_1, + rt10_31_1, rt10_3m1_1, + rt00_31_2, rt00_3m1_2, + rt11_31_2, rt11_3m1_2, + r1m1_33_2, r1m1_11_2, + r1m1_31_2, r1m1_3m1_2, + rt1m1_31_2, rt1m1_3m1_2, + r10_33_2, r10_11_2, + r10_31_2, r10_3m1_2, + rt10_31_2, rt10_3m1_2 + + + ); +} diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel.cu new file mode 100755 index 000000000..dc1966a59 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel.cu @@ -0,0 +1,118 @@ + +#include + +#include "GPUManager/GPUCustomTypes.h" +#include "GPUManager/CUDA-Complex.cuh" + + +__global__ void +// +GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel( GPU_AMP_PROTO, + //order is like the appearing order in the paper + //Wmm + GDouble r00_33_0, //GDouble r00_11_0, + GDouble r11_33_0, GDouble r11_11_0, + GDouble r1m1_33_0, GDouble r1m1_11_0, + GDouble r10_33_0, GDouble r10_11_0, + + //Wbar + GDouble r00_31_0, GDouble r00_3m1_0, + GDouble r11_31_0, GDouble r11_3m1_0, + GDouble r1m1_31_0, GDouble r1m1_3m1_0, + GDouble r10_31_0, GDouble r10_3m1_0, + + //Wtil + GDouble rt1m1_31_0, GDouble rt1m1_3m1_0, + GDouble rt10_31_0, GDouble rt10_3m1_0 +) + { + + int iEvent = GPU_THIS_EVENT; + + // here we need to be careful to index the user-defined + // data with the proper integer corresponding to the + // enumeration in the C++ header file + + + GDouble Pgamma = GPU_UVARS(0); + GDouble cosTheta_pim = GPU_UVARS(1); + GDouble sinSqTheta_pim = GPU_UVARS(2); + GDouble sin2Theta_pim = GPU_UVARS(3); + GDouble phi_pim = GPU_UVARS(4); + GDouble cosTheta_proton = GPU_UVARS(5); + GDouble sinSqTheta_proton = GPU_UVARS(6); + GDouble sin2Theta_proton = GPU_UVARS(7); + GDouble phi_proton = GPU_UVARS(8); + GDouble bigPhi = GPU_UVARS(9); + // flag for pol (0.0 = no pol, 1.0 = pol) + + GDouble sinSqTh = sinSqTheta_proton; + GDouble sin2Th = sin2Theta_proton; + GDouble cosSqTh = 1.0 - sinSqTh; + + GDouble cphi = cos(phi_proton); + GDouble sphi = sin(phi_proton); + GDouble c2phi = cos(2.0 * phi_proton); + GDouble s2phi = sin(2.0 * phi_proton); + + GDouble sinSqThPi = sinSqTheta_pim; + GDouble sin2ThPi = sin2Theta_pim; + GDouble cosSqThPi = 1.0 - sinSqThPi; + + GDouble cphiPi = cos(phi_pim); + GDouble sphiPi = sin(phi_pim); + GDouble c2phiPi = cos(2.0 * phi_pim); + GDouble s2phiPi = sin(2.0 * phi_pim); + + GDouble r00_11_0 = 0.5 - r00_33_0 - 2.0 * r11_11_0 - 2.0 * r11_33_0; + + GDouble W00_0 = r00_33_0 * sinSqTh + r00_11_0 * (1.0/3.0 + cosSqTh); + GDouble Wb00_0 = (2.0 / sqrt(3.0)) * (r00_31_0 * cphi * sin2Th + r00_3m1_0 * c2phi * sinSqTh); + + GDouble W11_0 = r11_33_0 * sinSqTh + r11_11_0 * (1.0/3.0 + cosSqTh); + GDouble Wb11_0 = (2.0 / sqrt(3.0)) * (r11_31_0 * cphi * sin2Th + r11_3m1_0 * c2phi * sinSqTh); + + GDouble W1m1_0 = r1m1_33_0 * sinSqTh + r1m1_11_0 * (1.0/3.0 + cosSqTh); + GDouble Wb1m1_0 = (2.0 / sqrt(3.0)) * (r1m1_31_0 * cphi * sin2Th + r1m1_3m1_0 * c2phi * sinSqTh); + GDouble Wt1m1_0 = (2.0 / sqrt(3.0)) * (rt1m1_31_0 * sphi * sin2Th + rt1m1_3m1_0 * s2phi * sinSqTh); + + GDouble W10_0 = r10_33_0 * sinSqTh + r10_11_0 * (1.0/3.0 + cosSqTh); + GDouble Wb10_0 = (2.0 / sqrt(3.0)) * (r10_31_0 * cphi * sin2Th + r10_3m1_0 * c2phi * sinSqTh); + GDouble Wt10_0 = (2.0 / sqrt(3.0)) * (rt10_31_0 * sphi * sin2Th + rt10_3m1_0 * s2phi * sinSqTh); + GDouble W0 = cosSqThPi * (W00_0 - Wb00_0) + sinSqThPi * (W11_0 - Wb11_0) - sinSqThPi * (c2phiPi * (W1m1_0 - Wb1m1_0) + s2phiPi * Wt1m1_0) - sqrt(2.0) * sin2ThPi * (cphiPi * (W10_0 - Wb10_0) + sphiPi * Wt10_0); + + WCUComplex amp = { sqrt(fabs(W0)), 0.0 }; + pcDevAmp[iEvent] = amp; + +} + + +void +GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble r00_33_0, //GDouble r00_11_0, + GDouble r11_33_0, GDouble r11_11_0, + GDouble r1m1_33_0, GDouble r1m1_11_0, + GDouble r10_33_0, GDouble r10_11_0, + GDouble r00_31_0, GDouble r00_3m1_0, + GDouble r11_31_0, GDouble r11_3m1_0, + GDouble r1m1_31_0, GDouble r1m1_3m1_0, + GDouble r10_31_0, GDouble r10_3m1_0, + GDouble rt1m1_31_0, GDouble rt1m1_3m1_0, + GDouble rt10_31_0, GDouble rt10_3m1_0 +) +{ + + GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel<<< dimGrid, dimBlock >>> + ( GPU_AMP_ARGS, + r00_33_0, //r00_11_0, + r11_33_0, r11_11_0, + r1m1_33_0, r1m1_11_0, + r10_33_0, r10_11_0, + r00_31_0, r00_3m1_0, + r11_31_0, r11_3m1_0, + r1m1_31_0, r1m1_3m1_0, + r10_31_0, r10_3m1_0, + rt1m1_31_0, rt1m1_3m1_0, + rt10_31_0, rt10_3m1_0 + ); +} diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_factorized_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_factorized_kernel.cu new file mode 100755 index 000000000..84918e4cb --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_factorized_kernel.cu @@ -0,0 +1,107 @@ + +#include + +#include "GPUManager/GPUCustomTypes.h" +#include "GPUManager/CUDA-Complex.cuh" + + +__global__ void +// +GPUTwoPiAngles_Delta_factorized_kernel( GPU_AMP_PROTO, +GDouble rho000, +GDouble rho100, +GDouble rho1m10, +GDouble rho111, +GDouble rho101, +GDouble rho1m11, +GDouble rho102, +GDouble rho1m12, +GDouble delta_rho011, +GDouble delta_rho031, +GDouble delta_rho03m1, +GDouble rho001 +) + { + + int iEvent = GPU_THIS_EVENT; + + // here we need to be careful to index the user-defined + // data with the proper integer corresponding to the + // enumeration in the C++ header file + + + GDouble Pgamma = GPU_UVARS(0); + GDouble cosTheta_pim = GPU_UVARS(1); + GDouble sinSqTheta_pim = GPU_UVARS(2); + GDouble sin2Theta_pim = GPU_UVARS(3); + GDouble phi_pim = GPU_UVARS(4); + GDouble cosTheta_piplus = GPU_UVARS(5); + GDouble sinSqTheta_piplus = GPU_UVARS(6); + GDouble sin2Theta_piplus = GPU_UVARS(7); + GDouble phi_piplus = GPU_UVARS(8); + GDouble bigPhi = GPU_UVARS(9); + // flag for pol (0.0 = no pol, 1.0 = pol) + + // GDouble rho001_val; + // rho001_val = 2*(delta_rho111 + delta_rho133 - rho111); +// Use beam assy. to eliminate one parameter + + GDouble W0_meson = 3.*(0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta_pim*cosTheta_pim - sqrt(2.)*rho100*sin2Theta_pim*cos(phi_pim) - rho1m10*sinSqTheta_pim*cos(2.*phi_pim)); + GDouble W1_meson= 3.*(rho111*sinSqTheta_pim + rho001*cosTheta_pim*cosTheta_pim - sqrt(2.)*rho101*sin2Theta_pim*cos(phi_pim) - rho1m11*sinSqTheta_pim*cos(2.*phi_pim)); + GDouble W2_meson = 3. * (sqrt(2.)*rho102*sin2Theta_pim*sin(phi_pim) + rho1m12*sinSqTheta_pim*sin(2.*phi_pim)); + + GDouble W0_baryon = 3.*(0.5 - delta_rho011)*sinSqTheta_piplus + delta_rho011*(1.+3.*cosTheta_piplus*cosTheta_piplus) - 2.*sqrt(3.)*delta_rho031*cos(phi_piplus)*sin2Theta_piplus - 2.*sqrt(3.)*delta_rho03m1*cos(2.*phi_piplus)*sinSqTheta_piplus; + // GDouble W1_baryon = (3.*delta_rho133*sinSqTheta_piplus + delta_rho111*(1.+3.*cosTheta_piplus*cosTheta_piplus) - 2.*sqrt(3.)*delta_rho131*cos(phi_piplus)*sin2Theta_piplus - 2.*sqrt(3.)*delta_rho13m1*cos(2.*phi_piplus)*sinSqTheta_piplus); + // GDouble W2_baryon = (2.*sqrt(3.)*delta_rho231*sin(phi_piplus)*sin2Theta_piplus + 2.*sqrt(3.)*delta_rho23m1*sin(2.*phi_piplus)*sinSqTheta_piplus); + + // GDouble Wpol = W0_meson*W0_baryon - Pgamma * cos(2.0 * bigPhi) * W1_meson * W1_baryon - Pgamma * sin(2.0 * bigPhi) * W2_meson * W2_baryon; + + /// Just another tests!!!!!! --- IGNORE --- + + // GDouble Wpol = W0_meson*W0_baryon -( Pgamma * cos(2.0 * bigPhi) * W1_meson + Pgamma * sin(2.0 * bigPhi) * W2_meson) * (W1_baryon + W2_baryon); +//Just another test + GDouble Wpol = W0_meson*W0_baryon - Pgamma * cos(2.0 * bigPhi) *( W1_meson*W0_baryon) - Pgamma * sin(2.0 * bigPhi) *( W2_meson*W0_baryon); + + // GDouble Wpol = (W0_meson - Pgamma * cos(2.0 * bigPhi) * W1_meson - Pgamma * sin(2.0 * bigPhi) * W2_meson )*(W0_baryon - Pgamma * cos(2.0 * bigPhi) * W1_baryon - Pgamma * sin(2.0 * bigPhi) * W2_baryon); + + Wpol *= 1/(4.*PI); + + WCUComplex amp = { sqrt(fabs(Wpol)), 0.0 }; + pcDevAmp[iEvent] = amp; + +} + + +void +GPUTwoPiAngles_Delta_factorized_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble rho000, + GDouble rho100, + GDouble rho1m10, + GDouble rho111, + GDouble rho101, + GDouble rho1m11, + GDouble rho102, + GDouble rho1m12, + GDouble delta_rho011, + GDouble delta_rho031, + GDouble delta_rho03m1, + GDouble rho001 +) +{ + + GPUTwoPiAngles_Delta_factorized_kernel<<< dimGrid, dimBlock >>> + ( GPU_AMP_ARGS, + rho000, + rho100, + rho1m10, + rho111, + rho101, + rho1m11, + rho102, + rho1m12, + delta_rho011, + delta_rho031, + delta_rho03m1, + rho001 + ); +} diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_kernel.cu new file mode 100755 index 000000000..c6c9411f0 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_kernel.cu @@ -0,0 +1,52 @@ + +#include + +#include "GPUManager/GPUCustomTypes.h" +#include "GPUManager/CUDA-Complex.cuh" + + +__global__ void +GPUTwoPiAngles_Delta_kernel( GPU_AMP_PROTO, GDouble rho000, GDouble rho100, + GDouble rho1m10, GDouble rho111, GDouble delta_rho133, + GDouble rho101, GDouble rho1m11, GDouble rho102, + GDouble rho1m12, GDouble polAngle, GDouble delta_rho111 ){ + + int iEvent = GPU_THIS_EVENT; + + // here we need to be careful to index the user-defined + // data with the proper integer corresponding to the + // enumeration in the C++ header file + + GDouble Pgamma = GPU_UVARS(0); + GDouble cosTheta = GPU_UVARS(1); + GDouble sinSqTheta = GPU_UVARS(2); + GDouble sin2Theta = GPU_UVARS(3); + GDouble bigPhi = GPU_UVARS(4); // before polAngle*0.017453293 + + GDouble phi = GPU_UVARS(5); + GDouble rho001=2*(delta_rho111 + delta_rho133 - rho111); + GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); + + W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); + + W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); + + W *= 3./(4.*PI); + + WCUComplex amp = { sqrt( fabs( W ) ), 0 }; + + pcDevAmp[iEvent] = amp; +} + + +void +GPUTwoPiAngles_Delta_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble rho000, GDouble rho100, GDouble rho1m10, + GDouble rho111, GDouble delta_rho133, GDouble rho101, + GDouble rho1m11, GDouble rho102, GDouble rho1m12, + GDouble polAngle, GDouble delta_rho111 ) +{ + + GPUTwoPiAngles_Delta_kernel<<< dimGrid, dimBlock >>> + ( GPU_AMP_ARGS, rho000, rho100, rho1m10, rho111,delta_rho133, + rho101, rho1m11, rho102, rho1m12, polAngle, delta_rho111 ); +} diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_upperv_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_upperv_kernel.cu new file mode 100755 index 000000000..7c9f9f89c --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_upperv_kernel.cu @@ -0,0 +1,51 @@ + +#include + +#include "GPUManager/GPUCustomTypes.h" +#include "GPUManager/CUDA-Complex.cuh" + + +__global__ void +GPUTwoPiAngles_Delta_only_upperv_kernel( GPU_AMP_PROTO, GDouble rho000, GDouble rho100, + GDouble rho1m10, GDouble rho111, GDouble rho001, + GDouble rho101, GDouble rho1m11, GDouble rho102, + GDouble rho1m12, GDouble polAngle ){ + + int iEvent = GPU_THIS_EVENT; + + // here we need to be careful to index the user-defined + // data with the proper integer corresponding to the + // enumeration in the C++ header file + + GDouble Pgamma = GPU_UVARS(0); + GDouble cosTheta = GPU_UVARS(1); + GDouble sinSqTheta = GPU_UVARS(2); + GDouble sin2Theta = GPU_UVARS(3); + GDouble bigPhi = GPU_UVARS(4); // before polAngle*0.017453293 + + GDouble phi = GPU_UVARS(5); + GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); + + W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); + + W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); + + W *= 3./(4.*PI); + + WCUComplex amp = { sqrt( fabs( W ) ), 0 }; + + pcDevAmp[iEvent] = amp; +} + + +void +GPUTwoPiAngles_Delta_only_upperv_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble rho000, GDouble rho100, GDouble rho1m10, + GDouble rho111, GDouble rho001, GDouble rho101, + GDouble rho1m11, GDouble rho102, GDouble rho1m12, + GDouble polAngle ) +{ + + GPUTwoPiAngles_Delta_only_upperv_kernel<<< dimGrid, dimBlock >>> + ( GPU_AMP_ARGS, rho000, rho100, rho1m10, rho111,rho001, + rho101, rho1m11, rho102, rho1m12, polAngle ); +} diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_only_upperv_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_only_upperv_kernel.cu new file mode 100755 index 000000000..7c9f9f89c --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_only_upperv_kernel.cu @@ -0,0 +1,51 @@ + +#include + +#include "GPUManager/GPUCustomTypes.h" +#include "GPUManager/CUDA-Complex.cuh" + + +__global__ void +GPUTwoPiAngles_Delta_only_upperv_kernel( GPU_AMP_PROTO, GDouble rho000, GDouble rho100, + GDouble rho1m10, GDouble rho111, GDouble rho001, + GDouble rho101, GDouble rho1m11, GDouble rho102, + GDouble rho1m12, GDouble polAngle ){ + + int iEvent = GPU_THIS_EVENT; + + // here we need to be careful to index the user-defined + // data with the proper integer corresponding to the + // enumeration in the C++ header file + + GDouble Pgamma = GPU_UVARS(0); + GDouble cosTheta = GPU_UVARS(1); + GDouble sinSqTheta = GPU_UVARS(2); + GDouble sin2Theta = GPU_UVARS(3); + GDouble bigPhi = GPU_UVARS(4); // before polAngle*0.017453293 + + GDouble phi = GPU_UVARS(5); + GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); + + W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); + + W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); + + W *= 3./(4.*PI); + + WCUComplex amp = { sqrt( fabs( W ) ), 0 }; + + pcDevAmp[iEvent] = amp; +} + + +void +GPUTwoPiAngles_Delta_only_upperv_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble rho000, GDouble rho100, GDouble rho1m10, + GDouble rho111, GDouble rho001, GDouble rho101, + GDouble rho1m11, GDouble rho102, GDouble rho1m12, + GDouble polAngle ) +{ + + GPUTwoPiAngles_Delta_only_upperv_kernel<<< dimGrid, dimBlock >>> + ( GPU_AMP_ARGS, rho000, rho100, rho1m10, rho111,rho001, + rho101, rho1m11, rho102, rho1m12, polAngle ); +} diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.cc new file mode 100755 index 000000000..9fb708b55 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.cc @@ -0,0 +1,205 @@ + +#include +#include +#include +#include +#include + +#include "TLorentzVector.h" +#include "TLorentzRotation.h" +#include "TFile.h" + +#include "IUAmpTools/Kinematics.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta.h" +#include "AMPTOOLS_AMPS/clebschGordan.h" +#include "AMPTOOLS_AMPS/wignerD.h" + +TwoPiAngles_Delta::TwoPiAngles_Delta( const vector< string >& args ) : + UserAmplitude< TwoPiAngles_Delta >( args ) +{ + assert(args.size() == 12 || args.size() == 13 || args.size() == 14 ); + + rho000 = AmpParameter( args[0] ); + rho100 = AmpParameter( args[1] ); + rho1m10 = AmpParameter( args[2] ); + rho111 = AmpParameter( args[3] ); + delta_rho133 = AmpParameter( args[4] ); + rho101 = AmpParameter( args[5] ); + rho1m11 = AmpParameter( args[6] ); + rho102 = AmpParameter( args[7] ); + rho1m12 = AmpParameter( args[8] ); + frame = string( args[9] ); + polAngle = AmpParameter( args[10] ); + + delta_rho111 = AmpParameter( args[12] ); + constraint = true; + + // need to register any free parameters so the framework knows about them + registerParameter( rho000 ); + registerParameter( rho100 ); + registerParameter( rho1m10 ); + + registerParameter( rho111 ); + + // if(args.size() == 12){ + // registerParameter( rho001 ); + // } + registerParameter( rho101 ); + registerParameter( rho1m11 ); + + registerParameter( rho102 ); + registerParameter( rho1m12 ); + + //new parameter try + + registerParameter( polAngle ); + // if( args.size() == 13){ + registerParameter( delta_rho111 ); + registerParameter( delta_rho133 ); + // } + // Two possibilities to initialize this amplitude: + // 1: 11 arguments, fixed polarization + // Usage: amplitude :::: TwoPiAngles ... + if(args.size() == 13 || args.size() == 12) { + polFraction = atof(args[11].c_str()); + cout << "Fitting with constant polarization " << polFraction << endl; + } + // 2: 12 arguments, read polarization from histogram in file + // Usage: amplitude :::: TwoPiAngles ... +// else if(args.size() == 13) { +// polFraction = 0.; +// TFile* f = new TFile( args[11].c_str() ); +// polFrac_vs_E = (TH1D*)f->Get( args[12].c_str() ); +// assert( polFrac_vs_E != NULL ); +// cout << "Fitting with polarization from " << polFrac_vs_E->GetName() << endl; +// } +// +} + + +complex< GDouble > +TwoPiAngles_Delta::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { + +GDouble sinSqTheta = userVars[kSinSqTheta]; +GDouble sin2Theta = userVars[kSin2Theta]; +GDouble cosTheta = userVars[kCosTheta]; +GDouble phi = userVars[kPhi]; +//GDouble bigPhi = polAngle*0.017453293 + userVars[kBigPhi]; // rotate Phi (in rad) +GDouble bigPhi = userVars[kBigPhi]; +GDouble Pgamma = userVars[kPgamma]; + + + // vector meson production from K. Schilling et. al. last indize = upper + GDouble rho001_val; + if (constraint) { + rho001_val = 2*(delta_rho111 + delta_rho133 - rho111); + } + else { + rho001_val = rho001; + } + // Use beam assy. to eliminate one parameter + + GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); + W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001_val*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); + W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); + W *= 3./(4.*PI); + + return complex< GDouble > ( sqrt(fabs(W)) ); + +} + +void +TwoPiAngles_Delta::calcUserVars( GDouble** pKin, GDouble* userVars ) const { + + TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); + TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); + TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); + TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); + TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); + TLorentzVector target ( 0, 0, 0, 0.9382720813); + + TLorentzVector resonance = p2 + p3; + TLorentzVector recoil = proton + p1; + TLorentzVector CM_motion_lab = beam + target; + TLorentzRotation resonanceBoost( -resonance.BoostVector() ); + TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); + + + + TLorentzVector beam_res = resonanceBoost * beam; + TLorentzVector recoil_res = resonanceBoost * recoil; + TLorentzVector p2_res = resonanceBoost * p2; + TLorentzVector beam_cm = CMBoost * beam; + TLorentzVector recoil_cm = CMBoost * recoil; + TLorentzVector p2_cm = CMBoost * p2; + TLorentzVector resonance_cm = CMBoost * resonance; + + + // normal to the production plane + TVector3 y = (beam.Vect().Unit().Cross(-recoil.Vect().Unit())).Unit(); + //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); + //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose helicity frame: z-axis opposite recoil Delta in rho rest frame + TVector3 z = -1. * recoil_res.Vect().Unit(); + TVector3 x = y.Cross(z).Unit(); + TVector3 angles( (p2_res.Vect()).Dot(x), + (p2_res.Vect()).Dot(y), + (p2_res.Vect()).Dot(z) ); + + //// Calculation angles GFJ frame + + + + // normal to the production plane + TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame + TVector3 z_GFJ = beam_res.Vect().Unit(); + TVector3 x_GFJ = y_GFJ.Cross(z_GFJ).Unit(); + TVector3 angles_GFJ( (p2_res.Vect()).Dot(x_GFJ), + (p2_res.Vect()).Dot(y_GFJ), + (p2_res.Vect()).Dot(z_GFJ) ); + + if(frame=="Hel"){ + userVars[kCosTheta] = angles.CosTheta(); + userVars[kSinSqTheta] = sin(angles.Theta())*sin(angles.Theta()); + userVars[kSin2Theta] = sin(2.*angles.Theta()); + userVars[kPhi] = angles.Phi(); + } + else{ + userVars[kCosTheta] = angles_GFJ.CosTheta(); + userVars[kSinSqTheta] = sin(angles_GFJ.Theta())*sin(angles_GFJ.Theta()); + userVars[kSin2Theta] = sin(2.*angles_GFJ.Theta()); + userVars[kPhi] = angles_GFJ.Phi(); + } + TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); + userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); + + // vector meson production from K. Schilling et. al. + GDouble Pgamma; + if(polFraction > 0.) { // for fitting with constant polarization + Pgamma = polFraction; + } + // else{ + // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); + // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ + // Pgamma = 0.; + // } + // else Pgamma = polFrac_vs_E->GetBinContent(bin); + // } + userVars[kPgamma] = Pgamma; +} + +#ifdef GPU_ACCELERATION +void +TwoPiAngles_Delta::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { + + GPUTwoPiAngles_Delta_exec( dimGrid, dimBlock, GPU_AMP_ARGS, + rho000, rho100, rho1m10, + rho111, delta_rho133, rho101, + rho1m11, rho102, rho1m12, + polAngle, delta_rho111 ); +} + +#endif //GPU_ACCELERATION \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.h b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.h new file mode 100755 index 000000000..967cb8ca6 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.h @@ -0,0 +1,82 @@ +#if !defined(TWOPIANGLES_DELTA) +#define TWOPIANGLES_DELTA + +#include "IUAmpTools/Amplitude.h" +#include "IUAmpTools/UserAmplitude.h" +#include "IUAmpTools/AmpParameter.h" +#include "GPUManager/GPUCustomTypes.h" + +#include "TH1D.h" +#include +#include +#include + +#ifdef GPU_ACCELERATION +void +GPUTwoPiAngles_Delta_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble rho000, GDouble rho100, GDouble rho1m10, + GDouble rho111, GDouble delta_rho133, GDouble rho101, + GDouble rho1m11, GDouble rho102, GDouble rho1m12, + GDouble polAngle,GDouble delta_rho111 ); + +#endif // GPU_ACCELERATION + +using std::complex; +using namespace std; + +class Kinematics; + +class TwoPiAngles_Delta : public UserAmplitude< TwoPiAngles_Delta > +{ + +public: + + TwoPiAngles_Delta() : UserAmplitude< TwoPiAngles_Delta >() { }; + TwoPiAngles_Delta( const vector< string >& args ); + + enum UserVars { kPgamma = 0, kCosTheta, kSinSqTheta, kSin2Theta, + kBigPhi, kPhi, kNumUserVars }; + unsigned int numUserVars() const { return kNumUserVars; } + + string name() const { return "TwoPiAngles_Delta"; } + + complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; + void calcUserVars( GDouble** pKin, GDouble* userVars ) const; + + // we can calcualte everythign we need from userVars block so allow + // the framework to purge the four-vectors + bool needsUserVarsOnly() const { return true; } + +#ifdef GPU_ACCELERATION + + void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; + bool isGPUEnabled() const { return true; } + +#endif // GPU_ACCELERATION + +private: + + AmpParameter rho000; + AmpParameter rho100; + AmpParameter rho1m10; + + AmpParameter rho111; + AmpParameter delta_rho133; + AmpParameter rho101; + AmpParameter rho1m11; + + AmpParameter rho102; + AmpParameter rho1m12; + AmpParameter rho001; + + AmpParameter polAngle; + AmpParameter delta_rho111; + bool constraint; + + double polFraction; + //TH1D *polFrac_vs_E; + string frame; + +}; + +#endif diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc new file mode 100755 index 000000000..9a96ae23b --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc @@ -0,0 +1,499 @@ + +#include +#include +#include +#include +#include + +#include "TLorentzVector.h" +#include "TLorentzRotation.h" +#include "TFile.h" + +#include "IUAmpTools/Kinematics.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h" +#include "AMPTOOLS_AMPS/clebschGordan.h" +#include "AMPTOOLS_AMPS/wignerD.h" + +TwoPiAngles_Delta_DoubleSDMEs::TwoPiAngles_Delta_DoubleSDMEs( const vector< string >& args ) : + UserAmplitude< TwoPiAngles_Delta_DoubleSDMEs >( args ) +{ + +// assert(args.size() == 22 || args.size() == 23 || args.size() == 24 ); +frame = string( args[0] ); +polAngle = AmpParameter( args[1] ); + +polFraction = atof(args[2].c_str()); +cout << "Fitting with constant polarization " << polFraction << endl; + +AMO = string (args[3]); +r00_33_0 = AmpParameter( args[4] ); +// r00_11_0 = AmpParameter( args[4] ); + +r11_33_0 = AmpParameter( args[5] ); +r11_11_0 = AmpParameter( args[6] ); + +r1m1_33_0 = AmpParameter( args[7] ); +r1m1_11_0 = AmpParameter( args[8] ); + +r10_33_0 = AmpParameter( args[9] ); +r10_11_0 = AmpParameter( args[10] ); + +r00_31_0 = AmpParameter( args[11] ); +r00_3m1_0 = AmpParameter( args[12] ); // spin-flip + +r11_31_0 = AmpParameter( args[13] ); // spin-flip +r11_3m1_0 = AmpParameter( args[14] ); // spin-flip + +r1m1_31_0 = AmpParameter( args[15] ); // spin-flip +r1m1_3m1_0 = AmpParameter( args[16] ); // spin-flip + +r10_31_0 = AmpParameter( args[17] ); // spin-flip +r10_3m1_0 = AmpParameter( args[18] ); // spin-flip + +rt1m1_31_0 = AmpParameter( args[19] ); // sin-flip +rt1m1_3m1_0 = AmpParameter( args[20] ); // sin-flip + +rt10_31_0 = AmpParameter( args[21] ); +rt10_3m1_0 = AmpParameter( args[22] ); +//alpha = 1 (same structure) +r00_33_1 = AmpParameter( args[23] ); +r00_11_1 = AmpParameter( args[24] ); + +r11_33_1 = AmpParameter( args[25] ); +r11_11_1 = AmpParameter( args[26] ); + +r1m1_33_1 = AmpParameter( args[27] ); +r1m1_11_1 = AmpParameter( args[28] ); + +r10_33_1 = AmpParameter( args[29] ); +r10_11_1 = AmpParameter( args[30] ); + +r00_31_1 = AmpParameter( args[31] ); +r00_3m1_1 = AmpParameter( args[32] ); + +r11_31_1 = AmpParameter( args[33] ); +r11_3m1_1 = AmpParameter( args[34] ); + +r1m1_31_1 = AmpParameter( args[35] ); +r1m1_3m1_1 = AmpParameter( args[36] ); + +r10_31_1 = AmpParameter( args[37] ); +r10_3m1_1 = AmpParameter( args[38] ); + +rt1m1_31_1 = AmpParameter( args[39] ); +rt1m1_3m1_1 = AmpParameter( args[40] ); + +rt10_31_1 = AmpParameter( args[41] ); +rt10_3m1_1 = AmpParameter( args[42] ); + +//alpha = 2 (different structure) +rt00_31_2 = AmpParameter( args[43] ); +rt00_3m1_2 = AmpParameter( args[44] ); + +rt11_31_2 = AmpParameter( args[45] ); +rt11_3m1_2 = AmpParameter( args[46] ); + +// 1 <-> -1 +r1m1_33_2 = AmpParameter( args[47] ); +r1m1_11_2 = AmpParameter( args[48] ); + +r1m1_31_2 = AmpParameter( args[49] ); +r1m1_3m1_2 = AmpParameter( args[50] ); + +rt1m1_31_2 = AmpParameter( args[51] ); +rt1m1_3m1_2 = AmpParameter( args[52] ); + +r10_33_2 = AmpParameter( args[53] ); +r10_11_2 = AmpParameter( args[54] ); + +r10_31_2 = AmpParameter( args[55] ); +r10_3m1_2 = AmpParameter( args[56] ); + +rt10_31_2 = AmpParameter( args[57] ); +rt10_3m1_2 = AmpParameter( args[58] ); + + +registerParameter( r00_33_0 ); +// registerParameter( r00_11_0 ); + +registerParameter( r11_33_0 ); +registerParameter( r11_11_0 ); + +registerParameter( r1m1_33_0 ); +registerParameter( r1m1_11_0 ); + +registerParameter( r10_33_0 ); +registerParameter( r10_11_0 ); + +registerParameter( r00_31_0 ); +registerParameter( r00_3m1_0 ); + +registerParameter( r11_31_0 ); +registerParameter( r11_3m1_0 ); + +registerParameter( r1m1_31_0 ); +registerParameter( r1m1_3m1_0 ); + +registerParameter( r10_31_0 ); +registerParameter( r10_3m1_0 ); + +registerParameter( rt1m1_31_0 ); +registerParameter( rt1m1_3m1_0 ); + +registerParameter( rt10_31_0 ); +registerParameter( rt10_3m1_0 ); + +registerParameter( r00_33_1 ); +registerParameter( r00_11_1 ); + +registerParameter( r11_33_1 ); +registerParameter( r11_11_1 ); + +registerParameter( r1m1_33_1 ); +registerParameter( r1m1_11_1 ); + +registerParameter( r10_33_1 ); +registerParameter( r10_11_1 ); + +registerParameter( r00_31_1 ); +registerParameter( r00_3m1_1 ); + +registerParameter( r11_31_1 ); +registerParameter( r11_3m1_1 ); + +registerParameter( r1m1_31_1 ); +registerParameter( r1m1_3m1_1 ); + +registerParameter( r10_31_1 ); +registerParameter( r10_3m1_1 ); + +registerParameter( rt1m1_31_1 ); +registerParameter( rt1m1_3m1_1 ); + +registerParameter( rt10_31_1 ); +registerParameter( rt10_3m1_1 ); +//alpha = 2 (different structure) +registerParameter( rt00_31_2 ); +registerParameter( rt00_3m1_2 ); + +registerParameter( rt11_31_2 ); +registerParameter( rt11_3m1_2 ); + +registerParameter( r1m1_33_2 ); +registerParameter( r1m1_11_2 ); + +registerParameter( r1m1_31_2 ); +registerParameter( r1m1_3m1_2 ); + +registerParameter( rt1m1_31_2 ); +registerParameter( rt1m1_3m1_2 ); + +registerParameter( r10_33_2 ); +registerParameter( r10_11_2 ); + +registerParameter( r10_31_2 ); +registerParameter( r10_3m1_2 ); + +registerParameter( rt10_31_2 ); +registerParameter( rt10_3m1_2 ); + +registerParameter( polAngle ); + + // } + // Two possibilities to initialize this amplitude: + // 1: 11 arguments, fixed polarization + // Usage: amplitude :::: TwoPiAngles ... + + // 2: 12 arguments, read polarization from histogram in file + // Usage: amplitude :::: TwoPiAngles ... +// else if(args.size() == 13) { +// polFraction = 0.; +// TFile* f = new TFile( args[11].c_str() ); +// polFrac_vs_E = (TH1D*)f->Get( args[12].c_str() ); +// assert( polFrac_vs_E != NULL ); +// cout << "Fitting with polarization from " << polFrac_vs_E->GetName() << endl; +// } +// +} + + +complex< GDouble > +TwoPiAngles_Delta_DoubleSDMEs::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { + + +//GDouble bigPhi = polAngle*0.017453293 + userVars[kBigPhi]; // rotate Phi (in rad) +GDouble bigPhi = userVars[kBigPhi]; +GDouble Pgamma = userVars[kPgamma]; +GDouble cosTheta_pim = userVars[kCosTheta_pim]; +GDouble sinSqTheta_pim = userVars[kSinSqTheta_pim]; +GDouble sin2Theta_pim = userVars[kSin2Theta_pim]; +GDouble phi_pim = userVars[kPhi_pim]; +GDouble cosTheta_proton = userVars[kCosTheta_proton]; +GDouble sinSqTheta_proton = userVars[kSinSqTheta_proton]; +GDouble sin2Theta_proton = userVars[kSin2Theta_proton]; +GDouble phi_proton = userVars[kPhi_proton]; + + + // vector meson production from K. Schilling et. al. last indize = upper + +GDouble sinSqTh = sinSqTheta_proton; +GDouble sin2Th = sin2Theta_proton; +GDouble cosSqTh = 1.0 - sinSqTh; + +GDouble cphi = cos(phi_proton); +GDouble sphi = sin(phi_proton); +GDouble c2phi = cos(2.0 * phi_proton); +GDouble s2phi = sin(2.0 * phi_proton); + +GDouble sinSqThPi = sinSqTheta_pim; +GDouble sin2ThPi = sin2Theta_pim; +GDouble cosSqThPi = 1.0 - sinSqThPi; + +GDouble cphiPi = cos(phi_pim); +GDouble sphiPi = sin(phi_pim); +GDouble c2phiPi = cos(2.0 * phi_pim); +GDouble s2phiPi = sin(2.0 * phi_pim); + +GDouble r00_11_0 = 0.5 - r00_33_0 - 2.0 * r11_11_0 - 2.0 * r11_33_0; + + +GDouble W00_0 = r00_33_0 * sinSqTh + r00_11_0 * (1.0/3.0 + cosSqTh); +GDouble Wb00_0 = (2.0 / sqrt(3.0)) * (r00_31_0 * cphi * sin2Th + r00_3m1_0 * c2phi * sinSqTh); + +GDouble W11_0 = r11_33_0 * sinSqTh + r11_11_0 * (1.0/3.0 + cosSqTh); +GDouble Wb11_0 = (2.0 / sqrt(3.0)) * (r11_31_0 * cphi * sin2Th + r11_3m1_0 * c2phi * sinSqTh); + +GDouble W1m1_0 = r1m1_33_0 * sinSqTh + r1m1_11_0 * (1.0/3.0 + cosSqTh); +GDouble Wb1m1_0 = (2.0 / sqrt(3.0)) * (r1m1_31_0 * cphi * sin2Th + r1m1_3m1_0 * c2phi * sinSqTh); +GDouble Wt1m1_0 = (2.0 / sqrt(3.0)) * (rt1m1_31_0 * sphi * sin2Th + rt1m1_3m1_0 * s2phi * sinSqTh); + +GDouble W10_0 = r10_33_0 * sinSqTh + r10_11_0 * (1.0/3.0 + cosSqTh); +GDouble Wb10_0 = (2.0 / sqrt(3.0)) * (r10_31_0 * cphi * sin2Th + r10_3m1_0 * c2phi * sinSqTh); +GDouble Wt10_0 = (2.0 / sqrt(3.0)) * (rt10_31_0 * sphi * sin2Th + rt10_3m1_0 * s2phi * sinSqTh); + +GDouble W0 = cosSqThPi * (W00_0 - Wb00_0) + sinSqThPi * (W11_0 - Wb11_0) - sinSqThPi * (c2phiPi * (W1m1_0 - Wb1m1_0) + s2phiPi * Wt1m1_0) - sqrt(2.0) * sin2ThPi * (cphiPi * (W10_0 - Wb10_0) + sphiPi * Wt10_0); +//alpha = 1 (same structure) +GDouble W00_1 = r00_33_1 * sinSqTh + r00_11_1 * (1.0/3.0 + cosSqTh); +GDouble Wb00_1 = (2.0 / sqrt(3.0)) * (r00_31_1 * cphi * sin2Th + r00_3m1_1 * c2phi * sinSqTh); + +GDouble W11_1 = r11_33_1 * sinSqTh + r11_11_1 * (1.0/3.0 + cosSqTh); +GDouble Wb11_1 = (2.0 / sqrt(3.0)) * (r11_31_1 * cphi * sin2Th + r11_3m1_1 * c2phi * sinSqTh); + +GDouble W1m1_1 = r1m1_33_1 * sinSqTh + r1m1_11_1 * (1.0/3.0 + cosSqTh); +GDouble Wb1m1_1 = (2.0 / sqrt(3.0)) * (r1m1_31_1 * cphi * sin2Th + r1m1_3m1_1 * c2phi * sinSqTh); +GDouble Wt1m1_1 = (2.0 / sqrt(3.0)) * (rt1m1_31_1 * sphi * sin2Th + rt1m1_3m1_1 * s2phi * sinSqTh); + +GDouble W10_1 = r10_33_1 * sinSqTh + r10_11_1 * (1.0/3.0 + cosSqTh); +GDouble Wb10_1 = (2.0 / sqrt(3.0)) * (r10_31_1 * cphi * sin2Th + r10_3m1_1 * c2phi * sinSqTh); +GDouble Wt10_1 = (2.0 / sqrt(3.0)) * (rt10_31_1 * sphi * sin2Th + rt10_3m1_1 * s2phi * sinSqTh); + +GDouble W1 =cosSqThPi * (W00_1 - Wb00_1) + sinSqThPi * (W11_1 - Wb11_1) - sinSqThPi * (c2phiPi * (W1m1_1 - Wb1m1_1) + s2phiPi * Wt1m1_1) - sqrt(2.0) * sin2ThPi * (cphiPi * (W10_1 - Wb10_1) + sphiPi * Wt10_1); + +// alpha = 2 (different structure) +GDouble Wt00_2 = (2.0 / sqrt(3.0)) * (rt00_31_2 * sphi * sin2Th + rt00_3m1_2 * s2phi * sinSqTh); +GDouble Wt11_2 = (2.0 / sqrt(3.0)) * (rt11_31_2 * sphi * sin2Th + rt11_3m1_2 * s2phi * sinSqTh); + +GDouble W1m1_2 = r1m1_33_2 * sinSqTh + r1m1_11_2 * (1.0/3.0 + cosSqTh); +GDouble Wb1m1_2 = (2.0 / sqrt(3.0)) * (r1m1_31_2 * cphi * sin2Th + r1m1_3m1_2 * c2phi * sinSqTh); +GDouble Wt1m1_2 = (2.0 / sqrt(3.0)) * (rt1m1_31_2 * sphi * sin2Th + rt1m1_3m1_2 * s2phi * sinSqTh); + +GDouble W10_2 = r10_33_2 * sinSqTh + r10_11_2 * (1.0/3.0 + cosSqTh); +GDouble Wb10_2 = (2.0 / sqrt(3.0)) * (r10_31_2 * cphi * sin2Th + r10_3m1_2 * c2phi * sinSqTh); +GDouble Wt10_2 = (2.0 / sqrt(3.0)) * (rt10_31_2 * sphi * sin2Th + rt10_3m1_2 * s2phi * sinSqTh); +GDouble W2 = cosSqThPi * Wt00_2+ sinSqThPi * Wt11_2+ sinSqThPi * (s2phiPi * (W1m1_2 - Wb1m1_2) - c2phiPi * Wt1m1_2) + sqrt(2.0) * sin2ThPi * (sphiPi * (W10_2 - Wb10_2) + cphiPi * Wt10_2); // 19.05 change sign of cphiPi * Wt10_2 + +GDouble Wpol = W0 - Pgamma * cos(2.0 * bigPhi) * W1 - Pgamma * sin(2.0 * bigPhi) * W2; +return complex< GDouble > ( sqrt(fabs(Wpol)) ); +} + +void +TwoPiAngles_Delta_DoubleSDMEs::calcUserVars( GDouble** pKin, GDouble* userVars ) const { + + TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); + TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); + TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); // pip + TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); // pim + TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); // pi0 + TLorentzVector target ( 0, 0, 0, 0.9382720813); + // determine boost vectors + TLorentzVector resonance = p2 + p3; + TLorentzVector recoil = proton + p1; + TLorentzVector rho = p2 + p3; + TLorentzVector Delta = proton + p1; + TLorentzVector CM_motion_lab = beam + target; + TLorentzVector piminus = p2; + + TLorentzRotation resonanceBoost( -resonance.BoostVector() ); + + TLorentzRotation rhoBoost( -rho.BoostVector() ); + TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); + TLorentzRotation DeltaBoost( -Delta.BoostVector() ); + + + + //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); + //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose helicity frame: z-axis opposite recoil Delta in rho rest frame +//bost in rho restframe + TLorentzVector beam_resrho = rhoBoost * beam; + TLorentzVector Delta_resrho = rhoBoost * Delta; + TLorentzVector piminus_resrho = rhoBoost * piminus; + TLorentzVector proton_resrho = rhoBoost * proton; +//boost in CM frame + TLorentzVector beam_cm = CMBoost * beam; + TLorentzVector Delta_cm = CMBoost * Delta; + TLorentzVector piminus_cm = CMBoost * piminus; + TLorentzVector rho_cm = CMBoost * rho; + +//boost in recoil frame + TLorentzVector target_resDelta = DeltaBoost * target; + TLorentzVector proton_resDelta = DeltaBoost * proton; + TLorentzVector rho_resDelta = DeltaBoost * rho; + + // Define coordinate systems: + // y equal in all frames + TVector3 y = (beam.Vect().Unit().Cross(-Delta.Vect().Unit())).Unit(); + + //rho system + + //Helicity frame + TVector3 z_hel_rho = -1. * Delta_resrho.Vect().Unit(); + TVector3 x_hel_rho = y.Cross(z_hel_rho).Unit(); + + // GJ frame + + TVector3 z_GJ_rho = beam_resrho.Vect().Unit(); + TVector3 x_GJ_rho = y.Cross(z_GJ_rho).Unit(); + + //Delta system + + // Helicity frame + TVector3 z_hel_Delta = -rho_resDelta.Vect().Unit(); + TVector3 x_hel_Delta = (y.Cross(z_hel_Delta)).Unit(); + + // GJ frame + TVector3 z_GJ_Delta = target_resDelta.Vect().Unit(); + TVector3 x_GJ_Delta = y.Cross(z_GJ_Delta).Unit(); + + // normal to the production plane + + //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); + //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + //rho rest frame + // choose helicity frame: z-axis opposite recoil Delta in rho rest frame + //helicity frame + + + + //Angle calculation + TVector3 angles_piminus_hel_rho( (piminus_resrho.Vect()).Dot(x_hel_rho), + (piminus_resrho.Vect()).Dot(y), + (piminus_resrho.Vect()).Dot(z_hel_rho) ); + + TVector3 angles_piminus_GJ_rho( (piminus_resrho.Vect()).Dot(x_GJ_rho), + (piminus_resrho.Vect()).Dot(y), + (piminus_resrho.Vect()).Dot(z_GJ_rho) ); + + TVector3 angles_proton_hel_Delta( (proton_resDelta.Vect()).Dot(x_hel_Delta), + (proton_resDelta.Vect()).Dot(y), + (proton_resDelta.Vect()).Dot(z_hel_Delta) ); + + TVector3 angles_proton_GJ_Delta( (proton_resDelta.Vect()).Dot(x_GJ_Delta), + (proton_resDelta.Vect()).Dot(y), + (proton_resDelta.Vect()).Dot(z_GJ_Delta) ); + + + + + + + + + + + // // normal to the production plane + // TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame + + + + if(frame=="Hel"){ + + userVars[kCosTheta_pim] = angles_piminus_hel_rho.CosTheta(); + userVars[kSinSqTheta_pim] = sin(angles_piminus_hel_rho.Theta())*sin(angles_piminus_hel_rho.Theta()); + userVars[kSin2Theta_pim] = sin(2.*angles_piminus_hel_rho.Theta()); + userVars[kPhi_pim] = angles_piminus_hel_rho.Phi(); + + userVars[kCosTheta_proton] = angles_proton_hel_Delta.CosTheta(); + userVars[kSinSqTheta_proton] = sin(angles_proton_hel_Delta.Theta())*sin(angles_proton_hel_Delta.Theta()); + userVars[kSin2Theta_proton] = sin(2.*angles_proton_hel_Delta.Theta()); + userVars[kPhi_proton] = angles_proton_hel_Delta.Phi(); + } + else{ + userVars[kCosTheta_pim] = angles_piminus_GJ_rho.CosTheta(); + userVars[kSinSqTheta_pim] = sin(angles_piminus_GJ_rho.Theta())*sin(angles_piminus_GJ_rho.Theta()); + userVars[kSin2Theta_pim] = sin(2.*angles_piminus_GJ_rho.Theta()); + userVars[kPhi_pim] = angles_piminus_GJ_rho.Phi(); + + userVars[kCosTheta_proton] = angles_proton_GJ_Delta.CosTheta(); + userVars[kSinSqTheta_proton] = sin(angles_proton_GJ_Delta.Theta())*sin(angles_proton_GJ_Delta.Theta()); + userVars[kSin2Theta_proton] = sin(2.*angles_proton_GJ_Delta.Theta()); + userVars[kPhi_proton] = angles_proton_GJ_Delta.Phi(); + } + TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); + userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); + + // vector meson production from K. Schilling et. al. + GDouble Pgamma; + if(polFraction > 0.) { // for fitting with constant polarization + Pgamma = polFraction; + } + // else{ + // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); + // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ + // Pgamma = 0.; + // } + // else Pgamma = polFrac_vs_E->GetBinContent(bin); + // } + userVars[kPgamma] = Pgamma; + +} + +#ifdef GPU_ACCELERATION +void +TwoPiAngles_Delta_DoubleSDMEs::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { + + GPUTwoPiAngles_Delta_DoubleSDMEs_exec( dimGrid, dimBlock, GPU_AMP_ARGS, + r00_33_0, //r00_11_0, + r11_33_0, r11_11_0, + r1m1_33_0, r1m1_11_0, + r10_33_0, r10_11_0, + r00_31_0, r00_3m1_0, + r11_31_0, r11_3m1_0, + r1m1_31_0, r1m1_3m1_0, + r10_31_0, r10_3m1_0, + rt1m1_31_0, rt1m1_3m1_0, + rt10_31_0, rt10_3m1_0, + r00_33_1, r00_11_1, + r11_33_1, r11_11_1, + r1m1_33_1, r1m1_11_1, + r10_33_1, r10_11_1, + r00_31_1, r00_3m1_1, + r11_31_1, r11_3m1_1, + r1m1_31_1, r1m1_3m1_1, + r10_31_1, r10_3m1_1, + rt1m1_31_1, rt1m1_3m1_1, + rt10_31_1, rt10_3m1_1, + rt00_31_2, rt00_3m1_2, + rt11_31_2, rt11_3m1_2, + r1m1_33_2, r1m1_11_2, + r1m1_31_2, r1m1_3m1_2, + rt1m1_31_2, rt1m1_3m1_2, + r10_33_2, r10_11_2, + r10_31_2, r10_3m1_2, + rt10_31_2, rt10_3m1_2 +); +} +#endif //GPU_ACCELERATION \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h new file mode 100755 index 000000000..c58d57d58 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h @@ -0,0 +1,166 @@ +#if !defined(TWOPIANGLES_DELTA_DOUBLESDMES) +#define TWOPIANGLES_DELTA_DOUBLESDMES + +#include "IUAmpTools/Amplitude.h" +#include "IUAmpTools/UserAmplitude.h" +#include "IUAmpTools/AmpParameter.h" +#include "GPUManager/GPUCustomTypes.h" + +#include "TH1D.h" +#include +#include +#include + +#ifdef GPU_ACCELERATION +void +GPUTwoPiAngles_Delta_DoubleSDMEs_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, +GDouble r00_33_0, //GDouble r00_11_0 +GDouble r11_33_0, GDouble r11_11_0, +GDouble r1m1_33_0, GDouble r1m1_11_0, +GDouble r10_33_0, GDouble r10_11_0, + +GDouble r00_31_0, GDouble r00_3m1_0, +GDouble r11_31_0, GDouble r11_3m1_0, +GDouble r1m1_31_0, GDouble r1m1_3m1_0, +GDouble r10_31_0, GDouble r10_3m1_0, + +GDouble rt1m1_31_0, GDouble rt1m1_3m1_0, +GDouble rt10_31_0, GDouble rt10_3m1_0, +GDouble r00_33_1, GDouble r00_11_1, +GDouble r11_33_1, GDouble r11_11_1, +GDouble r1m1_33_1, GDouble r1m1_11_1, +GDouble r10_33_1, GDouble r10_11_1, +GDouble r00_31_1, GDouble r00_3m1_1, +GDouble r11_31_1, GDouble r11_3m1_1, +GDouble r1m1_31_1, GDouble r1m1_3m1_1, +GDouble r10_31_1, GDouble r10_3m1_1, +GDouble rt1m1_31_1, GDouble rt1m1_3m1_1, +GDouble rt10_31_1, GDouble rt10_3m1_1, +GDouble rt00_31_2, GDouble rt00_3m1_2, +GDouble rt11_31_2, GDouble rt11_3m1_2, +GDouble r1m1_33_2, GDouble r1m1_11_2, +GDouble r1m1_31_2, GDouble r1m1_3m1_2, +GDouble rt1m1_31_2, GDouble rt1m1_3m1_2, +GDouble r10_33_2, GDouble r10_11_2, +GDouble r10_31_2, GDouble r10_3m1_2, +GDouble rt10_31_2, GDouble rt10_3m1_2 +); + +#endif // GPU_ACCELERATION + +using std::complex; +using namespace std; + +class Kinematics; + +class TwoPiAngles_Delta_DoubleSDMEs : public UserAmplitude< TwoPiAngles_Delta_DoubleSDMEs > +{ + +public: + + TwoPiAngles_Delta_DoubleSDMEs() : UserAmplitude< TwoPiAngles_Delta_DoubleSDMEs >() { }; + TwoPiAngles_Delta_DoubleSDMEs( const vector< string >& args ); + + enum UserVars { kPgamma = 0, kCosTheta_pim, kSinSqTheta_pim, kSin2Theta_pim, kPhi_pim, kCosTheta_proton, kSinSqTheta_proton, kSin2Theta_proton, kPhi_proton, + kBigPhi, kNumUserVars }; + unsigned int numUserVars() const { return kNumUserVars; } + + string name() const { return "TwoPiAngles_Delta_DoubleSDMEs"; } + + complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; + void calcUserVars( GDouble** pKin, GDouble* userVars ) const; + + // we can calcualte everythign we need from userVars block so allow + // the framework to purge the four-vectors + bool needsUserVarsOnly() const { return true; } + +#ifdef GPU_ACCELERATION + + void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; + bool isGPUEnabled() const { return true; } + +#endif // GPU_ACCELERATION + +private: + + AmpParameter r00_33_0; + // AmpParameter r00_11_0; + + AmpParameter r11_33_0; + AmpParameter r11_11_0; + + AmpParameter r1m1_33_0; + AmpParameter r1m1_11_0; + + AmpParameter r10_33_0; + AmpParameter r10_11_0; + + // \bar W^0 (31 / 3-1) + + AmpParameter r00_31_0; + AmpParameter r00_3m1_0; + + AmpParameter r11_31_0; + AmpParameter r11_3m1_0; + + AmpParameter r1m1_31_0; + AmpParameter r1m1_3m1_0; + + AmpParameter r10_31_0; + AmpParameter r10_3m1_0; + + // \tilde W^0 + + AmpParameter rt1m1_31_0; + AmpParameter rt1m1_3m1_0; + + AmpParameter rt10_31_0; + AmpParameter rt10_3m1_0; + + //alpha = 1 (same structure) + AmpParameter r00_33_1; + AmpParameter r00_11_1; + AmpParameter r11_33_1; + AmpParameter r11_11_1; + AmpParameter r1m1_33_1; + AmpParameter r1m1_11_1; + AmpParameter r10_33_1; + AmpParameter r10_11_1; + AmpParameter r00_31_1; + AmpParameter r00_3m1_1; + AmpParameter r11_31_1; + AmpParameter r11_3m1_1; + AmpParameter r1m1_31_1; + AmpParameter r1m1_3m1_1; + AmpParameter r10_31_1; + AmpParameter r10_3m1_1; + AmpParameter rt1m1_31_1; + AmpParameter rt1m1_3m1_1; + AmpParameter rt10_31_1; + AmpParameter rt10_3m1_1; + //alpha = 2 (different structure) + AmpParameter rt00_31_2; + AmpParameter rt00_3m1_2; + AmpParameter rt11_31_2; + AmpParameter rt11_3m1_2; + AmpParameter r1m1_33_2; + AmpParameter r1m1_11_2; + AmpParameter r1m1_31_2; + AmpParameter r1m1_3m1_2; + AmpParameter rt1m1_31_2; + AmpParameter rt1m1_3m1_2; + AmpParameter r10_33_2; + AmpParameter r10_11_2; + AmpParameter r10_31_2; + AmpParameter r10_3m1_2; + AmpParameter rt10_31_2; + AmpParameter rt10_3m1_2; + AmpParameter polAngle; + + double polFraction; + //TH1D *polFrac_vs_E; + string frame; + string AMO; +}; + +#endif diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.cc new file mode 100755 index 000000000..85ffa4b2f --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.cc @@ -0,0 +1,343 @@ + +#include +#include +#include +#include +#include + +#include "TLorentzVector.h" +#include "TLorentzRotation.h" +#include "TFile.h" + +#include "IUAmpTools/Kinematics.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h" +#include "AMPTOOLS_AMPS/clebschGordan.h" +#include "AMPTOOLS_AMPS/wignerD.h" + +TwoPiAngles_Delta_DoubleSDMEs_unpol::TwoPiAngles_Delta_DoubleSDMEs_unpol( const vector< string >& args ) : + UserAmplitude< TwoPiAngles_Delta_DoubleSDMEs_unpol >( args ) +{ + +// assert(args.size() == 22 || args.size() == 23 || args.size() == 24 ); +frame = string( args[0] ); +polAngle = AmpParameter( args[1] ); + +polFraction = atof(args[2].c_str()); +cout << "Fitting with constant polarization " << polFraction << endl; + +AMO = string (args[3]); +r00_33_0 = AmpParameter( args[4] ); +// r00_11_0 = AmpParameter( args[4] ); + +r11_33_0 = AmpParameter( args[5] ); +r11_11_0 = AmpParameter( args[6] ); + +r1m1_33_0 = AmpParameter( args[7] ); +r1m1_11_0 = AmpParameter( args[8] ); + +r10_33_0 = AmpParameter( args[9] ); +r10_11_0 = AmpParameter( args[10] ); + +r00_31_0 = AmpParameter( args[11] ); +r00_3m1_0 = AmpParameter( args[12] ); // spin-flip + +r11_31_0 = AmpParameter( args[13] ); // spin-flip +r11_3m1_0 = AmpParameter( args[14] ); // spin-flip + +r1m1_31_0 = AmpParameter( args[15] ); // spin-flip +r1m1_3m1_0 = AmpParameter( args[16] ); // spin-flip + +r10_31_0 = AmpParameter( args[17] ); // spin-flip +r10_3m1_0 = AmpParameter( args[18] ); // spin-flip + +rt1m1_31_0 = AmpParameter( args[19] ); // sin-flip +rt1m1_3m1_0 = AmpParameter( args[20] ); // sin-flip + +rt10_31_0 = AmpParameter( args[21] ); +rt10_3m1_0 = AmpParameter( args[22] ); + + + +registerParameter( r00_33_0 ); +// registerParameter( r00_11_0 ); + +registerParameter( r11_33_0 ); +registerParameter( r11_11_0 ); + +registerParameter( r1m1_33_0 ); +registerParameter( r1m1_11_0 ); + +registerParameter( r10_33_0 ); +registerParameter( r10_11_0 ); + +registerParameter( r00_31_0 ); +registerParameter( r00_3m1_0 ); + +registerParameter( r11_31_0 ); +registerParameter( r11_3m1_0 ); + +registerParameter( r1m1_31_0 ); +registerParameter( r1m1_3m1_0 ); + +registerParameter( r10_31_0 ); +registerParameter( r10_3m1_0 ); + +registerParameter( rt1m1_31_0 ); +registerParameter( rt1m1_3m1_0 ); + +registerParameter( rt10_31_0 ); +registerParameter( rt10_3m1_0 ); + + +registerParameter( polAngle ); + + // } + // Two possibilities to initialize this amplitude: + // 1: 11 arguments, fixed polarization + // Usage: amplitude :::: TwoPiAngles ... + + // 2: 12 arguments, read polarization from histogram in file + // Usage: amplitude :::: TwoPiAngles ... +// else if(args.size() == 13) { +// polFraction = 0.; +// TFile* f = new TFile( args[11].c_str() ); +// polFrac_vs_E = (TH1D*)f->Get( args[12].c_str() ); +// assert( polFrac_vs_E != NULL ); +// cout << "Fitting with polarization from " << polFrac_vs_E->GetName() << endl; +// } +// +} + + +complex< GDouble > +TwoPiAngles_Delta_DoubleSDMEs_unpol::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { + + +//GDouble bigPhi = polAngle*0.017453293 + userVars[kBigPhi]; // rotate Phi (in rad) +GDouble bigPhi = userVars[kBigPhi]; +GDouble Pgamma = userVars[kPgamma]; +GDouble cosTheta_pim = userVars[kCosTheta_pim]; +GDouble sinSqTheta_pim = userVars[kSinSqTheta_pim]; +GDouble sin2Theta_pim = userVars[kSin2Theta_pim]; +GDouble phi_pim = userVars[kPhi_pim]; +GDouble cosTheta_proton = userVars[kCosTheta_proton]; +GDouble sinSqTheta_proton = userVars[kSinSqTheta_proton]; +GDouble sin2Theta_proton = userVars[kSin2Theta_proton]; +GDouble phi_proton = userVars[kPhi_proton]; + + + // vector meson production from K. Schilling et. al. last indize = upper + +GDouble sinSqTh = sinSqTheta_proton; +GDouble sin2Th = sin2Theta_proton; +GDouble cosSqTh = 1.0 - sinSqTh; + +GDouble cphi = cos(phi_proton); +GDouble sphi = sin(phi_proton); +GDouble c2phi = cos(2.0 * phi_proton); +GDouble s2phi = sin(2.0 * phi_proton); + +GDouble sinSqThPi = sinSqTheta_pim; +GDouble sin2ThPi = sin2Theta_pim; +GDouble cosSqThPi = 1.0 - sinSqThPi; + +GDouble cphiPi = cos(phi_pim); +GDouble sphiPi = sin(phi_pim); +GDouble c2phiPi = cos(2.0 * phi_pim); +GDouble s2phiPi = sin(2.0 * phi_pim); + +GDouble r00_11_0 = 0.5 - r00_33_0 - 2.0 * r11_11_0 - 2.0 * r11_33_0; + + +GDouble W00_0 = r00_33_0 * sinSqTh + r00_11_0 * (1.0/3.0 + cosSqTh); +GDouble Wb00_0 = (2.0 / sqrt(3.0)) * (r00_31_0 * cphi * sin2Th + r00_3m1_0 * c2phi * sinSqTh); + +GDouble W11_0 = r11_33_0 * sinSqTh + r11_11_0 * (1.0/3.0 + cosSqTh); +GDouble Wb11_0 = (2.0 / sqrt(3.0)) * (r11_31_0 * cphi * sin2Th + r11_3m1_0 * c2phi * sinSqTh); + +GDouble W1m1_0 = r1m1_33_0 * sinSqTh + r1m1_11_0 * (1.0/3.0 + cosSqTh); +GDouble Wb1m1_0 = (2.0 / sqrt(3.0)) * (r1m1_31_0 * cphi * sin2Th + r1m1_3m1_0 * c2phi * sinSqTh); +GDouble Wt1m1_0 = (2.0 / sqrt(3.0)) * (rt1m1_31_0 * sphi * sin2Th + rt1m1_3m1_0 * s2phi * sinSqTh); + +GDouble W10_0 = r10_33_0 * sinSqTh + r10_11_0 * (1.0/3.0 + cosSqTh); +GDouble Wb10_0 = (2.0 / sqrt(3.0)) * (r10_31_0 * cphi * sin2Th + r10_3m1_0 * c2phi * sinSqTh); +GDouble Wt10_0 = (2.0 / sqrt(3.0)) * (rt10_31_0 * sphi * sin2Th + rt10_3m1_0 * s2phi * sinSqTh); + +GDouble W0 = cosSqThPi * (W00_0 - Wb00_0) + sinSqThPi * (W11_0 - Wb11_0) - sinSqThPi * (c2phiPi * (W1m1_0 - Wb1m1_0) + s2phiPi * Wt1m1_0) - sqrt(2.0) * sin2ThPi * (cphiPi * (W10_0 - Wb10_0) + sphiPi * Wt10_0); +//alpha = 1 (same structure) +return complex< GDouble > ( sqrt(fabs(W0)) ); +} + +void +TwoPiAngles_Delta_DoubleSDMEs_unpol::calcUserVars( GDouble** pKin, GDouble* userVars ) const { + + TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); + TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); + TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); // pip + TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); // pim + TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); // pi0 + TLorentzVector target ( 0, 0, 0, 0.9382720813); + // determine boost vectors + TLorentzVector resonance = p2 + p3; + TLorentzVector recoil = proton + p1; + TLorentzVector rho = p2 + p3; + TLorentzVector Delta = proton + p1; + TLorentzVector CM_motion_lab = beam + target; + TLorentzVector piminus = p2; + + TLorentzRotation resonanceBoost( -resonance.BoostVector() ); + + TLorentzRotation rhoBoost( -rho.BoostVector() ); + TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); + TLorentzRotation DeltaBoost( -Delta.BoostVector() ); + + + + //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); + //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose helicity frame: z-axis opposite recoil Delta in rho rest frame +//bost in rho restframe + TLorentzVector beam_resrho = rhoBoost * beam; + TLorentzVector Delta_resrho = rhoBoost * Delta; + TLorentzVector piminus_resrho = rhoBoost * piminus; + TLorentzVector proton_resrho = rhoBoost * proton; +//boost in CM frame + TLorentzVector beam_cm = CMBoost * beam; + TLorentzVector Delta_cm = CMBoost * Delta; + TLorentzVector piminus_cm = CMBoost * piminus; + TLorentzVector rho_cm = CMBoost * rho; + +//boost in recoil frame + TLorentzVector target_resDelta = DeltaBoost * target; + TLorentzVector proton_resDelta = DeltaBoost * proton; + TLorentzVector rho_resDelta = DeltaBoost * rho; + + // Define coordinate systems: + // y equal in all frames + TVector3 y = (beam.Vect().Unit().Cross(-Delta.Vect().Unit())).Unit(); + + //rho system + + //Helicity frame + TVector3 z_hel_rho = -1. * Delta_resrho.Vect().Unit(); + TVector3 x_hel_rho = y.Cross(z_hel_rho).Unit(); + + // GJ frame + + TVector3 z_GJ_rho = beam_resrho.Vect().Unit(); + TVector3 x_GJ_rho = y.Cross(z_GJ_rho).Unit(); + + //Delta system + + // Helicity frame + TVector3 z_hel_Delta = -rho_resDelta.Vect().Unit(); + TVector3 x_hel_Delta = (y.Cross(z_hel_Delta)).Unit(); + + // GJ frame + TVector3 z_GJ_Delta = target_resDelta.Vect().Unit(); + TVector3 x_GJ_Delta = y.Cross(z_GJ_Delta).Unit(); + + // normal to the production plane + + //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); + //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + //rho rest frame + // choose helicity frame: z-axis opposite recoil Delta in rho rest frame + //helicity frame + + + + //Angle calculation + TVector3 angles_piminus_hel_rho( (piminus_resrho.Vect()).Dot(x_hel_rho), + (piminus_resrho.Vect()).Dot(y), + (piminus_resrho.Vect()).Dot(z_hel_rho) ); + + TVector3 angles_piminus_GJ_rho( (piminus_resrho.Vect()).Dot(x_GJ_rho), + (piminus_resrho.Vect()).Dot(y), + (piminus_resrho.Vect()).Dot(z_GJ_rho) ); + + TVector3 angles_proton_hel_Delta( (proton_resDelta.Vect()).Dot(x_hel_Delta), + (proton_resDelta.Vect()).Dot(y), + (proton_resDelta.Vect()).Dot(z_hel_Delta) ); + + TVector3 angles_proton_GJ_Delta( (proton_resDelta.Vect()).Dot(x_GJ_Delta), + (proton_resDelta.Vect()).Dot(y), + (proton_resDelta.Vect()).Dot(z_GJ_Delta) ); + + + + + + + + + + + // // normal to the production plane + // TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame + + + + if(frame=="Hel"){ + + userVars[kCosTheta_pim] = angles_piminus_hel_rho.CosTheta(); + userVars[kSinSqTheta_pim] = sin(angles_piminus_hel_rho.Theta())*sin(angles_piminus_hel_rho.Theta()); + userVars[kSin2Theta_pim] = sin(2.*angles_piminus_hel_rho.Theta()); + userVars[kPhi_pim] = angles_piminus_hel_rho.Phi(); + + userVars[kCosTheta_proton] = angles_proton_hel_Delta.CosTheta(); + userVars[kSinSqTheta_proton] = sin(angles_proton_hel_Delta.Theta())*sin(angles_proton_hel_Delta.Theta()); + userVars[kSin2Theta_proton] = sin(2.*angles_proton_hel_Delta.Theta()); + userVars[kPhi_proton] = angles_proton_hel_Delta.Phi(); + } + else{ + userVars[kCosTheta_pim] = angles_piminus_GJ_rho.CosTheta(); + userVars[kSinSqTheta_pim] = sin(angles_piminus_GJ_rho.Theta())*sin(angles_piminus_GJ_rho.Theta()); + userVars[kSin2Theta_pim] = sin(2.*angles_piminus_GJ_rho.Theta()); + userVars[kPhi_pim] = angles_piminus_GJ_rho.Phi(); + + userVars[kCosTheta_proton] = angles_proton_GJ_Delta.CosTheta(); + userVars[kSinSqTheta_proton] = sin(angles_proton_GJ_Delta.Theta())*sin(angles_proton_GJ_Delta.Theta()); + userVars[kSin2Theta_proton] = sin(2.*angles_proton_GJ_Delta.Theta()); + userVars[kPhi_proton] = angles_proton_GJ_Delta.Phi(); + } + TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); + userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); + + // vector meson production from K. Schilling et. al. + GDouble Pgamma; + if(polFraction > 0.) { // for fitting with constant polarization + Pgamma = polFraction; + } + // else{ + // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); + // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ + // Pgamma = 0.; + // } + // else Pgamma = polFrac_vs_E->GetBinContent(bin); + // } + userVars[kPgamma] = Pgamma; + +} + +#ifdef GPU_ACCELERATION +void +TwoPiAngles_Delta_DoubleSDMEs_unpol::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { + + GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_exec( dimGrid, dimBlock, GPU_AMP_ARGS, + r00_33_0, //r00_11_0, + r11_33_0, r11_11_0, + r1m1_33_0, r1m1_11_0, + r10_33_0, r10_11_0, + r00_31_0, r00_3m1_0, + r11_31_0, r11_3m1_0, + r1m1_31_0, r1m1_3m1_0, + r10_31_0, r10_3m1_0, + rt1m1_31_0, rt1m1_3m1_0, + rt10_31_0, rt10_3m1_0 +); +} +#endif //GPU_ACCELERATION \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h new file mode 100755 index 000000000..d8697cdf9 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h @@ -0,0 +1,109 @@ +#if !defined(TWOPIANGLES_DELTA_DOUBLESDMES_UNPOL) +#define TWOPIANGLES_DELTA_DOUBLESDMES_UNPOL + +#include "IUAmpTools/Amplitude.h" +#include "IUAmpTools/UserAmplitude.h" +#include "IUAmpTools/AmpParameter.h" +#include "GPUManager/GPUCustomTypes.h" + +#include "TH1D.h" +#include +#include +#include + +#ifdef GPU_ACCELERATION +void +GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, +GDouble r00_33_0, //GDouble r00_11_0 +GDouble r11_33_0, GDouble r11_11_0, +GDouble r1m1_33_0, GDouble r1m1_11_0, +GDouble r10_33_0, GDouble r10_11_0, +GDouble r00_31_0, GDouble r00_3m1_0, +GDouble r11_31_0, GDouble r11_3m1_0, +GDouble r1m1_31_0, GDouble r1m1_3m1_0, +GDouble r10_31_0, GDouble r10_3m1_0, +GDouble rt1m1_31_0, GDouble rt1m1_3m1_0, +GDouble rt10_31_0, GDouble rt10_3m1_0 + +); + +#endif // GPU_ACCELERATION + +using std::complex; +using namespace std; + +class Kinematics; + +class TwoPiAngles_Delta_DoubleSDMEs_unpol : public UserAmplitude< TwoPiAngles_Delta_DoubleSDMEs_unpol > +{ + +public: + + TwoPiAngles_Delta_DoubleSDMEs_unpol() : UserAmplitude< TwoPiAngles_Delta_DoubleSDMEs_unpol >() { }; + TwoPiAngles_Delta_DoubleSDMEs_unpol( const vector< string >& args ); + + enum UserVars { kPgamma = 0, kCosTheta_pim, kSinSqTheta_pim, kSin2Theta_pim, kPhi_pim, kCosTheta_proton, kSinSqTheta_proton, kSin2Theta_proton, kPhi_proton, + kBigPhi, kNumUserVars }; + unsigned int numUserVars() const { return kNumUserVars; } + + string name() const { return "TwoPiAngles_Delta_DoubleSDMEs_unpol"; } + + complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; + void calcUserVars( GDouble** pKin, GDouble* userVars ) const; + + // we can calcualte everythign we need from userVars block so allow + // the framework to purge the four-vectors + bool needsUserVarsOnly() const { return true; } + +#ifdef GPU_ACCELERATION + + void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; + bool isGPUEnabled() const { return true; } + +#endif // GPU_ACCELERATION + +private: + + AmpParameter r00_33_0; + // AmpParameter r00_11_0; + + AmpParameter r11_33_0; + AmpParameter r11_11_0; + + AmpParameter r1m1_33_0; + AmpParameter r1m1_11_0; + + AmpParameter r10_33_0; + AmpParameter r10_11_0; + + // \bar W^0 (31 / 3-1) + + AmpParameter r00_31_0; + AmpParameter r00_3m1_0; + + AmpParameter r11_31_0; + AmpParameter r11_3m1_0; + + AmpParameter r1m1_31_0; + AmpParameter r1m1_3m1_0; + + AmpParameter r10_31_0; + AmpParameter r10_3m1_0; + + // \tilde W^0 + + AmpParameter rt1m1_31_0; + AmpParameter rt1m1_3m1_0; + + AmpParameter rt10_31_0; + AmpParameter rt10_3m1_0; + + AmpParameter polAngle; + + double polFraction; + //TH1D *polFrac_vs_E; + string frame; + string AMO; +}; + +#endif diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc new file mode 100755 index 000000000..eb404a7a1 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc @@ -0,0 +1,333 @@ +#include +#include +#include +#include +#include + +#include "TLorentzVector.h" +#include "TLorentzRotation.h" +#include "TFile.h" + +#include "IUAmpTools/Kinematics.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h" +#include "AMPTOOLS_AMPS/clebschGordan.h" +#include "AMPTOOLS_AMPS/wignerD.h" + +TwoPiAngles_Delta_factorized::TwoPiAngles_Delta_factorized( const vector< string >& args ) : + UserAmplitude< TwoPiAngles_Delta_factorized >( args ) +{ + +// assert(args.size() == 22 || args.size() == 23 || args.size() == 24 ); +frame = string( args[0] ); +polAngle = AmpParameter( args[1] ); + +polFraction = atof(args[2].c_str()); +cout << "Fitting with constant polarization " << polFraction << endl; + +rho000 = AmpParameter( args[3] ); +rho100 = AmpParameter( args[4] ); +rho1m10 = AmpParameter( args[5] ); +rho111 = AmpParameter( args[6] ); + +rho101 = AmpParameter( args[7] ); +rho1m11 = AmpParameter( args[8] ); +rho102 = AmpParameter( args[9] ); +rho1m12 = AmpParameter( args[10] ); + +delta_rho011 = AmpParameter( args[11] ); +delta_rho031 = AmpParameter( args[12] ); +delta_rho03m1 = AmpParameter( args[13] ); +rho001 = AmpParameter( args[14] ); +// delta_rho111 = AmpParameter( args[14] ); +// delta_rho133 = AmpParameter( args[15] ); +// delta_rho131 = AmpParameter( args[16] ); +// delta_rho13m1 = AmpParameter( args[17] ); + +// delta_rho231 = AmpParameter( args[18] ); +// delta_rho23m1 = AmpParameter( args[19] ); + +registerParameter( rho000 ); +registerParameter( rho100 ); +registerParameter( rho1m10 ); + +registerParameter( rho111 ); +registerParameter( rho101 ); +registerParameter( rho1m11 ); + +registerParameter( rho102 ); +registerParameter( rho1m12 ); +registerParameter( delta_rho011 ); +registerParameter( delta_rho031 ); +registerParameter( delta_rho03m1 ); +registerParameter( rho001 ); +// registerParameter( delta_rho111 ); +// registerParameter( delta_rho133 ); +// registerParameter( delta_rho131 ); +// registerParameter( delta_rho13m1 ); + +// registerParameter( delta_rho231 ); +// registerParameter( delta_rho23m1 ); + +//new parameter try + +registerParameter( polAngle ); + + // } + // Two possibilities to initialize this amplitude: + // 1: 11 arguments, fixed polarization + // Usage: amplitude :::: TwoPiAngles ... + + // 2: 12 arguments, read polarization from histogram in file + // Usage: amplitude :::: TwoPiAngles ... +// else if(args.size() == 13) { +// polFraction = 0.; +// TFile* f = new TFile( args[11].c_str() ); +// polFrac_vs_E = (TH1D*)f->Get( args[12].c_str() ); +// assert( polFrac_vs_E != NULL ); +// cout << "Fitting with polarization from " << polFrac_vs_E->GetName() << endl; +// } +// +} + + +complex< GDouble > +TwoPiAngles_Delta_factorized::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { + + +//GDouble bigPhi = polAngle*0.017453293 + userVars[kBigPhi]; // rotate Phi (in rad) +GDouble bigPhi = userVars[kBigPhi]; +GDouble Pgamma = userVars[kPgamma]; +GDouble cosTheta_pim = userVars[kCosTheta_pim]; +GDouble sinSqTheta_pim = userVars[kSinSqTheta_pim]; +GDouble sin2Theta_pim = userVars[kSin2Theta_pim]; +GDouble phi_pim = userVars[kPhi_pim]; +GDouble cosTheta_piplus = userVars[kCosTheta_piplus]; +GDouble sinSqTheta_piplus = userVars[kSinSqTheta_piplus]; +GDouble sin2Theta_piplus = userVars[kSin2Theta_piplus]; +GDouble phi_piplus = userVars[kPhi_piplus]; + + + // vector meson production from K. Schilling et. al. last indize = upper + + + +// GDouble rho001_val; +// rho001_val = 2*(delta_rho111 + delta_rho133 - rho111); +// Use beam assy. to eliminate one parameter + +GDouble W0_meson = 3.*(0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta_pim*cosTheta_pim - sqrt(2.)*rho100*sin2Theta_pim*cos(phi_pim) - rho1m10*sinSqTheta_pim*cos(2.*phi_pim)); +GDouble W1_meson= 3.*(rho111*sinSqTheta_pim + rho001*cosTheta_pim*cosTheta_pim - sqrt(2.)*rho101*sin2Theta_pim*cos(phi_pim) - rho1m11*sinSqTheta_pim*cos(2.*phi_pim)); +GDouble W2_meson = 3. * (sqrt(2.)*rho102*sin2Theta_pim*sin(phi_pim) + rho1m12*sinSqTheta_pim*sin(2.*phi_pim)); + +GDouble W0_baryon = 3.*(0.5 - delta_rho011)*sinSqTheta_piplus + delta_rho011*(1.+3.*cosTheta_piplus*cosTheta_piplus) - 2.*TMath::Sqrt(3.)*delta_rho031*cos(phi_piplus)*sin2Theta_piplus - 2.*TMath::Sqrt(3.)*delta_rho03m1*cos(2.*phi_piplus)*sinSqTheta_piplus; +// GDouble W1_baryon = (3.*delta_rho133*sinSqTheta_piplus + delta_rho111*(1.+3.*cosTheta_piplus*cosTheta_piplus) - 2.*TMath::Sqrt(3.)*delta_rho131*cos(phi_piplus)*sin2Theta_piplus - 2.*TMath::Sqrt(3.)*delta_rho13m1*cos(2.*phi_piplus)*sinSqTheta_piplus); +// GDouble W2_baryon = (2.*TMath::Sqrt(3.)*delta_rho231*sin(phi_piplus)*sin2Theta_piplus + 2.*TMath::Sqrt(3.)*delta_rho23m1*sin(2.*phi_piplus)*sinSqTheta_piplus); + +// GDouble Wpol = W0_meson*W0_baryon - Pgamma * cos(2.0 * bigPhi) * W1_meson * W1_baryon - Pgamma * sin(2.0 * bigPhi) * W2_meson * W2_baryon; + +// GDouble Wpol = W0_meson*W0_baryon -( Pgamma * cos(2.0 * bigPhi) * W1_meson + Pgamma * sin(2.0 * bigPhi) * W2_meson) * (W1_baryon + W2_baryon); +// //Just another tests!!!!!! + +// GDouble Wpol = W0_meson*W0_baryon -( Pgamma * cos(2.0 * bigPhi) * W1_meson + Pgamma * sin(2.0 * bigPhi) * W2_meson) * (W1_baryon + W2_baryon); + +// //Just another test +GDouble Wpol = W0_meson*W0_baryon - Pgamma * cos(2.0 * bigPhi) *( W1_meson*W0_baryon) - Pgamma * sin(2.0 * bigPhi) *( W2_meson*W0_baryon); +// GDouble Wpol = (W0_meson - Pgamma * cos(2.0 * bigPhi) * W1_meson - Pgamma * sin(2.0 * bigPhi) * W2_meson )*(W0_baryon - Pgamma * cos(2.0 * bigPhi) * W1_baryon - Pgamma * sin(2.0 * bigPhi) * W2_baryon); +Wpol *= 1/(4.*PI); + + + +return complex< GDouble > ( sqrt(fabs(Wpol)) ); +} + +void +TwoPiAngles_Delta_factorized::calcUserVars( GDouble** pKin, GDouble* userVars ) const { + + TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); + TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); + TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); // pip + TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); // pim + TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); // pi0 + TLorentzVector target ( 0, 0, 0, 0.9382720813); + // determine boost vectors + TLorentzVector resonance = p2 + p3; + TLorentzVector recoil = proton + p1; + TLorentzVector rho = p2 + p3; + TLorentzVector Delta = proton + p1; + TLorentzVector CM_motion_lab = beam + target; + TLorentzVector piminus = p2; + + TLorentzRotation resonanceBoost( -resonance.BoostVector() ); + + TLorentzRotation rhoBoost( -rho.BoostVector() ); + TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); + TLorentzRotation DeltaBoost( -Delta.BoostVector() ); + + + + //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); + //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose helicity frame: z-axis opposite recoil Delta in rho rest frame +//bost in rho restframe + TLorentzVector beam_resrho = rhoBoost * beam; + TLorentzVector Delta_resrho = rhoBoost * Delta; + TLorentzVector piminus_resrho = rhoBoost * piminus; + TLorentzVector proton_resrho = rhoBoost * proton; +//boost in CM frame + TLorentzVector beam_cm = CMBoost * beam; + TLorentzVector Delta_cm = CMBoost * Delta; + TLorentzVector piminus_cm = CMBoost * piminus; + TLorentzVector rho_cm = CMBoost * rho; + +//boost in recoil frame + TLorentzVector target_resDelta = DeltaBoost * target; + TLorentzVector proton_resDelta = DeltaBoost * proton; + TLorentzVector piplus_resDelta = DeltaBoost * p1; + TLorentzVector rho_resDelta = DeltaBoost * rho; + + // Define coordinate systems: + // y equal in all frames + TVector3 y = (beam.Vect().Unit().Cross(-Delta.Vect().Unit())).Unit(); + + //rho system + + //Helicity frame + TVector3 z_hel_rho = -1. * Delta_resrho.Vect().Unit(); + TVector3 x_hel_rho = y.Cross(z_hel_rho).Unit(); + + // GJ frame + + TVector3 z_GJ_rho = beam_resrho.Vect().Unit(); + TVector3 x_GJ_rho = y.Cross(z_GJ_rho).Unit(); + + //Delta system + + // Helicity frame + TVector3 z_hel_Delta = -rho_resDelta.Vect().Unit(); + TVector3 x_hel_Delta = (y.Cross(z_hel_Delta)).Unit(); + + // GJ frame + TVector3 z_GJ_Delta = target_resDelta.Vect().Unit(); + TVector3 x_GJ_Delta = y.Cross(z_GJ_Delta).Unit(); + + // normal to the production plane + + //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); + //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + //rho rest frame + // choose helicity frame: z-axis opposite recoil Delta in rho rest frame + //helicity frame + + + + //Angle calculation + TVector3 angles_piminus_hel_rho( (piminus_resrho.Vect()).Dot(x_hel_rho), + (piminus_resrho.Vect()).Dot(y), + (piminus_resrho.Vect()).Dot(z_hel_rho) ); + + TVector3 angles_piminus_GJ_rho( (piminus_resrho.Vect()).Dot(x_GJ_rho), + (piminus_resrho.Vect()).Dot(y), + (piminus_resrho.Vect()).Dot(z_GJ_rho) ); + + + + TVector3 angles_proton_hel_Delta( (proton_resDelta.Vect()).Dot(x_hel_Delta), + (proton_resDelta.Vect()).Dot(y), + (proton_resDelta.Vect()).Dot(z_hel_Delta) ); + TVector3 angles_piplus_hel_Delta( (piplus_resDelta.Vect()).Dot(x_hel_Delta), + (piplus_resDelta.Vect()).Dot(y), + (piplus_resDelta.Vect()).Dot(z_hel_Delta) ); + + TVector3 angles_proton_GJ_Delta( (piplus_resDelta.Vect()).Dot(x_GJ_Delta), + (proton_resDelta.Vect()).Dot(y), + (proton_resDelta.Vect()).Dot(z_GJ_Delta) ); + + TVector3 angles_piplus_GJ_Delta( (piplus_resDelta.Vect()).Dot(x_GJ_Delta), + (piplus_resDelta.Vect()).Dot(y), + (piplus_resDelta.Vect()).Dot(z_GJ_Delta) ); + + + + + + + + + + + + + // // normal to the production plane + // TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame + + + + if(frame=="Hel"){ + + userVars[kCosTheta_pim] = angles_piminus_hel_rho.CosTheta(); + userVars[kSinSqTheta_pim] = sin(angles_piminus_hel_rho.Theta())*sin(angles_piminus_hel_rho.Theta()); + userVars[kSin2Theta_pim] = sin(2.*angles_piminus_hel_rho.Theta()); + userVars[kPhi_pim] = angles_piminus_hel_rho.Phi(); + + userVars[kCosTheta_piplus] = angles_proton_hel_Delta.CosTheta(); + userVars[kSinSqTheta_piplus] = sin(angles_proton_hel_Delta.Theta())*sin(angles_proton_hel_Delta.Theta()); + userVars[kSin2Theta_piplus] = sin(2.*angles_proton_hel_Delta.Theta()); + userVars[kPhi_piplus] = angles_proton_hel_Delta.Phi(); + } + else{ + userVars[kCosTheta_pim] = angles_piminus_GJ_rho.CosTheta(); + userVars[kSinSqTheta_pim] = sin(angles_piminus_GJ_rho.Theta())*sin(angles_piminus_GJ_rho.Theta()); + userVars[kSin2Theta_pim] = sin(2.*angles_piminus_GJ_rho.Theta()); + userVars[kPhi_pim] = angles_piminus_GJ_rho.Phi(); + userVars[kCosTheta_piplus] = angles_piplus_GJ_Delta.CosTheta(); + userVars[kSinSqTheta_piplus] = sin(angles_piplus_GJ_Delta.Theta())*sin(angles_piplus_GJ_Delta.Theta()); + userVars[kSin2Theta_piplus] = sin(2.*angles_piplus_GJ_Delta.Theta()); + userVars[kPhi_piplus] = angles_piplus_GJ_Delta.Phi(); + + // userVars[kCosTheta_proton] = angles_proton_GJ_Delta.CosTheta(); + // userVars[kSinSqTheta_proton] = sin(angles_proton_GJ_Delta.Theta())*sin(angles_proton_GJ_Delta.Theta()); + // userVars[kSin2Theta_proton] = sin(2.*angles_proton_GJ_Delta.Theta()); + // userVars[kPhi_proton] = angles_proton_GJ_Delta.Phi(); + } + TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); + userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); + + // vector meson production from K. Schilling et. al. + GDouble Pgamma; + if(polFraction > 0.) { // for fitting with constant polarization + Pgamma = polFraction; + } + // else{ + // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); + // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ + // Pgamma = 0.; + // } + // else Pgamma = polFrac_vs_E->GetBinContent(bin); + // } + userVars[kPgamma] = Pgamma; + +} + +#ifdef GPU_ACCELERATION +void +TwoPiAngles_Delta_factorized::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { + + GPUTwoPiAngles_Delta_factorized_exec( dimGrid, dimBlock, GPU_AMP_ARGS, + rho000, + rho100, + rho1m10, + rho111, + rho101, + rho1m11, + rho102, + rho1m12, + delta_rho011, + delta_rho031, + delta_rho03m1, + rho001 +); +} +#endif //GPU_ACCELERATION \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h new file mode 100755 index 000000000..1f0c4e2a5 --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h @@ -0,0 +1,97 @@ +#if !defined(TWOPIANGLES_DELTA_FACTORIZED) +#define TWOPIANGLES_DELTA_FACTORIZED + +#include "IUAmpTools/Amplitude.h" +#include "IUAmpTools/UserAmplitude.h" +#include "IUAmpTools/AmpParameter.h" +#include "GPUManager/GPUCustomTypes.h" + +#include "TH1D.h" +#include +#include +#include + +#ifdef GPU_ACCELERATION +void +GPUTwoPiAngles_Delta_factorized_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble rho000, + GDouble rho100, + GDouble rho1m10, + GDouble rho111, + GDouble rho101, + GDouble rho1m11, + GDouble rho102, + GDouble rho1m12, + GDouble delta_rho011, + GDouble delta_rho031, + GDouble delta_rho03m1, + GDouble rho001 +); + +#endif // GPU_ACCELERATION + +using std::complex; +using namespace std; + +class Kinematics; + +class TwoPiAngles_Delta_factorized : public UserAmplitude< TwoPiAngles_Delta_factorized > +{ + +public: + + TwoPiAngles_Delta_factorized() : UserAmplitude< TwoPiAngles_Delta_factorized >() { }; + TwoPiAngles_Delta_factorized( const vector< string >& args ); + + enum UserVars { kPgamma = 0, kCosTheta_pim, kSinSqTheta_pim, kSin2Theta_pim, kPhi_pim, kCosTheta_piplus, kSinSqTheta_piplus, kSin2Theta_piplus, kPhi_piplus, + kBigPhi, kNumUserVars }; + unsigned int numUserVars() const { return kNumUserVars; } + + string name() const { return "TwoPiAngles_Delta_factorized"; } + + complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; + void calcUserVars( GDouble** pKin, GDouble* userVars ) const; + + // we can calcualte everythign we need from userVars block so allow + // the framework to purge the four-vectors + bool needsUserVarsOnly() const { return true; } + +#ifdef GPU_ACCELERATION + + void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; + bool isGPUEnabled() const { return true; } + +#endif // GPU_ACCELERATION + +private: + +AmpParameter rho000; +AmpParameter rho100; +AmpParameter rho1m10; + +AmpParameter rho111; +AmpParameter rho101; +AmpParameter rho1m11; + +AmpParameter rho102; +AmpParameter rho1m12; +AmpParameter delta_rho011; +AmpParameter delta_rho031; +AmpParameter delta_rho03m1; + +// AmpParameter delta_rho111; +// AmpParameter delta_rho133; +// AmpParameter delta_rho131; +// AmpParameter delta_rho13m1; + +// AmpParameter delta_rho231; +// AmpParameter delta_rho23m1; +AmpParameter rho001; +AmpParameter polAngle; + + double polFraction; + //TH1D *polFrac_vs_E; + string frame; +}; + +#endif diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.cc new file mode 100755 index 000000000..19cfc6e6c --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.cc @@ -0,0 +1,198 @@ + +#include +#include +#include +#include +#include + +#include "TLorentzVector.h" +#include "TLorentzRotation.h" +#include "TFile.h" + +#include "IUAmpTools/Kinematics.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h" +#include "AMPTOOLS_AMPS/clebschGordan.h" +#include "AMPTOOLS_AMPS/wignerD.h" + +TwoPiAngles_Delta_only_upperv::TwoPiAngles_Delta_only_upperv( const vector< string >& args ) : + UserAmplitude< TwoPiAngles_Delta_only_upperv >( args ) +{ + assert(args.size() == 12 || args.size() == 13 || args.size() == 14 ); + + rho000 = AmpParameter( args[0] ); + rho100 = AmpParameter( args[1] ); + rho1m10 = AmpParameter( args[2] ); + rho111 = AmpParameter( args[3] ); + rho001 = AmpParameter( args[4] ); + rho101 = AmpParameter( args[5] ); + rho1m11 = AmpParameter( args[6] ); + rho102 = AmpParameter( args[7] ); + rho1m12 = AmpParameter( args[8] ); + frame = string( args[9] ); + polAngle = AmpParameter( args[10] ); + + + + // need to register any free parameters so the framework knows about them + registerParameter( rho000 ); + registerParameter( rho100 ); + registerParameter( rho1m10 ); + + registerParameter( rho111 ); + registerParameter( rho001 ); + // if(args.size() == 12){ + // registerParameter( rho001 ); + // } + registerParameter( rho101 ); + registerParameter( rho1m11 ); + + registerParameter( rho102 ); + registerParameter( rho1m12 ); + + //new parameter try + + registerParameter( polAngle ); + + // } + // Two possibilities to initialize this amplitude: + // 1: 11 arguments, fixed polarization + // Usage: amplitude :::: TwoPiAngles ... + if(args.size() == 13 || args.size() == 12) { + polFraction = atof(args[11].c_str()); + cout << "Fitting with constant polarization " << polFraction << endl; + } + // 2: 12 arguments, read polarization from histogram in file + // Usage: amplitude :::: TwoPiAngles ... +// else if(args.size() == 13) { +// polFraction = 0.; +// TFile* f = new TFile( args[11].c_str() ); +// polFrac_vs_E = (TH1D*)f->Get( args[12].c_str() ); +// assert( polFrac_vs_E != NULL ); +// cout << "Fitting with polarization from " << polFrac_vs_E->GetName() << endl; +// } +// +} + + +complex< GDouble > +TwoPiAngles_Delta_only_upperv::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { + + GDouble sinSqTheta = userVars[kSinSqTheta]; + GDouble sin2Theta = userVars[kSin2Theta]; + GDouble cosTheta = userVars[kCosTheta]; + GDouble phi = userVars[kPhi]; + //GDouble bigPhi = polAngle*0.017453293 + userVars[kBigPhi]; // rotate Phi (in rad) + GDouble bigPhi = userVars[kBigPhi]; + GDouble Pgamma = userVars[kPgamma]; + + // vector meson production from K. Schilling et. al. last indize = upper + + + // Use beam assy. to eliminate one parameter + + GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); + + W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); + + W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); + + W *= 3./(4.*PI); + + return complex< GDouble > ( sqrt(fabs(W)) ); +} + +void +TwoPiAngles_Delta_only_upperv::calcUserVars( GDouble** pKin, GDouble* userVars ) const { + + TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); + TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); + TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); + TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); + TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); + TLorentzVector target ( 0, 0, 0, 0.9382720813); + + TLorentzVector resonance = p2 + p3; + TLorentzVector recoil = proton + p1; + TLorentzVector CM_motion_lab = beam + target; + TLorentzRotation resonanceBoost( -resonance.BoostVector() ); + TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); + + + + TLorentzVector beam_res = resonanceBoost * beam; + TLorentzVector recoil_res = resonanceBoost * recoil; + TLorentzVector p2_res = resonanceBoost * p2; + TLorentzVector beam_cm = CMBoost * beam; + TLorentzVector recoil_cm = CMBoost * recoil; + TLorentzVector p2_cm = CMBoost * p2; + TLorentzVector resonance_cm = CMBoost * resonance; + + + // normal to the production plane + TVector3 y = (beam.Vect().Unit().Cross(-recoil.Vect().Unit())).Unit(); + //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); + //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose helicity frame: z-axis opposite recoil Delta in rho rest frame + TVector3 z = -1. * recoil_res.Vect().Unit(); + TVector3 x = y.Cross(z).Unit(); + TVector3 angles( (p2_res.Vect()).Dot(x), + (p2_res.Vect()).Dot(y), + (p2_res.Vect()).Dot(z) ); + + //// Calculation angles GFJ frame + + + + // normal to the production plane + TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame + TVector3 z_GFJ = beam_res.Vect().Unit(); + TVector3 x_GFJ = y_GFJ.Cross(z_GFJ).Unit(); + TVector3 angles_GFJ( (p2_res.Vect()).Dot(x_GFJ), + (p2_res.Vect()).Dot(y_GFJ), + (p2_res.Vect()).Dot(z_GFJ) ); + + if(frame=="Hel"){ + userVars[kCosTheta] = angles.CosTheta(); + userVars[kSinSqTheta] = sin(angles.Theta())*sin(angles.Theta()); + userVars[kSin2Theta] = sin(2.*angles.Theta()); + userVars[kPhi] = angles.Phi(); + } + else{ + userVars[kCosTheta] = angles_GFJ.CosTheta(); + userVars[kSinSqTheta] = sin(angles_GFJ.Theta())*sin(angles_GFJ.Theta()); + userVars[kSin2Theta] = sin(2.*angles_GFJ.Theta()); + userVars[kPhi] = angles_GFJ.Phi(); + } + TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); + userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); + + // vector meson production from K. Schilling et. al. + GDouble Pgamma; + if(polFraction > 0.) { // for fitting with constant polarization + Pgamma = polFraction; + } + // else{ + // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); + // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ + // Pgamma = 0.; + // } + // else Pgamma = polFrac_vs_E->GetBinContent(bin); + // } + userVars[kPgamma] = Pgamma; +} + +#ifdef GPU_ACCELERATION +void +TwoPiAngles_Delta_only_upperv::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { + + GPUTwoPiAngles_Delta_only_upperv_exec( dimGrid, dimBlock, GPU_AMP_ARGS, + rho000, rho100, rho1m10, + rho111, rho001, rho101, + rho1m11, rho102, rho1m12, + polAngle); +} + +#endif //GPU_ACCELERATION \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h new file mode 100755 index 000000000..490f82a7b --- /dev/null +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h @@ -0,0 +1,79 @@ +#if !defined(TWOPIANGLES_DELTA_only_upperv) +#define TWOPIANGLES_DELTA_only_upperv + +#include "IUAmpTools/Amplitude.h" +#include "IUAmpTools/UserAmplitude.h" +#include "IUAmpTools/AmpParameter.h" +#include "GPUManager/GPUCustomTypes.h" + +#include "TH1D.h" +#include +#include +#include + +#ifdef GPU_ACCELERATION +void +GPUTwoPiAngles_Delta_only_upperv_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, + GDouble rho000, GDouble rho100, GDouble rho1m10, + GDouble rho111, GDouble rho001, GDouble rho101, + GDouble rho1m11, GDouble rho102, GDouble rho1m12, + GDouble polAngle); + +#endif // GPU_ACCELERATION + +using std::complex; +using namespace std; + +class Kinematics; + +class TwoPiAngles_Delta_only_upperv : public UserAmplitude< TwoPiAngles_Delta_only_upperv > +{ + +public: + + TwoPiAngles_Delta_only_upperv() : UserAmplitude< TwoPiAngles_Delta_only_upperv >() { }; + TwoPiAngles_Delta_only_upperv( const vector< string >& args ); + + enum UserVars { kPgamma = 0, kCosTheta, kSinSqTheta, kSin2Theta, + kBigPhi, kPhi, kNumUserVars }; + unsigned int numUserVars() const { return kNumUserVars; } + + string name() const { return "TwoPiAngles_Delta_only_upperv"; } + + complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; + void calcUserVars( GDouble** pKin, GDouble* userVars ) const; + + // we can calcualte everythign we need from userVars block so allow + // the framework to purge the four-vectors + bool needsUserVarsOnly() const { return true; } + +#ifdef GPU_ACCELERATION + + void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; + bool isGPUEnabled() const { return true; } + +#endif // GPU_ACCELERATION + +private: + + AmpParameter rho000; + AmpParameter rho100; + AmpParameter rho1m10; + + AmpParameter rho111; + AmpParameter rho001; + AmpParameter rho101; + AmpParameter rho1m11; + + AmpParameter rho102; + AmpParameter rho1m12; + + AmpParameter polAngle; + + double polFraction; + //TH1D *polFrac_vs_E; + string frame; + +}; + +#endif diff --git a/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.cc b/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.cc new file mode 100755 index 000000000..1d11edc7b --- /dev/null +++ b/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.cc @@ -0,0 +1,288 @@ +#include "TLorentzVector.h" +#include "TLorentzRotation.h" +#include "TLorentzVector.h" +#include "TLorentzRotation.h" + +#include "AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h" +#include "IUAmpTools/Histogram1D.h" +#include "IUAmpTools/Kinematics.h" +#include "IUAmpTools/FitResults.h" + +TwoPiDeltaPlotGenerator::TwoPiDeltaPlotGenerator( const FitResults& results ) : +PlotGenerator( results ) +{ + + vector< string > reactionVec = reactions(); + for( auto reac = reactionVec.begin(); reac != reactionVec.end(); ++reac ){ + + // obtain the polarization angle for this reaction by getting the list of amplitudes + // associated with this reaction -- we know all are SDME amplitudes + // take the 1th argument of the first factor of the first amplitude in the first sum + string ampArgument = { cfgInfo()->amplitudeList( *reac, "", "" ).at(0)->factors().at(0).at(1) }; + + // pick out the name of the parameter + // string parName = ampArgument.substr(1,ampArgument.length()-2); + + // // here results is of type FitResults which is passed into the constructor of the plot generator + // //cout << "Angle " << results.parValue( parName ) << endl; + // m_reactionAngleMap[*reac] = results.parValue( parName ); + + + double polAngle = atof(ampArgument.c_str()); + m_reactionAngleMap[*reac] = polAngle; + cout << "Angle " << polAngle << endl; + + + } +// for( auto reac = reactionVec.begin(); reac != reactionVec.end(); ++reac ){ + +// string ampArgument = { cfgInfo()->amplitudeList( *reac, "", "" ).at(0)->factors().at(0).at(10) }; +// string parName = ampArgument.substr(1,ampArgument.length()-2); + +// m_reactionAngleMap[*reac] = results.parValue( parName ); +// } + + +for(const auto& entry : m_reactionAngleMap){ + cout << "DEBUG: Reaction in map: " << entry.first + << " with angle: " << entry.second << endl; +} + + createHistograms(); +} + +TwoPiDeltaPlotGenerator::TwoPiDeltaPlotGenerator( ) : +PlotGenerator( ) +{ + createHistograms(); +} + +void TwoPiDeltaPlotGenerator::createHistograms() { + // calls to bookHistogram go here + + bookHistogram( k2PiMass, new Histogram1D( 50, 0.6, 0.95, "M2pi", "M(#pi^{0} #pi^{-}) (GeV)") ); + bookHistogram( kPPipMass, new Histogram1D( 50, 1.1, 1.4, "Mppip", "M(p#pi^{+} )(GeV)") ); + + bookHistogram( kPipPimMass, new Histogram1D( 100, 0.2, 2.5, "Mpippim", "M(#pi^{+}#pi^{-} )(GeV)") ); + bookHistogram( kPPi0Mass, new Histogram1D( 100, 1, 4.5, "Mppi0", "M(p#pi^{0}) (GeV)") ); + bookHistogram( kPipPi0Mass, new Histogram1D( 100, 0.1, 2.5, "Mpippi0", "M(#pi^{+}#pi^{0}) (GeV)") ); + + bookHistogram( kPPimMass, new Histogram1D( 100, 1, 4.5, "Mppim", "M( p#pi^{-}) (GeV)") ); + bookHistogram( kPi0PimMass, new Histogram1D( 100, 0.1, 1.5, "Mpi0pim", "M(#pi^{0}#pi^{-}) (GeV)") ); + bookHistogram( kPPipPimMass, new Histogram1D( 100, 1, 4.5, "Mppippim", "M(p#pi^{-}#pi^{+})(GeV)") ); + bookHistogram( kPPipPi0Mass, new Histogram1D( 100, 1, 4.5, "Mppippi0", "M( p#pi^{+}#pi^{0}) (GeV)") ); + bookHistogram( kPPimPi0Mass, new Histogram1D( 100, 2.5, 4.5, "Mppimpi0", "M( p#pi^{-}#pi^{0}) (GeV)") ); + bookHistogram( kPipPi0PimMass, new Histogram1D( 100, 0.5, 4.5, "Mpippi0pim", "M( #pi^{-}#pi^{0}#pi^{+}) (GeV)") ); + bookHistogram( kPPipPimMass, new Histogram1D( 100, 1, 4.5, "Mppippim", "M( p#pi^{-}#pi^{+}) (GeV)") ); + bookHistogram( kCosTheta_HF_rho, new Histogram1D( 60, -1., 1., "cosTheta_HF_rho", "cos( #theta_{#pi^{-}} ) in HF (restframe #rho)") ); + bookHistogram( kCosTheta_GFJ_rho, new Histogram1D( 60, -1., 1., "cosTheta_GFJ_rho", "cos( #theta_{#pi^{-}} ) in GJ (restframe #rho)") ); + bookHistogram( kCosTheta_GFJ_Delta, new Histogram1D( 60, -1., 1., "cosTheta_GFJ_Delta", "cos( #theta_{#pi^{+}} ) in GJ (restframe #Delta)") ); + bookHistogram( kCosTheta_HF_Delta, new Histogram1D( 60, -1., 1., "cosTheta_HF_Delta", "cos( #theta_{#pi^{+}} ) in HF (restframe #Delta)") ); + bookHistogram( kPhiPiPlus, new Histogram1D( 180, -180, 180, "PhiPiPlus", "#Phi_{#pi^{+}}" ) ); + bookHistogram( kPhiPiMinus, new Histogram1D( 180, -180, 180, "PhiPiMinus", "#Phi_{#pi^{-}}" ) ); + bookHistogram( kPhiProton, new Histogram1D( 180, -180, 180, "PhiProton", "#Phi_{p}" ) ); + bookHistogram( kThetaPiPlus, new Histogram1D( 200, 0, 20, "ThetaPiPlus", "#Theta_{#pi^{+}}" ) ); + bookHistogram( kThetaPiMinus, new Histogram1D( 200, 0, 20, "ThetaPiMinus", "#Theta_{#pi^{-}}" ) ); + bookHistogram( kThetaDelta, new Histogram1D( 200, 50, 90, "ThetaDelta", "#Theta_{#Delta}" ) ); + bookHistogram( kMomPiPlus, new Histogram1D( 60, 0, 0.7, "MomPiPlus", "p_{#pi^{+}}" ) ); + bookHistogram( kMomPiMinus, new Histogram1D( 60, 0, 9, "MomPiMinus", "p_{#pi^{-}}" ) ); + bookHistogram( kMomPi0, new Histogram1D( 60, 0, 9, "MomPi0", "p_{#pi^{0}}" ) ); + bookHistogram( kMomProton, new Histogram1D( 180, 0, 1, "MomProton", "p_{p}" ) ); + bookHistogram( kPhi, new Histogram1D( 50, -180, 180, "Phi", "#Phi" ) ); + bookHistogram( kPhi_GFJ, new Histogram1D( 50, -180, 180, "PhiGFJ", "#Phi_{GJ}" ) ); + + bookHistogram( klongMomPiPlus, new Histogram1D( 60, 0, 0.5, "longMomPiPlus", "p_{z,#pi^{+}}" ) ); + bookHistogram( klongMomPiMinus, new Histogram1D( 60, 0, 9, "longMomPiMinus", "p_{z,#pi^{-}}" ) ); + bookHistogram( klongMomPi0, new Histogram1D( 60, 0, 9, "longMomPi0", "p_{z,#pi^{0}}" ) ); + bookHistogram( klongMomProton, new Histogram1D( 60, 0, 1.5, "longMomProton", "p_{z,p}" ) ); + + bookHistogram( kphi_HF_rho, new Histogram1D( 60, -180, 180, "phi_HF_rho", " #phi_{#pi^{-}} in HF (restframe #rho) " ) ); + bookHistogram( kphi_GFJ_rho, new Histogram1D( 60, -180, 180, "phi_GFJ_rho", "#phi_{#pi^{-}} in GJ (restframe #rho)" ) ); + bookHistogram( kphi_HF_Delta, new Histogram1D( 60, -180, 180, "phi_HF_Delta", " #phi_{#pi^{+}} in HF (restframe #Delta)" ) ); + bookHistogram( kphi_GFJ_Delta, new Histogram1D( 60, -180, 180, "phi_GFJ_Delta", "#phi_{#pi^{+}} in GJ (restframe #Delta)" ) ); + bookHistogram( kPsi, new Histogram1D( 20, -180, 180, "psi", "#psi" ) ); + bookHistogram( kt, new Histogram1D( 1000, 0, 1.4, "-t", "-t (GeV^2)" ) ); + bookHistogram( kBeamassymetrie, new Histogram1D( 100, 0.16, 0.21 , "Beamass", "#Sigma_{#rho}" ) ); + bookHistogram( kBeamassymetrie_Delta, new Histogram1D( 100, 0.16, 0.21 , "Beamass_Delta", "#Sigma_{#Delta}" ) ); + +} + +void TwoPiDeltaPlotGenerator::projectEvent( Kinematics* kin ){ + + // this function will make this class backwards-compatible with older versions + // (v0.10.x and prior) of AmpTools, but will not be able to properly obtain + // the polariation plane in the lab when multiple orientations are used + + projectEvent( kin, "" ); +} + +void TwoPiDeltaPlotGenerator::projectEvent( Kinematics* kin, const string& reactionName ){ + + double polAngle = m_reactionAngleMap[ reactionName ]; + + TLorentzVector beam = kin->particle( 0 ); + TLorentzVector proton = kin->particle( 1 ); //proton + TLorentzVector p1 = kin->particle( 2 ); //pip + TLorentzVector p2 = kin->particle( 3 ); //pim + TLorentzVector p3 = kin->particle( 4 ); //pi0 + TLorentzVector target ( 0, 0, 0, 0.9382720813); + + TLorentzVector resonance = p2 + p3; + TLorentzVector recoil = proton + p1; + TLorentzVector CM_motion_lab = beam + target; + TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); + TLorentzRotation resonanceBoost( -resonance.BoostVector() ); + + TLorentzVector recoil_res = resonanceBoost * recoil; + TLorentzVector p2_res = resonanceBoost * p2; + TLorentzVector beam_res = resonanceBoost * beam; + TLorentzVector beam_cm = CMBoost * beam; + TLorentzVector recoil_cm = CMBoost * recoil; + TLorentzVector p2_cm = CMBoost * p2; + TLorentzVector resonance_cm = CMBoost * resonance; + + // logitudinal component + + + + // normal to the production plane + TVector3 y = (beam.Vect().Unit().Cross(-recoil.Vect().Unit())).Unit(); + //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); + //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + // choose helicity frame: z-axis opposite recoil proton in rho rest frame + TVector3 z = -1. * recoil_res.Vect().Unit(); + + TVector3 x = y.Cross(z).Unit(); + TVector3 angles( (p2_res.Vect()).Dot(x), + (p2_res.Vect()).Dot(y), + (p2_res.Vect()).Dot(z) ); + + // choose GFJ frame: z-axis points in direction of beam photon in restframe + + TVector3 y_GFJ_rho = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); + + TVector3 z_GFJ_rho = beam_res.Vect().Unit(); + + TVector3 x_GFJ_rho = y_GFJ_rho.Cross(z_GFJ_rho).Unit(); + TVector3 angles_GFJ_rho( (p2_res.Vect()).Dot(x_GFJ_rho), + (p2_res.Vect()).Dot(y_GFJ_rho), + (p2_res.Vect()).Dot(z_GFJ_rho) ); + + + GDouble cosTheta = angles.CosTheta(); + GDouble phi = angles.Phi(); + + GDouble cosTheta_GFJ_rho = angles_GFJ_rho.CosTheta(); + GDouble phi_GFJ_rho = angles_GFJ_rho.Phi(); + + TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); // beam polarization vector + GDouble Phi = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); + + GDouble psi = phi - Phi; + if(psi < -1*PI) psi += 2*PI; + if(psi > PI) psi -= 2*PI; + + // compute invariant t + GDouble t = -(beam-p3-p2).M2(); + + // Calculate angles in GFJ + TLorentzVector resonance_Delta = proton + p1; //Delta + TLorentzVector piminuspi0 = p2 + p3; // rho + + + + //Restframe Delta + TLorentzRotation resonanceBoost_Delta( -resonance_Delta.BoostVector() ); + + TLorentzVector target_resDelta = resonanceBoost_Delta * target; + TLorentzVector beam_resDelta = resonanceBoost_Delta * beam; + TLorentzVector piminuspi0_resDelta = resonanceBoost_Delta * piminuspi0; + TLorentzVector p1_resDelta = resonanceBoost_Delta * p1; // piplus + + + + + + + TVector3 y_resDelta = (beam_resDelta.Vect().Unit().Cross(piminuspi0_resDelta.Vect().Unit())).Unit(); + TVector3 z_resDelta = target_resDelta.Vect().Unit(); + + TVector3 x_resDelta = y_resDelta.Cross(z_resDelta).Unit(); + + TVector3 angles_piplus_gfj( (p1_resDelta.Vect()).Dot(x_resDelta), + (p1_resDelta.Vect()).Dot(y_resDelta), + (p1_resDelta.Vect()).Dot(z_resDelta) ); + + GDouble phi_piplus_gfj = angles_piplus_gfj.Phi(); + GDouble cosTheta_piplus_gfj = angles_piplus_gfj.CosTheta(); + GDouble Phi_GFJ = atan2(y_resDelta.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y_resDelta))); // _resDelta removed behind beam + + TVector3 z_HF_Delta = -piminuspi0_resDelta.Vect().Unit(); + TVector3 y_HF_Delta = (beam_resDelta.Vect().Cross(piminuspi0_resDelta.Vect())).Unit(); + TVector3 x_HF_Delta = (y_HF_Delta.Cross(z_HF_Delta)).Unit(); + + TVector3 angles_HF_Delta( (p1_resDelta.Vect()).Dot(x_HF_Delta), + (p1_resDelta.Vect()).Dot(y_HF_Delta), + (p1_resDelta.Vect()).Dot(z_HF_Delta) ); + + GDouble phi_HF_Delta= angles_HF_Delta.Phi(); + GDouble cosTheta_HF_Delta = angles_HF_Delta.CosTheta(); + GDouble Beamassymetrie = -0.0881138417353299* 2 * sin(angles_GFJ_rho.Theta())*sin(angles_GFJ_rho.Theta()) -0.231777925342216 * angles_GFJ_rho.CosTheta() * angles_GFJ_rho.CosTheta(); + GDouble Beamassymetrie_Delta =2 * ((0.0852934984398916 * sin(angles_piplus_gfj.Theta())* sin(angles_piplus_gfj.Theta()))+0.104825277169257*(1/3 + angles_piplus_gfj.CosTheta() * angles_piplus_gfj.CosTheta())); + + + + + + + + + + + + // calls to fillHistogram go here + + fillHistogram( k2PiMass, ( resonance ).M() ); + fillHistogram( kPPipMass, ( proton+p1 ).M() ); + fillHistogram( kPPimMass, ( proton+p2 ).M() ); + fillHistogram( kPi0PimMass, ( p3+p2 ).M() ); + + fillHistogram( kCosTheta_HF_rho, cosTheta ); + fillHistogram( kCosTheta_GFJ_Delta, cosTheta_piplus_gfj ); + fillHistogram( kCosTheta_HF_Delta, cosTheta_HF_Delta ); + fillHistogram( kCosTheta_GFJ_rho, cosTheta_GFJ_rho ); + fillHistogram( kPipPimMass, (p1+p2 ).M()); + fillHistogram( kPPi0Mass, (proton+p3 ).M()); + fillHistogram( kPipPi0Mass, (p1+p3 ).M()); + + fillHistogram( kPhiPiPlus, p1.Phi()*TMath::RadToDeg() ); + fillHistogram( kPhiPiMinus, p2.Phi()*TMath::RadToDeg() ); + fillHistogram( kPhiProton, proton.Phi()*TMath::RadToDeg() ); + fillHistogram( kThetaPiPlus, p1.Theta()*TMath::RadToDeg() ); + fillHistogram( kThetaPiMinus, p2.Theta()*TMath::RadToDeg() ); + fillHistogram( kThetaDelta, recoil.Theta()*TMath::RadToDeg() ); + fillHistogram( klongMomPiPlus, p1.Pz() ); + fillHistogram( klongMomPiMinus, p2.Pz() ); + fillHistogram( klongMomPi0, p3.Pz() ); + fillHistogram( klongMomProton, proton.Pz() ); + + fillHistogram( kMomPiPlus, p1.P() ); + fillHistogram( kMomPiMinus, p2.P() ); + fillHistogram( kMomPi0, p3.P() ); + fillHistogram( kMomProton, proton.P() ); + fillHistogram( kPPipPi0Mass, ( proton + p1 + p3 ).M() ); + fillHistogram( kPipPi0PimMass, ( p1 + p3 + p2 ).M() ); + fillHistogram( kPPipPimMass, ( proton + p1 + p2 ).M() ); + fillHistogram( kPPimPi0Mass, ( proton + p2 + p3 ).M() ); + fillHistogram( kPhi, Phi*TMath::RadToDeg() ); + fillHistogram( kPhi_GFJ, Phi_GFJ*TMath::RadToDeg() ); + fillHistogram( kphi_HF_rho, phi*TMath::RadToDeg() ); + fillHistogram( kphi_GFJ_Delta, phi_piplus_gfj*TMath::RadToDeg()); + fillHistogram( kphi_HF_Delta, phi_HF_Delta*TMath::RadToDeg()); + fillHistogram( kphi_GFJ_rho, phi_GFJ_rho*TMath::RadToDeg()); + fillHistogram( kPsi, psi*TMath::RadToDeg() ); + fillHistogram( kt, t ); // fill with -t to make positive + fillHistogram( kBeamassymetrie, Beamassymetrie ); + fillHistogram( kBeamassymetrie_Delta, Beamassymetrie_Delta ); +} diff --git a/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h b/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h new file mode 100755 index 000000000..ecfb04945 --- /dev/null +++ b/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h @@ -0,0 +1,78 @@ +#if !(defined TWOPIDELTAPLOTGENERATOR) +#define TWOPIDELTAPLOTGENERATOR + +#include +#include + +#include "IUAmpTools/PlotGenerator.h" + +using namespace std; + +class FitResults; +class Kinematics; + +class TwoPiDeltaPlotGenerator : public PlotGenerator +{ + +public: + + // create an index for different histograms + enum { + k2PiMass = 0, + kPPipMass, + kPPimMass, + kPi0PimMass, + kPPipPimMass, + kPPipPi0Mass, + kPipPi0PimMass, + kPPimPi0Mass, + kPipPimMass, + kPPi0Mass, + kPipPi0Mass, + kThetaDelta, + kThetaPiPlus, + kThetaPiMinus, + kMomPiPlus, + kMomPiMinus, + klongMomPiPlus, + klongMomPiMinus, + klongMomPi0, + klongMomProton, + kMomPi0, + kMomProton, + kPhiPiPlus, + kPhiPiMinus, + kPhiProton, + kPhi, + kPhi_GFJ, + kphi_GFJ_rho, + kphi_HF_Delta, + kphi_HF_rho, + kphi_GFJ_Delta, + kPsi, + kt, + kCosTheta_GFJ_Delta, + kCosTheta_GFJ_rho, + kCosTheta_HF_Delta, + kCosTheta_HF_rho, + kBeamassymetrie, + kBeamassymetrie_Delta, + + + kNumHists + }; + + TwoPiDeltaPlotGenerator( const FitResults& results ); + TwoPiDeltaPlotGenerator( ); + + void projectEvent( Kinematics* kin ); + void projectEvent( Kinematics* kin, const string& reactionName ); + +private: + + void createHistograms(); + + map< string, double > m_reactionAngleMap; +}; + +#endif diff --git a/src/programs/AmplitudeAnalysis/SConscript b/src/programs/AmplitudeAnalysis/SConscript index 2e64c9056..8626e0f97 100644 --- a/src/programs/AmplitudeAnalysis/SConscript +++ b/src/programs/AmplitudeAnalysis/SConscript @@ -3,7 +3,7 @@ import sbms Import('*') -subdirs = ['fit', 'twopi_plotter', 'twopi_plotter_amp', 'twopi_plotter_mom', 'twopi_plotter_primakoff', 'twolepton_plotter', 'twoleptonGJ_plotter', 'split_mass', 'split_t', 'threepi_plotter_schilling', 'omega_radiative_plotter', 'project_moments', 'plot_etapi_delta', 'project_moments_polarized', 'Bootstrap_plot_etapi_delta_SPDG_allamps_mass_t_bins', 'Pol_moments_viafittedPW', 'project_moments_SPD_etapi0_posepsilon', 'omegapi_plotter', 'vecps_plotter', 'plot_etapi0'] +subdirs = ['fit','twopi_plotter','twopidelta_plotter', 'twopi_plotter_amp', 'twopi_plotter_mom', 'twopi_plotter_primakoff', 'twolepton_plotter', 'twoleptonGJ_plotter', 'split_mass', 'split_t', 'threepi_plotter_schilling', 'omega_radiative_plotter', 'project_moments', 'plot_etapi_delta', 'project_moments_polarized', 'Bootstrap_plot_etapi_delta_SPDG_allamps_mass_t_bins', 'Pol_moments_viafittedPW', 'project_moments_SPD_etapi0_posepsilon', 'omegapi_plotter', 'vecps_plotter', 'plot_etapi0'] SConscript(dirs=subdirs, exports='env osname', duplicate=0) diff --git a/src/programs/AmplitudeAnalysis/fit/fit.cc b/src/programs/AmplitudeAnalysis/fit/fit.cc index c630f946d..0b40334ee 100644 --- a/src/programs/AmplitudeAnalysis/fit/fit.cc +++ b/src/programs/AmplitudeAnalysis/fit/fit.cc @@ -22,6 +22,12 @@ #include "AMPTOOLS_AMPS/TwoPSHelicity.h" #include "AMPTOOLS_AMPS/TwoPiAngles.h" #include "AMPTOOLS_AMPS/TwoPiAngles_amp.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h" +#include "AMPTOOLS_AMPS/DeltaAngles_Rho.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h" #include "AMPTOOLS_AMPS/TwoPiWt_primakoff.h" #include "AMPTOOLS_AMPS/TwoPiWt_sigma.h" #include "AMPTOOLS_AMPS/TwoPiW_brokenetas.h" @@ -437,6 +443,12 @@ int main( int argc, char* argv[] ){ AmpToolsInterface::registerAmplitude( TwoPSAngles() ); AmpToolsInterface::registerAmplitude( TwoPSHelicity() ); AmpToolsInterface::registerAmplitude( TwoPiAngles() ); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta()); + AmpToolsInterface::registerAmplitude( DeltaAngles_Rho()); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_only_upperv()); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs()); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs_unpol()); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_factorized()); AmpToolsInterface::registerAmplitude( TwoPiAngles_amp() ); AmpToolsInterface::registerAmplitude( TwoPiAngles_primakoff() ); AmpToolsInterface::registerAmplitude( TwoPiWt_primakoff() ); diff --git a/src/programs/AmplitudeAnalysis/fitMPI/fitMPI.cc b/src/programs/AmplitudeAnalysis/fitMPI/fitMPI.cc index 46883d57e..fcbe48c4a 100644 --- a/src/programs/AmplitudeAnalysis/fitMPI/fitMPI.cc +++ b/src/programs/AmplitudeAnalysis/fitMPI/fitMPI.cc @@ -20,6 +20,12 @@ #include "AMPTOOLS_AMPS/TwoPSHelicity.h" #include "AMPTOOLS_AMPS/TwoPiAngles.h" #include "AMPTOOLS_AMPS/TwoPiAngles_amp.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h" +#include "AMPTOOLS_AMPS/DeltaAngles_Rho.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h" #include "AMPTOOLS_AMPS/TwoPiWt_primakoff.h" #include "AMPTOOLS_AMPS/TwoPiWt_sigma.h" #include "AMPTOOLS_AMPS/TwoPiW_brokenetas.h" @@ -412,6 +418,12 @@ int main( int argc, char* argv[] ){ AmpToolsInterface::registerAmplitude( TwoPSAngles() ); AmpToolsInterface::registerAmplitude( TwoPSHelicity() ); AmpToolsInterface::registerAmplitude( TwoPiAngles() ); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta()); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_only_upperv()); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs()); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs_unpol()); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_factorized()); + AmpToolsInterface::registerAmplitude( DeltaAngles_Rho()); AmpToolsInterface::registerAmplitude( TwoPiAngles_amp() ); AmpToolsInterface::registerAmplitude( TwoPiAngles_primakoff() ); AmpToolsInterface::registerAmplitude( TwoPiWt_primakoff() ); diff --git a/src/programs/AmplitudeAnalysis/twopidelta_plotter/SConscript b/src/programs/AmplitudeAnalysis/twopidelta_plotter/SConscript new file mode 100755 index 000000000..642f372be --- /dev/null +++ b/src/programs/AmplitudeAnalysis/twopidelta_plotter/SConscript @@ -0,0 +1,23 @@ + +import os +import sbms + +# get env object and clone it +Import('*') + +# Verify AMPTOOLS environment variable is set +if os.getenv('AMPTOOLS', 'nada')!='nada' and os.getenv('AMPPLOTTER', 'nada')!='nada': + + env = env.Clone() + + AMPTOOLS_LIBS = "AMPTOOLS_AMPS AMPTOOLS_DATAIO AMPTOOLS_MCGEN UTILITIES" + env.AppendUnique(LIBS = AMPTOOLS_LIBS.split()) + + sbms.AddHDDM(env) + sbms.AddAmpTools(env) + sbms.AddAmpPlotter(env) + sbms.AddUtilities(env) + sbms.AddROOT(env) + + sbms.executable(env) + diff --git a/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc b/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc new file mode 100755 index 000000000..4578f85c0 --- /dev/null +++ b/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc @@ -0,0 +1,1049 @@ +#include +#include +#include +#include + +#include "TClass.h" +#include "TApplication.h" +#include "TGClient.h" +#include "TROOT.h" +#include "TH1.h" +#include "TStyle.h" +#include "TClass.h" +#include "TFile.h" + +#include "IUAmpTools/AmpToolsInterface.h" +#include "IUAmpTools/FitResults.h" + +#include "AmpPlotter/PlotterMainWindow.h" +#include "AmpPlotter/PlotFactory.h" + +#include "AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h" +#include "AMPTOOLS_DATAIO/ROOTDataReader.h" +#include "AMPTOOLS_DATAIO/ROOTDataReaderHist.h" +#include "AMPTOOLS_AMPS/Zlm.h" +#include "AMPTOOLS_AMPS/TwoPiAngles.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta.h" +#include "AMPTOOLS_AMPS/DeltaAngles_Rho.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h" +#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h" +//#include "AMPTOOLS_AMPS/Delta_rho_tdep.h" +#include "AMPTOOLS_AMPS/BreitWigner.h" +#include "AMPTOOLS_AMPS/Uniform.h" + +typedef TwoPiDeltaPlotGenerator PlotGen; + +void atiSetup(){ + + AmpToolsInterface::registerAmplitude( Zlm() ); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta() ); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_only_upperv() ); + AmpToolsInterface::registerAmplitude( DeltaAngles_Rho() ); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs() ); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs_unpol() ); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_factorized() ); + // AmpToolsInterface::registerAmplitude( Delta_rho_tdep() ); + AmpToolsInterface::registerAmplitude( BreitWigner() ); + AmpToolsInterface::registerAmplitude( Uniform() ); + AmpToolsInterface::registerDataReader( ROOTDataReader() ); + AmpToolsInterface::registerDataReader( ROOTDataReaderHist() ); +} + +using namespace std; + +int main( int argc, char* argv[] ){ //char array for strings + + + // ************************ + // usage + // ************************ + + cout << endl << " *** Viewing Results Using AmpPlotter and writing root histograms *** " << endl << endl; + + if (argc < 2){ + cout << "Usage:" << endl << endl; + cout << "\ttwopidelta_plotter -o " << endl << endl; + return 0; + } + + bool showGui = false; + bool rootfile_creation = true; + string outName = "twopidelta_plot.root"; + string resultsName(argv[1]); + Double_t tmean; + Double_t terr; + double tmean_old = 0; + double terr_old = 0; + for (int i = 2; i < argc; i++){ + + string arg(argv[i]); + + if (arg == "-g"){ + showGui = true; + } + if (arg == "-o"){ + outName = argv[++i]; + } + if (arg == "-h"){ + cout << endl << " Usage for: " << argv[0] << endl << endl; + cout << "\t -o \t output file path" << endl; + cout << "\t -g \t show GUI" << endl; + exit(1); + } + if (arg == "-n"){ + rootfile_creation = false; + std::ifstream infile("twopidelta_fitPars.txt"); + std::string name; + double value, error; + while (infile >> name >> value >> error) { + if (name == "tmean") { + tmean_old = value; + terr_old = error; + break; + } + } +} + + } + + + // ************************ + // parse the command line parameters + // ************************ + + cout << "Fit results file name = " << resultsName << endl; + cout << "Output file name = " << outName << endl << endl; + + // ************************ + // load the results and display the configuration info + // ************************ + + FitResults results( resultsName ); //get fitresults + cout << "Fit results loaded" << endl; + if( !results.valid() ){ + + cout << "Invalid fit results in file: " << resultsName << endl; + exit( 1 ); + } + + // ************************ + // set up the plot generator + // ************************ + cout << "Setting up ATI" << endl; + atiSetup(); + cout << "ATI set up" << endl; + PlotGen plotGen( results ); + cout << "Plot generator set up" << endl; + + // ************************ + // set up an output ROOT file to store histograms + // ************************ + if (rootfile_creation){ + TFile* plotfile = new TFile( outName.c_str(), "recreate"); + TH1::AddDirectory(kFALSE); + + string reactionName = results.reactionList()[0]; + auto reactions = results.reactionList(); + cout << "Number of reactions: " << reactions.size() << endl; + for (size_t k = 0; k < reactions.size(); ++k) { + auto& reaction = reactions[k]; + string reactionName = reaction; + cout << "Reaction name: " << reactionName << endl; + plotGen.enableReaction( reactionName ); + vector sums = plotGen.uniqueSums(); + + + // loop over sum configurations (one for each of the individual contributions, and the combined sum of all) + + for (unsigned int isum = 0; isum <= sums.size(); isum++){ + + // turn on all sums by default + for (unsigned int i = 0; i < sums.size(); i++){ + plotGen.enableSum(i); + } + + // for individual contributions turn off all sums but the one of interest + if (isum < sums.size()){ + for (unsigned int i = 0; i < sums.size(); i++){ + if (i != isum) plotGen.disableSum(i); + } + } + + + // loop over data, accMC, and genMC + for (unsigned int iplot = 0; iplot < PlotGenerator::kNumTypes; iplot++){ + if (isum < sums.size() && iplot == PlotGenerator::kData) continue; // only plot data once + + // loop over different variables + for (unsigned int ivar = 0; ivar < TwoPiDeltaPlotGenerator::kNumHists; ivar++){ + + // set unique histogram name for each plot (could put in directories...) + string histname = ""; + if (ivar == TwoPiDeltaPlotGenerator::k2PiMass) histname += "M2pi"; + else if (ivar == TwoPiDeltaPlotGenerator::kPPipMass) histname += "Mppip"; + else if (ivar == TwoPiDeltaPlotGenerator::kPPimMass) histname += "Mppim"; + else if (ivar == TwoPiDeltaPlotGenerator::kPi0PimMass) histname += "Mpi0pim"; + else if (ivar == TwoPiDeltaPlotGenerator::kPPipPimMass) histname += "Mppippim"; + else if (ivar == TwoPiDeltaPlotGenerator::kPPipPi0Mass) histname += "Mppippi0"; + else if (ivar == TwoPiDeltaPlotGenerator::kPPimPi0Mass) histname += "Mppimpi0"; + else if (ivar == TwoPiDeltaPlotGenerator::kPipPi0PimMass) histname += "Mpippi0pim"; + else if (ivar == TwoPiDeltaPlotGenerator::kPipPimMass) histname += "Mpippim"; + else if (ivar == TwoPiDeltaPlotGenerator::kPPi0Mass) histname += "Mppi0"; + else if (ivar == TwoPiDeltaPlotGenerator::kPipPi0Mass) histname += "Mpippi0"; + + + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_GFJ_Delta) histname += "cosTheta_GFJ_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_HF_Delta) histname += "cosTheta_HF_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_HF_rho) histname += "cosTheta_HF_rho"; + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_GFJ_rho) histname += "cosTheta_GFJ_rho"; + + + + else if (ivar == TwoPiDeltaPlotGenerator::kPhiPiPlus) histname += "PhiPiPlus"; + else if (ivar == TwoPiDeltaPlotGenerator::kPhiPiMinus) histname += "PhiPiMinus"; + else if (ivar == TwoPiDeltaPlotGenerator::kPhiProton) histname += "PhiProton"; + else if (ivar == TwoPiDeltaPlotGenerator::kThetaPiPlus) histname += "ThetaPiPlus"; + else if (ivar == TwoPiDeltaPlotGenerator::kThetaPiMinus) histname += "ThetaPiMinus"; + else if (ivar == TwoPiDeltaPlotGenerator::kThetaDelta) histname += "ThetaDelta"; + else if (ivar == TwoPiDeltaPlotGenerator::kMomPiPlus) histname += "MomPiPlus"; + else if (ivar == TwoPiDeltaPlotGenerator::kMomPiMinus) histname += "MomPiMinus"; + else if (ivar == TwoPiDeltaPlotGenerator::kMomPi0) histname += "MomPi0"; + else if (ivar == TwoPiDeltaPlotGenerator::kMomProton) histname += "MomProton"; + else if (ivar == TwoPiDeltaPlotGenerator::klongMomPiPlus) histname += "longMomPiPlus"; + else if (ivar == TwoPiDeltaPlotGenerator::klongMomPiMinus) histname += "longMomPiMinus"; + else if (ivar == TwoPiDeltaPlotGenerator::klongMomPi0) histname += "longMomPi0"; + else if (ivar == TwoPiDeltaPlotGenerator::klongMomProton) histname += "longMomProton"; + else if (ivar == TwoPiDeltaPlotGenerator::kPhi) histname += "Phi"; + else if (ivar == TwoPiDeltaPlotGenerator::kPhi_GFJ) histname += "PhiGFJ"; + else if (ivar == TwoPiDeltaPlotGenerator::kphi_GFJ_Delta) histname += "phi_GFJ_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kphi_HF_Delta) histname += "phi_HF_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kphi_HF_rho) histname += "phi_HF_rho"; + else if (ivar == TwoPiDeltaPlotGenerator::kphi_GFJ_rho) histname += "phi_GFJ_rho"; + else if (ivar == TwoPiDeltaPlotGenerator::kPsi) histname += "psi"; + else if (ivar == TwoPiDeltaPlotGenerator::kt) histname += "-t"; + else if (ivar == TwoPiDeltaPlotGenerator::kBeamassymetrie) histname += "Beamass"; + else if (ivar == TwoPiDeltaPlotGenerator::kBeamassymetrie_Delta) histname += "Beamass_Delta"; + + else continue; + + if (iplot == PlotGenerator::kData) histname += "dat"; + if (iplot == PlotGenerator::kAccMC) histname += "acc"; + if (iplot == PlotGenerator::kGenMC) histname += "gen"; + if (iplot == PlotGenerator::kBkgnd) histname += "_bkgnd"; + + if (isum < sums.size()){ + //ostringstream sdig; sdig << (isum + 1); + //histname += sdig.str(); + + // get name of sum for naming histogram + string sumName = sums[isum]; + histname += "_"; + histname += sumName; + } + ; + if (k==0){ + Histogram* hist = plotGen.projection(ivar, reactionName, iplot); + TH1* thist = hist->toRoot(); + thist->SetName(histname.c_str()); + + if (histname=="-tdat"&& k==reactions.size()-1){ + tmean = thist->GetMean(); + terr = thist->GetRMS(); + } + plotfile->cd(); + thist->Write(); + } + else + { + Histogram* hist = plotGen.projection(ivar, reactionName, iplot); + TH1* histSumReac = (TH1*) plotfile->Get(histname.c_str()); + TH1* thist = hist->toRoot(); + histSumReac->Add(thist); + if (histname=="-tdat" && k==reactions.size()-1){ + tmean = histSumReac->GetMean(); + terr = histSumReac->GetRMS(); + } + plotfile->cd(); + histSumReac->Write(histname.c_str(), TObject::kOverwrite); + + } + + histname += "_"; + histname += reactionName; + Histogram* hist = plotGen.projection(ivar, reactionName, iplot); + TH1* thist = hist->toRoot(); + thist->SetName(histname.c_str()); + plotfile->cd(); + thist->Write(); + + } + } + } +} + plotfile->Close(); + } + // ************************ + // retrieve SDME parameters for plotting and asymmetry + // ************************ + + // parameters to check! be careful! for rho last number is upper case # Delta first number + vector< string > pars; + pars.push_back("rho000"); + pars.push_back("rho100"); + pars.push_back("rho1m10"); + + pars.push_back("rho111"); + pars.push_back("rho001"); + pars.push_back("rho101"); + pars.push_back("rho1m11"); + + pars.push_back("rho102"); + pars.push_back("rho1m12"); + pars.push_back("delta_rho011"); + pars.push_back("delta_rho031"); + pars.push_back("delta_rho03m1"); + pars.push_back("delta_rho111"); + pars.push_back("delta_rho133"); + pars.push_back("delta_rho131"); + pars.push_back("delta_rho13m1"); + pars.push_back("delta_rho231"); + pars.push_back("delta_rho23m1"); + pars.push_back("r00_33_0"); + pars.push_back("r00_11_0"); + pars.push_back("r11_33_0"); + pars.push_back("r11_11_0"); + pars.push_back("r1m1_33_0"); + pars.push_back("r1m1_11_0"); + pars.push_back("r10_33_0"); + pars.push_back("r10_11_0"); + pars.push_back("r00_31_0"); + pars.push_back("r00_3m1_0"); + pars.push_back("r11_31_0"); + pars.push_back("r11_3m1_0"); + pars.push_back("r1m1_31_0"); + pars.push_back("r1m1_3m1_0"); + pars.push_back("r10_31_0"); + pars.push_back("r10_3m1_0"); + pars.push_back("rt1m1_31_0"); + pars.push_back("rt1m1_3m1_0"); + pars.push_back("rt10_31_0"); + pars.push_back("rt10_3m1_0"); + // alpha = 1 + pars.push_back("r00_33_1"); + pars.push_back("r00_11_1"); + pars.push_back("r11_33_1"); + pars.push_back("r11_11_1"); + pars.push_back("r1m1_33_1"); + pars.push_back("r1m1_11_1"); + pars.push_back("r10_33_1"); + pars.push_back("r10_11_1"); + pars.push_back("r00_31_1"); + pars.push_back("r00_3m1_1"); + pars.push_back("r11_31_1"); + pars.push_back("r11_3m1_1"); + pars.push_back("r1m1_31_1"); + pars.push_back("r1m1_3m1_1"); + pars.push_back("r10_31_1"); + pars.push_back("r10_3m1_1"); + pars.push_back("rt1m1_31_1"); + pars.push_back("rt1m1_3m1_1"); + pars.push_back("rt10_31_1"); + pars.push_back("rt10_3m1_1"); + + // alpha = 2 + pars.push_back("rt00_31_2"); + pars.push_back("rt00_3m1_2"); + pars.push_back("rt11_31_2"); + pars.push_back("rt11_3m1_2"); + pars.push_back("r1m1_33_2"); + pars.push_back("r1m1_11_2"); + pars.push_back("r1m1_31_2"); + pars.push_back("r1m1_3m1_2"); + pars.push_back("rt1m1_31_2"); + pars.push_back("rt1m1_3m1_2"); + pars.push_back("r10_33_2"); + pars.push_back("r10_11_2"); + pars.push_back("r10_31_2"); + pars.push_back("r10_3m1_2"); + pars.push_back("rt10_31_2"); + pars.push_back("rt10_3m1_2"); + pars.push_back("a"); + pars.push_back("b"); + // pars.push_back("c"); + // pars.push_back("d"); + + + + // file for writing parameters (later switch to putting in ROOT file) + ofstream outfile; + outfile.open( "twopidelta_fitPars.txt" ); + if (rootfile_creation){ + outfile << "tmean" << "\t" << tmean << "\t" << terr << "\t" << "\n"; + } + else{ + outfile << "tmean" << "\t" << tmean_old << "\t" << terr_old << "\t" << "\n"; + } + for(unsigned int i = 0; i > covMatrix; + covMatrix = results.errorMatrix(); + + // double SigmaN = results.parValue(pars[3]) + results.parValue(pars[6]); + // double SigmaN_err = covMatrix[5][5] + covMatrix[8][8] + 2*covMatrix[5][8]; + + // double SigmaD = 0.5*(1 - results.parValue(pars[0])) + results.parValue(pars[2]); + // double SigmaD_err = 0.5*0.5*covMatrix[2][2] + covMatrix[4][4] - 2*0.5*covMatrix[2][4]; + + // double Sigma = SigmaN/SigmaD; + // double Sigma_err = fabs(Sigma) * sqrt(SigmaN_err/SigmaN/SigmaN + SigmaD_err/SigmaD/SigmaD); + // outfile << Sigma << "\t" << Sigma_err << "\t"; + + + + outfile << endl; + + // ************************ + // start the GUI + // ************************ + + if(showGui) { + + cout << ">> Plot generator ready, starting GUI..." << endl; + + int dummy_argc = 0; + char* dummy_argv[] = {}; + TApplication app( "app", &dummy_argc, dummy_argv ); + + gStyle->SetFillColor(10); + gStyle->SetCanvasColor(10); + gStyle->SetPadColor(10); + gStyle->SetFillStyle(1001); + gStyle->SetPalette(1); + gStyle->SetFrameFillColor(10); + gStyle->SetFrameFillStyle(1001); + + PlotFactory factory( plotGen ); + PlotterMainWindow mainFrame( gClient->GetRoot(), factory ); + + app.Run(); + } + + return 0; + +} + From 132fd456dd2beb04ae0530aa312d507547e53afb Mon Sep 17 00:00:00 2001 From: Niklas Herrmann Date: Wed, 8 Jul 2026 06:11:51 -0400 Subject: [PATCH 2/5] cleaned folder --- .../twopidelta_plotter/twopidelta_plotter.cc | 771 +++++++----------- 1 file changed, 276 insertions(+), 495 deletions(-) diff --git a/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc b/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc index 4578f85c0..09e00a575 100755 --- a/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc +++ b/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc @@ -23,13 +23,8 @@ #include "AMPTOOLS_DATAIO/ROOTDataReaderHist.h" #include "AMPTOOLS_AMPS/Zlm.h" #include "AMPTOOLS_AMPS/TwoPiAngles.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta.h" -#include "AMPTOOLS_AMPS/DeltaAngles_Rho.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h" #include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h" #include "AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h" -//#include "AMPTOOLS_AMPS/Delta_rho_tdep.h" #include "AMPTOOLS_AMPS/BreitWigner.h" #include "AMPTOOLS_AMPS/Uniform.h" @@ -38,13 +33,9 @@ typedef TwoPiDeltaPlotGenerator PlotGen; void atiSetup(){ AmpToolsInterface::registerAmplitude( Zlm() ); - AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta() ); - AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_only_upperv() ); - AmpToolsInterface::registerAmplitude( DeltaAngles_Rho() ); + AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs() ); - AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs_unpol() ); AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_factorized() ); - // AmpToolsInterface::registerAmplitude( Delta_rho_tdep() ); AmpToolsInterface::registerAmplitude( BreitWigner() ); AmpToolsInterface::registerAmplitude( Uniform() ); AmpToolsInterface::registerDataReader( ROOTDataReader() ); @@ -189,42 +180,45 @@ int main( int argc, char* argv[] ){ //char array for strings else if (ivar == TwoPiDeltaPlotGenerator::kPPipPi0Mass) histname += "Mppippi0"; else if (ivar == TwoPiDeltaPlotGenerator::kPPimPi0Mass) histname += "Mppimpi0"; else if (ivar == TwoPiDeltaPlotGenerator::kPipPi0PimMass) histname += "Mpippi0pim"; - else if (ivar == TwoPiDeltaPlotGenerator::kPipPimMass) histname += "Mpippim"; - else if (ivar == TwoPiDeltaPlotGenerator::kPPi0Mass) histname += "Mppi0"; - else if (ivar == TwoPiDeltaPlotGenerator::kPipPi0Mass) histname += "Mpippi0"; - - - else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_GFJ_Delta) histname += "cosTheta_GFJ_Delta"; - else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_HF_Delta) histname += "cosTheta_HF_Delta"; - else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_HF_rho) histname += "cosTheta_HF_rho"; - else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_GFJ_rho) histname += "cosTheta_GFJ_rho"; - - - + else if (ivar == TwoPiDeltaPlotGenerator::kPipPimMass) histname += "Mpippim"; + else if (ivar == TwoPiDeltaPlotGenerator::kPPi0Mass) histname += "Mppi0"; + else if (ivar == TwoPiDeltaPlotGenerator::kPipPi0Mass) histname += "Mpippi0"; + else if (ivar == TwoPiDeltaPlotGenerator::kPhiPiPlus) histname += "PhiPiPlus"; else if (ivar == TwoPiDeltaPlotGenerator::kPhiPiMinus) histname += "PhiPiMinus"; else if (ivar == TwoPiDeltaPlotGenerator::kPhiProton) histname += "PhiProton"; + else if (ivar == TwoPiDeltaPlotGenerator::kThetaPiPlus) histname += "ThetaPiPlus"; else if (ivar == TwoPiDeltaPlotGenerator::kThetaPiMinus) histname += "ThetaPiMinus"; else if (ivar == TwoPiDeltaPlotGenerator::kThetaDelta) histname += "ThetaDelta"; - else if (ivar == TwoPiDeltaPlotGenerator::kMomPiPlus) histname += "MomPiPlus"; - else if (ivar == TwoPiDeltaPlotGenerator::kMomPiMinus) histname += "MomPiMinus"; - else if (ivar == TwoPiDeltaPlotGenerator::kMomPi0) histname += "MomPi0"; - else if (ivar == TwoPiDeltaPlotGenerator::kMomProton) histname += "MomProton"; + else if (ivar == TwoPiDeltaPlotGenerator::klongMomPiPlus) histname += "longMomPiPlus"; else if (ivar == TwoPiDeltaPlotGenerator::klongMomPiMinus) histname += "longMomPiMinus"; else if (ivar == TwoPiDeltaPlotGenerator::klongMomPi0) histname += "longMomPi0"; else if (ivar == TwoPiDeltaPlotGenerator::klongMomProton) histname += "longMomProton"; + + else if (ivar == TwoPiDeltaPlotGenerator::kMomPiPlus) histname += "MomPiPlus"; + else if (ivar == TwoPiDeltaPlotGenerator::kMomPiMinus) histname += "MomPiMinus"; + else if (ivar == TwoPiDeltaPlotGenerator::kMomPi0) histname += "MomPi0"; + else if (ivar == TwoPiDeltaPlotGenerator::kMomProton) histname += "MomProton"; + + else if (ivar == TwoPiDeltaPlotGenerator::kphi_PiMinus_hel_rho) histname += "phi_PiMinus_hel_rho"; + else if (ivar == TwoPiDeltaPlotGenerator::kphi_PiMinus_GJ_rho) histname += "phi_PiMinus_GJ_rho"; + else if (ivar == TwoPiDeltaPlotGenerator::kphi_PiPlus_hel_Delta) histname += "phi_PiPlus_hel_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kphi_PiPlus_GJ_Delta) histname += "phi_PiPlus_GJ_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kphi_Proton_hel_Delta) histname += "phi_Proton_hel_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kphi_Proton_GJ_Delta) histname += "phi_Proton_GJ_Delta"; + + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_PiMinus_hel_rho) histname += "cosTheta_PiMinus_hel_rho"; + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_PiMinus_GJ_rho) histname += "cosTheta_PiMinus_GJ_rho"; + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_PiPlus_hel_Delta) histname += "cosTheta_PiPlus_hel_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_PiPlus_GJ_Delta) histname += "cosTheta_PiPlus_GJ_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_Proton_hel_Delta) histname += "cosTheta_Proton_hel_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kCosTheta_Proton_GJ_Delta) histname += "cosTheta_Proton_GJ_Delta"; + else if (ivar == TwoPiDeltaPlotGenerator::kPhi) histname += "Phi"; - else if (ivar == TwoPiDeltaPlotGenerator::kPhi_GFJ) histname += "PhiGFJ"; - else if (ivar == TwoPiDeltaPlotGenerator::kphi_GFJ_Delta) histname += "phi_GFJ_Delta"; - else if (ivar == TwoPiDeltaPlotGenerator::kphi_HF_Delta) histname += "phi_HF_Delta"; - else if (ivar == TwoPiDeltaPlotGenerator::kphi_HF_rho) histname += "phi_HF_rho"; - else if (ivar == TwoPiDeltaPlotGenerator::kphi_GFJ_rho) histname += "phi_GFJ_rho"; else if (ivar == TwoPiDeltaPlotGenerator::kPsi) histname += "psi"; else if (ivar == TwoPiDeltaPlotGenerator::kt) histname += "-t"; - else if (ivar == TwoPiDeltaPlotGenerator::kBeamassymetrie) histname += "Beamass"; - else if (ivar == TwoPiDeltaPlotGenerator::kBeamassymetrie_Delta) histname += "Beamass_Delta"; else continue; @@ -270,13 +264,13 @@ int main( int argc, char* argv[] ){ //char array for strings } - histname += "_"; - histname += reactionName; - Histogram* hist = plotGen.projection(ivar, reactionName, iplot); - TH1* thist = hist->toRoot(); - thist->SetName(histname.c_str()); - plotfile->cd(); - thist->Write(); + // histname += "_"; + // histname += reactionName; + // Histogram* hist = plotGen.projection(ivar, reactionName, iplot); + // TH1* thist = hist->toRoot(); + // thist->SetName(histname.c_str()); + // plotfile->cd(); + // thist->Write(); } } @@ -369,10 +363,7 @@ int main( int argc, char* argv[] ){ //char array for strings pars.push_back("r10_3m1_2"); pars.push_back("rt10_31_2"); pars.push_back("rt10_3m1_2"); - pars.push_back("a"); - pars.push_back("b"); - // pars.push_back("c"); - // pars.push_back("d"); + @@ -392,10 +383,6 @@ int main( int argc, char* argv[] ){ //char array for strings if (std::isnan(parValue) || std::isnan(parError)) { continue; } - if (pars[i]=="rho001") { - outfile << "rho001_upperv" << "\t" << parValue << "\t" << parError << "\t" << "\n"; - continue; - } outfile << pars[i] << "\t" << parValue << "\t" << parError << "\t" << "\n"; } @@ -407,147 +394,9 @@ int main( int argc, char* argv[] ){ //char array for strings double P_sigma_error = 2*sqrt(results.parError("rho1m11")*results.parError("rho1m11")+results.parError("rho111")*results.parError("rho111")+results.parError("delta_rho111")*results.parError("delta_rho111")+results.parError("delta_rho133")*results.parError("delta_rho133")+2*(results.covariance("rho1m11","rho111")-results.covariance("rho1m11","delta_rho111")-results.covariance("rho1m11","delta_rho133")-results.covariance("rho111","delta_rho111")-results.covariance("rho111","delta_rho133")+results.covariance("delta_rho111","delta_rho133"))); outfile << "P" << "\t" << P_sigma_value << "\t" << P_sigma_error << "\t" << "\n"; - - - - double r00_33_0_single_value = results.parValue("rho000") * (0.5-results.parValue("delta_rho011")); - double r00_33_0_single_error = sqrt(results.parError("rho000")*results.parError("rho000")*(0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho000")*results.parValue("rho000")-2*results.covariance("rho000","delta_rho011")*(0.5-results.parValue("delta_rho011"))*results.parValue("rho000")); - outfile << "r00_33_0_single" << "\t" << r00_33_0_single_value << "\t" << r00_33_0_single_error << "\t" << "\n"; - - double r00_31_0_single_value = results.parValue("rho000") * results.parValue("delta_rho031"); - double r00_31_0_single_error = sqrt(results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho031")*results.parValue("delta_rho031")+results.parError("delta_rho031")*results.parError("delta_rho031")*results.parValue("rho000")*results.parValue("rho000")+2*results.covariance("rho000","delta_rho031")*results.parValue("delta_rho031")*results.parValue("rho000")); - outfile << "r00_31_0_single" << "\t" << r00_31_0_single_value << "\t" << r00_31_0_single_error << "\t" << "\n"; - - double r00_11_0_single_value = results.parValue("rho000") * results.parValue("delta_rho011"); - double r00_11_0_single_error = sqrt(results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho011")*results.parValue("delta_rho011")+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho000")*results.parValue("rho000")+2*results.covariance("rho000","delta_rho011")*results.parValue("delta_rho011")*results.parValue("rho000")); - outfile << "r00_11_0_single" << "\t" << r00_11_0_single_value << "\t" << r00_11_0_single_error << "\t" << "\n"; - - double r00_3m1_0_single_value = results.parValue("rho000") * results.parValue("delta_rho03m1"); - double r00_3m1_0_single_error = sqrt(results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")+results.parError("delta_rho03m1")*results.parError("delta_rho03m1")*results.parValue("rho000")*results.parValue("rho000")+2*results.covariance("rho000","delta_rho03m1")*results.parValue("delta_rho03m1")*results.parValue("rho000")); - outfile << "r00_3m1_0_single" << "\t" << r00_3m1_0_single_value << "\t" << r00_3m1_0_single_error << "\t" << "\n"; - - - double r11_33_0_single_value = (1-results.parValue("rho000")) * 0.5 * (0.5-results.parValue("delta_rho011")); - double r11_33_0_single_error = sqrt(0.25*(0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho000")*results.parError("rho000")+0.25*(results.parValue("rho000")-1)*(results.parValue("rho000")-1)*results.parError("delta_rho011")*results.parError("delta_rho011")-0.5*(results.parValue("rho000")-1)*(0.5-results.parValue("delta_rho011"))*results.covariance("rho000","delta_rho011")); - outfile << "r11_33_0_single" << "\t" << r11_33_0_single_value << "\t" << r11_33_0_single_error << "\t" << "\n"; - - double r11_31_0_single_value = (1-results.parValue("rho000")) * 0.5 * results.parValue("delta_rho031"); - double r11_31_0_single_error = sqrt(0.25*results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho031")*results.parValue("delta_rho031")+0.25*results.parError("delta_rho031")*results.parError("delta_rho031")*(results.parValue("rho000")-1)*(results.parValue("rho000")-1)+0.5*results.covariance("rho000","delta_rho031")*results.parValue("delta_rho031")*(results.parValue("rho000")-1)); - outfile << "r11_31_0_single" << "\t" << r11_31_0_single_value << "\t" << r11_31_0_single_error << "\t" << "\n"; - - double r11_11_0_single_value = (1-results.parValue("rho000")) * 0.5 * results.parValue("delta_rho011"); - double r11_11_0_single_error = sqrt(0.25*results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho011")*results.parValue("delta_rho011")+0.25*results.parError("delta_rho011")*results.parError("delta_rho011")*(results.parValue("rho000")-1)*(results.parValue("rho000")-1)+0.5*results.covariance("rho000","delta_rho011")*results.parValue("delta_rho011")*(results.parValue("rho000")-1)); - outfile << "r11_11_0_single" << "\t" << r11_11_0_single_value << "\t" << r11_11_0_single_error << "\t" << "\n"; - - double r11_3m1_0_single_value = (1-results.parValue("rho000")) * 0.5 * results.parValue("delta_rho03m1"); - double r11_3m1_0_single_error = sqrt(0.25*results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")+0.25*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")*(results.parValue("rho000")-1)*(results.parValue("rho000")-1)+0.5*results.covariance("rho000","delta_rho03m1")*results.parValue("delta_rho03m1")*(results.parValue("rho000")-1)); - outfile << "r11_3m1_0_single" << "\t" << r11_3m1_0_single_value << "\t" << r11_3m1_0_single_error << "\t" << "\n"; - - - double r1m1_33_0_single_value = results.parValue("rho1m10") * (0.5-results.parValue("delta_rho011")); - double r1m1_33_0_single_error = sqrt(results.parError("rho1m10")*results.parError("rho1m10")*(0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho1m10")*results.parValue("rho1m10")-2*results.covariance("rho1m10","delta_rho011")*(0.5-results.parValue("delta_rho011"))*results.parValue("rho1m10")); - outfile << "r1m1_33_0_single" << "\t" << r1m1_33_0_single_value << "\t" << r1m1_33_0_single_error << "\t" << "\n"; - - double r1m1_11_0_single_value = results.parValue("rho1m10") * results.parValue("delta_rho011"); - double r1m1_11_0_single_error = sqrt(results.parError("rho1m10")*results.parError("rho1m10")*results.parValue("delta_rho011")*results.parValue("delta_rho011")+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho1m10")*results.parValue("rho1m10")+2*results.covariance("rho1m10","delta_rho011")*results.parValue("delta_rho011")*results.parValue("rho1m10")); - outfile << "r1m1_11_0_single" << "\t" << r1m1_11_0_single_value << "\t" << r1m1_11_0_single_error << "\t" << "\n"; - - double r1m1_31_0_single_value = results.parValue("rho1m10") * results.parValue("delta_rho031"); - double r1m1_31_0_single_error = sqrt(results.parError("rho1m10")*results.parError("rho1m10")*results.parValue("delta_rho031")*results.parValue("delta_rho031")+results.parError("delta_rho031")*results.parError("delta_rho031")*results.parValue("rho1m10")*results.parValue("rho1m10")+2*results.covariance("rho1m10","delta_rho031")*results.parValue("delta_rho031")*results.parValue("rho1m10")); - outfile << "r1m1_31_0_single" << "\t" << r1m1_31_0_single_value << "\t" << r1m1_31_0_single_error << "\t" << "\n"; - - double r1m1_3m1_0_single_value = results.parValue("rho1m10") * results.parValue("delta_rho03m1"); - double r1m1_3m1_0_single_error = sqrt(results.parError("rho1m10")*results.parError("rho1m10")*results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")+results.parError("delta_rho03m1")*results.parError("delta_rho03m1")*results.parValue("rho1m10")*results.parValue("rho1m10")+2*results.covariance("rho1m10","delta_rho03m1")*results.parValue("delta_rho03m1")*results.parValue("rho1m10")); - outfile << "r1m1_3m1_0_single" << "\t" << r1m1_3m1_0_single_value << "\t" << r1m1_3m1_0_single_error << "\t" << "\n"; - - - double r10_33_0_single_value = results.parValue("rho100") * (0.5-results.parValue("delta_rho011")); - double r10_33_0_single_error = sqrt(results.parError("rho100")*results.parError("rho100")*(0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho100")*results.parValue("rho100")-2*results.covariance("rho100","delta_rho011")*(0.5-results.parValue("delta_rho011"))*results.parValue("rho100")); - outfile << "r10_33_0_single" << "\t" << r10_33_0_single_value << "\t" << r10_33_0_single_error << "\t" << "\n"; - - double r10_31_0_single_value = results.parValue("rho100") * results.parValue("delta_rho031"); - double r10_31_0_single_error = sqrt(results.parError("rho100")*results.parError("rho100")*results.parValue("delta_rho031")*results.parValue("delta_rho031")+results.parError("delta_rho031")*results.parError("delta_rho031")*results.parValue("rho100")*results.parValue("rho100")+2*results.covariance("rho100","delta_rho031")*results.parValue("delta_rho031")*results.parValue("rho100")); - outfile << "r10_31_0_single" << "\t" << r10_31_0_single_value << "\t" << r10_31_0_single_error << "\t" << "\n"; - - double r10_11_0_single_value = results.parValue("rho100") * results.parValue("delta_rho011"); - double r10_11_0_single_error = sqrt(results.parError("rho100")*results.parError("rho100")*results.parValue("delta_rho011")*results.parValue("delta_rho011")+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho100")*results.parValue("rho100")+2*results.covariance("rho100","delta_rho011")*results.parValue("delta_rho011")*results.parValue("rho100")); - outfile << "r10_11_0_single" << "\t" << r10_11_0_single_value << "\t" << r10_11_0_single_error << "\t" << "\n"; - - double r10_3m1_0_single_value = results.parValue("rho100") * results.parValue("delta_rho03m1"); - double r10_3m1_0_single_error = sqrt(results.parError("rho100")*results.parError("rho100")*results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")+results.parError("delta_rho03m1")*results.parError("delta_rho03m1")*results.parValue("rho100")*results.parValue("rho100")+2*results.covariance("rho100","delta_rho03m1")*results.parValue("delta_rho03m1")*results.parValue("rho100")); - outfile << "r10_3m1_0_single" << "\t" << r10_3m1_0_single_value << "\t" << r10_3m1_0_single_error << "\t" << "\n"; - - - - //alpha=1 - double r00_33_1_single_value = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")) * results.parValue("delta_rho133"); - double r00_33_1_single_error = sqrt((results.parValue("delta_rho133")*results.parValue("delta_rho133"))*4*((results.parError("delta_rho111")*results.parError("delta_rho111"))+(results.parError("delta_rho133")*results.parError("delta_rho133"))+(results.parError("rho111")*results.parError("rho111"))+2*results.covariance("delta_rho111","delta_rho133")-2*results.covariance("delta_rho111","rho111")-2*results.covariance("delta_rho133","rho111"))+(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*(results.parError("delta_rho133")*results.parError("delta_rho133"))+2*(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*results.parValue("delta_rho133")*2*(results.covariance("delta_rho111","delta_rho133")+results.covariance("delta_rho133","delta_rho133")-results.covariance("rho111","delta_rho133"))); - outfile << "r00_33_1_single" << "\t" << r00_33_1_single_value << "\t" << r00_33_1_single_error << "\n"; - - double r00_31_1_single_value = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")) * results.parValue("delta_rho131"); - double r00_31_1_single_error = sqrt((results.parValue("delta_rho131")*results.parValue("delta_rho131"))*4*((results.parError("delta_rho111")*results.parError("delta_rho111"))+(results.parError("delta_rho133")*results.parError("delta_rho133"))+(results.parError("rho111")*results.parError("rho111"))+2*results.covariance("delta_rho111","delta_rho133")-2*results.covariance("delta_rho111","rho111")-2*results.covariance("delta_rho133","rho111"))+(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*(results.parError("delta_rho131")*results.parError("delta_rho131"))+2*(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*results.parValue("delta_rho131")*2*(results.covariance("delta_rho111","delta_rho131")+results.covariance("delta_rho133","delta_rho131")-results.covariance("rho111","delta_rho131"))); - outfile << "r00_31_1_single" << "\t" << r00_31_1_single_value << "\t" << r00_31_1_single_error << "\t" << "\n"; - - double r00_11_1_single_value = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")) * results.parValue("delta_rho111"); - double r00_11_1_single_error = sqrt((results.parValue("delta_rho111")*results.parValue("delta_rho111"))*4*((results.parError("delta_rho111")*results.parError("delta_rho111"))+(results.parError("delta_rho133")*results.parError("delta_rho133"))+(results.parError("rho111")*results.parError("rho111"))+2*results.covariance("delta_rho111","delta_rho133")-2*results.covariance("delta_rho111","rho111")-2*results.covariance("delta_rho133","rho111"))+(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*(results.parError("delta_rho111")*results.parError("delta_rho111"))+2*(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*results.parValue("delta_rho111")*2*(results.covariance("delta_rho111","delta_rho111")+results.covariance("delta_rho133","delta_rho111")-results.covariance("rho111","delta_rho111"))); - outfile << "r00_11_1_single" << "\t" << r00_11_1_single_value << "\t" << r00_11_1_single_error << "\t" << "\n"; - - double r00_3m1_1_single_value = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")) * results.parValue("delta_rho13m1"); - double r00_3m1_1_single_error = sqrt((results.parValue("delta_rho13m1")*results.parValue("delta_rho13m1"))*4*((results.parError("delta_rho111")*results.parError("delta_rho111"))+(results.parError("delta_rho133")*results.parError("delta_rho133"))+(results.parError("rho111")*results.parError("rho111"))+2*results.covariance("delta_rho111","delta_rho133")-2*results.covariance("delta_rho111","rho111")-2*results.covariance("delta_rho133","rho111"))+(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*(results.parError("delta_rho13m1")*results.parError("delta_rho13m1"))+2*(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")))*results.parValue("delta_rho13m1")*2*(results.covariance("delta_rho111","delta_rho13m1")+results.covariance("delta_rho133","delta_rho13m1")-results.covariance("rho111","delta_rho13m1"))); - outfile << "r00_3m1_1_single" << "\t" << r00_3m1_1_single_value << "\t" << r00_3m1_1_single_error << "\n"; - - double r11_33_1_single_value = results.parValue("rho111") * results.parValue("delta_rho133"); - double r11_33_1_single_error = sqrt(results.parError("rho111")*results.parError("rho111")*results.parValue("delta_rho133")*results.parValue("delta_rho133")+results.parError("delta_rho133")*results.parError("delta_rho133")*results.parValue("rho111")*results.parValue("rho111")+2*results.covariance("rho111","delta_rho133")*results.parValue("delta_rho133")*results.parValue("rho111")); - outfile << "r11_33_1_single" << "\t" << r11_33_1_single_value << "\t" << r11_33_1_single_error << "\n"; - - double r11_31_1_single_value = results.parValue("rho111") * results.parValue("delta_rho131"); - double r11_31_1_single_error = sqrt(results.parError("rho111")*results.parError("rho111")*results.parValue("delta_rho131")*results.parValue("delta_rho131")+results.parError("delta_rho131")*results.parError("delta_rho131")*results.parValue("rho111")*results.parValue("rho111")+2*results.covariance("rho111","delta_rho131")*results.parValue("delta_rho131")*results.parValue("rho111")); - outfile << "r11_31_1_single" << "\t" << r11_31_1_single_value << "\t" << r11_31_1_single_error << "\n"; - - double r11_11_1_single_value = results.parValue("rho111") * results.parValue("delta_rho111"); - double r11_11_1_single_error = sqrt(results.parError("rho111")*results.parError("rho111")*results.parValue("delta_rho111")*results.parValue("delta_rho111")+results.parError("delta_rho111")*results.parError("delta_rho111")*results.parValue("rho111")*results.parValue("rho111")+2*results.covariance("rho111","delta_rho111")*results.parValue("delta_rho111")*results.parValue("rho111")); - outfile << "r11_11_1_single" << "\t" << r11_11_1_single_value << "\t" << r11_11_1_single_error << "\n"; - - double r11_3m1_1_single_value = results.parValue("rho111") * results.parValue("delta_rho13m1"); - double r11_3m1_1_single_error = sqrt(results.parError("rho111")*results.parError("rho111")*results.parValue("delta_rho13m1")*results.parValue("delta_rho13m1")+results.parError("delta_rho13m1")*results.parError("delta_rho13m1")*results.parValue("rho111")*results.parValue("rho111")+2*results.covariance("rho111","delta_rho13m1")*results.parValue("delta_rho13m1")*results.parValue("rho111")); - outfile << "r11_3m1_1_single" << "\t" << r11_3m1_1_single_value << "\t" << r11_3m1_1_single_error << "\n"; - - double r1m1_33_1_single_value = results.parValue("rho1m11") * results.parValue("delta_rho133"); - double r1m1_33_1_single_error = sqrt(results.parError("rho1m11")*results.parError("rho1m11")*results.parValue("delta_rho133")*results.parValue("delta_rho133")+results.parError("delta_rho133")*results.parError("delta_rho133")*results.parValue("rho1m11")*results.parValue("rho1m11")+2*results.covariance("rho1m11","delta_rho133")*results.parValue("delta_rho133")*results.parValue("rho1m11")); - outfile << "r1m1_33_1_single" << "\t" << r1m1_33_1_single_value << "\t" << r1m1_33_1_single_error << "\n"; - - double r1m1_11_1_single_value = results.parValue("rho1m11") * results.parValue("delta_rho111"); - double r1m1_11_1_single_error = sqrt(results.parError("rho1m11")*results.parError("rho1m11")*results.parValue("delta_rho111")*results.parValue("delta_rho111")+results.parError("delta_rho111")*results.parError("delta_rho111")*results.parValue("rho1m11")*results.parValue("rho1m11")+2*results.covariance("rho1m11","delta_rho111")*results.parValue("delta_rho111")*results.parValue("rho1m11")); - outfile << "r1m1_11_1_single" << "\t" << r1m1_11_1_single_value << "\t" << r1m1_11_1_single_error << "\n"; - - double r1m1_31_1_single_value = results.parValue("rho1m11") * results.parValue("delta_rho131"); - double r1m1_31_1_single_error = sqrt(results.parError("rho1m11")*results.parError("rho1m11")*results.parValue("delta_rho131")*results.parValue("delta_rho131")+results.parError("delta_rho131")*results.parError("delta_rho131")*results.parValue("rho1m11")*results.parValue("rho1m11")+2*results.covariance("rho1m11","delta_rho131")*results.parValue("delta_rho131")*results.parValue("rho1m11")); - outfile << "r1m1_31_1_single" << "\t" << r1m1_31_1_single_value << "\t" << r1m1_31_1_single_error << "\n"; - - double r1m1_3m1_1_single_value = results.parValue("rho1m11") * results.parValue("delta_rho13m1"); - double r1m1_3m1_1_single_error = sqrt(results.parError("rho1m11")*results.parError("rho1m11")*results.parValue("delta_rho13m1")*results.parValue("delta_rho13m1")+results.parError("delta_rho13m1")*results.parError("delta_rho13m1")*results.parValue("rho1m11")*results.parValue("rho1m11")+2*results.covariance("rho1m11","delta_rho13m1")*results.parValue("delta_rho13m1")*results.parValue("rho1m11")); - outfile << "r1m1_3m1_1_single" << "\t" << r1m1_3m1_1_single_value << "\t" << r1m1_3m1_1_single_error << "\n"; - - double r10_33_1_single_value = results.parValue("rho101") * results.parValue("delta_rho133"); - double r10_33_1_single_error = sqrt(results.parError("rho101")*results.parError("rho101")*results.parValue("delta_rho133")*results.parValue("delta_rho133")+results.parError("delta_rho133")*results.parError("delta_rho133")*results.parValue("rho101")*results.parValue("rho101")+2*results.covariance("rho101","delta_rho133")*results.parValue("delta_rho133")*results.parValue("rho101")); - outfile << "r10_33_1_single" << "\t" << r10_33_1_single_value << "\t" << r10_33_1_single_error << "\n"; - - double r10_31_1_single_value = results.parValue("rho101") * results.parValue("delta_rho131"); - double r10_31_1_single_error = sqrt(results.parError("rho101")*results.parError("rho101")*results.parValue("delta_rho131")*results.parValue("delta_rho131")+results.parError("delta_rho131")*results.parError("delta_rho131")*results.parValue("rho101")*results.parValue("rho101")+2*results.covariance("rho101","delta_rho131")*results.parValue("delta_rho131")*results.parValue("rho101")); - outfile << "r10_31_1_single" << "\t" << r10_31_1_single_value << "\t" << r10_31_1_single_error << "\n"; - - double r10_11_1_single_value = results.parValue("rho101") * results.parValue("delta_rho111"); - double r10_11_1_single_error = sqrt(results.parError("rho101")*results.parError("rho101")*results.parValue("delta_rho111")*results.parValue("delta_rho111")+results.parError("delta_rho111")*results.parError("delta_rho111")*results.parValue("rho101")*results.parValue("rho101")+2*results.covariance("rho101","delta_rho111")*results.parValue("delta_rho111")*results.parValue("rho101")); - outfile << "r10_11_1_single" << "\t" << r10_11_1_single_value << "\t" << r10_11_1_single_error << "\n"; - - double r10_3m1_1_single_value = results.parValue("rho101") * results.parValue("delta_rho13m1"); - double r10_3m1_1_single_error = sqrt(results.parError("rho101")*results.parError("rho101")*results.parValue("delta_rho13m1")*results.parValue("delta_rho13m1")+results.parError("delta_rho13m1")*results.parError("delta_rho13m1")*results.parValue("rho101")*results.parValue("rho101")+2*results.covariance("rho101","delta_rho13m1")*results.parValue("delta_rho13m1")*results.parValue("rho101")); - outfile << "r10_3m1_1_single" << "\t" << r10_3m1_1_single_value << "\t" << r10_3m1_1_single_error << "\n"; - + // Calculate the single SDMEs with the double SDMEs //alpha=0 - - // TraceB(rho_mm'_lambdalambda') double rho000_double_value = 1.0-4.0*results.parValue("r11_11_0") - 4.0 *results.parValue("r11_33_0"); double rho000_double_error = sqrt(16.0*results.parError("r11_11_0")*results.parError("r11_11_0")+16.0*results.parError("r11_33_0")*results.parError("r11_33_0")+32.0*results.covariance("r11_11_0","r11_33_0")); outfile << "rho000_double" << "\t" << rho000_double_value << "\t" << rho000_double_error << "\t" << "\n"; @@ -560,7 +409,6 @@ int main( int argc, char* argv[] ){ //char array for strings double rho1m10_double_error = sqrt(4.0*results.parError("r1m1_11_0")*results.parError("r1m1_11_0")+4.0*results.parError("r1m1_33_0")*results.parError("r1m1_33_0")+8.0*results.covariance("r1m1_11_0","r1m1_33_0")); outfile << "rho1m10_double" << "\t" << rho1m10_double_value << "\t" << rho1m10_double_error << "\t" << "\n"; - // TraceM(rho_mm'_lambdalambda') double delta_rho011_double_value = 0.5-results.parValue("r00_33_0")-2*results.parValue("r11_33_0"); double delta_rho011_double_error = sqrt(results.parError("r00_33_0")*results.parError("r00_33_0")+4*results.parError("r11_33_0")*results.parError("r11_33_0")+4*results.covariance("r00_33_0","r11_33_0")); outfile << "delta_rho011_double" << "\t" << delta_rho011_double_value << "\t" << delta_rho011_double_error << "\t" << "\n"; @@ -623,398 +471,331 @@ int main( int argc, char* argv[] ){ //char array for strings outfile << "delta_rho23m1_double" << "\t" << delta_rho23m1_double_value << "\t" << delta_rho23m1_double_error << "\t" << "\n"; - //test - //test - double r00_33_1_single_value_test = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*(0.5-results.parValue("delta_rho011")) + results.parValue("rho000")*results.parValue("delta_rho133"); - double r00_33_1_single_error_test = sqrt((2*(0.5-results.parValue("delta_rho011"))*results.parError("delta_rho111"))*(2*(0.5-results.parValue("delta_rho011"))*results.parError("delta_rho111")) + ((2*(0.5-results.parValue("delta_rho011"))+results.parValue("rho000"))*results.parError("delta_rho133"))*((2*(0.5-results.parValue("delta_rho011"))+results.parValue("rho000"))*results.parError("delta_rho133")) + (-2*(0.5-results.parValue("delta_rho011"))*results.parError("rho111"))*(-2*(0.5-results.parValue("delta_rho011"))*results.parError("rho111")) + (-2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*results.parError("delta_rho011"))*(-2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*results.parError("delta_rho011")) + (results.parValue("delta_rho133")*results.parError("rho000"))*(results.parValue("delta_rho133")*results.parError("rho000"))); - outfile << "r00_33_1_single_test" << "\t" << r00_33_1_single_value_test << "\t" << r00_33_1_single_error_test << "\n"; - - double r00_31_1_single_value_test = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*results.parValue("delta_rho031") + results.parValue("rho000")*results.parValue("delta_rho131"); - double r00_31_1_single_error_test = sqrt((2*results.parValue("delta_rho031")*results.parError("delta_rho111"))*(2*results.parValue("delta_rho031")*results.parError("delta_rho111")) + (2*results.parValue("delta_rho031")*results.parError("delta_rho133"))*(2*results.parValue("delta_rho031")*results.parError("delta_rho133")) + (-2*results.parValue("delta_rho031")*results.parError("rho111"))*(-2*results.parValue("delta_rho031")*results.parError("rho111")) + (2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*results.parError("delta_rho031"))*(2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*results.parError("delta_rho031")) + (results.parValue("delta_rho131")*results.parError("rho000"))*(results.parValue("delta_rho131")*results.parError("rho000")) + (results.parValue("rho000")*results.parError("delta_rho131"))*(results.parValue("rho000")*results.parError("delta_rho131"))); - outfile << "r00_31_1_single_test" << "\t" << r00_31_1_single_value_test << "\t" << r00_31_1_single_error_test << "\n"; + //Calculate double SDMEs with single SDMEs (factorized fitmodel) +//alpha = 0 +double r00_33_0_single_value = results.parValue("rho000") * (0.5-results.parValue("delta_rho011")); +double r00_33_0_single_error = sqrt(results.parError("rho000")*results.parError("rho000")*(0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho000")*results.parValue("rho000")-2*results.covariance("rho000","delta_rho011")*(0.5-results.parValue("delta_rho011"))*results.parValue("rho000")); +outfile << "r00_33_0_single" << "\t" << r00_33_0_single_value << "\t" << r00_33_0_single_error << "\t" << "\n"; +double r00_31_0_single_value = results.parValue("rho000") * results.parValue("delta_rho031"); +double r00_31_0_single_error = sqrt(results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho031")*results.parValue("delta_rho031")+results.parError("delta_rho031")*results.parError("delta_rho031")*results.parValue("rho000")*results.parValue("rho000")+2*results.covariance("rho000","delta_rho031")*results.parValue("delta_rho031")*results.parValue("rho000")); +outfile << "r00_31_0_single" << "\t" << r00_31_0_single_value << "\t" << r00_31_0_single_error << "\t" << "\n"; - double r00_11_1_single_value_test = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*results.parValue("delta_rho011")+results.parValue("rho000")*results.parValue("delta_rho111"); - double r00_11_1_single_error_test = sqrt(4*results.parValue("delta_rho011")*results.parValue("delta_rho011")*(results.parError("delta_rho111")*results.parError("delta_rho111")+results.parError("delta_rho133")*results.parError("delta_rho133")+results.parError("rho111")*results.parError("rho111")+2*results.covariance("delta_rho111","delta_rho133")-2*results.covariance("delta_rho111","rho111")-2*results.covariance("delta_rho133","rho111"))+4*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*results.parError("delta_rho011")*results.parError("delta_rho011")+results.parValue("delta_rho111")*results.parValue("delta_rho111")*results.parError("rho000")*results.parError("rho000")+results.parValue("rho000")*results.parValue("rho000")*results.parError("delta_rho111")*results.parError("delta_rho111")+2*results.parValue("rho000")*results.parValue("delta_rho111")*results.covariance("rho000","delta_rho111")); - outfile << "r00_11_1_single_test" << "\t" << r00_11_1_single_value_test << "\t" << r00_11_1_single_error_test << "\n"; - - double r00_3m1_1_single_value_test = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*results.parValue("delta_rho03m1") + results.parValue("rho000")*results.parValue("delta_rho13m1"); - double r00_3m1_1_single_error_test = sqrt(4*results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*(results.parError("delta_rho111")*results.parError("delta_rho111")+results.parError("delta_rho133")*results.parError("delta_rho133")+results.parError("rho111")*results.parError("rho111")+2*results.covariance("delta_rho111","delta_rho133")-2*results.covariance("delta_rho111","rho111")-2*results.covariance("delta_rho133","rho111"))+4*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111"))*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+results.parValue("delta_rho13m1")*results.parValue("delta_rho13m1")*results.parError("rho000")*results.parError("rho000")+results.parValue("rho000")*results.parValue("rho000")*results.parError("delta_rho13m1")*results.parError("delta_rho13m1")+2*results.parValue("rho000")*results.parValue("delta_rho13m1")*results.covariance("rho000","delta_rho13m1")); - outfile << "r00_3m1_1_single_test" << "\t" << r00_3m1_1_single_value_test << "\t" << r00_3m1_1_single_error_test << "\n"; - - double r11_33_1_single_value_test = results.parValue("rho111")*(0.5-results.parValue("delta_rho011"))+(1-results.parValue("rho000"))*0.5*results.parValue("delta_rho133"); - double r11_33_1_single_error_test = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho011")*results.parError("delta_rho011")+0.25*results.parValue("delta_rho133")*results.parValue("delta_rho133")*results.parError("rho000")*results.parError("rho000")+0.25*(1-results.parValue("rho000"))*(1-results.parValue("rho000"))*results.parError("delta_rho133")*results.parError("delta_rho133")-2*results.parValue("rho111")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho111","delta_rho011")-(0.5-results.parValue("delta_rho011"))*results.parValue("delta_rho133")*results.covariance("rho111","rho000")+results.parValue("rho111")*(1-results.parValue("rho000"))*results.covariance("rho111","delta_rho133")+results.parValue("rho111")*results.parValue("delta_rho133")*results.covariance("delta_rho011","rho000")-results.parValue("rho111")*(1-results.parValue("rho000"))*results.covariance("delta_rho011","delta_rho133")-0.5*(1-results.parValue("rho000"))*results.parValue("delta_rho133")*results.covariance("rho000","delta_rho133")); - outfile << "r11_33_1_single_test" << "\t" << r11_33_1_single_value_test << "\t" << r11_33_1_single_error_test << "\n"; - - double r11_31_1_single_value_test = results.parValue("rho111")*results.parValue("delta_rho031")+(1-results.parValue("rho000"))*0.5*results.parValue("delta_rho131"); - double r11_31_1_single_error_test = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho031")*results.parError("delta_rho031")+0.25*results.parValue("delta_rho131")*results.parValue("delta_rho131")*results.parError("rho000")*results.parError("rho000")+0.25*(1-results.parValue("rho000"))*(1-results.parValue("rho000"))*results.parError("delta_rho131")*results.parError("delta_rho131")+2*results.parValue("delta_rho031")*results.parValue("rho111")*results.covariance("rho111","delta_rho031")-results.parValue("delta_rho031")*results.parValue("delta_rho131")*results.covariance("rho111","rho000")+results.parValue("delta_rho031")*(1-results.parValue("rho000"))*results.covariance("rho111","delta_rho131")-results.parValue("rho111")*results.parValue("delta_rho131")*results.covariance("delta_rho031","rho000")+results.parValue("rho111")*(1-results.parValue("rho000"))*results.covariance("delta_rho031","delta_rho131")-(1-results.parValue("rho000"))*results.parValue("delta_rho131")*results.covariance("rho000","delta_rho131")); - outfile << "r11_31_1_single_test" << "\t" << r11_31_1_single_value_test << "\t" << r11_31_1_single_error_test << "\n"; - - double r11_11_1_single_value_test = results.parValue("rho111")*results.parValue("delta_rho011")+(1-results.parValue("rho000"))*0.5*results.parValue("delta_rho111"); - double r11_11_1_single_error_test = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho011")*results.parError("delta_rho011")+0.25*results.parValue("delta_rho111")*results.parValue("delta_rho111")*results.parError("rho000")*results.parError("rho000")+0.25*(1-results.parValue("rho000"))*(1-results.parValue("rho000"))*results.parError("delta_rho111")*results.parError("delta_rho111")+2*results.parValue("delta_rho011")*results.parValue("rho111")*results.covariance("rho111","delta_rho011")-results.parValue("delta_rho011")*results.parValue("delta_rho111")*results.covariance("rho111","rho000")+results.parValue("delta_rho011")*(1-results.parValue("rho000"))*results.covariance("rho111","delta_rho111")-results.parValue("rho111")*results.parValue("delta_rho111")*results.covariance("delta_rho011","rho000")+results.parValue("rho111")*(1-results.parValue("rho000"))*results.covariance("delta_rho011","delta_rho111")-(1-results.parValue("rho000"))*results.parValue("delta_rho111")*results.covariance("rho000","delta_rho111")); - outfile << "r11_11_1_single_test" << "\t" << r11_11_1_single_value_test << "\t" << r11_11_1_single_error_test << "\n"; - - double r11_3m1_1_single_value_test = results.parValue("rho111")*results.parValue("delta_rho03m1")+(1-results.parValue("rho000"))*0.5*results.parValue("delta_rho13m1"); - double r11_3m1_1_single_error_test = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+0.25*results.parValue("delta_rho13m1")*results.parValue("delta_rho13m1")*results.parError("rho000")*results.parError("rho000")+0.25*(1-results.parValue("rho000"))*(1-results.parValue("rho000"))*results.parError("delta_rho13m1")*results.parError("delta_rho13m1")+2*results.parValue("delta_rho03m1")*results.parValue("rho111")*results.covariance("rho111","delta_rho03m1")-results.parValue("delta_rho03m1")*results.parValue("delta_rho13m1")*results.covariance("rho111","rho000")+results.parValue("delta_rho03m1")*(1-results.parValue("rho000"))*results.covariance("rho111","delta_rho13m1")-results.parValue("rho111")*results.parValue("delta_rho13m1")*results.covariance("delta_rho03m1","rho000")+results.parValue("rho111")*(1-results.parValue("rho000"))*results.covariance("delta_rho03m1","delta_rho13m1")-(1-results.parValue("rho000"))*results.parValue("delta_rho13m1")*results.covariance("rho000","delta_rho13m1")); - outfile << "r11_3m1_1_single_test" << "\t" << r11_3m1_1_single_value_test << "\t" << r11_3m1_1_single_error_test << "\n"; - - double r1m1_33_1_single_value_test = results.parValue("rho1m11")*(0.5-results.parValue("delta_rho011"))+results.parValue("rho1m10")*results.parValue("delta_rho133"); - double r1m1_33_1_single_error_test = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho011")*results.parError("delta_rho011")+results.parValue("delta_rho133")*results.parValue("delta_rho133")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho133")*results.parError("delta_rho133")-2*results.parValue("rho1m11")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho1m11","delta_rho011")+2*(0.5-results.parValue("delta_rho011"))*results.parValue("delta_rho133")*results.covariance("rho1m11","rho1m10")+2*results.parValue("rho1m11")*results.parValue("rho1m10")*results.covariance("rho1m11","delta_rho133")-2*results.parValue("rho1m11")*results.parValue("delta_rho133")*results.covariance("delta_rho011","rho1m10")-2*results.parValue("rho1m11")*results.parValue("rho1m10")*results.covariance("delta_rho011","delta_rho133")+2*results.parValue("rho1m10")*results.parValue("delta_rho133")*results.covariance("rho1m10","delta_rho133")); - outfile << "r1m1_33_1_single_test" << "\t" << r1m1_33_1_single_value_test << "\t" << r1m1_33_1_single_error_test << "\n"; - - double r1m1_11_1_single_value_test = results.parValue("rho1m11")*results.parValue("delta_rho011")+results.parValue("rho1m10")*results.parValue("delta_rho111"); - double r1m1_11_1_single_error_test = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho011")*results.parError("delta_rho011")+results.parValue("delta_rho111")*results.parValue("delta_rho111")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho111")*results.parError("delta_rho111")+2*results.parValue("delta_rho011")*results.parValue("rho1m11")*results.covariance("rho1m11","delta_rho011")+2*results.parValue("delta_rho011")*results.parValue("delta_rho111")*results.covariance("rho1m11","rho1m10")+2*results.parValue("delta_rho011")*results.parValue("rho1m10")*results.covariance("rho1m11","delta_rho111")+2*results.parValue("rho1m11")*results.parValue("delta_rho111")*results.covariance("delta_rho011","rho1m10")+2*results.parValue("rho1m11")*results.parValue("rho1m10")*results.covariance("delta_rho011","delta_rho111")+2*results.parValue("rho1m10")*results.parValue("delta_rho111")*results.covariance("rho1m10","delta_rho111")); - outfile << "r1m1_11_1_single_test" << "\t" << r1m1_11_1_single_value_test << "\t" << r1m1_11_1_single_error_test << "\n"; - - double r1m1_31_1_single_value_test = results.parValue("rho1m11")*results.parValue("delta_rho031")+results.parValue("rho1m10")*results.parValue("delta_rho131"); - double r1m1_31_1_single_error_test = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho031")*results.parError("delta_rho031")+results.parValue("delta_rho131")*results.parValue("delta_rho131")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho131")*results.parError("delta_rho131")+2*results.parValue("delta_rho031")*results.parValue("rho1m11")*results.covariance("rho1m11","delta_rho031")+2*results.parValue("delta_rho031")*results.parValue("delta_rho131")*results.covariance("rho1m11","rho1m10")+2*results.parValue("delta_rho031")*results.parValue("rho1m10")*results.covariance("rho1m11","delta_rho131")+2*results.parValue("rho1m11")*results.parValue("delta_rho131")*results.covariance("delta_rho031","rho1m10")+2*results.parValue("rho1m11")*results.parValue("rho1m10")*results.covariance("delta_rho031","delta_rho131")+2*results.parValue("rho1m10")*results.parValue("delta_rho131")*results.covariance("rho1m10","delta_rho131")); - outfile << "r1m1_31_1_single_test" << "\t" << r1m1_31_1_single_value_test << "\t" << r1m1_31_1_single_error_test << "\n"; - - double r1m1_3m1_1_single_value_test = results.parValue("rho1m11")*results.parValue("delta_rho03m1")+results.parValue("rho1m10")*results.parValue("delta_rho13m1"); - double r1m1_3m1_1_single_error_test = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+results.parValue("delta_rho13m1")*results.parValue("delta_rho13m1")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho13m1")*results.parError("delta_rho13m1")+2*results.parValue("delta_rho03m1")*results.parValue("rho1m11")*results.covariance("rho1m11","delta_rho03m1")+2*results.parValue("delta_rho03m1")*results.parValue("delta_rho13m1")*results.covariance("rho1m11","rho1m10")+2*results.parValue("delta_rho03m1")*results.parValue("rho1m10")*results.covariance("rho1m11","delta_rho13m1")+2*results.parValue("rho1m11")*results.parValue("delta_rho13m1")*results.covariance("delta_rho03m1","rho1m10")+2*results.parValue("rho1m11")*results.parValue("rho1m10")*results.covariance("delta_rho03m1","delta_rho13m1")+2*results.parValue("rho1m10")*results.parValue("delta_rho13m1")*results.covariance("rho1m10","delta_rho13m1")); - outfile << "r1m1_3m1_1_single_test" << "\t" << r1m1_3m1_1_single_value_test << "\t" << r1m1_3m1_1_single_error_test << "\n"; - - double r10_33_1_single_value_test = results.parValue("rho101")*(0.5-results.parValue("delta_rho011"))+results.parValue("rho100")*results.parValue("delta_rho133"); - double r10_33_1_single_error_test = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho011")*results.parError("delta_rho011")+results.parValue("delta_rho133")*results.parValue("delta_rho133")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho133")*results.parError("delta_rho133")-2*results.parValue("rho101")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho101","delta_rho011")+2*(0.5-results.parValue("delta_rho011"))*results.parValue("delta_rho133")*results.covariance("rho101","rho100")+2*results.parValue("rho101")*results.parValue("rho100")*results.covariance("rho101","delta_rho133")-2*results.parValue("rho101")*results.parValue("delta_rho133")*results.covariance("delta_rho011","rho100")-2*results.parValue("rho101")*results.parValue("rho100")*results.covariance("delta_rho011","delta_rho133")+2*results.parValue("rho100")*results.parValue("delta_rho133")*results.covariance("rho100","delta_rho133")); - outfile << "r10_33_1_single_test" << "\t" << r10_33_1_single_value_test << "\t" << r10_33_1_single_error_test << "\n"; +double r00_11_0_single_value = results.parValue("rho000") * results.parValue("delta_rho011"); +double r00_11_0_single_error = sqrt(results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho011")*results.parValue("delta_rho011")+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho000")*results.parValue("rho000")+2*results.covariance("rho000","delta_rho011")*results.parValue("delta_rho011")*results.parValue("rho000")); +outfile << "r00_11_0_single" << "\t" << r00_11_0_single_value << "\t" << r00_11_0_single_error << "\t" << "\n"; - double r10_31_1_single_value_test = results.parValue("rho101")*results.parValue("delta_rho031")+results.parValue("rho100")*results.parValue("delta_rho131"); - double r10_31_1_single_error_test = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho031")*results.parError("delta_rho031")+results.parValue("delta_rho131")*results.parValue("delta_rho131")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho131")*results.parError("delta_rho131")+2*results.parValue("delta_rho031")*results.parValue("delta_rho131")*results.covariance("rho101","rho100")+2*results.parValue("delta_rho031")*results.parValue("rho100")*results.covariance("rho101","delta_rho131")+2*results.parValue("rho101")*results.parValue("delta_rho131")*results.covariance("delta_rho031","rho100")+2*results.parValue("rho101")*results.parValue("rho100")*results.covariance("delta_rho031","delta_rho131")+2*results.parValue("delta_rho031")*results.parValue("rho101")*results.covariance("rho101","delta_rho031")+2*results.parValue("rho100")*results.parValue("delta_rho131")*results.covariance("rho100","delta_rho131")); - outfile << "r10_31_1_single_test" << "\t" << r10_31_1_single_value_test << "\t" << r10_31_1_single_error_test << "\n"; - - double r10_11_1_single_value_test = results.parValue("rho101")*results.parValue("delta_rho011")+results.parValue("rho100")*results.parValue("delta_rho111"); - double r10_11_1_single_error_test = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho011")*results.parError("delta_rho011")+results.parValue("delta_rho111")*results.parValue("delta_rho111")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho111")*results.parError("delta_rho111")+2*results.parValue("delta_rho011")*results.parValue("delta_rho111")*results.covariance("rho101","rho100")+2*results.parValue("delta_rho011")*results.parValue("rho100")*results.covariance("rho101","delta_rho111")+2*results.parValue("rho101")*results.parValue("delta_rho111")*results.covariance("delta_rho011","rho100")+2*results.parValue("rho101")*results.parValue("rho100")*results.covariance("delta_rho011","delta_rho111")+2*results.parValue("delta_rho011")*results.parValue("rho101")*results.covariance("rho101","delta_rho011")+2*results.parValue("rho100")*results.parValue("delta_rho111")*results.covariance("rho100","delta_rho111")); - outfile << "r10_11_1_single_test" << "\t" << r10_11_1_single_value_test << "\t" << r10_11_1_single_error_test << "\n"; - - double r10_3m1_1_single_value_test = results.parValue("rho101")*results.parValue("delta_rho03m1")+results.parValue("rho100")*results.parValue("delta_rho13m1"); - double r10_3m1_1_single_error_test = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+results.parValue("delta_rho13m1")*results.parValue("delta_rho13m1")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho13m1")*results.parError("delta_rho13m1")+2*results.parValue("delta_rho03m1")*results.parValue("delta_rho13m1")*results.covariance("rho101","rho100")+2*results.parValue("delta_rho03m1")*results.parValue("rho100")*results.covariance("rho101","delta_rho13m1")+2*results.parValue("rho101")*results.parValue("delta_rho13m1")*results.covariance("delta_rho03m1","rho100")+2*results.parValue("rho101")*results.parValue("rho100")*results.covariance("delta_rho03m1","delta_rho13m1")+2*results.parValue("delta_rho03m1")*results.parValue("rho101")*results.covariance("rho101","delta_rho03m1")+2*results.parValue("rho100")*results.parValue("delta_rho13m1")*results.covariance("rho100","delta_rho13m1")); - outfile << "r10_3m1_1_single_test" << "\t" << r10_3m1_1_single_value_test << "\t" << r10_3m1_1_single_error_test << "\n"; - - //factorized fitmodel 2 - //factorized fitmodel 2 -double r00_33_1_single_value_test2 = results.parValue("rho001")*(0.5-results.parValue("delta_rho011")) ; -double r00_33_1_single_error_test2 = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho001")*results.parError("rho001")+results.parValue("rho001")*results.parValue("rho001")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho001")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho001","delta_rho011")); -outfile << "r00_33_1_single_test2" << "\t" << r00_33_1_single_value_test2 << "\t" << r00_33_1_single_error_test2 << "\n"; +double r00_3m1_0_single_value = results.parValue("rho000") * results.parValue("delta_rho03m1"); +double r00_3m1_0_single_error = sqrt(results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")+results.parError("delta_rho03m1")*results.parError("delta_rho03m1")*results.parValue("rho000")*results.parValue("rho000")+2*results.covariance("rho000","delta_rho03m1")*results.parValue("delta_rho03m1")*results.parValue("rho000")); +outfile << "r00_3m1_0_single" << "\t" << r00_3m1_0_single_value << "\t" << r00_3m1_0_single_error << "\t" << "\n"; -double r00_31_1_single_value_test2 = results.parValue("rho001")*results.parValue("delta_rho031") ; -double r00_31_1_single_error_test2 = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho001")*results.parError("rho001")+results.parValue("rho001")*results.parValue("rho001")*results.parError("delta_rho031")*results.parError("delta_rho031")+2*results.parValue("rho001")*results.parValue("delta_rho031")*results.covariance("rho001","delta_rho031")); -outfile << "r00_31_1_single_test2" << "\t" << r00_31_1_single_value_test2 << "\t" << r00_31_1_single_error_test2 << "\n"; -double r00_11_1_single_value_test2 = results.parValue("rho001")*results.parValue("delta_rho011"); -double r00_11_1_single_error_test2 = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho001")*results.parError("rho001")+results.parValue("rho001")*results.parValue("rho001")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("rho001")*results.parValue("delta_rho011")*results.covariance("rho001","delta_rho011")); -outfile << "r00_11_1_single_test2" << "\t" << r00_11_1_single_value_test2 << "\t" << r00_11_1_single_error_test2 << "\n"; +double r11_33_0_single_value = (1-results.parValue("rho000")) * 0.5 * (0.5-results.parValue("delta_rho011")); +double r11_33_0_single_error = sqrt(0.25*(0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho000")*results.parError("rho000")+0.25*(results.parValue("rho000")-1)*(results.parValue("rho000")-1)*results.parError("delta_rho011")*results.parError("delta_rho011")-0.5*(results.parValue("rho000")-1)*(0.5-results.parValue("delta_rho011"))*results.covariance("rho000","delta_rho011")); +outfile << "r11_33_0_single" << "\t" << r11_33_0_single_value << "\t" << r11_33_0_single_error << "\t" << "\n"; -double r00_3m1_1_single_value_test2 = results.parValue("rho001")*results.parValue("delta_rho03m1") ; -double r00_3m1_1_single_error_test2 = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho001")*results.parError("rho001")+results.parValue("rho001")*results.parValue("rho001")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+2*results.parValue("rho001")*results.parValue("delta_rho03m1")*results.covariance("rho001","delta_rho03m1")); -outfile << "r00_3m1_1_single_test2" << "\t" << r00_3m1_1_single_value_test2 << "\t" << r00_3m1_1_single_error_test2 << "\n"; +double r11_31_0_single_value = (1-results.parValue("rho000")) * 0.5 * results.parValue("delta_rho031"); +double r11_31_0_single_error = sqrt(0.25*results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho031")*results.parValue("delta_rho031")+0.25*results.parError("delta_rho031")*results.parError("delta_rho031")*(results.parValue("rho000")-1)*(results.parValue("rho000")-1)+0.5*results.covariance("rho000","delta_rho031")*results.parValue("delta_rho031")*(results.parValue("rho000")-1)); +outfile << "r11_31_0_single" << "\t" << r11_31_0_single_value << "\t" << r11_31_0_single_error << "\t" << "\n"; -double r11_33_1_single_value_test2 = results.parValue("rho111")*(0.5-results.parValue("delta_rho011")); -double r11_33_1_single_error_test2 = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho111")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho111","delta_rho011")); -outfile << "r11_33_1_single_test2" << "\t" << r11_33_1_single_value_test2 << "\t" << r11_33_1_single_error_test2 << "\n"; +double r11_11_0_single_value = (1-results.parValue("rho000")) * 0.5 * results.parValue("delta_rho011"); +double r11_11_0_single_error = sqrt(0.25*results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho011")*results.parValue("delta_rho011")+0.25*results.parError("delta_rho011")*results.parError("delta_rho011")*(results.parValue("rho000")-1)*(results.parValue("rho000")-1)+0.5*results.covariance("rho000","delta_rho011")*results.parValue("delta_rho011")*(results.parValue("rho000")-1)); +outfile << "r11_11_0_single" << "\t" << r11_11_0_single_value << "\t" << r11_11_0_single_error << "\t" << "\n"; -double r11_31_1_single_value_test2 = results.parValue("rho111")*results.parValue("delta_rho031"); -double r11_31_1_single_error_test2 = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho031")*results.parError("delta_rho031")+2*results.parValue("rho111")*results.parValue("delta_rho031")*results.covariance("rho111","delta_rho031")); -outfile << "r11_31_1_single_test2" << "\t" << r11_31_1_single_value_test2 << "\t" << r11_31_1_single_error_test2 << "\n"; +double r11_3m1_0_single_value = (1-results.parValue("rho000")) * 0.5 * results.parValue("delta_rho03m1"); +double r11_3m1_0_single_error = sqrt(0.25*results.parError("rho000")*results.parError("rho000")*results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")+0.25*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")*(results.parValue("rho000")-1)*(results.parValue("rho000")-1)+0.5*results.covariance("rho000","delta_rho03m1")*results.parValue("delta_rho03m1")*(results.parValue("rho000")-1)); +outfile << "r11_3m1_0_single" << "\t" << r11_3m1_0_single_value << "\t" << r11_3m1_0_single_error << "\t" << "\n"; -double r11_11_1_single_value_test2 = results.parValue("rho111")*results.parValue("delta_rho011"); -double r11_11_1_single_error_test2 = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("rho111")*results.parValue("delta_rho011")*results.covariance("rho111","delta_rho011")); -outfile << "r11_11_1_single_test2" << "\t" << r11_11_1_single_value_test2 << "\t" << r11_11_1_single_error_test2 << "\n"; -double r11_3m1_1_single_value_test2 = results.parValue("rho111")*results.parValue("delta_rho03m1"); -double r11_3m1_1_single_error_test2 = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+2*results.parValue("rho111")*results.parValue("delta_rho03m1")*results.covariance("rho111","delta_rho03m1")); -outfile << "r11_3m1_1_single_test2" << "\t" << r11_3m1_1_single_value_test2 << "\t" << r11_3m1_1_single_error_test2 << "\n"; +double r1m1_33_0_single_value = results.parValue("rho1m10") * (0.5-results.parValue("delta_rho011")); +double r1m1_33_0_single_error = sqrt(results.parError("rho1m10")*results.parError("rho1m10")*(0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho1m10")*results.parValue("rho1m10")-2*results.covariance("rho1m10","delta_rho011")*(0.5-results.parValue("delta_rho011"))*results.parValue("rho1m10")); +outfile << "r1m1_33_0_single" << "\t" << r1m1_33_0_single_value << "\t" << r1m1_33_0_single_error << "\t" << "\n"; -double r1m1_33_1_single_value_test2 = results.parValue("rho1m11")*(0.5-results.parValue("delta_rho011")); -double r1m1_33_1_single_error_test2 = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho1m11")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho1m11","delta_rho011")); -outfile << "r1m1_33_1_single_test2" << "\t" << r1m1_33_1_single_value_test2 << "\t" << r1m1_33_1_single_error_test2 << "\n"; +double r1m1_11_0_single_value = results.parValue("rho1m10") * results.parValue("delta_rho011"); +double r1m1_11_0_single_error = sqrt(results.parError("rho1m10")*results.parError("rho1m10")*results.parValue("delta_rho011")*results.parValue("delta_rho011")+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho1m10")*results.parValue("rho1m10")+2*results.covariance("rho1m10","delta_rho011")*results.parValue("delta_rho011")*results.parValue("rho1m10")); +outfile << "r1m1_11_0_single" << "\t" << r1m1_11_0_single_value << "\t" << r1m1_11_0_single_error << "\t" << "\n"; -double r1m1_11_1_single_value_test2 = results.parValue("rho1m11")*results.parValue("delta_rho011"); -double r1m1_11_1_single_error_test2 = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("delta_rho011")*results.parValue("rho1m11")*results.covariance("rho1m11","delta_rho011")); -outfile << "r1m1_11_1_single_test2" << "\t" << r1m1_11_1_single_value_test2 << "\t" << r1m1_11_1_single_error_test2 << "\n"; +double r1m1_31_0_single_value = results.parValue("rho1m10") * results.parValue("delta_rho031"); +double r1m1_31_0_single_error = sqrt(results.parError("rho1m10")*results.parError("rho1m10")*results.parValue("delta_rho031")*results.parValue("delta_rho031")+results.parError("delta_rho031")*results.parError("delta_rho031")*results.parValue("rho1m10")*results.parValue("rho1m10")+2*results.covariance("rho1m10","delta_rho031")*results.parValue("delta_rho031")*results.parValue("rho1m10")); +outfile << "r1m1_31_0_single" << "\t" << r1m1_31_0_single_value << "\t" << r1m1_31_0_single_error << "\t" << "\n"; -double r1m1_31_1_single_value_test2 = results.parValue("rho1m11")*results.parValue("delta_rho031"); -double r1m1_31_1_single_error_test2 = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho031")*results.parError("delta_rho031")+2*results.parValue("delta_rho031")*results.parValue("rho1m11")*results.covariance("rho1m11","delta_rho031")); -outfile << "r1m1_31_1_single_test2" << "\t" << r1m1_31_1_single_value_test2 << "\t" << r1m1_31_1_single_error_test2 << "\n"; +double r1m1_3m1_0_single_value = results.parValue("rho1m10") * results.parValue("delta_rho03m1"); +double r1m1_3m1_0_single_error = sqrt(results.parError("rho1m10")*results.parError("rho1m10")*results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")+results.parError("delta_rho03m1")*results.parError("delta_rho03m1")*results.parValue("rho1m10")*results.parValue("rho1m10")+2*results.covariance("rho1m10","delta_rho03m1")*results.parValue("delta_rho03m1")*results.parValue("rho1m10")); +outfile << "r1m1_3m1_0_single" << "\t" << r1m1_3m1_0_single_value << "\t" << r1m1_3m1_0_single_error << "\t" << "\n"; -double r1m1_3m1_1_single_value_test2 = results.parValue("rho1m11")*results.parValue("delta_rho03m1"); -double r1m1_3m1_1_single_error_test2 = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+2*results.parValue("delta_rho03m1")*results.parValue("rho1m11")*results.covariance("rho1m11","delta_rho03m1")); -outfile << "r1m1_3m1_1_single_test2" << "\t" << r1m1_3m1_1_single_value_test2 << "\t" << r1m1_3m1_1_single_error_test2 << "\n"; -double r10_33_1_single_value_test2 = results.parValue("rho101")*(0.5-results.parValue("delta_rho011")); -double r10_33_1_single_error_test2 = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho101")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho101","delta_rho011")); -outfile << "r10_33_1_single_test2" << "\t" << r10_33_1_single_value_test2 << "\t" << r10_33_1_single_error_test2 << "\n"; +double r10_33_0_single_value = results.parValue("rho100") * (0.5-results.parValue("delta_rho011")); +double r10_33_0_single_error = sqrt(results.parError("rho100")*results.parError("rho100")*(0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho100")*results.parValue("rho100")-2*results.covariance("rho100","delta_rho011")*(0.5-results.parValue("delta_rho011"))*results.parValue("rho100")); +outfile << "r10_33_0_single" << "\t" << r10_33_0_single_value << "\t" << r10_33_0_single_error << "\t" << "\n"; -double r10_31_1_single_value_test2 = results.parValue("rho101")*results.parValue("delta_rho031"); -double r10_31_1_single_error_test2 = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho031")*results.parError("delta_rho031")+2*results.parValue("delta_rho031")*results.parValue("rho101")*results.covariance("rho101","delta_rho031")); -outfile << "r10_31_1_single_test2" << "\t" << r10_31_1_single_value_test2 << "\t" << r10_31_1_single_error_test2 << "\n"; +double r10_31_0_single_value = results.parValue("rho100") * results.parValue("delta_rho031"); +double r10_31_0_single_error = sqrt(results.parError("rho100")*results.parError("rho100")*results.parValue("delta_rho031")*results.parValue("delta_rho031")+results.parError("delta_rho031")*results.parError("delta_rho031")*results.parValue("rho100")*results.parValue("rho100")+2*results.covariance("rho100","delta_rho031")*results.parValue("delta_rho031")*results.parValue("rho100")); +outfile << "r10_31_0_single" << "\t" << r10_31_0_single_value << "\t" << r10_31_0_single_error << "\t" << "\n"; -double r10_11_1_single_value_test2 = results.parValue("rho101")*results.parValue("delta_rho011"); -double r10_11_1_single_error_test2 = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("delta_rho011")*results.parValue("rho101")*results.covariance("rho101","delta_rho011")); -outfile << "r10_11_1_single_test2" << "\t" << r10_11_1_single_value_test2 << "\t" << r10_11_1_single_error_test2 << "\n"; +double r10_11_0_single_value = results.parValue("rho100") * results.parValue("delta_rho011"); +double r10_11_0_single_error = sqrt(results.parError("rho100")*results.parError("rho100")*results.parValue("delta_rho011")*results.parValue("delta_rho011")+results.parError("delta_rho011")*results.parError("delta_rho011")*results.parValue("rho100")*results.parValue("rho100")+2*results.covariance("rho100","delta_rho011")*results.parValue("delta_rho011")*results.parValue("rho100")); +outfile << "r10_11_0_single" << "\t" << r10_11_0_single_value << "\t" << r10_11_0_single_error << "\t" << "\n"; -double r10_3m1_1_single_value_test2 = results.parValue("rho101")*results.parValue("delta_rho03m1"); -double r10_3m1_1_single_error_test2 = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+2*results.parValue("delta_rho03m1")*results.parValue("rho101")*results.covariance("rho101","delta_rho03m1")); -outfile << "r10_3m1_1_single_test2" << "\t" << r10_3m1_1_single_value_test2 << "\t" << r10_3m1_1_single_error_test2 << "\n"; +double r10_3m1_0_single_value = results.parValue("rho100") * results.parValue("delta_rho03m1"); +double r10_3m1_0_single_error = sqrt(results.parError("rho100")*results.parError("rho100")*results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")+results.parError("delta_rho03m1")*results.parError("delta_rho03m1")*results.parValue("rho100")*results.parValue("rho100")+2*results.covariance("rho100","delta_rho03m1")*results.parValue("delta_rho03m1")*results.parValue("rho100")); +outfile << "r10_3m1_0_single" << "\t" << r10_3m1_0_single_value << "\t" << r10_3m1_0_single_error << "\t" << "\n"; + //alpha = 1 +double r00_33_1_single_value = results.parValue("rho001")*(0.5-results.parValue("delta_rho011")) ; +double r00_33_1_single_error = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho001")*results.parError("rho001")+results.parValue("rho001")*results.parValue("rho001")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho001")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho001","delta_rho011")); +outfile << "r00_33_1_single" << "\t" << r00_33_1_single_value << "\t" << r00_33_1_single_error << "\n"; +double r00_31_1_single_value = results.parValue("rho001")*results.parValue("delta_rho031") ; +double r00_31_1_single_error = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho001")*results.parError("rho001")+results.parValue("rho001")*results.parValue("rho001")*results.parError("delta_rho031")*results.parError("delta_rho031")+2*results.parValue("rho001")*results.parValue("delta_rho031")*results.covariance("rho001","delta_rho031")); +outfile << "r00_31_1_single" << "\t" << r00_31_1_single_value << "\t" << r00_31_1_single_error << "\n"; +double r00_11_1_single_value = results.parValue("rho001")*results.parValue("delta_rho011"); +double r00_11_1_single_error = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho001")*results.parError("rho001")+results.parValue("rho001")*results.parValue("rho001")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("rho001")*results.parValue("delta_rho011")*results.covariance("rho001","delta_rho011")); +outfile << "r00_11_1_single" << "\t" << r00_11_1_single_value << "\t" << r00_11_1_single_error << "\n"; -//allpha =2 +double r00_3m1_1_single_value = results.parValue("rho001")*results.parValue("delta_rho03m1") ; +double r00_3m1_1_single_error = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho001")*results.parError("rho001")+results.parValue("rho001")*results.parValue("rho001")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+2*results.parValue("rho001")*results.parValue("delta_rho03m1")*results.covariance("rho001","delta_rho03m1")); +outfile << "r00_3m1_1_single" << "\t" << r00_3m1_1_single_value << "\t" << r00_3m1_1_single_error << "\n"; - double r1m1_33_2_single_value_test = results.parValue("rho1m12")*(0.5-results.parValue("delta_rho011")); - double r1m1_33_2_single_error_test = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho1m12")*results.parError("rho1m12")+results.parValue("rho1m12")*results.parValue("rho1m12")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho1m12")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho1m12","delta_rho011")); - outfile << "r1m1_33_2_single_test" << "\t" << r1m1_33_2_single_value_test << "\t" << r1m1_33_2_single_error_test << "\n"; +double r11_33_1_single_value = results.parValue("rho111")*(0.5-results.parValue("delta_rho011")); +double r11_33_1_single_error = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho111")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho111","delta_rho011")); +outfile << "r11_33_1_single" << "\t" << r11_33_1_single_value << "\t" << r11_33_1_single_error << "\n"; - double r1m1_11_2_single_value_test = results.parValue("rho1m12")*results.parValue("delta_rho011"); - double r1m1_11_2_single_error_test = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho1m12")*results.parError("rho1m12")+results.parValue("rho1m12")*results.parValue("rho1m12")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("rho1m12")*results.parValue("delta_rho011")*results.covariance("rho1m12","delta_rho011")); - outfile << "r1m1_11_2_single_test" << "\t" << r1m1_11_2_single_value_test << "\t" << r1m1_11_2_single_error_test << "\n"; +double r11_31_1_single_value = results.parValue("rho111")*results.parValue("delta_rho031"); +double r11_31_1_single_error = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho031")*results.parError("delta_rho031")+2*results.parValue("rho111")*results.parValue("delta_rho031")*results.covariance("rho111","delta_rho031")); +outfile << "r11_31_1_single" << "\t" << r11_31_1_single_value << "\t" << r11_31_1_single_error << "\n"; - double r1m1_31_2_single_value_test = results.parValue("rho1m12")*results.parValue("delta_rho031");///results.parValue("rho1m10")*results.parValue("delta_rho231"); - double r1m1_31_2_single_error_test = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho1m12")*results.parError("rho1m12")+results.parValue("rho1m12")*results.parValue("rho1m12")*results.parError("delta_rho031")*results.parError("delta_rho031")+results.parValue("delta_rho231")*results.parValue("delta_rho231")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho231")*results.parError("delta_rho231")+2*results.parValue("delta_rho031")*results.parValue("delta_rho231")*results.covariance("rho1m12","rho1m10")+2*results.parValue("delta_rho031")*results.parValue("rho1m10")*results.covariance("rho1m12","delta_rho231")+2*results.parValue("rho1m12")*results.parValue("delta_rho231")*results.covariance("delta_rho031","rho1m10")+2*results.parValue("rho1m12")*results.parValue("rho1m10")*results.covariance("delta_rho031","delta_rho231")); - outfile << "r1m1_31_2_single_test" << "\t" << r1m1_31_2_single_value_test << "\t" << r1m1_31_2_single_error_test << "\n"; +double r11_11_1_single_value = results.parValue("rho111")*results.parValue("delta_rho011"); +double r11_11_1_single_error = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("rho111")*results.parValue("delta_rho011")*results.covariance("rho111","delta_rho011")); +outfile << "r11_11_1_single" << "\t" << r11_11_1_single_value << "\t" << r11_11_1_single_error << "\n"; - double r1m1_3m1_2_single_value_test = results.parValue("rho1m12")*results.parValue("delta_rho03m1");//; - double r1m1_3m1_2_single_error_test = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho1m12")*results.parError("rho1m12")+results.parValue("rho1m12")*results.parValue("rho1m12")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+results.parValue("delta_rho23m1")*results.parValue("delta_rho23m1")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho23m1")*results.parError("delta_rho23m1")+2*results.parValue("delta_rho03m1")*results.parValue("delta_rho23m1")*results.covariance("rho1m12","rho1m10")+2*results.parValue("delta_rho03m1")*results.parValue("rho1m10")*results.covariance("rho1m12","delta_rho23m1")+2*results.parValue("rho1m12")*results.parValue("delta_rho23m1")*results.covariance("delta_rho03m1","rho1m10")+2*results.parValue("rho1m12")*results.parValue("rho1m10")*results.covariance("delta_rho03m1","delta_rho23m1")); - outfile << "r1m1_3m1_2_single_test" << "\t" << r1m1_3m1_2_single_value_test << "\t" << r1m1_3m1_2_single_error_test << "\n"; +double r11_3m1_1_single_value = results.parValue("rho111")*results.parValue("delta_rho03m1"); +double r11_3m1_1_single_error = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho111")*results.parError("rho111")+results.parValue("rho111")*results.parValue("rho111")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+2*results.parValue("rho111")*results.parValue("delta_rho03m1")*results.covariance("rho111","delta_rho03m1")); +outfile << "r11_3m1_1_single" << "\t" << r11_3m1_1_single_value << "\t" << r11_3m1_1_single_error << "\n"; - double r10_33_2_single_value_test = results.parValue("rho102")*(0.5-results.parValue("delta_rho011")); - double r10_33_2_single_error_test = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho102")*results.parError("rho102")+results.parValue("rho102")*results.parValue("rho102")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho102")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho102","delta_rho011")); - outfile << "r10_33_2_single_test" << "\t" << r10_33_2_single_value_test << "\t" << r10_33_2_single_error_test << "\n"; +double r1m1_33_1_single_value = results.parValue("rho1m11")*(0.5-results.parValue("delta_rho011")); +double r1m1_33_1_single_error = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho1m11")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho1m11","delta_rho011")); +outfile << "r1m1_33_1_single" << "\t" << r1m1_33_1_single_value << "\t" << r1m1_33_1_single_error << "\n"; - double r10_11_2_single_value_test = results.parValue("rho102")*results.parValue("delta_rho011"); - double r10_11_2_single_error_test = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho102")*results.parError("rho102")+results.parValue("rho102")*results.parValue("rho102")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("rho102")*results.parValue("delta_rho011")*results.covariance("rho102","delta_rho011")); - outfile << "r10_11_2_single_test" << "\t" << r10_11_2_single_value_test << "\t" << r10_11_2_single_error_test << "\n"; +double r1m1_11_1_single_value = results.parValue("rho1m11")*results.parValue("delta_rho011"); +double r1m1_11_1_single_error = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("delta_rho011")*results.parValue("rho1m11")*results.covariance("rho1m11","delta_rho011")); +outfile << "r1m1_11_1_single" << "\t" << r1m1_11_1_single_value << "\t" << r1m1_11_1_single_error << "\n"; - double r10_31_2_single_value_test = results.parValue("rho102")*results.parValue("delta_rho031"); //+results.parValue("rho100")*results.parValue("delta_rho231") - double r10_31_2_single_error_test = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho102")*results.parError("rho102")+results.parValue("rho102")*results.parValue("rho102")*results.parError("delta_rho031")*results.parError("delta_rho031")+results.parValue("delta_rho231")*results.parValue("delta_rho231")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho231")*results.parError("delta_rho231")+2*results.parValue("delta_rho031")*results.parValue("delta_rho231")*results.covariance("rho102","rho100")+2*results.parValue("delta_rho031")*results.parValue("rho100")*results.covariance("rho102","delta_rho231")+2*results.parValue("rho102")*results.parValue("delta_rho231")*results.covariance("delta_rho031","rho100")+2*results.parValue("rho102")*results.parValue("rho100")*results.covariance("delta_rho031","delta_rho231")); - outfile << "r10_31_2_single_test" << "\t" << r10_31_2_single_value_test << "\t" << r10_31_2_single_error_test << "\n"; +double r1m1_31_1_single_value = results.parValue("rho1m11")*results.parValue("delta_rho031"); +double r1m1_31_1_single_error = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho031")*results.parError("delta_rho031")+2*results.parValue("delta_rho031")*results.parValue("rho1m11")*results.covariance("rho1m11","delta_rho031")); +outfile << "r1m1_31_1_single" << "\t" << r1m1_31_1_single_value << "\t" << r1m1_31_1_single_error << "\n"; - double r10_3m1_2_single_value_test = results.parValue("rho102")*results.parValue("delta_rho03m1"); //+results.parValue("rho100")*results.parValue("delta_rho23m1") - double r10_3m1_2_single_error_test = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho102")*results.parError("rho102")+results.parValue("rho102")*results.parValue("rho102")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+results.parValue("delta_rho23m1")*results.parValue("delta_rho23m1")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho23m1")*results.parError("delta_rho23m1")+2*results.parValue("delta_rho03m1")*results.parValue("delta_rho23m1")*results.covariance("rho102","rho100")+2*results.parValue("delta_rho03m1")*results.parValue("rho100")*results.covariance("rho102","delta_rho23m1")+2*results.parValue("rho102")*results.parValue("delta_rho23m1")*results.covariance("delta_rho03m1","rho100")+2*results.parValue("rho102")*results.parValue("rho100")*results.covariance("delta_rho03m1","delta_rho23m1")); - outfile << "r10_3m1_2_single_test" << "\t" << r10_3m1_2_single_value_test << "\t" << r10_3m1_2_single_error_test << "\n"; +double r1m1_3m1_1_single_value = results.parValue("rho1m11")*results.parValue("delta_rho03m1"); +double r1m1_3m1_1_single_error = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho1m11")*results.parError("rho1m11")+results.parValue("rho1m11")*results.parValue("rho1m11")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+2*results.parValue("delta_rho03m1")*results.parValue("rho1m11")*results.covariance("rho1m11","delta_rho03m1")); +outfile << "r1m1_3m1_1_single" << "\t" << r1m1_3m1_1_single_value << "\t" << r1m1_3m1_1_single_error << "\n"; - double rt00_31_2_single_value_test = results.parValue("rho000")*results.parValue("delta_rho231"); - double rt00_31_2_single_error_test = sqrt(results.parValue("delta_rho231")*results.parValue("delta_rho231")*results.parError("rho000")*results.parError("rho000")+results.parValue("rho000")*results.parValue("rho000")*results.parError("delta_rho231")*results.parError("delta_rho231")+2*results.parValue("delta_rho231")*results.parValue("rho000")*results.covariance("rho000","delta_rho231")); - outfile << "rt00_31_2_single_test" << "\t" << rt00_31_2_single_value_test << "\t" << rt00_31_2_single_error_test << "\n"; +double r10_33_1_single_value = results.parValue("rho101")*(0.5-results.parValue("delta_rho011")); +double r10_33_1_single_error = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho101")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho101","delta_rho011")); +outfile << "r10_33_1_single" << "\t" << r10_33_1_single_value << "\t" << r10_33_1_single_error << "\n"; - double rt00_3m1_2_single_value_test = results.parValue("rho000")*results.parValue("delta_rho23m1"); - double rt00_3m1_2_single_error_test = sqrt(results.parValue("delta_rho23m1")*results.parValue("delta_rho23m1")*results.parError("rho000")*results.parError("rho000")+results.parValue("rho000")*results.parValue("rho000")*results.parError("delta_rho23m1")*results.parError("delta_rho23m1")+2*results.parValue("delta_rho23m1")*results.parValue("rho000")*results.covariance("rho000","delta_rho23m1")); - outfile << "rt00_3m1_2_single_test" << "\t" << rt00_3m1_2_single_value_test << "\t" << rt00_3m1_2_single_error_test << "\n"; +double r10_31_1_single_value = results.parValue("rho101")*results.parValue("delta_rho031"); +double r10_31_1_single_error = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho031")*results.parError("delta_rho031")+2*results.parValue("delta_rho031")*results.parValue("rho101")*results.covariance("rho101","delta_rho031")); +outfile << "r10_31_1_single" << "\t" << r10_31_1_single_value << "\t" << r10_31_1_single_error << "\n"; - double rt11_31_2_single_value_test = (1-results.parValue("rho000"))*0.5*results.parValue("delta_rho231"); - double rt11_31_2_single_error_test = sqrt(0.25*results.parValue("delta_rho231")*results.parValue("delta_rho231")*results.parError("rho000")*results.parError("rho000")+0.25*(1-results.parValue("rho000"))*(1-results.parValue("rho000"))*results.parError("delta_rho231")*results.parError("delta_rho231")-0.5*results.parValue("delta_rho231")*(1-results.parValue("rho000"))*results.covariance("rho000","delta_rho231")); - outfile << "rt11_31_2_single_test" << "\t" << rt11_31_2_single_value_test << "\t" << rt11_31_2_single_error_test << "\n"; +double r10_11_1_single_value = results.parValue("rho101")*results.parValue("delta_rho011"); +double r10_11_1_single_error = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("delta_rho011")*results.parValue("rho101")*results.covariance("rho101","delta_rho011")); +outfile << "r10_11_1_single" << "\t" << r10_11_1_single_value << "\t" << r10_11_1_single_error << "\n"; - double rt11_3m1_2_single_value_test = (1-results.parValue("rho000"))*0.5*results.parValue("delta_rho23m1"); - double rt11_3m1_2_single_error_test = sqrt(0.25*results.parValue("delta_rho23m1")*results.parValue("delta_rho23m1")*results.parError("rho000")*results.parError("rho000")+0.25*(1-results.parValue("rho000"))*(1-results.parValue("rho000"))*results.parError("delta_rho23m1")*results.parError("delta_rho23m1")-0.5*results.parValue("delta_rho23m1")*(1-results.parValue("rho000"))*results.covariance("rho000","delta_rho23m1")); - outfile << "rt11_3m1_2_single_test" << "\t" << rt11_3m1_2_single_value_test << "\t" << rt11_3m1_2_single_error_test << "\n"; +double r10_3m1_1_single_value = results.parValue("rho101")*results.parValue("delta_rho03m1"); +double r10_3m1_1_single_error = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho101")*results.parError("rho101")+results.parValue("rho101")*results.parValue("rho101")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+2*results.parValue("delta_rho03m1")*results.parValue("rho101")*results.covariance("rho101","delta_rho03m1")); +outfile << "r10_3m1_1_single" << "\t" << r10_3m1_1_single_value << "\t" << r10_3m1_1_single_error << "\n"; - double rt1m1_31_2_single_value_test = results.parValue("rho1m10")*results.parValue("delta_rho231"); - double rt1m1_31_2_single_error_test = sqrt(results.parValue("delta_rho231")*results.parValue("delta_rho231")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho231")*results.parError("delta_rho231")+2*results.parValue("delta_rho231")*results.parValue("rho1m10")*results.covariance("rho1m10","delta_rho231")); - outfile << "rt1m1_31_2_single_test" << "\t" << rt1m1_31_2_single_value_test << "\t" << rt1m1_31_2_single_error_test << "\n"; - double rt1m1_3m1_2_single_value_test = results.parValue("rho1m10")*results.parValue("delta_rho23m1"); - double rt1m1_3m1_2_single_error_test = sqrt(results.parValue("delta_rho23m1")*results.parValue("delta_rho23m1")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho23m1")*results.parError("delta_rho23m1")+2*results.parValue("delta_rho23m1")*results.parValue("rho1m10")*results.covariance("rho1m10","delta_rho23m1")); - outfile << "rt1m1_3m1_2_single_test" << "\t" << rt1m1_3m1_2_single_value_test << "\t" << rt1m1_3m1_2_single_error_test << "\n"; - double rt10_31_2_single_value_test = results.parValue("rho100")*results.parValue("delta_rho231"); - double rt10_31_2_single_error_test = sqrt(results.parValue("delta_rho231")*results.parValue("delta_rho231")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho231")*results.parError("delta_rho231")+2*results.parValue("delta_rho231")*results.parValue("rho100")*results.covariance("rho100","delta_rho231")); - outfile << "rt10_31_2_single_test" << "\t" << rt10_31_2_single_value_test << "\t" << rt10_31_2_single_error_test << "\n"; +//allpha =2 - double rt10_3m1_2_single_value_test = results.parValue("rho100")*results.parValue("delta_rho23m1"); - double rt10_3m1_2_single_error_test = sqrt(results.parValue("delta_rho23m1")*results.parValue("delta_rho23m1")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho23m1")*results.parError("delta_rho23m1")+2*results.parValue("delta_rho23m1")*results.parValue("rho100")*results.covariance("rho100","delta_rho23m1")); - outfile << "rt10_3m1_2_single_test" << "\t" << rt10_3m1_2_single_value_test << "\t" << rt10_3m1_2_single_error_test << "\n"; - +double r1m1_33_2_single_value = results.parValue("rho1m12")*(0.5-results.parValue("delta_rho011")); +double r1m1_33_2_single_error = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho1m12")*results.parError("rho1m12")+results.parValue("rho1m12")*results.parValue("rho1m12")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho1m12")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho1m12","delta_rho011")); +outfile << "r1m1_33_2_single" << "\t" << r1m1_33_2_single_value << "\t" << r1m1_33_2_single_error << "\n"; - // natural and unnatural components +double r1m1_11_2_single_value = results.parValue("rho1m12")*results.parValue("delta_rho011"); +double r1m1_11_2_single_error = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho1m12")*results.parError("rho1m12")+results.parValue("rho1m12")*results.parValue("rho1m12")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("rho1m12")*results.parValue("delta_rho011")*results.covariance("rho1m12","delta_rho011")); +outfile << "r1m1_11_2_single" << "\t" << r1m1_11_2_single_value << "\t" << r1m1_11_2_single_error << "\n"; -double r00_33_0_plus_r00_33_1_value = results.parValue("r00_33_0") + results.parValue("r00_33_1"); -double r00_33_0_plus_r00_33_1_error = sqrt(results.parError("r00_33_0")*results.parError("r00_33_0") + results.parError("r00_33_1")*results.parError("r00_33_1") + 2*results.covariance("r00_33_0","r00_33_1")); -outfile << "r00_33_0_plus_r00_33_1" << "\t" << r00_33_0_plus_r00_33_1_value << "\t" << r00_33_0_plus_r00_33_1_error << "\n"; +double r1m1_31_2_single_value = results.parValue("rho1m12")*results.parValue("delta_rho031"); +double r1m1_31_2_single_error = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho1m12")*results.parError("rho1m12")+results.parValue("rho1m12")*results.parValue("rho1m12")*results.parError("delta_rho031")*results.parError("delta_rho031")+results.parValue("delta_rho231")*results.parValue("delta_rho231")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho231")*results.parError("delta_rho231")+2*results.parValue("delta_rho031")*results.parValue("delta_rho231")*results.covariance("rho1m12","rho1m10")+2*results.parValue("delta_rho031")*results.parValue("rho1m10")*results.covariance("rho1m12","delta_rho231")+2*results.parValue("rho1m12")*results.parValue("delta_rho231")*results.covariance("delta_rho031","rho1m10")+2*results.parValue("rho1m12")*results.parValue("rho1m10")*results.covariance("delta_rho031","delta_rho231")); +outfile << "r1m1_31_2_single" << "\t" << r1m1_31_2_single_value << "\t" << r1m1_31_2_single_error << "\n"; -double r00_33_0_minus_r00_33_1_value = results.parValue("r00_33_0") - results.parValue("r00_33_1"); -double r00_33_0_minus_r00_33_1_error = sqrt(results.parError("r00_33_0")*results.parError("r00_33_0") + results.parError("r00_33_1")*results.parError("r00_33_1") - 2*results.covariance("r00_33_0","r00_33_1")); -outfile << "r00_33_0_minus_r00_33_1" << "\t" << r00_33_0_minus_r00_33_1_value << "\t" << r00_33_0_minus_r00_33_1_error << "\n"; +double r1m1_3m1_2_single_value = results.parValue("rho1m12")*results.parValue("delta_rho03m1");//; +double r1m1_3m1_2_single_error = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho1m12")*results.parError("rho1m12")+results.parValue("rho1m12")*results.parValue("rho1m12")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+results.parValue("delta_rho23m1")*results.parValue("delta_rho23m1")*results.parError("rho1m10")*results.parError("rho1m10")+results.parValue("rho1m10")*results.parValue("rho1m10")*results.parError("delta_rho23m1")*results.parError("delta_rho23m1")+2*results.parValue("delta_rho03m1")*results.parValue("delta_rho23m1")*results.covariance("rho1m12","rho1m10")+2*results.parValue("delta_rho03m1")*results.parValue("rho1m10")*results.covariance("rho1m12","delta_rho23m1")+2*results.parValue("rho1m12")*results.parValue("delta_rho23m1")*results.covariance("delta_rho03m1","rho1m10")+2*results.parValue("rho1m12")*results.parValue("rho1m10")*results.covariance("delta_rho03m1","delta_rho23m1")); +outfile << "r1m1_3m1_2_single" << "\t" << r1m1_3m1_2_single_value << "\t" << r1m1_3m1_2_single_error << "\n"; -double r00_11_0_plus_r00_11_1_value = 0.5 - results.parValue("r00_33_0") - 2.0*results.parValue("r11_11_0") - 2.0*results.parValue("r11_33_0") + results.parValue("r00_11_1"); -double r00_11_0_plus_r00_11_1_error = sqrt(results.parError("r00_33_0")*results.parError("r00_33_0") + 4*results.parError("r11_11_0")*results.parError("r11_11_0") + 4*results.parError("r11_33_0")*results.parError("r11_33_0") + results.parError("r00_11_1")*results.parError("r00_11_1") + 4*results.covariance("r00_33_0","r11_11_0") + 4*results.covariance("r00_33_0","r11_33_0") - 2*results.covariance("r00_33_0","r00_11_1") + 8*results.covariance("r11_11_0","r11_33_0") - 4*results.covariance("r11_11_0","r00_11_1") - 4*results.covariance("r11_33_0","r00_11_1")); -outfile << "r00_11_0_plus_r00_11_1" << "\t" << r00_11_0_plus_r00_11_1_value << "\t" << r00_11_0_plus_r00_11_1_error << "\n"; +double r10_33_2_single_value = results.parValue("rho102")*(0.5-results.parValue("delta_rho011")); +double r10_33_2_single_error = sqrt((0.5-results.parValue("delta_rho011"))*(0.5-results.parValue("delta_rho011"))*results.parError("rho102")*results.parError("rho102")+results.parValue("rho102")*results.parValue("rho102")*results.parError("delta_rho011")*results.parError("delta_rho011")-2*results.parValue("rho102")*(0.5-results.parValue("delta_rho011"))*results.covariance("rho102","delta_rho011")); +outfile << "r10_33_2_single" << "\t" << r10_33_2_single_value << "\t" << r10_33_2_single_error << "\n"; -double r00_11_0_minus_r00_11_1_value = 0.5 - results.parValue("r00_33_0") - 2.0*results.parValue("r11_11_0") - 2.0*results.parValue("r11_33_0") - results.parValue("r00_11_1"); -double r00_11_0_minus_r00_11_1_error = sqrt(results.parError("r00_33_0")*results.parError("r00_33_0") + 4*results.parError("r11_11_0")*results.parError("r11_11_0") + 4*results.parError("r11_33_0")*results.parError("r11_33_0") + results.parError("r00_11_1")*results.parError("r00_11_1") + 4*results.covariance("r00_33_0","r11_11_0") + 4*results.covariance("r00_33_0","r11_33_0") + 2*results.covariance("r00_33_0","r00_11_1") + 8*results.covariance("r11_11_0","r11_33_0") + 4*results.covariance("r11_11_0","r00_11_1") + 4*results.covariance("r11_33_0","r00_11_1")); -outfile << "r00_11_0_minus_r00_11_1" << "\t" << r00_11_0_minus_r00_11_1_value << "\t" << r00_11_0_minus_r00_11_1_error << "\n"; +double r10_11_2_single_value = results.parValue("rho102")*results.parValue("delta_rho011"); +double r10_11_2_single_error = sqrt(results.parValue("delta_rho011")*results.parValue("delta_rho011")*results.parError("rho102")*results.parError("rho102")+results.parValue("rho102")*results.parValue("rho102")*results.parError("delta_rho011")*results.parError("delta_rho011")+2*results.parValue("rho102")*results.parValue("delta_rho011")*results.covariance("rho102","delta_rho011")); +outfile << "r10_11_2_single" << "\t" << r10_11_2_single_value << "\t" << r10_11_2_single_error << "\n"; -double r00_31_0_plus_r00_31_1_value = results.parValue("r00_31_0") + results.parValue("r00_31_1"); -double r00_31_0_plus_r00_31_1_error = sqrt(results.parError("r00_31_0")*results.parError("r00_31_0") + results.parError("r00_31_1")*results.parError("r00_31_1") + 2*results.covariance("r00_31_0","r00_31_1")); -outfile << "r00_31_0_plus_r00_31_1" << "\t" << r00_31_0_plus_r00_31_1_value << "\t" << r00_31_0_plus_r00_31_1_error << "\n"; +double r10_31_2_single_value = results.parValue("rho102")*results.parValue("delta_rho031"); +double r10_31_2_single_error = sqrt(results.parValue("delta_rho031")*results.parValue("delta_rho031")*results.parError("rho102")*results.parError("rho102")+results.parValue("rho102")*results.parValue("rho102")*results.parError("delta_rho031")*results.parError("delta_rho031")+results.parValue("delta_rho231")*results.parValue("delta_rho231")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho231")*results.parError("delta_rho231")+2*results.parValue("delta_rho031")*results.parValue("delta_rho231")*results.covariance("rho102","rho100")+2*results.parValue("delta_rho031")*results.parValue("rho100")*results.covariance("rho102","delta_rho231")+2*results.parValue("rho102")*results.parValue("delta_rho231")*results.covariance("delta_rho031","rho100")+2*results.parValue("rho102")*results.parValue("rho100")*results.covariance("delta_rho031","delta_rho231")); +outfile << "r10_31_2_single" << "\t" << r10_31_2_single_value << "\t" << r10_31_2_single_error << "\n"; -double r00_31_0_minus_r00_31_1_value = results.parValue("r00_31_0") - results.parValue("r00_31_1"); -double r00_31_0_minus_r00_31_1_error = sqrt(results.parError("r00_31_0")*results.parError("r00_31_0") + results.parError("r00_31_1")*results.parError("r00_31_1") - 2*results.covariance("r00_31_0","r00_31_1")); -outfile << "r00_31_0_minus_r00_31_1" << "\t" << r00_31_0_minus_r00_31_1_value << "\t" << r00_31_0_minus_r00_31_1_error << "\n"; +double r10_3m1_2_single_value = results.parValue("rho102")*results.parValue("delta_rho03m1"); +double r10_3m1_2_single_error = sqrt(results.parValue("delta_rho03m1")*results.parValue("delta_rho03m1")*results.parError("rho102")*results.parError("rho102")+results.parValue("rho102")*results.parValue("rho102")*results.parError("delta_rho03m1")*results.parError("delta_rho03m1")+results.parValue("delta_rho23m1")*results.parValue("delta_rho23m1")*results.parError("rho100")*results.parError("rho100")+results.parValue("rho100")*results.parValue("rho100")*results.parError("delta_rho23m1")*results.parError("delta_rho23m1")+2*results.parValue("delta_rho03m1")*results.parValue("delta_rho23m1")*results.covariance("rho102","rho100")+2*results.parValue("delta_rho03m1")*results.parValue("rho100")*results.covariance("rho102","delta_rho23m1")+2*results.parValue("rho102")*results.parValue("delta_rho23m1")*results.covariance("delta_rho03m1","rho100")+2*results.parValue("rho102")*results.parValue("rho100")*results.covariance("delta_rho03m1","delta_rho23m1")); +outfile << "r10_3m1_2_single" << "\t" << r10_3m1_2_single_value << "\t" << r10_3m1_2_single_error << "\n"; -double r00_3m1_0_plus_r00_3m1_1_value = results.parValue("r00_3m1_0") + results.parValue("r00_3m1_1"); -double r00_3m1_0_plus_r00_3m1_1_error = sqrt(results.parError("r00_3m1_0")*results.parError("r00_3m1_0") + results.parError("r00_3m1_1")*results.parError("r00_3m1_1") + 2*results.covariance("r00_3m1_0","r00_3m1_1")); -outfile << "r00_3m1_0_plus_r00_3m1_1" << "\t" << r00_3m1_0_plus_r00_3m1_1_value << "\t" << r00_3m1_0_plus_r00_3m1_1_error << "\n"; + + -double r00_3m1_0_minus_r00_3m1_1_value = results.parValue("r00_3m1_0") - results.parValue("r00_3m1_1"); -double r00_3m1_0_minus_r00_3m1_1_error = sqrt(results.parError("r00_3m1_0")*results.parError("r00_3m1_0") + results.parError("r00_3m1_1")*results.parError("r00_3m1_1") - 2*results.covariance("r00_3m1_0","r00_3m1_1")); -outfile << "r00_3m1_0_minus_r00_3m1_1" << "\t" << r00_3m1_0_minus_r00_3m1_1_value << "\t" << r00_3m1_0_minus_r00_3m1_1_error << "\n"; + // natural and unnatural components -double r11_33_0_plus_r1m1_33_1_value = results.parValue("r11_33_0") + results.parValue("r1m1_33_1"); -double r11_33_0_plus_r1m1_33_1_error = sqrt(results.parError("r11_33_0")*results.parError("r11_33_0") + results.parError("r1m1_33_1")*results.parError("r1m1_33_1") + 2*results.covariance("r11_33_0","r1m1_33_1")); -outfile << "r11_33_0_plus_r1m1_33_1" << "\t" << r11_33_0_plus_r1m1_33_1_value << "\t" << r11_33_0_plus_r1m1_33_1_error << "\n"; + double r00_33_0_plus_r00_33_1_value = results.parValue("r00_33_0") + results.parValue("r00_33_1"); + double r00_33_0_plus_r00_33_1_error = sqrt(results.parError("r00_33_0")*results.parError("r00_33_0") + results.parError("r00_33_1")*results.parError("r00_33_1") + 2*results.covariance("r00_33_0","r00_33_1")); + outfile << "r00_33_0_plus_r00_33_1" << "\t" << r00_33_0_plus_r00_33_1_value << "\t" << r00_33_0_plus_r00_33_1_error << "\n"; -double r11_33_0_minus_r1m1_33_1_value = results.parValue("r11_33_0") - results.parValue("r1m1_33_1"); -double r11_33_0_minus_r1m1_33_1_error = sqrt(results.parError("r11_33_0")*results.parError("r11_33_0") + results.parError("r1m1_33_1")*results.parError("r1m1_33_1") - 2*results.covariance("r11_33_0","r1m1_33_1")); -outfile << "r11_33_0_minus_r1m1_33_1" << "\t" << r11_33_0_minus_r1m1_33_1_value << "\t" << r11_33_0_minus_r1m1_33_1_error << "\n"; + double r00_33_0_minus_r00_33_1_value = results.parValue("r00_33_0") - results.parValue("r00_33_1"); + double r00_33_0_minus_r00_33_1_error = sqrt(results.parError("r00_33_0")*results.parError("r00_33_0") + results.parError("r00_33_1")*results.parError("r00_33_1") - 2*results.covariance("r00_33_0","r00_33_1")); + outfile << "r00_33_0_minus_r00_33_1" << "\t" << r00_33_0_minus_r00_33_1_value << "\t" << r00_33_0_minus_r00_33_1_error << "\n"; -double r11_11_0_plus_r1m1_11_1_value = results.parValue("r11_11_0") + results.parValue("r1m1_11_1"); -double r11_11_0_plus_r1m1_11_1_error = sqrt(results.parError("r11_11_0")*results.parError("r11_11_0") + results.parError("r1m1_11_1")*results.parError("r1m1_11_1") + 2*results.covariance("r11_11_0","r1m1_11_1")); -outfile << "r11_11_0_plus_r1m1_11_1" << "\t" << r11_11_0_plus_r1m1_11_1_value << "\t" << r11_11_0_plus_r1m1_11_1_error << "\n"; + double r00_11_0_plus_r00_11_1_value = 0.5 - results.parValue("r00_33_0") - 2.0*results.parValue("r11_11_0") - 2.0*results.parValue("r11_33_0") + results.parValue("r00_11_1"); + double r00_11_0_plus_r00_11_1_error = sqrt(results.parError("r00_33_0")*results.parError("r00_33_0") + 4*results.parError("r11_11_0")*results.parError("r11_11_0") + 4*results.parError("r11_33_0")*results.parError("r11_33_0") + results.parError("r00_11_1")*results.parError("r00_11_1") + 4*results.covariance("r00_33_0","r11_11_0") + 4*results.covariance("r00_33_0","r11_33_0") - 2*results.covariance("r00_33_0","r00_11_1") + 8*results.covariance("r11_11_0","r11_33_0") - 4*results.covariance("r11_11_0","r00_11_1") - 4*results.covariance("r11_33_0","r00_11_1")); + outfile << "r00_11_0_plus_r00_11_1" << "\t" << r00_11_0_plus_r00_11_1_value << "\t" << r00_11_0_plus_r00_11_1_error << "\n"; -double r11_11_0_minus_r1m1_11_1_value = results.parValue("r11_11_0") - results.parValue("r1m1_11_1"); -double r11_11_0_minus_r1m1_11_1_error = sqrt(results.parError("r11_11_0")*results.parError("r11_11_0") + results.parError("r1m1_11_1")*results.parError("r1m1_11_1") - 2*results.covariance("r11_11_0","r1m1_11_1")); -outfile << "r11_11_0_minus_r1m1_11_1" << "\t" << r11_11_0_minus_r1m1_11_1_value << "\t" << r11_11_0_minus_r1m1_11_1_error << "\n"; + double r00_11_0_minus_r00_11_1_value = 0.5 - results.parValue("r00_33_0") - 2.0*results.parValue("r11_11_0") - 2.0*results.parValue("r11_33_0") - results.parValue("r00_11_1"); + double r00_11_0_minus_r00_11_1_error = sqrt(results.parError("r00_33_0")*results.parError("r00_33_0") + 4*results.parError("r11_11_0")*results.parError("r11_11_0") + 4*results.parError("r11_33_0")*results.parError("r11_33_0") + results.parError("r00_11_1")*results.parError("r00_11_1") + 4*results.covariance("r00_33_0","r11_11_0") + 4*results.covariance("r00_33_0","r11_33_0") + 2*results.covariance("r00_33_0","r00_11_1") + 8*results.covariance("r11_11_0","r11_33_0") + 4*results.covariance("r11_11_0","r00_11_1") + 4*results.covariance("r11_33_0","r00_11_1")); + outfile << "r00_11_0_minus_r00_11_1" << "\t" << r00_11_0_minus_r00_11_1_value << "\t" << r00_11_0_minus_r00_11_1_error << "\n"; -double r11_31_0_plus_r1m1_31_1_value = results.parValue("r11_31_0") + results.parValue("r1m1_31_1"); -double r11_31_0_plus_r1m1_31_1_error = sqrt(results.parError("r11_31_0")*results.parError("r11_31_0") + results.parError("r1m1_31_1")*results.parError("r1m1_31_1") + 2*results.covariance("r11_31_0","r1m1_31_1")); -outfile << "r11_31_0_plus_r1m1_31_1" << "\t" << r11_31_0_plus_r1m1_31_1_value << "\t" << r11_31_0_plus_r1m1_31_1_error << "\n"; + double r00_31_0_plus_r00_31_1_value = results.parValue("r00_31_0") + results.parValue("r00_31_1"); + double r00_31_0_plus_r00_31_1_error = sqrt(results.parError("r00_31_0")*results.parError("r00_31_0") + results.parError("r00_31_1")*results.parError("r00_31_1") + 2*results.covariance("r00_31_0","r00_31_1")); + outfile << "r00_31_0_plus_r00_31_1" << "\t" << r00_31_0_plus_r00_31_1_value << "\t" << r00_31_0_plus_r00_31_1_error << "\n"; -double r11_31_0_minus_r1m1_31_1_value = results.parValue("r11_31_0") - results.parValue("r1m1_31_1"); -double r11_31_0_minus_r1m1_31_1_error = sqrt(results.parError("r11_31_0")*results.parError("r11_31_0") + results.parError("r1m1_31_1")*results.parError("r1m1_31_1") - 2*results.covariance("r11_31_0","r1m1_31_1")); -outfile << "r11_31_0_minus_r1m1_31_1" << "\t" << r11_31_0_minus_r1m1_31_1_value << "\t" << r11_31_0_minus_r1m1_31_1_error << "\n"; + double r00_31_0_minus_r00_31_1_value = results.parValue("r00_31_0") - results.parValue("r00_31_1"); + double r00_31_0_minus_r00_31_1_error = sqrt(results.parError("r00_31_0")*results.parError("r00_31_0") + results.parError("r00_31_1")*results.parError("r00_31_1") - 2*results.covariance("r00_31_0","r00_31_1")); + outfile << "r00_31_0_minus_r00_31_1" << "\t" << r00_31_0_minus_r00_31_1_value << "\t" << r00_31_0_minus_r00_31_1_error << "\n"; -double r11_3m1_0_plus_r1m1_3m1_1_value = results.parValue("r11_3m1_0") + results.parValue("r1m1_3m1_1"); -double r11_3m1_0_plus_r1m1_3m1_1_error = sqrt(results.parError("r11_3m1_0")*results.parError("r11_3m1_0") + results.parError("r1m1_3m1_1")*results.parError("r1m1_3m1_1") + 2*results.covariance("r11_3m1_0","r1m1_3m1_1")); -outfile << "r11_3m1_0_plus_r1m1_3m1_1" << "\t" << r11_3m1_0_plus_r1m1_3m1_1_value << "\t" << r11_3m1_0_plus_r1m1_3m1_1_error << "\n"; + double r00_3m1_0_plus_r00_3m1_1_value = results.parValue("r00_3m1_0") + results.parValue("r00_3m1_1"); + double r00_3m1_0_plus_r00_3m1_1_error = sqrt(results.parError("r00_3m1_0")*results.parError("r00_3m1_0") + results.parError("r00_3m1_1")*results.parError("r00_3m1_1") + 2*results.covariance("r00_3m1_0","r00_3m1_1")); + outfile << "r00_3m1_0_plus_r00_3m1_1" << "\t" << r00_3m1_0_plus_r00_3m1_1_value << "\t" << r00_3m1_0_plus_r00_3m1_1_error << "\n"; -double r11_3m1_0_minus_r1m1_3m1_1_value = results.parValue("r11_3m1_0") - results.parValue("r1m1_3m1_1"); -double r11_3m1_0_minus_r1m1_3m1_1_error = sqrt(results.parError("r11_3m1_0")*results.parError("r11_3m1_0") + results.parError("r1m1_3m1_1")*results.parError("r1m1_3m1_1") - 2*results.covariance("r11_3m1_0","r1m1_3m1_1")); -outfile << "r11_3m1_0_minus_r1m1_3m1_1" << "\t" << r11_3m1_0_minus_r1m1_3m1_1_value << "\t" << r11_3m1_0_minus_r1m1_3m1_1_error << "\n"; + double r00_3m1_0_minus_r00_3m1_1_value = results.parValue("r00_3m1_0") - results.parValue("r00_3m1_1"); + double r00_3m1_0_minus_r00_3m1_1_error = sqrt(results.parError("r00_3m1_0")*results.parError("r00_3m1_0") + results.parError("r00_3m1_1")*results.parError("r00_3m1_1") - 2*results.covariance("r00_3m1_0","r00_3m1_1")); + outfile << "r00_3m1_0_minus_r00_3m1_1" << "\t" << r00_3m1_0_minus_r00_3m1_1_value << "\t" << r00_3m1_0_minus_r00_3m1_1_error << "\n"; -double r1m1_33_0_plus_r11_33_1_value = results.parValue("r1m1_33_0") + results.parValue("r11_33_1"); -double r1m1_33_0_plus_r11_33_1_error = sqrt(results.parError("r1m1_33_0")*results.parError("r1m1_33_0") + results.parError("r11_33_1")*results.parError("r11_33_1") + 2*results.covariance("r1m1_33_0","r11_33_1")); -outfile << "r1m1_33_0_plus_r11_33_1" << "\t" << r1m1_33_0_plus_r11_33_1_value << "\t" << r1m1_33_0_plus_r11_33_1_error << "\n"; + double r11_33_0_plus_r1m1_33_1_value = results.parValue("r11_33_0") + results.parValue("r1m1_33_1"); + double r11_33_0_plus_r1m1_33_1_error = sqrt(results.parError("r11_33_0")*results.parError("r11_33_0") + results.parError("r1m1_33_1")*results.parError("r1m1_33_1") + 2*results.covariance("r11_33_0","r1m1_33_1")); + outfile << "r11_33_0_plus_r1m1_33_1" << "\t" << r11_33_0_plus_r1m1_33_1_value << "\t" << r11_33_0_plus_r1m1_33_1_error << "\n"; -double r1m1_33_0_minus_r11_33_1_value = results.parValue("r1m1_33_0") - results.parValue("r11_33_1"); -double r1m1_33_0_minus_r11_33_1_error = sqrt(results.parError("r1m1_33_0")*results.parError("r1m1_33_0") + results.parError("r11_33_1")*results.parError("r11_33_1") - 2*results.covariance("r1m1_33_0","r11_33_1")); -outfile << "r1m1_33_0_minus_r11_33_1" << "\t" << r1m1_33_0_minus_r11_33_1_value << "\t" << r1m1_33_0_minus_r11_33_1_error << "\n"; + double r11_33_0_minus_r1m1_33_1_value = results.parValue("r11_33_0") - results.parValue("r1m1_33_1"); + double r11_33_0_minus_r1m1_33_1_error = sqrt(results.parError("r11_33_0")*results.parError("r11_33_0") + results.parError("r1m1_33_1")*results.parError("r1m1_33_1") - 2*results.covariance("r11_33_0","r1m1_33_1")); + outfile << "r11_33_0_minus_r1m1_33_1" << "\t" << r11_33_0_minus_r1m1_33_1_value << "\t" << r11_33_0_minus_r1m1_33_1_error << "\n"; -double r1m1_11_0_plus_r11_11_1_value = results.parValue("r1m1_11_0") + results.parValue("r11_11_1"); -double r1m1_11_0_plus_r11_11_1_error = sqrt(results.parError("r1m1_11_0")*results.parError("r1m1_11_0") + results.parError("r11_11_1")*results.parError("r11_11_1") + 2*results.covariance("r1m1_11_0","r11_11_1")); -outfile << "r1m1_11_0_plus_r11_11_1" << "\t" << r1m1_11_0_plus_r11_11_1_value << "\t" << r1m1_11_0_plus_r11_11_1_error << "\n"; + double r11_11_0_plus_r1m1_11_1_value = results.parValue("r11_11_0") + results.parValue("r1m1_11_1"); + double r11_11_0_plus_r1m1_11_1_error = sqrt(results.parError("r11_11_0")*results.parError("r11_11_0") + results.parError("r1m1_11_1")*results.parError("r1m1_11_1") + 2*results.covariance("r11_11_0","r1m1_11_1")); + outfile << "r11_11_0_plus_r1m1_11_1" << "\t" << r11_11_0_plus_r1m1_11_1_value << "\t" << r11_11_0_plus_r1m1_11_1_error << "\n"; -double r1m1_11_0_minus_r11_11_1_value = results.parValue("r1m1_11_0") - results.parValue("r11_11_1"); -double r1m1_11_0_minus_r11_11_1_error = sqrt(results.parError("r1m1_11_0")*results.parError("r1m1_11_0") + results.parError("r11_11_1")*results.parError("r11_11_1") - 2*results.covariance("r1m1_11_0","r11_11_1")); -outfile << "r1m1_11_0_minus_r11_11_1" << "\t" << r1m1_11_0_minus_r11_11_1_value << "\t" << r1m1_11_0_minus_r11_11_1_error << "\n"; + double r11_11_0_minus_r1m1_11_1_value = results.parValue("r11_11_0") - results.parValue("r1m1_11_1"); + double r11_11_0_minus_r1m1_11_1_error = sqrt(results.parError("r11_11_0")*results.parError("r11_11_0") + results.parError("r1m1_11_1")*results.parError("r1m1_11_1") - 2*results.covariance("r11_11_0","r1m1_11_1")); + outfile << "r11_11_0_minus_r1m1_11_1" << "\t" << r11_11_0_minus_r1m1_11_1_value << "\t" << r11_11_0_minus_r1m1_11_1_error << "\n"; -double r1m1_31_0_plus_r11_31_1_value = results.parValue("r1m1_31_0") + results.parValue("r11_31_1"); -double r1m1_31_0_plus_r11_31_1_error = sqrt(results.parError("r1m1_31_0")*results.parError("r1m1_31_0") + results.parError("r11_31_1")*results.parError("r11_31_1") + 2*results.covariance("r1m1_31_0","r11_31_1")); -outfile << "r1m1_31_0_plus_r11_31_1" << "\t" << r1m1_31_0_plus_r11_31_1_value << "\t" << r1m1_31_0_plus_r11_31_1_error << "\n"; + double r11_31_0_plus_r1m1_31_1_value = results.parValue("r11_31_0") + results.parValue("r1m1_31_1"); + double r11_31_0_plus_r1m1_31_1_error = sqrt(results.parError("r11_31_0")*results.parError("r11_31_0") + results.parError("r1m1_31_1")*results.parError("r1m1_31_1") + 2*results.covariance("r11_31_0","r1m1_31_1")); + outfile << "r11_31_0_plus_r1m1_31_1" << "\t" << r11_31_0_plus_r1m1_31_1_value << "\t" << r11_31_0_plus_r1m1_31_1_error << "\n"; -double r1m1_31_0_minus_r11_31_1_value = results.parValue("r1m1_31_0") - results.parValue("r11_31_1"); -double r1m1_31_0_minus_r11_31_1_error = sqrt(results.parError("r1m1_31_0")*results.parError("r1m1_31_0") + results.parError("r11_31_1")*results.parError("r11_31_1") - 2*results.covariance("r1m1_31_0","r11_31_1")); -outfile << "r1m1_31_0_minus_r11_31_1" << "\t" << r1m1_31_0_minus_r11_31_1_value << "\t" << r1m1_31_0_minus_r11_31_1_error << "\n"; + double r11_31_0_minus_r1m1_31_1_value = results.parValue("r11_31_0") - results.parValue("r1m1_31_1"); + double r11_31_0_minus_r1m1_31_1_error = sqrt(results.parError("r11_31_0")*results.parError("r11_31_0") + results.parError("r1m1_31_1")*results.parError("r1m1_31_1") - 2*results.covariance("r11_31_0","r1m1_31_1")); + outfile << "r11_31_0_minus_r1m1_31_1" << "\t" << r11_31_0_minus_r1m1_31_1_value << "\t" << r11_31_0_minus_r1m1_31_1_error << "\n"; -double r1m1_3m1_0_plus_r11_3m1_1_value = results.parValue("r1m1_3m1_0") + results.parValue("r11_3m1_1"); -double r1m1_3m1_0_plus_r11_3m1_1_error = sqrt(results.parError("r1m1_3m1_0")*results.parError("r1m1_3m1_0") + results.parError("r11_3m1_1")*results.parError("r11_3m1_1") + 2*results.covariance("r1m1_3m1_0","r11_3m1_1")); -outfile << "r1m1_3m1_0_plus_r11_3m1_1" << "\t" << r1m1_3m1_0_plus_r11_3m1_1_value << "\t" << r1m1_3m1_0_plus_r11_3m1_1_error << "\n"; + double r11_3m1_0_plus_r1m1_3m1_1_value = results.parValue("r11_3m1_0") + results.parValue("r1m1_3m1_1"); + double r11_3m1_0_plus_r1m1_3m1_1_error = sqrt(results.parError("r11_3m1_0")*results.parError("r11_3m1_0") + results.parError("r1m1_3m1_1")*results.parError("r1m1_3m1_1") + 2*results.covariance("r11_3m1_0","r1m1_3m1_1")); + outfile << "r11_3m1_0_plus_r1m1_3m1_1" << "\t" << r11_3m1_0_plus_r1m1_3m1_1_value << "\t" << r11_3m1_0_plus_r1m1_3m1_1_error << "\n"; -double r1m1_3m1_0_minus_r11_3m1_1_value = results.parValue("r1m1_3m1_0") - results.parValue("r11_3m1_1"); -double r1m1_3m1_0_minus_r11_3m1_1_error = sqrt(results.parError("r1m1_3m1_0")*results.parError("r1m1_3m1_0") + results.parError("r11_3m1_1")*results.parError("r11_3m1_1") - 2*results.covariance("r1m1_3m1_0","r11_3m1_1")); -outfile << "r1m1_3m1_0_minus_r11_3m1_1" << "\t" << r1m1_3m1_0_minus_r11_3m1_1_value << "\t" << r1m1_3m1_0_minus_r11_3m1_1_error << "\n"; + double r11_3m1_0_minus_r1m1_3m1_1_value = results.parValue("r11_3m1_0") - results.parValue("r1m1_3m1_1"); + double r11_3m1_0_minus_r1m1_3m1_1_error = sqrt(results.parError("r11_3m1_0")*results.parError("r11_3m1_0") + results.parError("r1m1_3m1_1")*results.parError("r1m1_3m1_1") - 2*results.covariance("r11_3m1_0","r1m1_3m1_1")); + outfile << "r11_3m1_0_minus_r1m1_3m1_1" << "\t" << r11_3m1_0_minus_r1m1_3m1_1_value << "\t" << r11_3m1_0_minus_r1m1_3m1_1_error << "\n"; -double r10_33_0_plus_r10_33_1_value = results.parValue("r10_33_0") + results.parValue("r10_33_1"); -double r10_33_0_plus_r10_33_1_error = sqrt(results.parError("r10_33_0")*results.parError("r10_33_0") + results.parError("r10_33_1")*results.parError("r10_33_1") + 2*results.covariance("r10_33_0","r10_33_1")); -outfile << "r10_33_0_plus_r10_33_1" << "\t" << r10_33_0_plus_r10_33_1_value << "\t" << r10_33_0_plus_r10_33_1_error << "\n"; + double r1m1_33_0_plus_r11_33_1_value = results.parValue("r1m1_33_0") + results.parValue("r11_33_1"); + double r1m1_33_0_plus_r11_33_1_error = sqrt(results.parError("r1m1_33_0")*results.parError("r1m1_33_0") + results.parError("r11_33_1")*results.parError("r11_33_1") + 2*results.covariance("r1m1_33_0","r11_33_1")); + outfile << "r1m1_33_0_plus_r11_33_1" << "\t" << r1m1_33_0_plus_r11_33_1_value << "\t" << r1m1_33_0_plus_r11_33_1_error << "\n"; -double r10_33_0_minus_r10_33_1_value = results.parValue("r10_33_0") - results.parValue("r10_33_1"); -double r10_33_0_minus_r10_33_1_error = sqrt(results.parError("r10_33_0")*results.parError("r10_33_0") + results.parError("r10_33_1")*results.parError("r10_33_1") - 2*results.covariance("r10_33_0","r10_33_1")); -outfile << "r10_33_0_minus_r10_33_1" << "\t" << r10_33_0_minus_r10_33_1_value << "\t" << r10_33_0_minus_r10_33_1_error << "\n"; + double r1m1_33_0_minus_r11_33_1_value = results.parValue("r1m1_33_0") - results.parValue("r11_33_1"); + double r1m1_33_0_minus_r11_33_1_error = sqrt(results.parError("r1m1_33_0")*results.parError("r1m1_33_0") + results.parError("r11_33_1")*results.parError("r11_33_1") - 2*results.covariance("r1m1_33_0","r11_33_1")); + outfile << "r1m1_33_0_minus_r11_33_1" << "\t" << r1m1_33_0_minus_r11_33_1_value << "\t" << r1m1_33_0_minus_r11_33_1_error << "\n"; -double r10_11_0_plus_r10_11_1_value = results.parValue("r10_11_0") + results.parValue("r10_11_1"); -double r10_11_0_plus_r10_11_1_error = sqrt(results.parError("r10_11_0")*results.parError("r10_11_0") + results.parError("r10_11_1")*results.parError("r10_11_1") + 2*results.covariance("r10_11_0","r10_11_1")); -outfile << "r10_11_0_plus_r10_11_1" << "\t" << r10_11_0_plus_r10_11_1_value << "\t" << r10_11_0_plus_r10_11_1_error << "\n"; + double r1m1_11_0_plus_r11_11_1_value = results.parValue("r1m1_11_0") + results.parValue("r11_11_1"); + double r1m1_11_0_plus_r11_11_1_error = sqrt(results.parError("r1m1_11_0")*results.parError("r1m1_11_0") + results.parError("r11_11_1")*results.parError("r11_11_1") + 2*results.covariance("r1m1_11_0","r11_11_1")); + outfile << "r1m1_11_0_plus_r11_11_1" << "\t" << r1m1_11_0_plus_r11_11_1_value << "\t" << r1m1_11_0_plus_r11_11_1_error << "\n"; -double r10_11_0_minus_r10_11_1_value = results.parValue("r10_11_0") - results.parValue("r10_11_1"); -double r10_11_0_minus_r10_11_1_error = sqrt(results.parError("r10_11_0")*results.parError("r10_11_0") + results.parError("r10_11_1")*results.parError("r10_11_1") - 2*results.covariance("r10_11_0","r10_11_1")); -outfile << "r10_11_0_minus_r10_11_1" << "\t" << r10_11_0_minus_r10_11_1_value << "\t" << r10_11_0_minus_r10_11_1_error << "\n"; + double r1m1_11_0_minus_r11_11_1_value = results.parValue("r1m1_11_0") - results.parValue("r11_11_1"); + double r1m1_11_0_minus_r11_11_1_error = sqrt(results.parError("r1m1_11_0")*results.parError("r1m1_11_0") + results.parError("r11_11_1")*results.parError("r11_11_1") - 2*results.covariance("r1m1_11_0","r11_11_1")); + outfile << "r1m1_11_0_minus_r11_11_1" << "\t" << r1m1_11_0_minus_r11_11_1_value << "\t" << r1m1_11_0_minus_r11_11_1_error << "\n"; -double r10_31_0_plus_r10_31_1_value = results.parValue("r10_31_0") + results.parValue("r10_31_1"); -double r10_31_0_plus_r10_31_1_error = sqrt(results.parError("r10_31_0")*results.parError("r10_31_0") + results.parError("r10_31_1")*results.parError("r10_31_1") + 2*results.covariance("r10_31_0","r10_31_1")); -outfile << "r10_31_0_plus_r10_31_1" << "\t" << r10_31_0_plus_r10_31_1_value << "\t" << r10_31_0_plus_r10_31_1_error << "\n"; + double r1m1_31_0_plus_r11_31_1_value = results.parValue("r1m1_31_0") + results.parValue("r11_31_1"); + double r1m1_31_0_plus_r11_31_1_error = sqrt(results.parError("r1m1_31_0")*results.parError("r1m1_31_0") + results.parError("r11_31_1")*results.parError("r11_31_1") + 2*results.covariance("r1m1_31_0","r11_31_1")); + outfile << "r1m1_31_0_plus_r11_31_1" << "\t" << r1m1_31_0_plus_r11_31_1_value << "\t" << r1m1_31_0_plus_r11_31_1_error << "\n"; -double r10_31_0_minus_r10_31_1_value = results.parValue("r10_31_0") - results.parValue("r10_31_1"); -double r10_31_0_minus_r10_31_1_error = sqrt(results.parError("r10_31_0")*results.parError("r10_31_0") + results.parError("r10_31_1")*results.parError("r10_31_1") - 2*results.covariance("r10_31_0","r10_31_1")); -outfile << "r10_31_0_minus_r10_31_1" << "\t" << r10_31_0_minus_r10_31_1_value << "\t" << r10_31_0_minus_r10_31_1_error << "\n"; + double r1m1_31_0_minus_r11_31_1_value = results.parValue("r1m1_31_0") - results.parValue("r11_31_1"); + double r1m1_31_0_minus_r11_31_1_error = sqrt(results.parError("r1m1_31_0")*results.parError("r1m1_31_0") + results.parError("r11_31_1")*results.parError("r11_31_1") - 2*results.covariance("r1m1_31_0","r11_31_1")); + outfile << "r1m1_31_0_minus_r11_31_1" << "\t" << r1m1_31_0_minus_r11_31_1_value << "\t" << r1m1_31_0_minus_r11_31_1_error << "\n"; -double r10_3m1_0_plus_r10_3m1_1_value = results.parValue("r10_3m1_0") + results.parValue("r10_3m1_1"); -double r10_3m1_0_plus_r10_3m1_1_error = sqrt(results.parError("r10_3m1_0")*results.parError("r10_3m1_0") + results.parError("r10_3m1_1")*results.parError("r10_3m1_1") + 2*results.covariance("r10_3m1_0","r10_3m1_1")); -outfile << "r10_3m1_0_plus_r10_3m1_1" << "\t" << r10_3m1_0_plus_r10_3m1_1_value << "\t" << r10_3m1_0_plus_r10_3m1_1_error << "\n"; + double r1m1_3m1_0_plus_r11_3m1_1_value = results.parValue("r1m1_3m1_0") + results.parValue("r11_3m1_1"); + double r1m1_3m1_0_plus_r11_3m1_1_error = sqrt(results.parError("r1m1_3m1_0")*results.parError("r1m1_3m1_0") + results.parError("r11_3m1_1")*results.parError("r11_3m1_1") + 2*results.covariance("r1m1_3m1_0","r11_3m1_1")); + outfile << "r1m1_3m1_0_plus_r11_3m1_1" << "\t" << r1m1_3m1_0_plus_r11_3m1_1_value << "\t" << r1m1_3m1_0_plus_r11_3m1_1_error << "\n"; -double r10_3m1_0_minus_r10_3m1_1_value = results.parValue("r10_3m1_0") - results.parValue("r10_3m1_1"); -double r10_3m1_0_minus_r10_3m1_1_error = sqrt(results.parError("r10_3m1_0")*results.parError("r10_3m1_0") + results.parError("r10_3m1_1")*results.parError("r10_3m1_1") - 2*results.covariance("r10_3m1_0","r10_3m1_1")); -outfile << "r10_3m1_0_minus_r10_3m1_1" << "\t" << r10_3m1_0_minus_r10_3m1_1_value << "\t" << r10_3m1_0_minus_r10_3m1_1_error << "\n"; + double r1m1_3m1_0_minus_r11_3m1_1_value = results.parValue("r1m1_3m1_0") - results.parValue("r11_3m1_1"); + double r1m1_3m1_0_minus_r11_3m1_1_error = sqrt(results.parError("r1m1_3m1_0")*results.parError("r1m1_3m1_0") + results.parError("r11_3m1_1")*results.parError("r11_3m1_1") - 2*results.covariance("r1m1_3m1_0","r11_3m1_1")); + outfile << "r1m1_3m1_0_minus_r11_3m1_1" << "\t" << r1m1_3m1_0_minus_r11_3m1_1_value << "\t" << r1m1_3m1_0_minus_r11_3m1_1_error << "\n"; -double rt10_31_0_plus_rt10_31_1_value = results.parValue("rt10_31_0") + results.parValue("rt10_31_1"); -double rt10_31_0_plus_rt10_31_1_error = sqrt(results.parError("rt10_31_0")*results.parError("rt10_31_0") + results.parError("rt10_31_1")*results.parError("rt10_31_1") + 2*results.covariance("rt10_31_0","rt10_31_1")); -outfile << "rt10_31_0_plus_rt10_31_1" << "\t" << rt10_31_0_plus_rt10_31_1_value << "\t" << rt10_31_0_plus_rt10_31_1_error << "\n"; + double r10_33_0_plus_r10_33_1_value = results.parValue("r10_33_0") + results.parValue("r10_33_1"); + double r10_33_0_plus_r10_33_1_error = sqrt(results.parError("r10_33_0")*results.parError("r10_33_0") + results.parError("r10_33_1")*results.parError("r10_33_1") + 2*results.covariance("r10_33_0","r10_33_1")); + outfile << "r10_33_0_plus_r10_33_1" << "\t" << r10_33_0_plus_r10_33_1_value << "\t" << r10_33_0_plus_r10_33_1_error << "\n"; -double rt10_31_0_minus_rt10_31_1_value = results.parValue("rt10_31_0") - results.parValue("rt10_31_1"); -double rt10_31_0_minus_rt10_31_1_error = sqrt(results.parError("rt10_31_0")*results.parError("rt10_31_0") + results.parError("rt10_31_1")*results.parError("rt10_31_1") - 2*results.covariance("rt10_31_0","rt10_31_1")); -outfile << "rt10_31_0_minus_rt10_31_1" << "\t" << rt10_31_0_minus_rt10_31_1_value << "\t" << rt10_31_0_minus_rt10_31_1_error << "\n"; + double r10_33_0_minus_r10_33_1_value = results.parValue("r10_33_0") - results.parValue("r10_33_1"); + double r10_33_0_minus_r10_33_1_error = sqrt(results.parError("r10_33_0")*results.parError("r10_33_0") + results.parError("r10_33_1")*results.parError("r10_33_1") - 2*results.covariance("r10_33_0","r10_33_1")); + outfile << "r10_33_0_minus_r10_33_1" << "\t" << r10_33_0_minus_r10_33_1_value << "\t" << r10_33_0_minus_r10_33_1_error << "\n"; -double rt10_3m1_0_plus_rt10_3m1_1_value = results.parValue("rt10_3m1_0") + results.parValue("rt10_3m1_1"); -double rt10_3m1_0_plus_rt10_3m1_1_error = sqrt(results.parError("rt10_3m1_0")*results.parError("rt10_3m1_0") + results.parError("rt10_3m1_1")*results.parError("rt10_3m1_1") + 2*results.covariance("rt10_3m1_0","rt10_3m1_1")); -outfile << "rt10_3m1_0_plus_rt10_3m1_1" << "\t" << rt10_3m1_0_plus_rt10_3m1_1_value << "\t" << rt10_3m1_0_plus_rt10_3m1_1_error << "\n"; + double r10_11_0_plus_r10_11_1_value = results.parValue("r10_11_0") + results.parValue("r10_11_1"); + double r10_11_0_plus_r10_11_1_error = sqrt(results.parError("r10_11_0")*results.parError("r10_11_0") + results.parError("r10_11_1")*results.parError("r10_11_1") + 2*results.covariance("r10_11_0","r10_11_1")); + outfile << "r10_11_0_plus_r10_11_1" << "\t" << r10_11_0_plus_r10_11_1_value << "\t" << r10_11_0_plus_r10_11_1_error << "\n"; -double rt10_3m1_0_minus_rt10_3m1_1_value = results.parValue("rt10_3m1_0") - results.parValue("rt10_3m1_1"); -double rt10_3m1_0_minus_rt10_3m1_1_error = sqrt(results.parError("rt10_3m1_0")*results.parError("rt10_3m1_0") + results.parError("rt10_3m1_1")*results.parError("rt10_3m1_1") - 2*results.covariance("rt10_3m1_0","rt10_3m1_1")); -outfile << "rt10_3m1_0_minus_rt10_3m1_1" << "\t" << rt10_3m1_0_minus_rt10_3m1_1_value << "\t" << rt10_3m1_0_minus_rt10_3m1_1_error << "\n"; - + double r10_11_0_minus_r10_11_1_value = results.parValue("r10_11_0") - results.parValue("r10_11_1"); + double r10_11_0_minus_r10_11_1_error = sqrt(results.parError("r10_11_0")*results.parError("r10_11_0") + results.parError("r10_11_1")*results.parError("r10_11_1") - 2*results.covariance("r10_11_0","r10_11_1")); + outfile << "r10_11_0_minus_r10_11_1" << "\t" << r10_11_0_minus_r10_11_1_value << "\t" << r10_11_0_minus_r10_11_1_error << "\n"; - - // Constraint - - // double rhoN00 = 1/2*(results.parValue("rho000") - rho001_value); + double r10_31_0_plus_r10_31_1_value = results.parValue("r10_31_0") + results.parValue("r10_31_1"); + double r10_31_0_plus_r10_31_1_error = sqrt(results.parError("r10_31_0")*results.parError("r10_31_0") + results.parError("r10_31_1")*results.parError("r10_31_1") + 2*results.covariance("r10_31_0","r10_31_1")); + outfile << "r10_31_0_plus_r10_31_1" << "\t" << r10_31_0_plus_r10_31_1_value << "\t" << r10_31_0_plus_r10_31_1_error << "\n"; - // double rhoU00 = 1/2*(results.parValue("rho000") + rho001_value); + double r10_31_0_minus_r10_31_1_value = results.parValue("r10_31_0") - results.parValue("r10_31_1"); + double r10_31_0_minus_r10_31_1_error = sqrt(results.parError("r10_31_0")*results.parError("r10_31_0") + results.parError("r10_31_1")*results.parError("r10_31_1") - 2*results.covariance("r10_31_0","r10_31_1")); + outfile << "r10_31_0_minus_r10_31_1" << "\t" << r10_31_0_minus_r10_31_1_value << "\t" << r10_31_0_minus_r10_31_1_error << "\n"; - // double rhoN00 = 1/2*(results.parValue("rho110") + rhom111_value); + double r10_3m1_0_plus_r10_3m1_1_value = results.parValue("r10_3m1_0") + results.parValue("r10_3m1_1"); + double r10_3m1_0_plus_r10_3m1_1_error = sqrt(results.parError("r10_3m1_0")*results.parError("r10_3m1_0") + results.parError("r10_3m1_1")*results.parError("r10_3m1_1") + 2*results.covariance("r10_3m1_0","r10_3m1_1")); + outfile << "r10_3m1_0_plus_r10_3m1_1" << "\t" << r10_3m1_0_plus_r10_3m1_1_value << "\t" << r10_3m1_0_plus_r10_3m1_1_error << "\n"; - // double rhoU00 = 1/2*(results.parValue("rho000") + rho001_value); - - double sigma_low = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")); - double sigma_low_err = sqrt( - 4*results.parError("delta_rho111")*results.parError("delta_rho111") + - 4*results.parError("delta_rho133")*results.parError("delta_rho133") + - 8*results.covariance("delta_rho111","delta_rho133") -); - double sigma_up =(results.parValue("rho001")+2*results.parValue("rho111")); - double sigma_up_err = sqrt( - results.parError("rho001")*results.parError("rho001") + - 4*results.parError("rho111")*results.parError("rho111") + - 4*results.covariance("rho001","rho111") -); -outfile << "Sigma_low" << "\t" << sigma_low << "\t" << sigma_low_err << "\t" << "\n"; -outfile << "Sigma_up" << "\t" << sigma_up_err << "\t" << sigma_up_err << "\t" << "\n"; + double r10_3m1_0_minus_r10_3m1_1_value = results.parValue("r10_3m1_0") - results.parValue("r10_3m1_1"); + double r10_3m1_0_minus_r10_3m1_1_error = sqrt(results.parError("r10_3m1_0")*results.parError("r10_3m1_0") + results.parError("r10_3m1_1")*results.parError("r10_3m1_1") - 2*results.covariance("r10_3m1_0","r10_3m1_1")); + outfile << "r10_3m1_0_minus_r10_3m1_1" << "\t" << r10_3m1_0_minus_r10_3m1_1_value << "\t" << r10_3m1_0_minus_r10_3m1_1_error << "\n"; + double rt10_31_0_plus_rt10_31_1_value = results.parValue("rt10_31_0") + results.parValue("rt10_31_1"); + double rt10_31_0_plus_rt10_31_1_error = sqrt(results.parError("rt10_31_0")*results.parError("rt10_31_0") + results.parError("rt10_31_1")*results.parError("rt10_31_1") + 2*results.covariance("rt10_31_0","rt10_31_1")); + outfile << "rt10_31_0_plus_rt10_31_1" << "\t" << rt10_31_0_plus_rt10_31_1_value << "\t" << rt10_31_0_plus_rt10_31_1_error << "\n"; - // covariance matrix - vector< vector< double > > covMatrix; - covMatrix = results.errorMatrix(); - - // double SigmaN = results.parValue(pars[3]) + results.parValue(pars[6]); - // double SigmaN_err = covMatrix[5][5] + covMatrix[8][8] + 2*covMatrix[5][8]; + double rt10_31_0_minus_rt10_31_1_value = results.parValue("rt10_31_0") - results.parValue("rt10_31_1"); + double rt10_31_0_minus_rt10_31_1_error = sqrt(results.parError("rt10_31_0")*results.parError("rt10_31_0") + results.parError("rt10_31_1")*results.parError("rt10_31_1") - 2*results.covariance("rt10_31_0","rt10_31_1")); + outfile << "rt10_31_0_minus_rt10_31_1" << "\t" << rt10_31_0_minus_rt10_31_1_value << "\t" << rt10_31_0_minus_rt10_31_1_error << "\n"; - // double SigmaD = 0.5*(1 - results.parValue(pars[0])) + results.parValue(pars[2]); - // double SigmaD_err = 0.5*0.5*covMatrix[2][2] + covMatrix[4][4] - 2*0.5*covMatrix[2][4]; + double rt10_3m1_0_plus_rt10_3m1_1_value = results.parValue("rt10_3m1_0") + results.parValue("rt10_3m1_1"); + double rt10_3m1_0_plus_rt10_3m1_1_error = sqrt(results.parError("rt10_3m1_0")*results.parError("rt10_3m1_0") + results.parError("rt10_3m1_1")*results.parError("rt10_3m1_1") + 2*results.covariance("rt10_3m1_0","rt10_3m1_1")); + outfile << "rt10_3m1_0_plus_rt10_3m1_1" << "\t" << rt10_3m1_0_plus_rt10_3m1_1_value << "\t" << rt10_3m1_0_plus_rt10_3m1_1_error << "\n"; - // double Sigma = SigmaN/SigmaD; - // double Sigma_err = fabs(Sigma) * sqrt(SigmaN_err/SigmaN/SigmaN + SigmaD_err/SigmaD/SigmaD); - // outfile << Sigma << "\t" << Sigma_err << "\t"; + double rt10_3m1_0_minus_rt10_3m1_1_value = results.parValue("rt10_3m1_0") - results.parValue("rt10_3m1_1"); + double rt10_3m1_0_minus_rt10_3m1_1_error = sqrt(results.parError("rt10_3m1_0")*results.parError("rt10_3m1_0") + results.parError("rt10_3m1_1")*results.parError("rt10_3m1_1") - 2*results.covariance("rt10_3m1_0","rt10_3m1_1")); + outfile << "rt10_3m1_0_minus_rt10_3m1_1" << "\t" << rt10_3m1_0_minus_rt10_3m1_1_value << "\t" << rt10_3m1_0_minus_rt10_3m1_1_error << "\n"; + + + // covariance matrix + vector< vector< double > > covMatrix; + covMatrix = results.errorMatrix(); outfile << endl; // ************************ From ccc33464959a8f4fcae9667ca024f325585563e9 Mon Sep 17 00:00:00 2001 From: Niklas Herrmann Date: Wed, 8 Jul 2026 11:12:56 -0400 Subject: [PATCH 3/5] Fixed small errors --- .../AMPTOOLS_AMPS/DeltaAngles_Rho.cc | 176 --------- src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h | 75 ---- .../GPUDeltaAngles_Rho_kernel.cu | 52 --- ...GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu | 9 +- ...PiAngles_Delta_DoubleSDMEs_unpol_kernel.cu | 118 ------ .../GPUTwoPiAngles_Delta_factorized_kernel.cu | 35 +- .../GPUTwoPiAngles_Delta_kernel.cu | 52 --- .../GPUTwoPiAngles_Delta_upperv_kernel.cu | 51 --- .../GPUTwoPiAngles_only_upperv_kernel.cu | 51 --- .../AMPTOOLS_AMPS/TwoPiAngles_Delta.cc | 205 ----------- .../AMPTOOLS_AMPS/TwoPiAngles_Delta.h | 82 ----- .../TwoPiAngles_Delta_DoubleSDMEs.cc | 171 ++++----- .../TwoPiAngles_Delta_DoubleSDMEs_unpol.cc | 343 ------------------ .../TwoPiAngles_Delta_DoubleSDMEs_unpol.h | 109 ------ .../TwoPiAngles_Delta_factorized.cc | 127 ++----- .../TwoPiAngles_Delta_factorized.h | 15 +- .../TwoPiAngles_Delta_only_upperv.cc | 198 ---------- .../TwoPiAngles_Delta_only_upperv.h | 79 ---- .../TwoPiDeltaPlotGenerator.cc | 297 ++++++++------- .../AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h | 25 +- src/programs/AmplitudeAnalysis/fit/fit.cc | 8 - .../AmplitudeAnalysis/fitMPI/fitMPI.cc | 8 - .../twopidelta_plotter/twopidelta_plotter.cc | 6 - 23 files changed, 283 insertions(+), 2009 deletions(-) delete mode 100755 src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.cc delete mode 100755 src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h delete mode 100755 src/libraries/AMPTOOLS_AMPS/GPUDeltaAngles_Rho_kernel.cu delete mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel.cu delete mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_kernel.cu delete mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_upperv_kernel.cu delete mode 100755 src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_only_upperv_kernel.cu delete mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.cc delete mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.h delete mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.cc delete mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h delete mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.cc delete mode 100755 src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h diff --git a/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.cc b/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.cc deleted file mode 100755 index f3b717992..000000000 --- a/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.cc +++ /dev/null @@ -1,176 +0,0 @@ -#include -#include -#include -#include -#include - -#include "TLorentzVector.h" -#include "TLorentzRotation.h" - -#include "IUAmpTools/Kinematics.h" -#include "AMPTOOLS_AMPS/DeltaAngles_Rho.h" -#include "AMPTOOLS_AMPS/clebschGordan.h" -#include "AMPTOOLS_AMPS/wignerD.h" - -DeltaAngles_Rho::DeltaAngles_Rho( const vector< string >& args ) : -UserAmplitude< DeltaAngles_Rho >( args ) -{ - assert( args.size() == 12 || args.size() == 11 ); - - delta_rho011 = AmpParameter( args[0] ); - delta_rho031 = AmpParameter( args[1] ); - delta_rho03m1 = AmpParameter( args[2] ); - - delta_rho111 = AmpParameter( args[3] ); - delta_rho133 = AmpParameter( args[4] ); - delta_rho131 = AmpParameter( args[5] ); - delta_rho13m1 = AmpParameter( args[6] ); - - delta_rho231 = AmpParameter( args[7] ); - delta_rho23m1 = AmpParameter( args[8] ); - - frame = string( args[9] ); // choose between Gottfried Jackson (GJ) and helicity (Hel) frame - - // need to register any free parameters so the framework knows about them - registerParameter( delta_rho011 ); - registerParameter( delta_rho031 ); - registerParameter( delta_rho03m1 ); - - registerParameter( delta_rho111 ); - registerParameter( delta_rho133 ); - registerParameter( delta_rho131 ); - registerParameter( delta_rho13m1 ); - - registerParameter( delta_rho231 ); - registerParameter( delta_rho23m1 ); - - std::cout<< "number of arguments:" < -DeltaAngles_Rho::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { - - GDouble sinSqTheta = userVars[kSinSqTheta]; -// GDouble cosSqTheta = userVars[kCosSqTheta]; - GDouble sin2Theta = userVars[kSin2Theta]; - GDouble phi = userVars[kPhi]; - GDouble cosTheta = userVars[kCosTheta]; - GDouble bigPhi = userVars[kBigPhi]; - GDouble Pgamma = userVars[kPgamma]; - - //SDMEs for 3/2- -> 1/2+ + 0- (doi.org/10.1103/PhysRevC.96.025208) - - GDouble W = 3.*(0.5 - delta_rho011)*sinSqTheta + delta_rho011*(1.+3.*cosTheta*cosTheta) - 2.*TMath::Sqrt(3.)*delta_rho031*cos(phi)*sin2Theta - 2.*TMath::Sqrt(3.)*delta_rho03m1*cos(2.*phi)*sinSqTheta; - - W -= Pgamma*cos(2.*bigPhi) * (3.*delta_rho133*sinSqTheta + delta_rho111*(1.+3.*cosTheta*cosTheta) - 2.*TMath::Sqrt(3.)*delta_rho131*cos(phi)*sin2Theta - 2.*TMath::Sqrt(3.)*delta_rho13m1*cos(2.*phi)*sinSqTheta); - - W -= Pgamma*sin(2.*bigPhi) * (2.*TMath::Sqrt(3.)*delta_rho231*sin(phi)*sin2Theta + 2.*TMath::Sqrt(3.)*delta_rho23m1*sin(2.*phi)*sinSqTheta); - - W *= 1./(4.*PI); - - - -// return W; - return complex< GDouble > ( sqrt(fabs(W)) ); -} - -void -DeltaAngles_Rho::calcUserVars( GDouble** pKin, GDouble* userVars ) const { - - TLorentzVector target ( 0, 0, 0, 0.9382720813); - TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); - TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); - TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); - TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); - TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); - - TLorentzVector recoil = p2 + p3; - - TLorentzVector resonance = proton + p1; - TLorentzRotation resonanceBoost( -resonance.BoostVector() ); - - TLorentzVector target_res = resonanceBoost * target; - TLorentzVector beam_res = resonanceBoost * beam; - TLorentzVector recoil_res = resonanceBoost * recoil; - TLorentzVector p1_res = resonanceBoost * p1; - - // normal to the production plane - // choose Gottfried-Jackson frame: z-axis along target direction in baryon rest frame - TVector3 y = (beam_res.Vect().Unit().Cross(recoil_res.Vect().Unit())).Unit(); - TVector3 z = target_res.Vect().Unit(); - - // TVector3 y = (target_res.Vect().Unit().Cross(recoil_res.Vect().Unit())).Unit(); - // TVector3 z = target_res.Vect().Unit(); - TVector3 x = y.Cross(z).Unit(); - - TVector3 angles( (p1_res.Vect()).Dot(x), - (p1_res.Vect()).Dot(y), - (p1_res.Vect()).Dot(z) ); - - GDouble phi = angles.Phi(); - GDouble cosTheta = angles.CosTheta(); - - GDouble sinSqTheta = sin(angles.Theta())*sin(angles.Theta()); - // GDouble cosSqTheta = cos(angles.Theta())*cos(angles.Theta()); - GDouble sin2Theta = sin(2.*angles.Theta()); - - - TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); // beam polarization vector in lab - GDouble Phi = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); - //Phi = Phi > 0? Phi : Phi + 3.14159; - - // polarization BeamProperties - GDouble Pgamma=polFraction; - - if(polAngle == -1) - Pgamma = 0.; - - //angles in the helicity frame: - TVector3 z_hel = -recoil_res.Vect().Unit(); - TVector3 y_hel = (beam_res.Vect().Cross(recoil_res.Vect())).Unit(); - TVector3 x_hel = (y_hel.Cross(z_hel)).Unit(); - - TVector3 p1_hel(p1_res.Vect().Dot(x_hel),p1_res.Vect().Dot(y_hel),p1_res.Vect().Dot(z_hel)); - - GDouble phi_hel = p1_hel.Phi(); - GDouble cosTheta_hel = p1_hel.CosTheta(); - - GDouble sinSqTheta_hel = sin(p1_hel.Theta())*sin(p1_hel.Theta()); - // GDouble cosSqTheta_hel = cos(p2_hel.Theta())*cos(p2_hel.Theta()); - GDouble sin2Theta_hel = sin(2.*p1_hel.Theta()); - - if(frame=="Hel"){ - userVars[kCosTheta] = cosTheta_hel; - userVars[kSinSqTheta] = sinSqTheta_hel; - userVars[kSin2Theta] = sin2Theta_hel; - userVars[kPhi] = phi_hel; - } - else{ - userVars[kCosTheta] = cosTheta; - userVars[kSinSqTheta] = sinSqTheta; - userVars[kSin2Theta] = sin2Theta; - userVars[kPhi] = phi; - } - - userVars[kPgamma] = Pgamma; - userVars[kBigPhi] = Phi; - -} - -#ifdef GPU_ACCELERATION -void -DeltaAngles_Rho::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { - - GPUDeltaAngles_Rho_exec( dimGrid, dimBlock, GPU_AMP_ARGS, - delta_rho011, delta_rho031, delta_rho03m1, delta_rho111, delta_rho133, delta_rho131, delta_rho13m1, delta_rho231, delta_rho23m1, polAngle ); -} - -#endif // GPU_ACCELERATION diff --git a/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h b/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h deleted file mode 100755 index afacce7b2..000000000 --- a/src/libraries/AMPTOOLS_AMPS/DeltaAngles_Rho.h +++ /dev/null @@ -1,75 +0,0 @@ -#if !defined(DELTAANGLES_RHO) -#define DELTAANGLES_RHO - -#include "IUAmpTools/Amplitude.h" -#include "IUAmpTools/UserAmplitude.h" -#include "IUAmpTools/AmpParameter.h" -#include "GPUManager/GPUCustomTypes.h" - -#include "TH1D.h" - -#include -#include -#include - - - -using std::complex; -using namespace std; - -#ifdef GPU_ACCELERATION -void GPUDeltaAngles_Rho_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, - GDouble delta_rho011, GDouble delta_rho031, GDouble delta_rho03m1, - GDouble delta_rho111, GDouble delta_rho133, GDouble delta_rho131, GDouble delta_rho13m1, - GDouble delta_rho231, GDouble delta_rho23m1, GDouble polAngle ); -#endif // GPU_ACCELERATION - -class Kinematics; - -class DeltaAngles_Rho : public UserAmplitude< DeltaAngles_Rho > -{ - -public: - - DeltaAngles_Rho() : UserAmplitude< DeltaAngles_Rho >() { }; - DeltaAngles_Rho( const vector< string >& args ); - - enum UserVars { kPgamma = 0, kCosTheta, kSinSqTheta, kSin2Theta, kBigPhi, kPhi, kNumUserVars }; - unsigned int numUserVars() const { return kNumUserVars; } - - string name() const { return "DeltaAngles_Rho"; } - - complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; - void calcUserVars( GDouble** pKin, GDouble* userVars ) const; - - bool needsUserVarsOnly() const { return true; } - -#ifdef GPU_ACCELERATION - - void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; - bool isGPUEnabled() const { return true; } - -#endif // GPU_ACCELERATION - -private: - - AmpParameter delta_rho011; - AmpParameter delta_rho031; - AmpParameter delta_rho03m1; - - AmpParameter delta_rho111; - AmpParameter delta_rho133; - AmpParameter delta_rho131; - AmpParameter delta_rho13m1; - - AmpParameter delta_rho231; - AmpParameter delta_rho23m1; - - GDouble polFraction=0.; - GDouble polAngle=-1; - TH1D *polFrac_vs_E; - string frame; - -}; - -#endif \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/GPUDeltaAngles_Rho_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUDeltaAngles_Rho_kernel.cu deleted file mode 100755 index 5d16f80b8..000000000 --- a/src/libraries/AMPTOOLS_AMPS/GPUDeltaAngles_Rho_kernel.cu +++ /dev/null @@ -1,52 +0,0 @@ -#include - -#include "GPUManager/GPUCustomTypes.h" -#include "GPUManager/CUDA-Complex.cuh" - -#include "AMPTOOLS_AMPS/breakupMomentum.cuh" -#include "AMPTOOLS_AMPS/barrierFactor.cuh" - -#include "GPUUtils/wignerD.cuh" -#include "GPUUtils/clebsch.cuh" - -/////////////////////////////////////////////////////////////////////////////// -__global__ void -GPUDeltaAngles_Rho_kernel( GPU_AMP_PROTO, GDouble delta_rho011, GDouble delta_rho031, GDouble delta_rho03m1, - GDouble delta_rho111, GDouble delta_rho133, GDouble delta_rho131, GDouble delta_rho13m1, - GDouble delta_rho231, GDouble delta_rho23m1, GDouble polAngle ) -{ - int iEvent = GPU_THIS_EVENT; - - GDouble Pgamma = GPU_UVARS(0); - GDouble cosTheta = GPU_UVARS(1); - GDouble sinSqTheta = GPU_UVARS(2); - GDouble sin2Theta = GPU_UVARS(3); - GDouble bigPhi = GPU_UVARS(4); - GDouble phi = GPU_UVARS(5); - - GDouble W = 3.0*(0.5 - delta_rho011)*sinSqTheta + delta_rho011*(1.0 + 3.0*cosTheta*cosTheta) - 2.0*sqrt(3.0)*delta_rho031*cos(phi)*sin2Theta - 2.0*sqrt(3.0)*delta_rho03m1*cos(2.0*phi)*sinSqTheta; - - W -= Pgamma*cos(2.0*bigPhi)*(3.0*delta_rho133*sinSqTheta + delta_rho111*(1.0 + 3.0*cosTheta*cosTheta) - 2.0*sqrt(3.0)*delta_rho131*cos(phi)*sin2Theta - 2.0*sqrt(3.0)*delta_rho13m1*cos(2.0*phi)*sinSqTheta); - - W -= Pgamma*sin(2.0*bigPhi)*(2.0*sqrt(3.0)*delta_rho231*sin(phi)*sin2Theta + 2.0*sqrt(3.0)*delta_rho23m1*sin(2.0*phi)*sinSqTheta); - - W *= 1.0/(4.0*PI); - - WCUComplex amp = { sqrt( fabs( W ) ), 0 }; - - pcDevAmp[iEvent] = amp; - -} - -void -GPUDeltaAngles_Rho_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, - GDouble delta_rho011, GDouble delta_rho031, GDouble delta_rho03m1, - GDouble delta_rho111, GDouble delta_rho133, GDouble delta_rho131, GDouble delta_rho13m1, - GDouble delta_rho231, GDouble delta_rho23m1, GDouble polAngle ) - -{ - - GPUDeltaAngles_Rho_kernel<<< dimGrid, dimBlock >>> - ( GPU_AMP_ARGS, delta_rho011, delta_rho031, delta_rho03m1, delta_rho111, delta_rho133, delta_rho131, delta_rho13m1, delta_rho231, delta_rho23m1, polAngle ); - -} \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu index fff00b50e..03f2ce73c 100755 --- a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu +++ b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu @@ -10,7 +10,7 @@ __global__ void GPUTwoPiAngles_Delta_DoubleSDMEs_kernel( GPU_AMP_PROTO, //order is like the appearing order in the paper //Wmm - GDouble r00_33_0, //GDouble r00_11_0, + GDouble r00_33_0, GDouble r11_33_0, GDouble r11_11_0, GDouble r1m1_33_0, GDouble r1m1_11_0, GDouble r10_33_0, GDouble r10_11_0, @@ -100,6 +100,7 @@ GPUTwoPiAngles_Delta_DoubleSDMEs_kernel( GPU_AMP_PROTO, GDouble Wb10_0 = (2.0 / sqrt(3.0)) * (r10_31_0 * cphi * sin2Th + r10_3m1_0 * c2phi * sinSqTh); GDouble Wt10_0 = (2.0 / sqrt(3.0)) * (rt10_31_0 * sphi * sin2Th + rt10_3m1_0 * s2phi * sinSqTh); GDouble W0 = cosSqThPi * (W00_0 - Wb00_0) + sinSqThPi * (W11_0 - Wb11_0) - sinSqThPi * (c2phiPi * (W1m1_0 - Wb1m1_0) + s2phiPi * Wt1m1_0) - sqrt(2.0) * sin2ThPi * (cphiPi * (W10_0 - Wb10_0) + sphiPi * Wt10_0); + //alpha = 1 (same structure) GDouble W00_1 = r00_33_1 * sinSqTh + r00_11_1 * (1.0/3.0 + cosSqTh); GDouble Wb00_1 = (2.0 / sqrt(3.0)) * (r00_31_1 * cphi * sin2Th + r00_3m1_1 * c2phi * sinSqTh); @@ -128,7 +129,7 @@ GPUTwoPiAngles_Delta_DoubleSDMEs_kernel( GPU_AMP_PROTO, GDouble W10_2 = r10_33_2 * sinSqTh + r10_11_2 * (1.0/3.0 + cosSqTh); GDouble Wb10_2 = (2.0 / sqrt(3.0)) * (r10_31_2 * cphi * sin2Th + r10_3m1_2 * c2phi * sinSqTh); GDouble Wt10_2 = (2.0 / sqrt(3.0)) * (rt10_31_2 * sphi * sin2Th + rt10_3m1_2 * s2phi * sinSqTh); - GDouble W2 = cosSqThPi * Wt00_2+ sinSqThPi * Wt11_2+ sinSqThPi * (s2phiPi * (W1m1_2 - Wb1m1_2) - c2phiPi * Wt1m1_2) + sqrt(2.0) * sin2ThPi * (sphiPi * (W10_2 - Wb10_2) + cphiPi * Wt10_2); // 19.05 change sign of cphiPi * Wt10_2 + GDouble W2 = cosSqThPi * Wt00_2+ sinSqThPi * Wt11_2+ sinSqThPi * (s2phiPi * (W1m1_2 - Wb1m1_2) - c2phiPi * Wt1m1_2) + sqrt(2.0) * sin2ThPi * (sphiPi * (W10_2 - Wb10_2) + cphiPi * Wt10_2); GDouble Wpol = W0 - Pgamma * cos(2.0 * bigPhi) * W1 - Pgamma * sin(2.0 * bigPhi) * W2; @@ -140,7 +141,7 @@ GPUTwoPiAngles_Delta_DoubleSDMEs_kernel( GPU_AMP_PROTO, void GPUTwoPiAngles_Delta_DoubleSDMEs_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, - GDouble r00_33_0, //GDouble r00_11_0, + GDouble r00_33_0, GDouble r11_33_0, GDouble r11_11_0, GDouble r1m1_33_0, GDouble r1m1_11_0, GDouble r10_33_0, GDouble r10_11_0, @@ -173,7 +174,7 @@ GPUTwoPiAngles_Delta_DoubleSDMEs_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROT GPUTwoPiAngles_Delta_DoubleSDMEs_kernel<<< dimGrid, dimBlock >>> ( GPU_AMP_ARGS, - r00_33_0, //r00_11_0, + r00_33_0, r11_33_0, r11_11_0, r1m1_33_0, r1m1_11_0, r10_33_0, r10_11_0, diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel.cu deleted file mode 100755 index dc1966a59..000000000 --- a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel.cu +++ /dev/null @@ -1,118 +0,0 @@ - -#include - -#include "GPUManager/GPUCustomTypes.h" -#include "GPUManager/CUDA-Complex.cuh" - - -__global__ void -// -GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel( GPU_AMP_PROTO, - //order is like the appearing order in the paper - //Wmm - GDouble r00_33_0, //GDouble r00_11_0, - GDouble r11_33_0, GDouble r11_11_0, - GDouble r1m1_33_0, GDouble r1m1_11_0, - GDouble r10_33_0, GDouble r10_11_0, - - //Wbar - GDouble r00_31_0, GDouble r00_3m1_0, - GDouble r11_31_0, GDouble r11_3m1_0, - GDouble r1m1_31_0, GDouble r1m1_3m1_0, - GDouble r10_31_0, GDouble r10_3m1_0, - - //Wtil - GDouble rt1m1_31_0, GDouble rt1m1_3m1_0, - GDouble rt10_31_0, GDouble rt10_3m1_0 -) - { - - int iEvent = GPU_THIS_EVENT; - - // here we need to be careful to index the user-defined - // data with the proper integer corresponding to the - // enumeration in the C++ header file - - - GDouble Pgamma = GPU_UVARS(0); - GDouble cosTheta_pim = GPU_UVARS(1); - GDouble sinSqTheta_pim = GPU_UVARS(2); - GDouble sin2Theta_pim = GPU_UVARS(3); - GDouble phi_pim = GPU_UVARS(4); - GDouble cosTheta_proton = GPU_UVARS(5); - GDouble sinSqTheta_proton = GPU_UVARS(6); - GDouble sin2Theta_proton = GPU_UVARS(7); - GDouble phi_proton = GPU_UVARS(8); - GDouble bigPhi = GPU_UVARS(9); - // flag for pol (0.0 = no pol, 1.0 = pol) - - GDouble sinSqTh = sinSqTheta_proton; - GDouble sin2Th = sin2Theta_proton; - GDouble cosSqTh = 1.0 - sinSqTh; - - GDouble cphi = cos(phi_proton); - GDouble sphi = sin(phi_proton); - GDouble c2phi = cos(2.0 * phi_proton); - GDouble s2phi = sin(2.0 * phi_proton); - - GDouble sinSqThPi = sinSqTheta_pim; - GDouble sin2ThPi = sin2Theta_pim; - GDouble cosSqThPi = 1.0 - sinSqThPi; - - GDouble cphiPi = cos(phi_pim); - GDouble sphiPi = sin(phi_pim); - GDouble c2phiPi = cos(2.0 * phi_pim); - GDouble s2phiPi = sin(2.0 * phi_pim); - - GDouble r00_11_0 = 0.5 - r00_33_0 - 2.0 * r11_11_0 - 2.0 * r11_33_0; - - GDouble W00_0 = r00_33_0 * sinSqTh + r00_11_0 * (1.0/3.0 + cosSqTh); - GDouble Wb00_0 = (2.0 / sqrt(3.0)) * (r00_31_0 * cphi * sin2Th + r00_3m1_0 * c2phi * sinSqTh); - - GDouble W11_0 = r11_33_0 * sinSqTh + r11_11_0 * (1.0/3.0 + cosSqTh); - GDouble Wb11_0 = (2.0 / sqrt(3.0)) * (r11_31_0 * cphi * sin2Th + r11_3m1_0 * c2phi * sinSqTh); - - GDouble W1m1_0 = r1m1_33_0 * sinSqTh + r1m1_11_0 * (1.0/3.0 + cosSqTh); - GDouble Wb1m1_0 = (2.0 / sqrt(3.0)) * (r1m1_31_0 * cphi * sin2Th + r1m1_3m1_0 * c2phi * sinSqTh); - GDouble Wt1m1_0 = (2.0 / sqrt(3.0)) * (rt1m1_31_0 * sphi * sin2Th + rt1m1_3m1_0 * s2phi * sinSqTh); - - GDouble W10_0 = r10_33_0 * sinSqTh + r10_11_0 * (1.0/3.0 + cosSqTh); - GDouble Wb10_0 = (2.0 / sqrt(3.0)) * (r10_31_0 * cphi * sin2Th + r10_3m1_0 * c2phi * sinSqTh); - GDouble Wt10_0 = (2.0 / sqrt(3.0)) * (rt10_31_0 * sphi * sin2Th + rt10_3m1_0 * s2phi * sinSqTh); - GDouble W0 = cosSqThPi * (W00_0 - Wb00_0) + sinSqThPi * (W11_0 - Wb11_0) - sinSqThPi * (c2phiPi * (W1m1_0 - Wb1m1_0) + s2phiPi * Wt1m1_0) - sqrt(2.0) * sin2ThPi * (cphiPi * (W10_0 - Wb10_0) + sphiPi * Wt10_0); - - WCUComplex amp = { sqrt(fabs(W0)), 0.0 }; - pcDevAmp[iEvent] = amp; - -} - - -void -GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, - GDouble r00_33_0, //GDouble r00_11_0, - GDouble r11_33_0, GDouble r11_11_0, - GDouble r1m1_33_0, GDouble r1m1_11_0, - GDouble r10_33_0, GDouble r10_11_0, - GDouble r00_31_0, GDouble r00_3m1_0, - GDouble r11_31_0, GDouble r11_3m1_0, - GDouble r1m1_31_0, GDouble r1m1_3m1_0, - GDouble r10_31_0, GDouble r10_3m1_0, - GDouble rt1m1_31_0, GDouble rt1m1_3m1_0, - GDouble rt10_31_0, GDouble rt10_3m1_0 -) -{ - - GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_kernel<<< dimGrid, dimBlock >>> - ( GPU_AMP_ARGS, - r00_33_0, //r00_11_0, - r11_33_0, r11_11_0, - r1m1_33_0, r1m1_11_0, - r10_33_0, r10_11_0, - r00_31_0, r00_3m1_0, - r11_31_0, r11_3m1_0, - r1m1_31_0, r1m1_3m1_0, - r10_31_0, r10_3m1_0, - rt1m1_31_0, rt1m1_3m1_0, - rt10_31_0, rt10_3m1_0 - ); -} diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_factorized_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_factorized_kernel.cu index 84918e4cb..e19482fc4 100755 --- a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_factorized_kernel.cu +++ b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_factorized_kernel.cu @@ -11,6 +11,7 @@ GPUTwoPiAngles_Delta_factorized_kernel( GPU_AMP_PROTO, GDouble rho000, GDouble rho100, GDouble rho1m10, +GDouble rho001, GDouble rho111, GDouble rho101, GDouble rho1m11, @@ -18,8 +19,7 @@ GDouble rho102, GDouble rho1m12, GDouble delta_rho011, GDouble delta_rho031, -GDouble delta_rho03m1, -GDouble rho001 +GDouble delta_rho03m1 ) { @@ -35,34 +35,22 @@ GDouble rho001 GDouble sinSqTheta_pim = GPU_UVARS(2); GDouble sin2Theta_pim = GPU_UVARS(3); GDouble phi_pim = GPU_UVARS(4); - GDouble cosTheta_piplus = GPU_UVARS(5); - GDouble sinSqTheta_piplus = GPU_UVARS(6); - GDouble sin2Theta_piplus = GPU_UVARS(7); - GDouble phi_piplus = GPU_UVARS(8); + GDouble cosTheta_proton = GPU_UVARS(5); + GDouble sinSqTheta_proton = GPU_UVARS(6); + GDouble sin2Theta_proton = GPU_UVARS(7); + GDouble phi_proton = GPU_UVARS(8); GDouble bigPhi = GPU_UVARS(9); // flag for pol (0.0 = no pol, 1.0 = pol) - - // GDouble rho001_val; - // rho001_val = 2*(delta_rho111 + delta_rho133 - rho111); -// Use beam assy. to eliminate one parameter GDouble W0_meson = 3.*(0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta_pim*cosTheta_pim - sqrt(2.)*rho100*sin2Theta_pim*cos(phi_pim) - rho1m10*sinSqTheta_pim*cos(2.*phi_pim)); GDouble W1_meson= 3.*(rho111*sinSqTheta_pim + rho001*cosTheta_pim*cosTheta_pim - sqrt(2.)*rho101*sin2Theta_pim*cos(phi_pim) - rho1m11*sinSqTheta_pim*cos(2.*phi_pim)); GDouble W2_meson = 3. * (sqrt(2.)*rho102*sin2Theta_pim*sin(phi_pim) + rho1m12*sinSqTheta_pim*sin(2.*phi_pim)); - GDouble W0_baryon = 3.*(0.5 - delta_rho011)*sinSqTheta_piplus + delta_rho011*(1.+3.*cosTheta_piplus*cosTheta_piplus) - 2.*sqrt(3.)*delta_rho031*cos(phi_piplus)*sin2Theta_piplus - 2.*sqrt(3.)*delta_rho03m1*cos(2.*phi_piplus)*sinSqTheta_piplus; + GDouble W0_baryon = 3.*(0.5 - delta_rho011)*sinSqTheta_proton + delta_rho011*(1.+3.*cosTheta_proton*cosTheta_proton) - 2.*sqrt(3.)*delta_rho031*cos(phi_proton)*sin2Theta_proton - 2.*sqrt(3.)*delta_rho03m1*cos(2.*phi_proton)*sinSqTheta_proton; // GDouble W1_baryon = (3.*delta_rho133*sinSqTheta_piplus + delta_rho111*(1.+3.*cosTheta_piplus*cosTheta_piplus) - 2.*sqrt(3.)*delta_rho131*cos(phi_piplus)*sin2Theta_piplus - 2.*sqrt(3.)*delta_rho13m1*cos(2.*phi_piplus)*sinSqTheta_piplus); // GDouble W2_baryon = (2.*sqrt(3.)*delta_rho231*sin(phi_piplus)*sin2Theta_piplus + 2.*sqrt(3.)*delta_rho23m1*sin(2.*phi_piplus)*sinSqTheta_piplus); - // GDouble Wpol = W0_meson*W0_baryon - Pgamma * cos(2.0 * bigPhi) * W1_meson * W1_baryon - Pgamma * sin(2.0 * bigPhi) * W2_meson * W2_baryon; - - /// Just another tests!!!!!! --- IGNORE --- - - // GDouble Wpol = W0_meson*W0_baryon -( Pgamma * cos(2.0 * bigPhi) * W1_meson + Pgamma * sin(2.0 * bigPhi) * W2_meson) * (W1_baryon + W2_baryon); -//Just another test GDouble Wpol = W0_meson*W0_baryon - Pgamma * cos(2.0 * bigPhi) *( W1_meson*W0_baryon) - Pgamma * sin(2.0 * bigPhi) *( W2_meson*W0_baryon); - - // GDouble Wpol = (W0_meson - Pgamma * cos(2.0 * bigPhi) * W1_meson - Pgamma * sin(2.0 * bigPhi) * W2_meson )*(W0_baryon - Pgamma * cos(2.0 * bigPhi) * W1_baryon - Pgamma * sin(2.0 * bigPhi) * W2_baryon); Wpol *= 1/(4.*PI); @@ -77,6 +65,7 @@ GPUTwoPiAngles_Delta_factorized_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO GDouble rho000, GDouble rho100, GDouble rho1m10, + GDouble rho001, GDouble rho111, GDouble rho101, GDouble rho1m11, @@ -84,8 +73,8 @@ GPUTwoPiAngles_Delta_factorized_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO GDouble rho1m12, GDouble delta_rho011, GDouble delta_rho031, - GDouble delta_rho03m1, - GDouble rho001 + GDouble delta_rho03m1 + ) { @@ -94,6 +83,7 @@ GPUTwoPiAngles_Delta_factorized_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO rho000, rho100, rho1m10, + rho001, rho111, rho101, rho1m11, @@ -101,7 +91,6 @@ GPUTwoPiAngles_Delta_factorized_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO rho1m12, delta_rho011, delta_rho031, - delta_rho03m1, - rho001 + delta_rho03m1 ); } diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_kernel.cu deleted file mode 100755 index c6c9411f0..000000000 --- a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_kernel.cu +++ /dev/null @@ -1,52 +0,0 @@ - -#include - -#include "GPUManager/GPUCustomTypes.h" -#include "GPUManager/CUDA-Complex.cuh" - - -__global__ void -GPUTwoPiAngles_Delta_kernel( GPU_AMP_PROTO, GDouble rho000, GDouble rho100, - GDouble rho1m10, GDouble rho111, GDouble delta_rho133, - GDouble rho101, GDouble rho1m11, GDouble rho102, - GDouble rho1m12, GDouble polAngle, GDouble delta_rho111 ){ - - int iEvent = GPU_THIS_EVENT; - - // here we need to be careful to index the user-defined - // data with the proper integer corresponding to the - // enumeration in the C++ header file - - GDouble Pgamma = GPU_UVARS(0); - GDouble cosTheta = GPU_UVARS(1); - GDouble sinSqTheta = GPU_UVARS(2); - GDouble sin2Theta = GPU_UVARS(3); - GDouble bigPhi = GPU_UVARS(4); // before polAngle*0.017453293 + - GDouble phi = GPU_UVARS(5); - GDouble rho001=2*(delta_rho111 + delta_rho133 - rho111); - GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); - - W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); - - W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); - - W *= 3./(4.*PI); - - WCUComplex amp = { sqrt( fabs( W ) ), 0 }; - - pcDevAmp[iEvent] = amp; -} - - -void -GPUTwoPiAngles_Delta_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, - GDouble rho000, GDouble rho100, GDouble rho1m10, - GDouble rho111, GDouble delta_rho133, GDouble rho101, - GDouble rho1m11, GDouble rho102, GDouble rho1m12, - GDouble polAngle, GDouble delta_rho111 ) -{ - - GPUTwoPiAngles_Delta_kernel<<< dimGrid, dimBlock >>> - ( GPU_AMP_ARGS, rho000, rho100, rho1m10, rho111,delta_rho133, - rho101, rho1m11, rho102, rho1m12, polAngle, delta_rho111 ); -} diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_upperv_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_upperv_kernel.cu deleted file mode 100755 index 7c9f9f89c..000000000 --- a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_upperv_kernel.cu +++ /dev/null @@ -1,51 +0,0 @@ - -#include - -#include "GPUManager/GPUCustomTypes.h" -#include "GPUManager/CUDA-Complex.cuh" - - -__global__ void -GPUTwoPiAngles_Delta_only_upperv_kernel( GPU_AMP_PROTO, GDouble rho000, GDouble rho100, - GDouble rho1m10, GDouble rho111, GDouble rho001, - GDouble rho101, GDouble rho1m11, GDouble rho102, - GDouble rho1m12, GDouble polAngle ){ - - int iEvent = GPU_THIS_EVENT; - - // here we need to be careful to index the user-defined - // data with the proper integer corresponding to the - // enumeration in the C++ header file - - GDouble Pgamma = GPU_UVARS(0); - GDouble cosTheta = GPU_UVARS(1); - GDouble sinSqTheta = GPU_UVARS(2); - GDouble sin2Theta = GPU_UVARS(3); - GDouble bigPhi = GPU_UVARS(4); // before polAngle*0.017453293 + - GDouble phi = GPU_UVARS(5); - GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); - - W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); - - W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); - - W *= 3./(4.*PI); - - WCUComplex amp = { sqrt( fabs( W ) ), 0 }; - - pcDevAmp[iEvent] = amp; -} - - -void -GPUTwoPiAngles_Delta_only_upperv_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, - GDouble rho000, GDouble rho100, GDouble rho1m10, - GDouble rho111, GDouble rho001, GDouble rho101, - GDouble rho1m11, GDouble rho102, GDouble rho1m12, - GDouble polAngle ) -{ - - GPUTwoPiAngles_Delta_only_upperv_kernel<<< dimGrid, dimBlock >>> - ( GPU_AMP_ARGS, rho000, rho100, rho1m10, rho111,rho001, - rho101, rho1m11, rho102, rho1m12, polAngle ); -} diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_only_upperv_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_only_upperv_kernel.cu deleted file mode 100755 index 7c9f9f89c..000000000 --- a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_only_upperv_kernel.cu +++ /dev/null @@ -1,51 +0,0 @@ - -#include - -#include "GPUManager/GPUCustomTypes.h" -#include "GPUManager/CUDA-Complex.cuh" - - -__global__ void -GPUTwoPiAngles_Delta_only_upperv_kernel( GPU_AMP_PROTO, GDouble rho000, GDouble rho100, - GDouble rho1m10, GDouble rho111, GDouble rho001, - GDouble rho101, GDouble rho1m11, GDouble rho102, - GDouble rho1m12, GDouble polAngle ){ - - int iEvent = GPU_THIS_EVENT; - - // here we need to be careful to index the user-defined - // data with the proper integer corresponding to the - // enumeration in the C++ header file - - GDouble Pgamma = GPU_UVARS(0); - GDouble cosTheta = GPU_UVARS(1); - GDouble sinSqTheta = GPU_UVARS(2); - GDouble sin2Theta = GPU_UVARS(3); - GDouble bigPhi = GPU_UVARS(4); // before polAngle*0.017453293 + - GDouble phi = GPU_UVARS(5); - GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); - - W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); - - W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); - - W *= 3./(4.*PI); - - WCUComplex amp = { sqrt( fabs( W ) ), 0 }; - - pcDevAmp[iEvent] = amp; -} - - -void -GPUTwoPiAngles_Delta_only_upperv_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, - GDouble rho000, GDouble rho100, GDouble rho1m10, - GDouble rho111, GDouble rho001, GDouble rho101, - GDouble rho1m11, GDouble rho102, GDouble rho1m12, - GDouble polAngle ) -{ - - GPUTwoPiAngles_Delta_only_upperv_kernel<<< dimGrid, dimBlock >>> - ( GPU_AMP_ARGS, rho000, rho100, rho1m10, rho111,rho001, - rho101, rho1m11, rho102, rho1m12, polAngle ); -} diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.cc deleted file mode 100755 index 9fb708b55..000000000 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.cc +++ /dev/null @@ -1,205 +0,0 @@ - -#include -#include -#include -#include -#include - -#include "TLorentzVector.h" -#include "TLorentzRotation.h" -#include "TFile.h" - -#include "IUAmpTools/Kinematics.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta.h" -#include "AMPTOOLS_AMPS/clebschGordan.h" -#include "AMPTOOLS_AMPS/wignerD.h" - -TwoPiAngles_Delta::TwoPiAngles_Delta( const vector< string >& args ) : - UserAmplitude< TwoPiAngles_Delta >( args ) -{ - assert(args.size() == 12 || args.size() == 13 || args.size() == 14 ); - - rho000 = AmpParameter( args[0] ); - rho100 = AmpParameter( args[1] ); - rho1m10 = AmpParameter( args[2] ); - rho111 = AmpParameter( args[3] ); - delta_rho133 = AmpParameter( args[4] ); - rho101 = AmpParameter( args[5] ); - rho1m11 = AmpParameter( args[6] ); - rho102 = AmpParameter( args[7] ); - rho1m12 = AmpParameter( args[8] ); - frame = string( args[9] ); - polAngle = AmpParameter( args[10] ); - - delta_rho111 = AmpParameter( args[12] ); - constraint = true; - - // need to register any free parameters so the framework knows about them - registerParameter( rho000 ); - registerParameter( rho100 ); - registerParameter( rho1m10 ); - - registerParameter( rho111 ); - - // if(args.size() == 12){ - // registerParameter( rho001 ); - // } - registerParameter( rho101 ); - registerParameter( rho1m11 ); - - registerParameter( rho102 ); - registerParameter( rho1m12 ); - - //new parameter try - - registerParameter( polAngle ); - // if( args.size() == 13){ - registerParameter( delta_rho111 ); - registerParameter( delta_rho133 ); - // } - // Two possibilities to initialize this amplitude: - // 1: 11 arguments, fixed polarization - // Usage: amplitude :::: TwoPiAngles ... - if(args.size() == 13 || args.size() == 12) { - polFraction = atof(args[11].c_str()); - cout << "Fitting with constant polarization " << polFraction << endl; - } - // 2: 12 arguments, read polarization from histogram in file - // Usage: amplitude :::: TwoPiAngles ... -// else if(args.size() == 13) { -// polFraction = 0.; -// TFile* f = new TFile( args[11].c_str() ); -// polFrac_vs_E = (TH1D*)f->Get( args[12].c_str() ); -// assert( polFrac_vs_E != NULL ); -// cout << "Fitting with polarization from " << polFrac_vs_E->GetName() << endl; -// } -// -} - - -complex< GDouble > -TwoPiAngles_Delta::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { - -GDouble sinSqTheta = userVars[kSinSqTheta]; -GDouble sin2Theta = userVars[kSin2Theta]; -GDouble cosTheta = userVars[kCosTheta]; -GDouble phi = userVars[kPhi]; -//GDouble bigPhi = polAngle*0.017453293 + userVars[kBigPhi]; // rotate Phi (in rad) -GDouble bigPhi = userVars[kBigPhi]; -GDouble Pgamma = userVars[kPgamma]; - - - // vector meson production from K. Schilling et. al. last indize = upper - GDouble rho001_val; - if (constraint) { - rho001_val = 2*(delta_rho111 + delta_rho133 - rho111); - } - else { - rho001_val = rho001; - } - // Use beam assy. to eliminate one parameter - - GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); - W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001_val*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); - W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); - W *= 3./(4.*PI); - - return complex< GDouble > ( sqrt(fabs(W)) ); - -} - -void -TwoPiAngles_Delta::calcUserVars( GDouble** pKin, GDouble* userVars ) const { - - TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); - TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); - TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); - TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); - TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); - TLorentzVector target ( 0, 0, 0, 0.9382720813); - - TLorentzVector resonance = p2 + p3; - TLorentzVector recoil = proton + p1; - TLorentzVector CM_motion_lab = beam + target; - TLorentzRotation resonanceBoost( -resonance.BoostVector() ); - TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); - - - - TLorentzVector beam_res = resonanceBoost * beam; - TLorentzVector recoil_res = resonanceBoost * recoil; - TLorentzVector p2_res = resonanceBoost * p2; - TLorentzVector beam_cm = CMBoost * beam; - TLorentzVector recoil_cm = CMBoost * recoil; - TLorentzVector p2_cm = CMBoost * p2; - TLorentzVector resonance_cm = CMBoost * resonance; - - - // normal to the production plane - TVector3 y = (beam.Vect().Unit().Cross(-recoil.Vect().Unit())).Unit(); - //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); - //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose helicity frame: z-axis opposite recoil Delta in rho rest frame - TVector3 z = -1. * recoil_res.Vect().Unit(); - TVector3 x = y.Cross(z).Unit(); - TVector3 angles( (p2_res.Vect()).Dot(x), - (p2_res.Vect()).Dot(y), - (p2_res.Vect()).Dot(z) ); - - //// Calculation angles GFJ frame - - - - // normal to the production plane - TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame - TVector3 z_GFJ = beam_res.Vect().Unit(); - TVector3 x_GFJ = y_GFJ.Cross(z_GFJ).Unit(); - TVector3 angles_GFJ( (p2_res.Vect()).Dot(x_GFJ), - (p2_res.Vect()).Dot(y_GFJ), - (p2_res.Vect()).Dot(z_GFJ) ); - - if(frame=="Hel"){ - userVars[kCosTheta] = angles.CosTheta(); - userVars[kSinSqTheta] = sin(angles.Theta())*sin(angles.Theta()); - userVars[kSin2Theta] = sin(2.*angles.Theta()); - userVars[kPhi] = angles.Phi(); - } - else{ - userVars[kCosTheta] = angles_GFJ.CosTheta(); - userVars[kSinSqTheta] = sin(angles_GFJ.Theta())*sin(angles_GFJ.Theta()); - userVars[kSin2Theta] = sin(2.*angles_GFJ.Theta()); - userVars[kPhi] = angles_GFJ.Phi(); - } - TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); - userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); - - // vector meson production from K. Schilling et. al. - GDouble Pgamma; - if(polFraction > 0.) { // for fitting with constant polarization - Pgamma = polFraction; - } - // else{ - // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); - // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ - // Pgamma = 0.; - // } - // else Pgamma = polFrac_vs_E->GetBinContent(bin); - // } - userVars[kPgamma] = Pgamma; -} - -#ifdef GPU_ACCELERATION -void -TwoPiAngles_Delta::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { - - GPUTwoPiAngles_Delta_exec( dimGrid, dimBlock, GPU_AMP_ARGS, - rho000, rho100, rho1m10, - rho111, delta_rho133, rho101, - rho1m11, rho102, rho1m12, - polAngle, delta_rho111 ); -} - -#endif //GPU_ACCELERATION \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.h b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.h deleted file mode 100755 index 967cb8ca6..000000000 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta.h +++ /dev/null @@ -1,82 +0,0 @@ -#if !defined(TWOPIANGLES_DELTA) -#define TWOPIANGLES_DELTA - -#include "IUAmpTools/Amplitude.h" -#include "IUAmpTools/UserAmplitude.h" -#include "IUAmpTools/AmpParameter.h" -#include "GPUManager/GPUCustomTypes.h" - -#include "TH1D.h" -#include -#include -#include - -#ifdef GPU_ACCELERATION -void -GPUTwoPiAngles_Delta_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, - GDouble rho000, GDouble rho100, GDouble rho1m10, - GDouble rho111, GDouble delta_rho133, GDouble rho101, - GDouble rho1m11, GDouble rho102, GDouble rho1m12, - GDouble polAngle,GDouble delta_rho111 ); - -#endif // GPU_ACCELERATION - -using std::complex; -using namespace std; - -class Kinematics; - -class TwoPiAngles_Delta : public UserAmplitude< TwoPiAngles_Delta > -{ - -public: - - TwoPiAngles_Delta() : UserAmplitude< TwoPiAngles_Delta >() { }; - TwoPiAngles_Delta( const vector< string >& args ); - - enum UserVars { kPgamma = 0, kCosTheta, kSinSqTheta, kSin2Theta, - kBigPhi, kPhi, kNumUserVars }; - unsigned int numUserVars() const { return kNumUserVars; } - - string name() const { return "TwoPiAngles_Delta"; } - - complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; - void calcUserVars( GDouble** pKin, GDouble* userVars ) const; - - // we can calcualte everythign we need from userVars block so allow - // the framework to purge the four-vectors - bool needsUserVarsOnly() const { return true; } - -#ifdef GPU_ACCELERATION - - void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; - bool isGPUEnabled() const { return true; } - -#endif // GPU_ACCELERATION - -private: - - AmpParameter rho000; - AmpParameter rho100; - AmpParameter rho1m10; - - AmpParameter rho111; - AmpParameter delta_rho133; - AmpParameter rho101; - AmpParameter rho1m11; - - AmpParameter rho102; - AmpParameter rho1m12; - AmpParameter rho001; - - AmpParameter polAngle; - AmpParameter delta_rho111; - bool constraint; - - double polFraction; - //TH1D *polFrac_vs_E; - string frame; - -}; - -#endif diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc index 9a96ae23b..5e60f22a9 100755 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc @@ -24,98 +24,95 @@ polAngle = AmpParameter( args[1] ); polFraction = atof(args[2].c_str()); cout << "Fitting with constant polarization " << polFraction << endl; +// r(t)m,m'_lambda,lambda'_alpha (rt corresponds to rtilde, m corresponds to rho helicity, lambda to Delta helicity, alpha to photon polarization) +r00_33_0 = AmpParameter( args[3] ); -AMO = string (args[3]); -r00_33_0 = AmpParameter( args[4] ); -// r00_11_0 = AmpParameter( args[4] ); +r11_33_0 = AmpParameter( args[4] ); +r11_11_0 = AmpParameter( args[5] ); -r11_33_0 = AmpParameter( args[5] ); -r11_11_0 = AmpParameter( args[6] ); +r1m1_33_0 = AmpParameter( args[6] ); +r1m1_11_0 = AmpParameter( args[7] ); -r1m1_33_0 = AmpParameter( args[7] ); -r1m1_11_0 = AmpParameter( args[8] ); +r10_33_0 = AmpParameter( args[8] ); +r10_11_0 = AmpParameter( args[9] ); -r10_33_0 = AmpParameter( args[9] ); -r10_11_0 = AmpParameter( args[10] ); +r00_31_0 = AmpParameter( args[10] ); +r00_3m1_0 = AmpParameter( args[11] ); -r00_31_0 = AmpParameter( args[11] ); -r00_3m1_0 = AmpParameter( args[12] ); // spin-flip +r11_31_0 = AmpParameter( args[12] ); +r11_3m1_0 = AmpParameter( args[13] ); -r11_31_0 = AmpParameter( args[13] ); // spin-flip -r11_3m1_0 = AmpParameter( args[14] ); // spin-flip +r1m1_31_0 = AmpParameter( args[14] ); +r1m1_3m1_0 = AmpParameter( args[15] ); -r1m1_31_0 = AmpParameter( args[15] ); // spin-flip -r1m1_3m1_0 = AmpParameter( args[16] ); // spin-flip +r10_31_0 = AmpParameter( args[16] ); +r10_3m1_0 = AmpParameter( args[17] ); -r10_31_0 = AmpParameter( args[17] ); // spin-flip -r10_3m1_0 = AmpParameter( args[18] ); // spin-flip +rt1m1_31_0 = AmpParameter( args[18] ); +rt1m1_3m1_0 = AmpParameter( args[19] ); -rt1m1_31_0 = AmpParameter( args[19] ); // sin-flip -rt1m1_3m1_0 = AmpParameter( args[20] ); // sin-flip +rt10_31_0 = AmpParameter( args[20] ); +rt10_3m1_0 = AmpParameter( args[21] ); -rt10_31_0 = AmpParameter( args[21] ); -rt10_3m1_0 = AmpParameter( args[22] ); //alpha = 1 (same structure) -r00_33_1 = AmpParameter( args[23] ); -r00_11_1 = AmpParameter( args[24] ); +r00_33_1 = AmpParameter( args[22] ); +r00_11_1 = AmpParameter( args[23] ); -r11_33_1 = AmpParameter( args[25] ); -r11_11_1 = AmpParameter( args[26] ); +r11_33_1 = AmpParameter( args[24] ); +r11_11_1 = AmpParameter( args[25] ); -r1m1_33_1 = AmpParameter( args[27] ); -r1m1_11_1 = AmpParameter( args[28] ); +r1m1_33_1 = AmpParameter( args[26] ); +r1m1_11_1 = AmpParameter( args[27] ); -r10_33_1 = AmpParameter( args[29] ); -r10_11_1 = AmpParameter( args[30] ); +r10_33_1 = AmpParameter( args[28] ); +r10_11_1 = AmpParameter( args[29] ); -r00_31_1 = AmpParameter( args[31] ); -r00_3m1_1 = AmpParameter( args[32] ); +r00_31_1 = AmpParameter( args[30] ); +r00_3m1_1 = AmpParameter( args[31] ); -r11_31_1 = AmpParameter( args[33] ); -r11_3m1_1 = AmpParameter( args[34] ); +r11_31_1 = AmpParameter( args[32] ); +r11_3m1_1 = AmpParameter( args[33] ); -r1m1_31_1 = AmpParameter( args[35] ); -r1m1_3m1_1 = AmpParameter( args[36] ); +r1m1_31_1 = AmpParameter( args[34] ); +r1m1_3m1_1 = AmpParameter( args[35] ); -r10_31_1 = AmpParameter( args[37] ); -r10_3m1_1 = AmpParameter( args[38] ); +r10_31_1 = AmpParameter( args[36] ); +r10_3m1_1 = AmpParameter( args[37] ); -rt1m1_31_1 = AmpParameter( args[39] ); -rt1m1_3m1_1 = AmpParameter( args[40] ); +rt1m1_31_1 = AmpParameter( args[38] ); +rt1m1_3m1_1 = AmpParameter( args[39] ); -rt10_31_1 = AmpParameter( args[41] ); -rt10_3m1_1 = AmpParameter( args[42] ); +rt10_31_1 = AmpParameter( args[40] ); +rt10_3m1_1 = AmpParameter( args[41] ); //alpha = 2 (different structure) -rt00_31_2 = AmpParameter( args[43] ); -rt00_3m1_2 = AmpParameter( args[44] ); +rt00_31_2 = AmpParameter( args[42] ); +rt00_3m1_2 = AmpParameter( args[43] ); -rt11_31_2 = AmpParameter( args[45] ); -rt11_3m1_2 = AmpParameter( args[46] ); +rt11_31_2 = AmpParameter( args[44] ); +rt11_3m1_2 = AmpParameter( args[45] ); -// 1 <-> -1 -r1m1_33_2 = AmpParameter( args[47] ); -r1m1_11_2 = AmpParameter( args[48] ); +r1m1_33_2 = AmpParameter( args[46] ); +r1m1_11_2 = AmpParameter( args[47] ); -r1m1_31_2 = AmpParameter( args[49] ); -r1m1_3m1_2 = AmpParameter( args[50] ); +r1m1_31_2 = AmpParameter( args[48] ); +r1m1_3m1_2 = AmpParameter( args[49] ); -rt1m1_31_2 = AmpParameter( args[51] ); -rt1m1_3m1_2 = AmpParameter( args[52] ); +rt1m1_31_2 = AmpParameter( args[50] ); +rt1m1_3m1_2 = AmpParameter( args[51] ); -r10_33_2 = AmpParameter( args[53] ); -r10_11_2 = AmpParameter( args[54] ); +r10_33_2 = AmpParameter( args[52] ); +r10_11_2 = AmpParameter( args[53] ); -r10_31_2 = AmpParameter( args[55] ); -r10_3m1_2 = AmpParameter( args[56] ); - -rt10_31_2 = AmpParameter( args[57] ); -rt10_3m1_2 = AmpParameter( args[58] ); +r10_31_2 = AmpParameter( args[54] ); +r10_3m1_2 = AmpParameter( args[55] ); +rt10_31_2 = AmpParameter( args[56] ); +rt10_3m1_2 = AmpParameter( args[57] ); +// Parameter r00_11_0 was eliminated due to normalization constraint, so we don't register it); registerParameter( r00_33_0 ); -// registerParameter( r00_11_0 ); - + registerParameter( r11_33_0 ); registerParameter( r11_11_0 ); @@ -172,6 +169,7 @@ registerParameter( rt1m1_3m1_1 ); registerParameter( rt10_31_1 ); registerParameter( rt10_3m1_1 ); + //alpha = 2 (different structure) registerParameter( rt00_31_2 ); registerParameter( rt00_3m1_2 ); @@ -233,8 +231,6 @@ GDouble sinSqTheta_proton = userVars[kSinSqTheta_proton]; GDouble sin2Theta_proton = userVars[kSin2Theta_proton]; GDouble phi_proton = userVars[kPhi_proton]; - - // vector meson production from K. Schilling et. al. last indize = upper GDouble sinSqTh = sinSqTheta_proton; GDouble sin2Th = sin2Theta_proton; @@ -300,7 +296,7 @@ GDouble Wt1m1_2 = (2.0 / sqrt(3.0)) * (rt1m1_31_2 * sphi * sin2Th + rt1m1_3m1_2 GDouble W10_2 = r10_33_2 * sinSqTh + r10_11_2 * (1.0/3.0 + cosSqTh); GDouble Wb10_2 = (2.0 / sqrt(3.0)) * (r10_31_2 * cphi * sin2Th + r10_3m1_2 * c2phi * sinSqTh); GDouble Wt10_2 = (2.0 / sqrt(3.0)) * (rt10_31_2 * sphi * sin2Th + rt10_3m1_2 * s2phi * sinSqTh); -GDouble W2 = cosSqThPi * Wt00_2+ sinSqThPi * Wt11_2+ sinSqThPi * (s2phiPi * (W1m1_2 - Wb1m1_2) - c2phiPi * Wt1m1_2) + sqrt(2.0) * sin2ThPi * (sphiPi * (W10_2 - Wb10_2) + cphiPi * Wt10_2); // 19.05 change sign of cphiPi * Wt10_2 +GDouble W2 = cosSqThPi * Wt00_2+ sinSqThPi * Wt11_2+ sinSqThPi * (s2phiPi * (W1m1_2 - Wb1m1_2) - c2phiPi * Wt1m1_2) + sqrt(2.0) * sin2ThPi * (sphiPi * (W10_2 - Wb10_2) + cphiPi * Wt10_2); GDouble Wpol = W0 - Pgamma * cos(2.0 * bigPhi) * W1 - Pgamma * sin(2.0 * bigPhi) * W2; return complex< GDouble > ( sqrt(fabs(Wpol)) ); @@ -316,30 +312,21 @@ TwoPiAngles_Delta_DoubleSDMEs::calcUserVars( GDouble** pKin, GDouble* userVars ) TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); // pi0 TLorentzVector target ( 0, 0, 0, 0.9382720813); // determine boost vectors - TLorentzVector resonance = p2 + p3; - TLorentzVector recoil = proton + p1; TLorentzVector rho = p2 + p3; TLorentzVector Delta = proton + p1; TLorentzVector CM_motion_lab = beam + target; TLorentzVector piminus = p2; - TLorentzRotation resonanceBoost( -resonance.BoostVector() ); - TLorentzRotation rhoBoost( -rho.BoostVector() ); TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); TLorentzRotation DeltaBoost( -Delta.BoostVector() ); - - - //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); - //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose helicity frame: z-axis opposite recoil Delta in rho rest frame //bost in rho restframe TLorentzVector beam_resrho = rhoBoost * beam; TLorentzVector Delta_resrho = rhoBoost * Delta; TLorentzVector piminus_resrho = rhoBoost * piminus; TLorentzVector proton_resrho = rhoBoost * proton; + //boost in CM frame TLorentzVector beam_cm = CMBoost * beam; TLorentzVector Delta_cm = CMBoost * Delta; @@ -351,23 +338,21 @@ TwoPiAngles_Delta_DoubleSDMEs::calcUserVars( GDouble** pKin, GDouble* userVars ) TLorentzVector proton_resDelta = DeltaBoost * proton; TLorentzVector rho_resDelta = DeltaBoost * rho; - // Define coordinate systems: - // y equal in all frames +// Define coordinate systems: +// y equal in all frames TVector3 y = (beam.Vect().Unit().Cross(-Delta.Vect().Unit())).Unit(); - //rho system - + //rho restframe + //Helicity frame TVector3 z_hel_rho = -1. * Delta_resrho.Vect().Unit(); TVector3 x_hel_rho = y.Cross(z_hel_rho).Unit(); // GJ frame - TVector3 z_GJ_rho = beam_resrho.Vect().Unit(); TVector3 x_GJ_rho = y.Cross(z_GJ_rho).Unit(); //Delta system - // Helicity frame TVector3 z_hel_Delta = -rho_resDelta.Vect().Unit(); TVector3 x_hel_Delta = (y.Cross(z_hel_Delta)).Unit(); @@ -376,15 +361,6 @@ TwoPiAngles_Delta_DoubleSDMEs::calcUserVars( GDouble** pKin, GDouble* userVars ) TVector3 z_GJ_Delta = target_resDelta.Vect().Unit(); TVector3 x_GJ_Delta = y.Cross(z_GJ_Delta).Unit(); - // normal to the production plane - - //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); - //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - //rho rest frame - // choose helicity frame: z-axis opposite recoil Delta in rho rest frame - //helicity frame - - //Angle calculation TVector3 angles_piminus_hel_rho( (piminus_resrho.Vect()).Dot(x_hel_rho), @@ -402,21 +378,6 @@ TwoPiAngles_Delta_DoubleSDMEs::calcUserVars( GDouble** pKin, GDouble* userVars ) TVector3 angles_proton_GJ_Delta( (proton_resDelta.Vect()).Dot(x_GJ_Delta), (proton_resDelta.Vect()).Dot(y), (proton_resDelta.Vect()).Dot(z_GJ_Delta) ); - - - - - - - - - - - // // normal to the production plane - // TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame - if(frame=="Hel"){ @@ -466,7 +427,7 @@ void TwoPiAngles_Delta_DoubleSDMEs::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { GPUTwoPiAngles_Delta_DoubleSDMEs_exec( dimGrid, dimBlock, GPU_AMP_ARGS, - r00_33_0, //r00_11_0, + r00_33_0, r11_33_0, r11_11_0, r1m1_33_0, r1m1_11_0, r10_33_0, r10_11_0, diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.cc deleted file mode 100755 index 85ffa4b2f..000000000 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.cc +++ /dev/null @@ -1,343 +0,0 @@ - -#include -#include -#include -#include -#include - -#include "TLorentzVector.h" -#include "TLorentzRotation.h" -#include "TFile.h" - -#include "IUAmpTools/Kinematics.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h" -#include "AMPTOOLS_AMPS/clebschGordan.h" -#include "AMPTOOLS_AMPS/wignerD.h" - -TwoPiAngles_Delta_DoubleSDMEs_unpol::TwoPiAngles_Delta_DoubleSDMEs_unpol( const vector< string >& args ) : - UserAmplitude< TwoPiAngles_Delta_DoubleSDMEs_unpol >( args ) -{ - -// assert(args.size() == 22 || args.size() == 23 || args.size() == 24 ); -frame = string( args[0] ); -polAngle = AmpParameter( args[1] ); - -polFraction = atof(args[2].c_str()); -cout << "Fitting with constant polarization " << polFraction << endl; - -AMO = string (args[3]); -r00_33_0 = AmpParameter( args[4] ); -// r00_11_0 = AmpParameter( args[4] ); - -r11_33_0 = AmpParameter( args[5] ); -r11_11_0 = AmpParameter( args[6] ); - -r1m1_33_0 = AmpParameter( args[7] ); -r1m1_11_0 = AmpParameter( args[8] ); - -r10_33_0 = AmpParameter( args[9] ); -r10_11_0 = AmpParameter( args[10] ); - -r00_31_0 = AmpParameter( args[11] ); -r00_3m1_0 = AmpParameter( args[12] ); // spin-flip - -r11_31_0 = AmpParameter( args[13] ); // spin-flip -r11_3m1_0 = AmpParameter( args[14] ); // spin-flip - -r1m1_31_0 = AmpParameter( args[15] ); // spin-flip -r1m1_3m1_0 = AmpParameter( args[16] ); // spin-flip - -r10_31_0 = AmpParameter( args[17] ); // spin-flip -r10_3m1_0 = AmpParameter( args[18] ); // spin-flip - -rt1m1_31_0 = AmpParameter( args[19] ); // sin-flip -rt1m1_3m1_0 = AmpParameter( args[20] ); // sin-flip - -rt10_31_0 = AmpParameter( args[21] ); -rt10_3m1_0 = AmpParameter( args[22] ); - - - -registerParameter( r00_33_0 ); -// registerParameter( r00_11_0 ); - -registerParameter( r11_33_0 ); -registerParameter( r11_11_0 ); - -registerParameter( r1m1_33_0 ); -registerParameter( r1m1_11_0 ); - -registerParameter( r10_33_0 ); -registerParameter( r10_11_0 ); - -registerParameter( r00_31_0 ); -registerParameter( r00_3m1_0 ); - -registerParameter( r11_31_0 ); -registerParameter( r11_3m1_0 ); - -registerParameter( r1m1_31_0 ); -registerParameter( r1m1_3m1_0 ); - -registerParameter( r10_31_0 ); -registerParameter( r10_3m1_0 ); - -registerParameter( rt1m1_31_0 ); -registerParameter( rt1m1_3m1_0 ); - -registerParameter( rt10_31_0 ); -registerParameter( rt10_3m1_0 ); - - -registerParameter( polAngle ); - - // } - // Two possibilities to initialize this amplitude: - // 1: 11 arguments, fixed polarization - // Usage: amplitude :::: TwoPiAngles ... - - // 2: 12 arguments, read polarization from histogram in file - // Usage: amplitude :::: TwoPiAngles ... -// else if(args.size() == 13) { -// polFraction = 0.; -// TFile* f = new TFile( args[11].c_str() ); -// polFrac_vs_E = (TH1D*)f->Get( args[12].c_str() ); -// assert( polFrac_vs_E != NULL ); -// cout << "Fitting with polarization from " << polFrac_vs_E->GetName() << endl; -// } -// -} - - -complex< GDouble > -TwoPiAngles_Delta_DoubleSDMEs_unpol::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { - - -//GDouble bigPhi = polAngle*0.017453293 + userVars[kBigPhi]; // rotate Phi (in rad) -GDouble bigPhi = userVars[kBigPhi]; -GDouble Pgamma = userVars[kPgamma]; -GDouble cosTheta_pim = userVars[kCosTheta_pim]; -GDouble sinSqTheta_pim = userVars[kSinSqTheta_pim]; -GDouble sin2Theta_pim = userVars[kSin2Theta_pim]; -GDouble phi_pim = userVars[kPhi_pim]; -GDouble cosTheta_proton = userVars[kCosTheta_proton]; -GDouble sinSqTheta_proton = userVars[kSinSqTheta_proton]; -GDouble sin2Theta_proton = userVars[kSin2Theta_proton]; -GDouble phi_proton = userVars[kPhi_proton]; - - - // vector meson production from K. Schilling et. al. last indize = upper - -GDouble sinSqTh = sinSqTheta_proton; -GDouble sin2Th = sin2Theta_proton; -GDouble cosSqTh = 1.0 - sinSqTh; - -GDouble cphi = cos(phi_proton); -GDouble sphi = sin(phi_proton); -GDouble c2phi = cos(2.0 * phi_proton); -GDouble s2phi = sin(2.0 * phi_proton); - -GDouble sinSqThPi = sinSqTheta_pim; -GDouble sin2ThPi = sin2Theta_pim; -GDouble cosSqThPi = 1.0 - sinSqThPi; - -GDouble cphiPi = cos(phi_pim); -GDouble sphiPi = sin(phi_pim); -GDouble c2phiPi = cos(2.0 * phi_pim); -GDouble s2phiPi = sin(2.0 * phi_pim); - -GDouble r00_11_0 = 0.5 - r00_33_0 - 2.0 * r11_11_0 - 2.0 * r11_33_0; - - -GDouble W00_0 = r00_33_0 * sinSqTh + r00_11_0 * (1.0/3.0 + cosSqTh); -GDouble Wb00_0 = (2.0 / sqrt(3.0)) * (r00_31_0 * cphi * sin2Th + r00_3m1_0 * c2phi * sinSqTh); - -GDouble W11_0 = r11_33_0 * sinSqTh + r11_11_0 * (1.0/3.0 + cosSqTh); -GDouble Wb11_0 = (2.0 / sqrt(3.0)) * (r11_31_0 * cphi * sin2Th + r11_3m1_0 * c2phi * sinSqTh); - -GDouble W1m1_0 = r1m1_33_0 * sinSqTh + r1m1_11_0 * (1.0/3.0 + cosSqTh); -GDouble Wb1m1_0 = (2.0 / sqrt(3.0)) * (r1m1_31_0 * cphi * sin2Th + r1m1_3m1_0 * c2phi * sinSqTh); -GDouble Wt1m1_0 = (2.0 / sqrt(3.0)) * (rt1m1_31_0 * sphi * sin2Th + rt1m1_3m1_0 * s2phi * sinSqTh); - -GDouble W10_0 = r10_33_0 * sinSqTh + r10_11_0 * (1.0/3.0 + cosSqTh); -GDouble Wb10_0 = (2.0 / sqrt(3.0)) * (r10_31_0 * cphi * sin2Th + r10_3m1_0 * c2phi * sinSqTh); -GDouble Wt10_0 = (2.0 / sqrt(3.0)) * (rt10_31_0 * sphi * sin2Th + rt10_3m1_0 * s2phi * sinSqTh); - -GDouble W0 = cosSqThPi * (W00_0 - Wb00_0) + sinSqThPi * (W11_0 - Wb11_0) - sinSqThPi * (c2phiPi * (W1m1_0 - Wb1m1_0) + s2phiPi * Wt1m1_0) - sqrt(2.0) * sin2ThPi * (cphiPi * (W10_0 - Wb10_0) + sphiPi * Wt10_0); -//alpha = 1 (same structure) -return complex< GDouble > ( sqrt(fabs(W0)) ); -} - -void -TwoPiAngles_Delta_DoubleSDMEs_unpol::calcUserVars( GDouble** pKin, GDouble* userVars ) const { - - TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); - TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); - TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); // pip - TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); // pim - TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); // pi0 - TLorentzVector target ( 0, 0, 0, 0.9382720813); - // determine boost vectors - TLorentzVector resonance = p2 + p3; - TLorentzVector recoil = proton + p1; - TLorentzVector rho = p2 + p3; - TLorentzVector Delta = proton + p1; - TLorentzVector CM_motion_lab = beam + target; - TLorentzVector piminus = p2; - - TLorentzRotation resonanceBoost( -resonance.BoostVector() ); - - TLorentzRotation rhoBoost( -rho.BoostVector() ); - TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); - TLorentzRotation DeltaBoost( -Delta.BoostVector() ); - - - - //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); - //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose helicity frame: z-axis opposite recoil Delta in rho rest frame -//bost in rho restframe - TLorentzVector beam_resrho = rhoBoost * beam; - TLorentzVector Delta_resrho = rhoBoost * Delta; - TLorentzVector piminus_resrho = rhoBoost * piminus; - TLorentzVector proton_resrho = rhoBoost * proton; -//boost in CM frame - TLorentzVector beam_cm = CMBoost * beam; - TLorentzVector Delta_cm = CMBoost * Delta; - TLorentzVector piminus_cm = CMBoost * piminus; - TLorentzVector rho_cm = CMBoost * rho; - -//boost in recoil frame - TLorentzVector target_resDelta = DeltaBoost * target; - TLorentzVector proton_resDelta = DeltaBoost * proton; - TLorentzVector rho_resDelta = DeltaBoost * rho; - - // Define coordinate systems: - // y equal in all frames - TVector3 y = (beam.Vect().Unit().Cross(-Delta.Vect().Unit())).Unit(); - - //rho system - - //Helicity frame - TVector3 z_hel_rho = -1. * Delta_resrho.Vect().Unit(); - TVector3 x_hel_rho = y.Cross(z_hel_rho).Unit(); - - // GJ frame - - TVector3 z_GJ_rho = beam_resrho.Vect().Unit(); - TVector3 x_GJ_rho = y.Cross(z_GJ_rho).Unit(); - - //Delta system - - // Helicity frame - TVector3 z_hel_Delta = -rho_resDelta.Vect().Unit(); - TVector3 x_hel_Delta = (y.Cross(z_hel_Delta)).Unit(); - - // GJ frame - TVector3 z_GJ_Delta = target_resDelta.Vect().Unit(); - TVector3 x_GJ_Delta = y.Cross(z_GJ_Delta).Unit(); - - // normal to the production plane - - //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); - //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - //rho rest frame - // choose helicity frame: z-axis opposite recoil Delta in rho rest frame - //helicity frame - - - - //Angle calculation - TVector3 angles_piminus_hel_rho( (piminus_resrho.Vect()).Dot(x_hel_rho), - (piminus_resrho.Vect()).Dot(y), - (piminus_resrho.Vect()).Dot(z_hel_rho) ); - - TVector3 angles_piminus_GJ_rho( (piminus_resrho.Vect()).Dot(x_GJ_rho), - (piminus_resrho.Vect()).Dot(y), - (piminus_resrho.Vect()).Dot(z_GJ_rho) ); - - TVector3 angles_proton_hel_Delta( (proton_resDelta.Vect()).Dot(x_hel_Delta), - (proton_resDelta.Vect()).Dot(y), - (proton_resDelta.Vect()).Dot(z_hel_Delta) ); - - TVector3 angles_proton_GJ_Delta( (proton_resDelta.Vect()).Dot(x_GJ_Delta), - (proton_resDelta.Vect()).Dot(y), - (proton_resDelta.Vect()).Dot(z_GJ_Delta) ); - - - - - - - - - - - // // normal to the production plane - // TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame - - - - if(frame=="Hel"){ - - userVars[kCosTheta_pim] = angles_piminus_hel_rho.CosTheta(); - userVars[kSinSqTheta_pim] = sin(angles_piminus_hel_rho.Theta())*sin(angles_piminus_hel_rho.Theta()); - userVars[kSin2Theta_pim] = sin(2.*angles_piminus_hel_rho.Theta()); - userVars[kPhi_pim] = angles_piminus_hel_rho.Phi(); - - userVars[kCosTheta_proton] = angles_proton_hel_Delta.CosTheta(); - userVars[kSinSqTheta_proton] = sin(angles_proton_hel_Delta.Theta())*sin(angles_proton_hel_Delta.Theta()); - userVars[kSin2Theta_proton] = sin(2.*angles_proton_hel_Delta.Theta()); - userVars[kPhi_proton] = angles_proton_hel_Delta.Phi(); - } - else{ - userVars[kCosTheta_pim] = angles_piminus_GJ_rho.CosTheta(); - userVars[kSinSqTheta_pim] = sin(angles_piminus_GJ_rho.Theta())*sin(angles_piminus_GJ_rho.Theta()); - userVars[kSin2Theta_pim] = sin(2.*angles_piminus_GJ_rho.Theta()); - userVars[kPhi_pim] = angles_piminus_GJ_rho.Phi(); - - userVars[kCosTheta_proton] = angles_proton_GJ_Delta.CosTheta(); - userVars[kSinSqTheta_proton] = sin(angles_proton_GJ_Delta.Theta())*sin(angles_proton_GJ_Delta.Theta()); - userVars[kSin2Theta_proton] = sin(2.*angles_proton_GJ_Delta.Theta()); - userVars[kPhi_proton] = angles_proton_GJ_Delta.Phi(); - } - TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); - userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); - - // vector meson production from K. Schilling et. al. - GDouble Pgamma; - if(polFraction > 0.) { // for fitting with constant polarization - Pgamma = polFraction; - } - // else{ - // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); - // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ - // Pgamma = 0.; - // } - // else Pgamma = polFrac_vs_E->GetBinContent(bin); - // } - userVars[kPgamma] = Pgamma; - -} - -#ifdef GPU_ACCELERATION -void -TwoPiAngles_Delta_DoubleSDMEs_unpol::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { - - GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_exec( dimGrid, dimBlock, GPU_AMP_ARGS, - r00_33_0, //r00_11_0, - r11_33_0, r11_11_0, - r1m1_33_0, r1m1_11_0, - r10_33_0, r10_11_0, - r00_31_0, r00_3m1_0, - r11_31_0, r11_3m1_0, - r1m1_31_0, r1m1_3m1_0, - r10_31_0, r10_3m1_0, - rt1m1_31_0, rt1m1_3m1_0, - rt10_31_0, rt10_3m1_0 -); -} -#endif //GPU_ACCELERATION \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h deleted file mode 100755 index d8697cdf9..000000000 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h +++ /dev/null @@ -1,109 +0,0 @@ -#if !defined(TWOPIANGLES_DELTA_DOUBLESDMES_UNPOL) -#define TWOPIANGLES_DELTA_DOUBLESDMES_UNPOL - -#include "IUAmpTools/Amplitude.h" -#include "IUAmpTools/UserAmplitude.h" -#include "IUAmpTools/AmpParameter.h" -#include "GPUManager/GPUCustomTypes.h" - -#include "TH1D.h" -#include -#include -#include - -#ifdef GPU_ACCELERATION -void -GPUTwoPiAngles_Delta_DoubleSDMEs_unpol_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, -GDouble r00_33_0, //GDouble r00_11_0 -GDouble r11_33_0, GDouble r11_11_0, -GDouble r1m1_33_0, GDouble r1m1_11_0, -GDouble r10_33_0, GDouble r10_11_0, -GDouble r00_31_0, GDouble r00_3m1_0, -GDouble r11_31_0, GDouble r11_3m1_0, -GDouble r1m1_31_0, GDouble r1m1_3m1_0, -GDouble r10_31_0, GDouble r10_3m1_0, -GDouble rt1m1_31_0, GDouble rt1m1_3m1_0, -GDouble rt10_31_0, GDouble rt10_3m1_0 - -); - -#endif // GPU_ACCELERATION - -using std::complex; -using namespace std; - -class Kinematics; - -class TwoPiAngles_Delta_DoubleSDMEs_unpol : public UserAmplitude< TwoPiAngles_Delta_DoubleSDMEs_unpol > -{ - -public: - - TwoPiAngles_Delta_DoubleSDMEs_unpol() : UserAmplitude< TwoPiAngles_Delta_DoubleSDMEs_unpol >() { }; - TwoPiAngles_Delta_DoubleSDMEs_unpol( const vector< string >& args ); - - enum UserVars { kPgamma = 0, kCosTheta_pim, kSinSqTheta_pim, kSin2Theta_pim, kPhi_pim, kCosTheta_proton, kSinSqTheta_proton, kSin2Theta_proton, kPhi_proton, - kBigPhi, kNumUserVars }; - unsigned int numUserVars() const { return kNumUserVars; } - - string name() const { return "TwoPiAngles_Delta_DoubleSDMEs_unpol"; } - - complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; - void calcUserVars( GDouble** pKin, GDouble* userVars ) const; - - // we can calcualte everythign we need from userVars block so allow - // the framework to purge the four-vectors - bool needsUserVarsOnly() const { return true; } - -#ifdef GPU_ACCELERATION - - void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; - bool isGPUEnabled() const { return true; } - -#endif // GPU_ACCELERATION - -private: - - AmpParameter r00_33_0; - // AmpParameter r00_11_0; - - AmpParameter r11_33_0; - AmpParameter r11_11_0; - - AmpParameter r1m1_33_0; - AmpParameter r1m1_11_0; - - AmpParameter r10_33_0; - AmpParameter r10_11_0; - - // \bar W^0 (31 / 3-1) - - AmpParameter r00_31_0; - AmpParameter r00_3m1_0; - - AmpParameter r11_31_0; - AmpParameter r11_3m1_0; - - AmpParameter r1m1_31_0; - AmpParameter r1m1_3m1_0; - - AmpParameter r10_31_0; - AmpParameter r10_3m1_0; - - // \tilde W^0 - - AmpParameter rt1m1_31_0; - AmpParameter rt1m1_3m1_0; - - AmpParameter rt10_31_0; - AmpParameter rt10_3m1_0; - - AmpParameter polAngle; - - double polFraction; - //TH1D *polFrac_vs_E; - string frame; - string AMO; -}; - -#endif diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc index eb404a7a1..8ee350cd5 100755 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc @@ -27,29 +27,21 @@ cout << "Fitting with constant polarization " << polFraction << endl; rho000 = AmpParameter( args[3] ); rho100 = AmpParameter( args[4] ); rho1m10 = AmpParameter( args[5] ); -rho111 = AmpParameter( args[6] ); +rho001 = AmpParameter( args[6] ); +rho111 = AmpParameter( args[7] ); +rho101 = AmpParameter( args[8] ); +rho1m11 = AmpParameter( args[9] ); +rho102 = AmpParameter( args[10] ); +rho1m12 = AmpParameter( args[11] ); -rho101 = AmpParameter( args[7] ); -rho1m11 = AmpParameter( args[8] ); -rho102 = AmpParameter( args[9] ); -rho1m12 = AmpParameter( args[10] ); - -delta_rho011 = AmpParameter( args[11] ); -delta_rho031 = AmpParameter( args[12] ); -delta_rho03m1 = AmpParameter( args[13] ); -rho001 = AmpParameter( args[14] ); -// delta_rho111 = AmpParameter( args[14] ); -// delta_rho133 = AmpParameter( args[15] ); -// delta_rho131 = AmpParameter( args[16] ); -// delta_rho13m1 = AmpParameter( args[17] ); - -// delta_rho231 = AmpParameter( args[18] ); -// delta_rho23m1 = AmpParameter( args[19] ); +delta_rho011 = AmpParameter( args[12] ); +delta_rho031 = AmpParameter( args[13] ); +delta_rho03m1 = AmpParameter( args[14] ); registerParameter( rho000 ); registerParameter( rho100 ); registerParameter( rho1m10 ); - +registerParameter( rho001 ); registerParameter( rho111 ); registerParameter( rho101 ); registerParameter( rho1m11 ); @@ -59,16 +51,6 @@ registerParameter( rho1m12 ); registerParameter( delta_rho011 ); registerParameter( delta_rho031 ); registerParameter( delta_rho03m1 ); -registerParameter( rho001 ); -// registerParameter( delta_rho111 ); -// registerParameter( delta_rho133 ); -// registerParameter( delta_rho131 ); -// registerParameter( delta_rho13m1 ); - -// registerParameter( delta_rho231 ); -// registerParameter( delta_rho23m1 ); - -//new parameter try registerParameter( polAngle ); @@ -101,10 +83,10 @@ GDouble cosTheta_pim = userVars[kCosTheta_pim]; GDouble sinSqTheta_pim = userVars[kSinSqTheta_pim]; GDouble sin2Theta_pim = userVars[kSin2Theta_pim]; GDouble phi_pim = userVars[kPhi_pim]; -GDouble cosTheta_piplus = userVars[kCosTheta_piplus]; -GDouble sinSqTheta_piplus = userVars[kSinSqTheta_piplus]; -GDouble sin2Theta_piplus = userVars[kSin2Theta_piplus]; -GDouble phi_piplus = userVars[kPhi_piplus]; +GDouble cosTheta_proton = userVars[kCosTheta_proton]; +GDouble sinSqTheta_proton = userVars[kSinSqTheta_proton]; +GDouble sin2Theta_proton = userVars[kSin2Theta_proton]; +GDouble phi_proton = userVars[kPhi_proton]; // vector meson production from K. Schilling et. al. last indize = upper @@ -119,20 +101,9 @@ GDouble W0_meson = 3.*(0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta_pim*cos GDouble W1_meson= 3.*(rho111*sinSqTheta_pim + rho001*cosTheta_pim*cosTheta_pim - sqrt(2.)*rho101*sin2Theta_pim*cos(phi_pim) - rho1m11*sinSqTheta_pim*cos(2.*phi_pim)); GDouble W2_meson = 3. * (sqrt(2.)*rho102*sin2Theta_pim*sin(phi_pim) + rho1m12*sinSqTheta_pim*sin(2.*phi_pim)); -GDouble W0_baryon = 3.*(0.5 - delta_rho011)*sinSqTheta_piplus + delta_rho011*(1.+3.*cosTheta_piplus*cosTheta_piplus) - 2.*TMath::Sqrt(3.)*delta_rho031*cos(phi_piplus)*sin2Theta_piplus - 2.*TMath::Sqrt(3.)*delta_rho03m1*cos(2.*phi_piplus)*sinSqTheta_piplus; -// GDouble W1_baryon = (3.*delta_rho133*sinSqTheta_piplus + delta_rho111*(1.+3.*cosTheta_piplus*cosTheta_piplus) - 2.*TMath::Sqrt(3.)*delta_rho131*cos(phi_piplus)*sin2Theta_piplus - 2.*TMath::Sqrt(3.)*delta_rho13m1*cos(2.*phi_piplus)*sinSqTheta_piplus); -// GDouble W2_baryon = (2.*TMath::Sqrt(3.)*delta_rho231*sin(phi_piplus)*sin2Theta_piplus + 2.*TMath::Sqrt(3.)*delta_rho23m1*sin(2.*phi_piplus)*sinSqTheta_piplus); - -// GDouble Wpol = W0_meson*W0_baryon - Pgamma * cos(2.0 * bigPhi) * W1_meson * W1_baryon - Pgamma * sin(2.0 * bigPhi) * W2_meson * W2_baryon; - -// GDouble Wpol = W0_meson*W0_baryon -( Pgamma * cos(2.0 * bigPhi) * W1_meson + Pgamma * sin(2.0 * bigPhi) * W2_meson) * (W1_baryon + W2_baryon); -// //Just another tests!!!!!! +GDouble W0_baryon = 3.*(0.5 - delta_rho011)*sinSqTheta_proton + delta_rho011*(1.+3.*cosTheta_proton*cosTheta_proton) - 2.*TMath::Sqrt(3.)*delta_rho031*cos(phi_proton)*sin2Theta_proton - 2.*TMath::Sqrt(3.)*delta_rho03m1*cos(2.*phi_proton)*sinSqTheta_proton; -// GDouble Wpol = W0_meson*W0_baryon -( Pgamma * cos(2.0 * bigPhi) * W1_meson + Pgamma * sin(2.0 * bigPhi) * W2_meson) * (W1_baryon + W2_baryon); - -// //Just another test GDouble Wpol = W0_meson*W0_baryon - Pgamma * cos(2.0 * bigPhi) *( W1_meson*W0_baryon) - Pgamma * sin(2.0 * bigPhi) *( W2_meson*W0_baryon); -// GDouble Wpol = (W0_meson - Pgamma * cos(2.0 * bigPhi) * W1_meson - Pgamma * sin(2.0 * bigPhi) * W2_meson )*(W0_baryon - Pgamma * cos(2.0 * bigPhi) * W1_baryon - Pgamma * sin(2.0 * bigPhi) * W2_baryon); Wpol *= 1/(4.*PI); @@ -150,25 +121,16 @@ TwoPiAngles_Delta_factorized::calcUserVars( GDouble** pKin, GDouble* userVars ) TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); // pi0 TLorentzVector target ( 0, 0, 0, 0.9382720813); // determine boost vectors - TLorentzVector resonance = p2 + p3; TLorentzVector recoil = proton + p1; TLorentzVector rho = p2 + p3; TLorentzVector Delta = proton + p1; TLorentzVector CM_motion_lab = beam + target; TLorentzVector piminus = p2; - TLorentzRotation resonanceBoost( -resonance.BoostVector() ); - TLorentzRotation rhoBoost( -rho.BoostVector() ); TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); TLorentzRotation DeltaBoost( -Delta.BoostVector() ); - - - - //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); - //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose helicity frame: z-axis opposite recoil Delta in rho rest frame + //bost in rho restframe TLorentzVector beam_resrho = rhoBoost * beam; TLorentzVector Delta_resrho = rhoBoost * Delta; @@ -197,7 +159,6 @@ TwoPiAngles_Delta_factorized::calcUserVars( GDouble** pKin, GDouble* userVars ) TVector3 x_hel_rho = y.Cross(z_hel_rho).Unit(); // GJ frame - TVector3 z_GJ_rho = beam_resrho.Vect().Unit(); TVector3 x_GJ_rho = y.Cross(z_GJ_rho).Unit(); @@ -211,16 +172,6 @@ TwoPiAngles_Delta_factorized::calcUserVars( GDouble** pKin, GDouble* userVars ) TVector3 z_GJ_Delta = target_resDelta.Vect().Unit(); TVector3 x_GJ_Delta = y.Cross(z_GJ_Delta).Unit(); - // normal to the production plane - - //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); - //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - //rho rest frame - // choose helicity frame: z-axis opposite recoil Delta in rho rest frame - //helicity frame - - - //Angle calculation TVector3 angles_piminus_hel_rho( (piminus_resrho.Vect()).Dot(x_hel_rho), (piminus_resrho.Vect()).Dot(y), @@ -239,31 +190,13 @@ TwoPiAngles_Delta_factorized::calcUserVars( GDouble** pKin, GDouble* userVars ) (piplus_resDelta.Vect()).Dot(y), (piplus_resDelta.Vect()).Dot(z_hel_Delta) ); - TVector3 angles_proton_GJ_Delta( (piplus_resDelta.Vect()).Dot(x_GJ_Delta), + TVector3 angles_proton_GJ_Delta( (proton_resDelta.Vect()).Dot(x_GJ_Delta), (proton_resDelta.Vect()).Dot(y), (proton_resDelta.Vect()).Dot(z_GJ_Delta) ); TVector3 angles_piplus_GJ_Delta( (piplus_resDelta.Vect()).Dot(x_GJ_Delta), (piplus_resDelta.Vect()).Dot(y), (piplus_resDelta.Vect()).Dot(z_GJ_Delta) ); - - - - - - - - - - - - - // // normal to the production plane - // TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame - - if(frame=="Hel"){ @@ -272,25 +205,21 @@ TwoPiAngles_Delta_factorized::calcUserVars( GDouble** pKin, GDouble* userVars ) userVars[kSin2Theta_pim] = sin(2.*angles_piminus_hel_rho.Theta()); userVars[kPhi_pim] = angles_piminus_hel_rho.Phi(); - userVars[kCosTheta_piplus] = angles_proton_hel_Delta.CosTheta(); - userVars[kSinSqTheta_piplus] = sin(angles_proton_hel_Delta.Theta())*sin(angles_proton_hel_Delta.Theta()); - userVars[kSin2Theta_piplus] = sin(2.*angles_proton_hel_Delta.Theta()); - userVars[kPhi_piplus] = angles_proton_hel_Delta.Phi(); + userVars[kCosTheta_proton] = angles_proton_hel_Delta.CosTheta(); + userVars[kSinSqTheta_proton] = sin(angles_proton_hel_Delta.Theta())*sin(angles_proton_hel_Delta.Theta()); + userVars[kSin2Theta_proton] = sin(2.*angles_proton_hel_Delta.Theta()); + userVars[kPhi_proton] = angles_proton_hel_Delta.Phi(); } else{ userVars[kCosTheta_pim] = angles_piminus_GJ_rho.CosTheta(); userVars[kSinSqTheta_pim] = sin(angles_piminus_GJ_rho.Theta())*sin(angles_piminus_GJ_rho.Theta()); userVars[kSin2Theta_pim] = sin(2.*angles_piminus_GJ_rho.Theta()); userVars[kPhi_pim] = angles_piminus_GJ_rho.Phi(); - userVars[kCosTheta_piplus] = angles_piplus_GJ_Delta.CosTheta(); - userVars[kSinSqTheta_piplus] = sin(angles_piplus_GJ_Delta.Theta())*sin(angles_piplus_GJ_Delta.Theta()); - userVars[kSin2Theta_piplus] = sin(2.*angles_piplus_GJ_Delta.Theta()); - userVars[kPhi_piplus] = angles_piplus_GJ_Delta.Phi(); - - // userVars[kCosTheta_proton] = angles_proton_GJ_Delta.CosTheta(); - // userVars[kSinSqTheta_proton] = sin(angles_proton_GJ_Delta.Theta())*sin(angles_proton_GJ_Delta.Theta()); - // userVars[kSin2Theta_proton] = sin(2.*angles_proton_GJ_Delta.Theta()); - // userVars[kPhi_proton] = angles_proton_GJ_Delta.Phi(); + + userVars[kCosTheta_proton] = angles_proton_GJ_Delta.CosTheta(); + userVars[kSinSqTheta_proton] = sin(angles_proton_GJ_Delta.Theta())*sin(angles_proton_GJ_Delta.Theta()); + userVars[kSin2Theta_proton] = sin(2.*angles_proton_GJ_Delta.Theta()); + userVars[kPhi_proton] = angles_proton_GJ_Delta.Phi(); } TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); @@ -319,6 +248,7 @@ TwoPiAngles_Delta_factorized::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_ rho000, rho100, rho1m10, + rho001, rho111, rho101, rho1m11, @@ -326,8 +256,7 @@ TwoPiAngles_Delta_factorized::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_ rho1m12, delta_rho011, delta_rho031, - delta_rho03m1, - rho001 + delta_rho03m1 ); } #endif //GPU_ACCELERATION \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h index 1f0c4e2a5..3663e48b7 100755 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h @@ -17,6 +17,7 @@ GPUTwoPiAngles_Delta_factorized_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO GDouble rho000, GDouble rho100, GDouble rho1m10, + GDouble rho001, GDouble rho111, GDouble rho101, GDouble rho1m11, @@ -24,8 +25,7 @@ GPUTwoPiAngles_Delta_factorized_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO GDouble rho1m12, GDouble delta_rho011, GDouble delta_rho031, - GDouble delta_rho03m1, - GDouble rho001 + GDouble delta_rho03m1 ); #endif // GPU_ACCELERATION @@ -43,7 +43,7 @@ class TwoPiAngles_Delta_factorized : public UserAmplitude< TwoPiAngles_Delta_fac TwoPiAngles_Delta_factorized() : UserAmplitude< TwoPiAngles_Delta_factorized >() { }; TwoPiAngles_Delta_factorized( const vector< string >& args ); - enum UserVars { kPgamma = 0, kCosTheta_pim, kSinSqTheta_pim, kSin2Theta_pim, kPhi_pim, kCosTheta_piplus, kSinSqTheta_piplus, kSin2Theta_piplus, kPhi_piplus, + enum UserVars { kPgamma = 0, kCosTheta_pim, kSinSqTheta_pim, kSin2Theta_pim, kPhi_pim, kCosTheta_proton, kSinSqTheta_proton, kSin2Theta_proton, kPhi_proton, kBigPhi, kNumUserVars }; unsigned int numUserVars() const { return kNumUserVars; } @@ -69,6 +69,7 @@ AmpParameter rho000; AmpParameter rho100; AmpParameter rho1m10; +AmpParameter rho001; AmpParameter rho111; AmpParameter rho101; AmpParameter rho1m11; @@ -79,14 +80,6 @@ AmpParameter delta_rho011; AmpParameter delta_rho031; AmpParameter delta_rho03m1; -// AmpParameter delta_rho111; -// AmpParameter delta_rho133; -// AmpParameter delta_rho131; -// AmpParameter delta_rho13m1; - -// AmpParameter delta_rho231; -// AmpParameter delta_rho23m1; -AmpParameter rho001; AmpParameter polAngle; double polFraction; diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.cc deleted file mode 100755 index 19cfc6e6c..000000000 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.cc +++ /dev/null @@ -1,198 +0,0 @@ - -#include -#include -#include -#include -#include - -#include "TLorentzVector.h" -#include "TLorentzRotation.h" -#include "TFile.h" - -#include "IUAmpTools/Kinematics.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h" -#include "AMPTOOLS_AMPS/clebschGordan.h" -#include "AMPTOOLS_AMPS/wignerD.h" - -TwoPiAngles_Delta_only_upperv::TwoPiAngles_Delta_only_upperv( const vector< string >& args ) : - UserAmplitude< TwoPiAngles_Delta_only_upperv >( args ) -{ - assert(args.size() == 12 || args.size() == 13 || args.size() == 14 ); - - rho000 = AmpParameter( args[0] ); - rho100 = AmpParameter( args[1] ); - rho1m10 = AmpParameter( args[2] ); - rho111 = AmpParameter( args[3] ); - rho001 = AmpParameter( args[4] ); - rho101 = AmpParameter( args[5] ); - rho1m11 = AmpParameter( args[6] ); - rho102 = AmpParameter( args[7] ); - rho1m12 = AmpParameter( args[8] ); - frame = string( args[9] ); - polAngle = AmpParameter( args[10] ); - - - - // need to register any free parameters so the framework knows about them - registerParameter( rho000 ); - registerParameter( rho100 ); - registerParameter( rho1m10 ); - - registerParameter( rho111 ); - registerParameter( rho001 ); - // if(args.size() == 12){ - // registerParameter( rho001 ); - // } - registerParameter( rho101 ); - registerParameter( rho1m11 ); - - registerParameter( rho102 ); - registerParameter( rho1m12 ); - - //new parameter try - - registerParameter( polAngle ); - - // } - // Two possibilities to initialize this amplitude: - // 1: 11 arguments, fixed polarization - // Usage: amplitude :::: TwoPiAngles ... - if(args.size() == 13 || args.size() == 12) { - polFraction = atof(args[11].c_str()); - cout << "Fitting with constant polarization " << polFraction << endl; - } - // 2: 12 arguments, read polarization from histogram in file - // Usage: amplitude :::: TwoPiAngles ... -// else if(args.size() == 13) { -// polFraction = 0.; -// TFile* f = new TFile( args[11].c_str() ); -// polFrac_vs_E = (TH1D*)f->Get( args[12].c_str() ); -// assert( polFrac_vs_E != NULL ); -// cout << "Fitting with polarization from " << polFrac_vs_E->GetName() << endl; -// } -// -} - - -complex< GDouble > -TwoPiAngles_Delta_only_upperv::calcAmplitude( GDouble** pKin, GDouble* userVars ) const { - - GDouble sinSqTheta = userVars[kSinSqTheta]; - GDouble sin2Theta = userVars[kSin2Theta]; - GDouble cosTheta = userVars[kCosTheta]; - GDouble phi = userVars[kPhi]; - //GDouble bigPhi = polAngle*0.017453293 + userVars[kBigPhi]; // rotate Phi (in rad) - GDouble bigPhi = userVars[kBigPhi]; - GDouble Pgamma = userVars[kPgamma]; - - // vector meson production from K. Schilling et. al. last indize = upper - - - // Use beam assy. to eliminate one parameter - - GDouble W = 0.5*(1. - rho000) + 0.5*(3.*rho000 - 1.)*cosTheta*cosTheta - sqrt(2.)*rho100*sin2Theta*cos(phi) - rho1m10*sinSqTheta*cos(2.*phi); - - W -= Pgamma*cos(2.*bigPhi) * (rho111*sinSqTheta + rho001*cosTheta*cosTheta - sqrt(2.)*rho101*sin2Theta*cos(phi) - rho1m11*sinSqTheta*cos(2.*phi)); - - W -= Pgamma*sin(2.*bigPhi) * (sqrt(2.)*rho102*sin2Theta*sin(phi) + rho1m12*sinSqTheta*sin(2.*phi)); - - W *= 3./(4.*PI); - - return complex< GDouble > ( sqrt(fabs(W)) ); -} - -void -TwoPiAngles_Delta_only_upperv::calcUserVars( GDouble** pKin, GDouble* userVars ) const { - - TLorentzVector beam ( pKin[0][1], pKin[0][2], pKin[0][3], pKin[0][0] ); - TLorentzVector proton ( pKin[1][1], pKin[1][2], pKin[1][3], pKin[1][0] ); - TLorentzVector p1 ( pKin[2][1], pKin[2][2], pKin[2][3], pKin[2][0] ); - TLorentzVector p2 ( pKin[3][1], pKin[3][2], pKin[3][3], pKin[3][0] ); - TLorentzVector p3 ( pKin[4][1], pKin[4][2], pKin[4][3], pKin[4][0] ); - TLorentzVector target ( 0, 0, 0, 0.9382720813); - - TLorentzVector resonance = p2 + p3; - TLorentzVector recoil = proton + p1; - TLorentzVector CM_motion_lab = beam + target; - TLorentzRotation resonanceBoost( -resonance.BoostVector() ); - TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); - - - - TLorentzVector beam_res = resonanceBoost * beam; - TLorentzVector recoil_res = resonanceBoost * recoil; - TLorentzVector p2_res = resonanceBoost * p2; - TLorentzVector beam_cm = CMBoost * beam; - TLorentzVector recoil_cm = CMBoost * recoil; - TLorentzVector p2_cm = CMBoost * p2; - TLorentzVector resonance_cm = CMBoost * resonance; - - - // normal to the production plane - TVector3 y = (beam.Vect().Unit().Cross(-recoil.Vect().Unit())).Unit(); - //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); - //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose helicity frame: z-axis opposite recoil Delta in rho rest frame - TVector3 z = -1. * recoil_res.Vect().Unit(); - TVector3 x = y.Cross(z).Unit(); - TVector3 angles( (p2_res.Vect()).Dot(x), - (p2_res.Vect()).Dot(y), - (p2_res.Vect()).Dot(z) ); - - //// Calculation angles GFJ frame - - - - // normal to the production plane - TVector3 y_GFJ = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose GFJ frame: z-axis points in direction of beam vector in rho rest frame - TVector3 z_GFJ = beam_res.Vect().Unit(); - TVector3 x_GFJ = y_GFJ.Cross(z_GFJ).Unit(); - TVector3 angles_GFJ( (p2_res.Vect()).Dot(x_GFJ), - (p2_res.Vect()).Dot(y_GFJ), - (p2_res.Vect()).Dot(z_GFJ) ); - - if(frame=="Hel"){ - userVars[kCosTheta] = angles.CosTheta(); - userVars[kSinSqTheta] = sin(angles.Theta())*sin(angles.Theta()); - userVars[kSin2Theta] = sin(2.*angles.Theta()); - userVars[kPhi] = angles.Phi(); - } - else{ - userVars[kCosTheta] = angles_GFJ.CosTheta(); - userVars[kSinSqTheta] = sin(angles_GFJ.Theta())*sin(angles_GFJ.Theta()); - userVars[kSin2Theta] = sin(2.*angles_GFJ.Theta()); - userVars[kPhi] = angles_GFJ.Phi(); - } - TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); - userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); - - // vector meson production from K. Schilling et. al. - GDouble Pgamma; - if(polFraction > 0.) { // for fitting with constant polarization - Pgamma = polFraction; - } - // else{ - // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); - // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ - // Pgamma = 0.; - // } - // else Pgamma = polFrac_vs_E->GetBinContent(bin); - // } - userVars[kPgamma] = Pgamma; -} - -#ifdef GPU_ACCELERATION -void -TwoPiAngles_Delta_only_upperv::launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const { - - GPUTwoPiAngles_Delta_only_upperv_exec( dimGrid, dimBlock, GPU_AMP_ARGS, - rho000, rho100, rho1m10, - rho111, rho001, rho101, - rho1m11, rho102, rho1m12, - polAngle); -} - -#endif //GPU_ACCELERATION \ No newline at end of file diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h deleted file mode 100755 index 490f82a7b..000000000 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h +++ /dev/null @@ -1,79 +0,0 @@ -#if !defined(TWOPIANGLES_DELTA_only_upperv) -#define TWOPIANGLES_DELTA_only_upperv - -#include "IUAmpTools/Amplitude.h" -#include "IUAmpTools/UserAmplitude.h" -#include "IUAmpTools/AmpParameter.h" -#include "GPUManager/GPUCustomTypes.h" - -#include "TH1D.h" -#include -#include -#include - -#ifdef GPU_ACCELERATION -void -GPUTwoPiAngles_Delta_only_upperv_exec( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO, - GDouble rho000, GDouble rho100, GDouble rho1m10, - GDouble rho111, GDouble rho001, GDouble rho101, - GDouble rho1m11, GDouble rho102, GDouble rho1m12, - GDouble polAngle); - -#endif // GPU_ACCELERATION - -using std::complex; -using namespace std; - -class Kinematics; - -class TwoPiAngles_Delta_only_upperv : public UserAmplitude< TwoPiAngles_Delta_only_upperv > -{ - -public: - - TwoPiAngles_Delta_only_upperv() : UserAmplitude< TwoPiAngles_Delta_only_upperv >() { }; - TwoPiAngles_Delta_only_upperv( const vector< string >& args ); - - enum UserVars { kPgamma = 0, kCosTheta, kSinSqTheta, kSin2Theta, - kBigPhi, kPhi, kNumUserVars }; - unsigned int numUserVars() const { return kNumUserVars; } - - string name() const { return "TwoPiAngles_Delta_only_upperv"; } - - complex< GDouble > calcAmplitude( GDouble** pKin, GDouble* userVars ) const; - void calcUserVars( GDouble** pKin, GDouble* userVars ) const; - - // we can calcualte everythign we need from userVars block so allow - // the framework to purge the four-vectors - bool needsUserVarsOnly() const { return true; } - -#ifdef GPU_ACCELERATION - - void launchGPUKernel( dim3 dimGrid, dim3 dimBlock, GPU_AMP_PROTO ) const; - bool isGPUEnabled() const { return true; } - -#endif // GPU_ACCELERATION - -private: - - AmpParameter rho000; - AmpParameter rho100; - AmpParameter rho1m10; - - AmpParameter rho111; - AmpParameter rho001; - AmpParameter rho101; - AmpParameter rho1m11; - - AmpParameter rho102; - AmpParameter rho1m12; - - AmpParameter polAngle; - - double polFraction; - //TH1D *polFrac_vs_E; - string frame; - -}; - -#endif diff --git a/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.cc b/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.cc index 1d11edc7b..22ddde407 100755 --- a/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.cc +++ b/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.cc @@ -17,8 +17,8 @@ PlotGenerator( results ) // obtain the polarization angle for this reaction by getting the list of amplitudes // associated with this reaction -- we know all are SDME amplitudes - // take the 1th argument of the first factor of the first amplitude in the first sum - string ampArgument = { cfgInfo()->amplitudeList( *reac, "", "" ).at(0)->factors().at(0).at(1) }; + // // take the 1th argument of the first factor of the first amplitude in the first sum + // string ampArgument = { cfgInfo()->amplitudeList( *reac, "", "" ).at(0)->factors().at(0).at(1) }; // pick out the name of the parameter // string parName = ampArgument.substr(1,ampArgument.length()-2); @@ -27,20 +27,25 @@ PlotGenerator( results ) // //cout << "Angle " << results.parValue( parName ) << endl; // m_reactionAngleMap[*reac] = results.parValue( parName ); - - double polAngle = atof(ampArgument.c_str()); - m_reactionAngleMap[*reac] = polAngle; - cout << "Angle " << polAngle << endl; + double polAngle = 0; + string angleString = cfgInfo()->amplitudeList( *reac, "", "" ).at(0)->factors().at(0).at(2); + + try{ polAngle = stod( angleString ); } + catch( ... ){ + + cout << "ERROR: Unable to get polarization angle from config file because converting\n" + << " the amplitude argument '" << angleString << "' to a double failed.\n" + << " Check the projectEvent method of the OmegaRadiativePlotGenerator to be sure\n" + << " the correct argument is specified. Also be sure the angle appears\n" + << " in the original fit config file as a number and not a parameter.\n" + << endl; + assert( false ); + } + m_reactionAngleMap[*reac] = polAngle; } -// for( auto reac = reactionVec.begin(); reac != reactionVec.end(); ++reac ){ - -// string ampArgument = { cfgInfo()->amplitudeList( *reac, "", "" ).at(0)->factors().at(0).at(10) }; -// string parName = ampArgument.substr(1,ampArgument.length()-2); -// m_reactionAngleMap[*reac] = results.parValue( parName ); -// } for(const auto& entry : m_reactionAngleMap){ @@ -59,51 +64,69 @@ PlotGenerator( ) void TwoPiDeltaPlotGenerator::createHistograms() { // calls to bookHistogram go here - + //signal mass bookHistogram( k2PiMass, new Histogram1D( 50, 0.6, 0.95, "M2pi", "M(#pi^{0} #pi^{-}) (GeV)") ); bookHistogram( kPPipMass, new Histogram1D( 50, 1.1, 1.4, "Mppip", "M(p#pi^{+} )(GeV)") ); - + //different combinations of invariant masses bookHistogram( kPipPimMass, new Histogram1D( 100, 0.2, 2.5, "Mpippim", "M(#pi^{+}#pi^{-} )(GeV)") ); bookHistogram( kPPi0Mass, new Histogram1D( 100, 1, 4.5, "Mppi0", "M(p#pi^{0}) (GeV)") ); bookHistogram( kPipPi0Mass, new Histogram1D( 100, 0.1, 2.5, "Mpippi0", "M(#pi^{+}#pi^{0}) (GeV)") ); - + bookHistogram( kPPimMass, new Histogram1D( 100, 1, 4.5, "Mppim", "M( p#pi^{-}) (GeV)") ); bookHistogram( kPi0PimMass, new Histogram1D( 100, 0.1, 1.5, "Mpi0pim", "M(#pi^{0}#pi^{-}) (GeV)") ); - bookHistogram( kPPipPimMass, new Histogram1D( 100, 1, 4.5, "Mppippim", "M(p#pi^{-}#pi^{+})(GeV)") ); bookHistogram( kPPipPi0Mass, new Histogram1D( 100, 1, 4.5, "Mppippi0", "M( p#pi^{+}#pi^{0}) (GeV)") ); bookHistogram( kPPimPi0Mass, new Histogram1D( 100, 2.5, 4.5, "Mppimpi0", "M( p#pi^{-}#pi^{0}) (GeV)") ); bookHistogram( kPipPi0PimMass, new Histogram1D( 100, 0.5, 4.5, "Mpippi0pim", "M( #pi^{-}#pi^{0}#pi^{+}) (GeV)") ); bookHistogram( kPPipPimMass, new Histogram1D( 100, 1, 4.5, "Mppippim", "M( p#pi^{-}#pi^{+}) (GeV)") ); - bookHistogram( kCosTheta_HF_rho, new Histogram1D( 60, -1., 1., "cosTheta_HF_rho", "cos( #theta_{#pi^{-}} ) in HF (restframe #rho)") ); - bookHistogram( kCosTheta_GFJ_rho, new Histogram1D( 60, -1., 1., "cosTheta_GFJ_rho", "cos( #theta_{#pi^{-}} ) in GJ (restframe #rho)") ); - bookHistogram( kCosTheta_GFJ_Delta, new Histogram1D( 60, -1., 1., "cosTheta_GFJ_Delta", "cos( #theta_{#pi^{+}} ) in GJ (restframe #Delta)") ); - bookHistogram( kCosTheta_HF_Delta, new Histogram1D( 60, -1., 1., "cosTheta_HF_Delta", "cos( #theta_{#pi^{+}} ) in HF (restframe #Delta)") ); + + + bookHistogram( kPhiPiPlus, new Histogram1D( 180, -180, 180, "PhiPiPlus", "#Phi_{#pi^{+}}" ) ); bookHistogram( kPhiPiMinus, new Histogram1D( 180, -180, 180, "PhiPiMinus", "#Phi_{#pi^{-}}" ) ); bookHistogram( kPhiProton, new Histogram1D( 180, -180, 180, "PhiProton", "#Phi_{p}" ) ); + bookHistogram( kThetaPiPlus, new Histogram1D( 200, 0, 20, "ThetaPiPlus", "#Theta_{#pi^{+}}" ) ); bookHistogram( kThetaPiMinus, new Histogram1D( 200, 0, 20, "ThetaPiMinus", "#Theta_{#pi^{-}}" ) ); bookHistogram( kThetaDelta, new Histogram1D( 200, 50, 90, "ThetaDelta", "#Theta_{#Delta}" ) ); - bookHistogram( kMomPiPlus, new Histogram1D( 60, 0, 0.7, "MomPiPlus", "p_{#pi^{+}}" ) ); - bookHistogram( kMomPiMinus, new Histogram1D( 60, 0, 9, "MomPiMinus", "p_{#pi^{-}}" ) ); - bookHistogram( kMomPi0, new Histogram1D( 60, 0, 9, "MomPi0", "p_{#pi^{0}}" ) ); - bookHistogram( kMomProton, new Histogram1D( 180, 0, 1, "MomProton", "p_{p}" ) ); - bookHistogram( kPhi, new Histogram1D( 50, -180, 180, "Phi", "#Phi" ) ); - bookHistogram( kPhi_GFJ, new Histogram1D( 50, -180, 180, "PhiGFJ", "#Phi_{GJ}" ) ); + + + + // longitudinal momenta bookHistogram( klongMomPiPlus, new Histogram1D( 60, 0, 0.5, "longMomPiPlus", "p_{z,#pi^{+}}" ) ); bookHistogram( klongMomPiMinus, new Histogram1D( 60, 0, 9, "longMomPiMinus", "p_{z,#pi^{-}}" ) ); bookHistogram( klongMomPi0, new Histogram1D( 60, 0, 9, "longMomPi0", "p_{z,#pi^{0}}" ) ); bookHistogram( klongMomProton, new Histogram1D( 60, 0, 1.5, "longMomProton", "p_{z,p}" ) ); + + // momenta + bookHistogram( kMomPiPlus, new Histogram1D( 60, 0, 0.7, "MomPiPlus", "p_{#pi^{+}}" ) ); + bookHistogram( kMomPiMinus, new Histogram1D( 60, 0, 9, "MomPiMinus", "p_{#pi^{-}}" ) ); + bookHistogram( kMomPi0, new Histogram1D( 60, 0, 9, "MomPi0", "p_{#pi^{0}}" ) ); + bookHistogram( kMomProton, new Histogram1D( 180, 0, 1, "MomProton", "p_{p}" ) ); + + // Angles in different frames Phi + bookHistogram( kphi_PiMinus_hel_rho, new Histogram1D( 60, -180, 180, "phi_PiMinus_hel_rho", " #phi_{#pi^{-}} in hel (restframe #rho) " ) ); + bookHistogram( kphi_PiMinus_GJ_rho, new Histogram1D( 60, -180, 180, "phi_PiMinus_GJ_rho", "#phi_{#pi^{-}} in GJ (restframe #rho)" ) ); + + bookHistogram( kphi_PiPlus_hel_Delta, new Histogram1D( 60, -180, 180, "phi_PiPlus_hel_Delta", " #phi_{#pi^{+}} in hel (restframe #Delta)" ) ); + bookHistogram( kphi_PiPlus_GJ_Delta, new Histogram1D( 60, -180, 180, "phi_PiPlus_GJ_Delta", "#phi_{#pi^{+}} in GJ (restframe #Delta)" ) ); + + bookHistogram( kphi_Proton_hel_Delta, new Histogram1D( 60, -180, 180, "phi_Proton_hel_Delta", " #phi_{p} in hel (restframe #Delta)" ) ); + bookHistogram( kphi_Proton_GJ_Delta, new Histogram1D( 60, -180, 180, "phi_Proton_GJ_Delta", "#phi_{p} in GJ (restframe #Delta)" ) ); + + bookHistogram( kCosTheta_PiMinus_hel_rho, new Histogram1D( 60, -1., 1., "cosTheta_PiMinus_hel_rho", "cos( #theta_{#pi^{-}} ) in hel (restframe #rho)") ); + bookHistogram( kCosTheta_PiMinus_GJ_rho, new Histogram1D( 60, -1., 1., "cosTheta_PiMinus_GJ_rho", "cos( #theta_{#pi^{-}} ) in GJ (restframe #rho)") ); + + bookHistogram( kCosTheta_PiPlus_hel_Delta, new Histogram1D( 60, -1., 1., "cosTheta_PiPlus_hel_Delta", "cos( #theta_{#pi^{+}} ) in hel (restframe #Delta)") ); + bookHistogram( kCosTheta_PiPlus_GJ_Delta, new Histogram1D( 60, -1., 1., "cosTheta_PiPlus_GJ_Delta", "cos( #theta_{#pi^{+}} ) in GJ (restframe #Delta)") ); + + bookHistogram( kCosTheta_Proton_hel_Delta, new Histogram1D( 60, -1., 1., "cosTheta_Proton_hel_Delta", "cos( #theta_{p} ) in hel (restframe #Delta)") ); + bookHistogram( kCosTheta_Proton_GJ_Delta, new Histogram1D( 60, -1., 1., "cosTheta_Proton_GJ_Delta", "cos( #theta_{p} ) in GJ (restframe #Delta)") ); - bookHistogram( kphi_HF_rho, new Histogram1D( 60, -180, 180, "phi_HF_rho", " #phi_{#pi^{-}} in HF (restframe #rho) " ) ); - bookHistogram( kphi_GFJ_rho, new Histogram1D( 60, -180, 180, "phi_GFJ_rho", "#phi_{#pi^{-}} in GJ (restframe #rho)" ) ); - bookHistogram( kphi_HF_Delta, new Histogram1D( 60, -180, 180, "phi_HF_Delta", " #phi_{#pi^{+}} in HF (restframe #Delta)" ) ); - bookHistogram( kphi_GFJ_Delta, new Histogram1D( 60, -180, 180, "phi_GFJ_Delta", "#phi_{#pi^{+}} in GJ (restframe #Delta)" ) ); + + bookHistogram( kPhi, new Histogram1D( 50, -180, 180, "Phi", "#Phi" ) ); bookHistogram( kPsi, new Histogram1D( 20, -180, 180, "psi", "#psi" ) ); bookHistogram( kt, new Histogram1D( 1000, 0, 1.4, "-t", "-t (GeV^2)" ) ); - bookHistogram( kBeamassymetrie, new Histogram1D( 100, 0.16, 0.21 , "Beamass", "#Sigma_{#rho}" ) ); - bookHistogram( kBeamassymetrie_Delta, new Histogram1D( 100, 0.16, 0.21 , "Beamass_Delta", "#Sigma_{#Delta}" ) ); } @@ -127,141 +150,107 @@ void TwoPiDeltaPlotGenerator::projectEvent( Kinematics* kin, const string& react TLorentzVector p3 = kin->particle( 4 ); //pi0 TLorentzVector target ( 0, 0, 0, 0.9382720813); - TLorentzVector resonance = p2 + p3; TLorentzVector recoil = proton + p1; + TLorentzVector rho = p2 + p3; + TLorentzVector Delta = proton + p1; TLorentzVector CM_motion_lab = beam + target; + TLorentzVector piminus = p2; + + TLorentzRotation rhoBoost( -rho.BoostVector() ); TLorentzRotation CMBoost( -CM_motion_lab.BoostVector() ); - TLorentzRotation resonanceBoost( -resonance.BoostVector() ); + TLorentzRotation DeltaBoost( -Delta.BoostVector() ); + - TLorentzVector recoil_res = resonanceBoost * recoil; - TLorentzVector p2_res = resonanceBoost * p2; - TLorentzVector beam_res = resonanceBoost * beam; +// choose helicity frame: z-axis opposite recoil Delta in rho rest frame +//bost in rho restframe + TLorentzVector beam_resrho = rhoBoost * beam; + TLorentzVector Delta_resrho = rhoBoost * Delta; + TLorentzVector piminus_resrho = rhoBoost * piminus; + TLorentzVector proton_resrho = rhoBoost * proton; +//boost in CM frame TLorentzVector beam_cm = CMBoost * beam; - TLorentzVector recoil_cm = CMBoost * recoil; - TLorentzVector p2_cm = CMBoost * p2; - TLorentzVector resonance_cm = CMBoost * resonance; + TLorentzVector Delta_cm = CMBoost * Delta; + TLorentzVector piminus_cm = CMBoost * piminus; + TLorentzVector rho_cm = CMBoost * rho; + +//boost in recoil frame + TLorentzVector target_resDelta = DeltaBoost * target; + TLorentzVector proton_resDelta = DeltaBoost * proton; + TLorentzVector piplus_resDelta = DeltaBoost * p1; + TLorentzVector rho_resDelta = DeltaBoost * rho; + + // Define coordinate systems: + // y equal in all frames + TVector3 y = (beam.Vect().Unit().Cross(-Delta.Vect().Unit())).Unit(); - // logitudinal component + //rho system + + //Helicity frame + TVector3 z_hel_rho = -1. * Delta_resrho.Vect().Unit(); + TVector3 x_hel_rho = y.Cross(z_hel_rho).Unit(); + // GJ frame + TVector3 z_GJ_rho = beam_resrho.Vect().Unit(); + TVector3 x_GJ_rho = y.Cross(z_GJ_rho).Unit(); - // normal to the production plane - TVector3 y = (beam.Vect().Unit().Cross(-recoil.Vect().Unit())).Unit(); - //TVector3 y = (beam_cm.Vect().Unit().Cross(resonance_cm.Vect().Unit())).Unit(); - //TVector3 y = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - // choose helicity frame: z-axis opposite recoil proton in rho rest frame - TVector3 z = -1. * recoil_res.Vect().Unit(); + //Delta system - TVector3 x = y.Cross(z).Unit(); - TVector3 angles( (p2_res.Vect()).Dot(x), - (p2_res.Vect()).Dot(y), - (p2_res.Vect()).Dot(z) ); - - // choose GFJ frame: z-axis points in direction of beam photon in restframe + // Helicity frame + TVector3 z_hel_Delta = -rho_resDelta.Vect().Unit(); + TVector3 x_hel_Delta = (y.Cross(z_hel_Delta)).Unit(); - TVector3 y_GFJ_rho = (beam_res.Vect().Unit().Cross(-recoil_res.Vect().Unit())).Unit(); - - TVector3 z_GFJ_rho = beam_res.Vect().Unit(); + // GJ frame + TVector3 z_GJ_Delta = target_resDelta.Vect().Unit(); + TVector3 x_GJ_Delta = y.Cross(z_GJ_Delta).Unit(); - TVector3 x_GFJ_rho = y_GFJ_rho.Cross(z_GFJ_rho).Unit(); - TVector3 angles_GFJ_rho( (p2_res.Vect()).Dot(x_GFJ_rho), - (p2_res.Vect()).Dot(y_GFJ_rho), - (p2_res.Vect()).Dot(z_GFJ_rho) ); + //Angle calculation + TVector3 angles_piminus_hel_rho( (piminus_resrho.Vect()).Dot(x_hel_rho), + (piminus_resrho.Vect()).Dot(y), + (piminus_resrho.Vect()).Dot(z_hel_rho) ); + + TVector3 angles_piminus_GJ_rho( (piminus_resrho.Vect()).Dot(x_GJ_rho), + (piminus_resrho.Vect()).Dot(y), + (piminus_resrho.Vect()).Dot(z_GJ_rho) ); - GDouble cosTheta = angles.CosTheta(); - GDouble phi = angles.Phi(); + TVector3 angles_proton_hel_Delta( (proton_resDelta.Vect()).Dot(x_hel_Delta), + (proton_resDelta.Vect()).Dot(y), + (proton_resDelta.Vect()).Dot(z_hel_Delta) ); + TVector3 angles_piplus_hel_Delta( (piplus_resDelta.Vect()).Dot(x_hel_Delta), + (piplus_resDelta.Vect()).Dot(y), + (piplus_resDelta.Vect()).Dot(z_hel_Delta) ); + + TVector3 angles_proton_GJ_Delta( (proton_resDelta.Vect()).Dot(x_GJ_Delta), + (proton_resDelta.Vect()).Dot(y), + (proton_resDelta.Vect()).Dot(z_GJ_Delta) ); - GDouble cosTheta_GFJ_rho = angles_GFJ_rho.CosTheta(); - GDouble phi_GFJ_rho = angles_GFJ_rho.Phi(); + TVector3 angles_piplus_GJ_Delta( (piplus_resDelta.Vect()).Dot(x_GJ_Delta), + (piplus_resDelta.Vect()).Dot(y), + (piplus_resDelta.Vect()).Dot(z_GJ_Delta) ); TVector3 eps(cos(polAngle*TMath::DegToRad()), sin(polAngle*TMath::DegToRad()), 0.0); // beam polarization vector GDouble Phi = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); - GDouble psi = phi - Phi; + GDouble psi = angles_piminus_GJ_rho.Phi() - Phi; if(psi < -1*PI) psi += 2*PI; if(psi > PI) psi -= 2*PI; // compute invariant t GDouble t = -(beam-p3-p2).M2(); - // Calculate angles in GFJ - TLorentzVector resonance_Delta = proton + p1; //Delta - TLorentzVector piminuspi0 = p2 + p3; // rho - - - - //Restframe Delta - TLorentzRotation resonanceBoost_Delta( -resonance_Delta.BoostVector() ); - - TLorentzVector target_resDelta = resonanceBoost_Delta * target; - TLorentzVector beam_resDelta = resonanceBoost_Delta * beam; - TLorentzVector piminuspi0_resDelta = resonanceBoost_Delta * piminuspi0; - TLorentzVector p1_resDelta = resonanceBoost_Delta * p1; // piplus - - - - - - - TVector3 y_resDelta = (beam_resDelta.Vect().Unit().Cross(piminuspi0_resDelta.Vect().Unit())).Unit(); - TVector3 z_resDelta = target_resDelta.Vect().Unit(); - - TVector3 x_resDelta = y_resDelta.Cross(z_resDelta).Unit(); - - TVector3 angles_piplus_gfj( (p1_resDelta.Vect()).Dot(x_resDelta), - (p1_resDelta.Vect()).Dot(y_resDelta), - (p1_resDelta.Vect()).Dot(z_resDelta) ); - - GDouble phi_piplus_gfj = angles_piplus_gfj.Phi(); - GDouble cosTheta_piplus_gfj = angles_piplus_gfj.CosTheta(); - GDouble Phi_GFJ = atan2(y_resDelta.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y_resDelta))); // _resDelta removed behind beam - - TVector3 z_HF_Delta = -piminuspi0_resDelta.Vect().Unit(); - TVector3 y_HF_Delta = (beam_resDelta.Vect().Cross(piminuspi0_resDelta.Vect())).Unit(); - TVector3 x_HF_Delta = (y_HF_Delta.Cross(z_HF_Delta)).Unit(); - - TVector3 angles_HF_Delta( (p1_resDelta.Vect()).Dot(x_HF_Delta), - (p1_resDelta.Vect()).Dot(y_HF_Delta), - (p1_resDelta.Vect()).Dot(z_HF_Delta) ); - - GDouble phi_HF_Delta= angles_HF_Delta.Phi(); - GDouble cosTheta_HF_Delta = angles_HF_Delta.CosTheta(); - GDouble Beamassymetrie = -0.0881138417353299* 2 * sin(angles_GFJ_rho.Theta())*sin(angles_GFJ_rho.Theta()) -0.231777925342216 * angles_GFJ_rho.CosTheta() * angles_GFJ_rho.CosTheta(); - GDouble Beamassymetrie_Delta =2 * ((0.0852934984398916 * sin(angles_piplus_gfj.Theta())* sin(angles_piplus_gfj.Theta()))+0.104825277169257*(1/3 + angles_piplus_gfj.CosTheta() * angles_piplus_gfj.CosTheta())); - - - - - - - - - - - // calls to fillHistogram go here - - fillHistogram( k2PiMass, ( resonance ).M() ); + fillHistogram( k2PiMass, ( rho ).M() ); fillHistogram( kPPipMass, ( proton+p1 ).M() ); fillHistogram( kPPimMass, ( proton+p2 ).M() ); fillHistogram( kPi0PimMass, ( p3+p2 ).M() ); - fillHistogram( kCosTheta_HF_rho, cosTheta ); - fillHistogram( kCosTheta_GFJ_Delta, cosTheta_piplus_gfj ); - fillHistogram( kCosTheta_HF_Delta, cosTheta_HF_Delta ); - fillHistogram( kCosTheta_GFJ_rho, cosTheta_GFJ_rho ); + fillHistogram( kPipPimMass, (p1+p2 ).M()); fillHistogram( kPPi0Mass, (proton+p3 ).M()); fillHistogram( kPipPi0Mass, (p1+p3 ).M()); - fillHistogram( kPhiPiPlus, p1.Phi()*TMath::RadToDeg() ); - fillHistogram( kPhiPiMinus, p2.Phi()*TMath::RadToDeg() ); - fillHistogram( kPhiProton, proton.Phi()*TMath::RadToDeg() ); - fillHistogram( kThetaPiPlus, p1.Theta()*TMath::RadToDeg() ); - fillHistogram( kThetaPiMinus, p2.Theta()*TMath::RadToDeg() ); - fillHistogram( kThetaDelta, recoil.Theta()*TMath::RadToDeg() ); + ; fillHistogram( klongMomPiPlus, p1.Pz() ); fillHistogram( klongMomPiMinus, p2.Pz() ); fillHistogram( klongMomPi0, p3.Pz() ); @@ -275,14 +264,40 @@ void TwoPiDeltaPlotGenerator::projectEvent( Kinematics* kin, const string& react fillHistogram( kPipPi0PimMass, ( p1 + p3 + p2 ).M() ); fillHistogram( kPPipPimMass, ( proton + p1 + p2 ).M() ); fillHistogram( kPPimPi0Mass, ( proton + p2 + p3 ).M() ); + + + //angles for fits + + // phi angles in different frames + fillHistogram( kphi_PiMinus_hel_rho, angles_piminus_hel_rho.Phi()*TMath::RadToDeg() ); + fillHistogram( kphi_PiMinus_GJ_rho, angles_piminus_GJ_rho.Phi()*TMath::RadToDeg()); + + fillHistogram( kphi_PiPlus_hel_Delta, angles_piplus_hel_Delta.Phi()*TMath::RadToDeg()); + fillHistogram( kphi_PiPlus_GJ_Delta, angles_piplus_GJ_Delta.Phi()*TMath::RadToDeg()); + + fillHistogram( kphi_Proton_hel_Delta, angles_proton_hel_Delta.Phi()*TMath::RadToDeg()); + fillHistogram( kphi_Proton_GJ_Delta, angles_proton_GJ_Delta.Phi()*TMath::RadToDeg()); + + // cosTheta angles in different frames + fillHistogram( kCosTheta_PiMinus_hel_rho, angles_piminus_hel_rho.CosTheta() ); + fillHistogram( kCosTheta_PiMinus_GJ_rho, angles_piminus_GJ_rho.CosTheta() ); + + fillHistogram( kCosTheta_PiPlus_hel_Delta, angles_piplus_hel_Delta.CosTheta() ); + fillHistogram( kCosTheta_PiPlus_GJ_Delta, angles_piplus_GJ_Delta.CosTheta() ); + + fillHistogram( kCosTheta_Proton_hel_Delta, angles_proton_hel_Delta.CosTheta() ); + fillHistogram( kCosTheta_Proton_GJ_Delta, angles_proton_GJ_Delta.CosTheta() ); + + //Different angles in lab frame + fillHistogram( kThetaPiPlus, p1.Theta()*TMath::RadToDeg() ); + fillHistogram( kThetaPiMinus, p2.Theta()*TMath::RadToDeg() ); + fillHistogram( kThetaDelta, recoil.Theta()*TMath::RadToDeg() ); + fillHistogram( kPhiPiPlus, p1.Phi()*TMath::RadToDeg() ); + fillHistogram( kPhiPiMinus, p2.Phi()*TMath::RadToDeg() ); + fillHistogram( kPhiProton, proton.Phi()*TMath::RadToDeg() ); + + //Polarisation angles fillHistogram( kPhi, Phi*TMath::RadToDeg() ); - fillHistogram( kPhi_GFJ, Phi_GFJ*TMath::RadToDeg() ); - fillHistogram( kphi_HF_rho, phi*TMath::RadToDeg() ); - fillHistogram( kphi_GFJ_Delta, phi_piplus_gfj*TMath::RadToDeg()); - fillHistogram( kphi_HF_Delta, phi_HF_Delta*TMath::RadToDeg()); - fillHistogram( kphi_GFJ_rho, phi_GFJ_rho*TMath::RadToDeg()); fillHistogram( kPsi, psi*TMath::RadToDeg() ); - fillHistogram( kt, t ); // fill with -t to make positive - fillHistogram( kBeamassymetrie, Beamassymetrie ); - fillHistogram( kBeamassymetrie_Delta, Beamassymetrie_Delta ); + fillHistogram( kt, t ); } diff --git a/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h b/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h index ecfb04945..a97878a14 100755 --- a/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h +++ b/src/libraries/AMPTOOLS_DATAIO/TwoPiDeltaPlotGenerator.h @@ -43,22 +43,21 @@ class TwoPiDeltaPlotGenerator : public PlotGenerator kPhiPiPlus, kPhiPiMinus, kPhiProton, + kphi_PiMinus_hel_rho, + kphi_PiMinus_GJ_rho, + kphi_PiPlus_hel_Delta, + kphi_PiPlus_GJ_Delta, + kphi_Proton_hel_Delta, + kphi_Proton_GJ_Delta, + kCosTheta_PiMinus_hel_rho, + kCosTheta_PiMinus_GJ_rho, + kCosTheta_PiPlus_hel_Delta, + kCosTheta_PiPlus_GJ_Delta, + kCosTheta_Proton_hel_Delta, + kCosTheta_Proton_GJ_Delta, kPhi, - kPhi_GFJ, - kphi_GFJ_rho, - kphi_HF_Delta, - kphi_HF_rho, - kphi_GFJ_Delta, kPsi, kt, - kCosTheta_GFJ_Delta, - kCosTheta_GFJ_rho, - kCosTheta_HF_Delta, - kCosTheta_HF_rho, - kBeamassymetrie, - kBeamassymetrie_Delta, - - kNumHists }; diff --git a/src/programs/AmplitudeAnalysis/fit/fit.cc b/src/programs/AmplitudeAnalysis/fit/fit.cc index 0b40334ee..66cc93d27 100644 --- a/src/programs/AmplitudeAnalysis/fit/fit.cc +++ b/src/programs/AmplitudeAnalysis/fit/fit.cc @@ -22,12 +22,8 @@ #include "AMPTOOLS_AMPS/TwoPSHelicity.h" #include "AMPTOOLS_AMPS/TwoPiAngles.h" #include "AMPTOOLS_AMPS/TwoPiAngles_amp.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta.h" #include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h" #include "AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h" -#include "AMPTOOLS_AMPS/DeltaAngles_Rho.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h" #include "AMPTOOLS_AMPS/TwoPiWt_primakoff.h" #include "AMPTOOLS_AMPS/TwoPiWt_sigma.h" #include "AMPTOOLS_AMPS/TwoPiW_brokenetas.h" @@ -443,11 +439,7 @@ int main( int argc, char* argv[] ){ AmpToolsInterface::registerAmplitude( TwoPSAngles() ); AmpToolsInterface::registerAmplitude( TwoPSHelicity() ); AmpToolsInterface::registerAmplitude( TwoPiAngles() ); - AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta()); - AmpToolsInterface::registerAmplitude( DeltaAngles_Rho()); - AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_only_upperv()); AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs()); - AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs_unpol()); AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_factorized()); AmpToolsInterface::registerAmplitude( TwoPiAngles_amp() ); AmpToolsInterface::registerAmplitude( TwoPiAngles_primakoff() ); diff --git a/src/programs/AmplitudeAnalysis/fitMPI/fitMPI.cc b/src/programs/AmplitudeAnalysis/fitMPI/fitMPI.cc index fcbe48c4a..74c170325 100644 --- a/src/programs/AmplitudeAnalysis/fitMPI/fitMPI.cc +++ b/src/programs/AmplitudeAnalysis/fitMPI/fitMPI.cc @@ -20,12 +20,8 @@ #include "AMPTOOLS_AMPS/TwoPSHelicity.h" #include "AMPTOOLS_AMPS/TwoPiAngles.h" #include "AMPTOOLS_AMPS/TwoPiAngles_amp.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta.h" #include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs_unpol.h" #include "AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.h" -#include "AMPTOOLS_AMPS/DeltaAngles_Rho.h" -#include "AMPTOOLS_AMPS/TwoPiAngles_Delta_only_upperv.h" #include "AMPTOOLS_AMPS/TwoPiWt_primakoff.h" #include "AMPTOOLS_AMPS/TwoPiWt_sigma.h" #include "AMPTOOLS_AMPS/TwoPiW_brokenetas.h" @@ -418,12 +414,8 @@ int main( int argc, char* argv[] ){ AmpToolsInterface::registerAmplitude( TwoPSAngles() ); AmpToolsInterface::registerAmplitude( TwoPSHelicity() ); AmpToolsInterface::registerAmplitude( TwoPiAngles() ); - AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta()); - AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_only_upperv()); AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs()); - AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_DoubleSDMEs_unpol()); AmpToolsInterface::registerAmplitude( TwoPiAngles_Delta_factorized()); - AmpToolsInterface::registerAmplitude( DeltaAngles_Rho()); AmpToolsInterface::registerAmplitude( TwoPiAngles_amp() ); AmpToolsInterface::registerAmplitude( TwoPiAngles_primakoff() ); AmpToolsInterface::registerAmplitude( TwoPiWt_primakoff() ); diff --git a/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc b/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc index 09e00a575..cc5536192 100755 --- a/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc +++ b/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc @@ -386,13 +386,7 @@ int main( int argc, char* argv[] ){ //char array for strings outfile << pars[i] << "\t" << parValue << "\t" << parError << "\t" << "\n"; } - double rho001_value = 2*(results.parValue("delta_rho111")+results.parValue("delta_rho133")-results.parValue("rho111")); - double rho001_error = 2*sqrt(results.parError("delta_rho111")*results.parError("delta_rho111")+results.parError("delta_rho133")*results.parError("delta_rho133")+results.parError("rho111")*results.parError("rho111")+2*(results.covariance("delta_rho111","delta_rho133")-results.covariance("delta_rho111","rho111")-results.covariance("delta_rho133","rho111"))); - outfile << "rho001" << "\t" << rho001_value << "\t" << rho001_error << "\t" << "\n"; - double P_sigma_value = 2*results.parValue("rho1m11") - rho001_value; //error calculation uses rho001 expressed by the three other SDMEs - double P_sigma_error = 2*sqrt(results.parError("rho1m11")*results.parError("rho1m11")+results.parError("rho111")*results.parError("rho111")+results.parError("delta_rho111")*results.parError("delta_rho111")+results.parError("delta_rho133")*results.parError("delta_rho133")+2*(results.covariance("rho1m11","rho111")-results.covariance("rho1m11","delta_rho111")-results.covariance("rho1m11","delta_rho133")-results.covariance("rho111","delta_rho111")-results.covariance("rho111","delta_rho133")+results.covariance("delta_rho111","delta_rho133"))); - outfile << "P" << "\t" << P_sigma_value << "\t" << P_sigma_error << "\t" << "\n"; // Calculate the single SDMEs with the double SDMEs From ee91ce4325a54120a283030127280619fda8932b Mon Sep 17 00:00:00 2001 From: Niklas Herrmann Date: Mon, 13 Jul 2026 05:21:24 -0400 Subject: [PATCH 4/5] changed a few lines to avoid warning during compiling of halldsim --- ...GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu | 4 ++-- .../TwoPiAngles_Delta_DoubleSDMEs.cc | 8 +++----- .../TwoPiAngles_Delta_factorized.cc | 6 ++---- .../twopidelta_plotter/twopidelta_plotter.cc | 19 +++++++++++++++++++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu index 03f2ce73c..eaff81ec0 100755 --- a/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu +++ b/src/libraries/AMPTOOLS_AMPS/GPUTwoPiAngles_Delta_DoubleSDMEs_kernel.cu @@ -68,7 +68,7 @@ GPUTwoPiAngles_Delta_DoubleSDMEs_kernel( GPU_AMP_PROTO, GDouble sinSqTh = sinSqTheta_proton; GDouble sin2Th = sin2Theta_proton; - GDouble cosSqTh = 1.0 - sinSqTh; + GDouble cosSqTh = cosTheta_proton * cosTheta_proton; GDouble cphi = cos(phi_proton); GDouble sphi = sin(phi_proton); @@ -77,7 +77,7 @@ GPUTwoPiAngles_Delta_DoubleSDMEs_kernel( GPU_AMP_PROTO, GDouble sinSqThPi = sinSqTheta_pim; GDouble sin2ThPi = sin2Theta_pim; - GDouble cosSqThPi = 1.0 - sinSqThPi; + GDouble cosSqThPi = cosTheta_pim * cosTheta_pim; GDouble cphiPi = cos(phi_pim); GDouble sphiPi = sin(phi_pim); diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc index 5e60f22a9..6b022a82e 100755 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_DoubleSDMEs.cc @@ -234,7 +234,7 @@ GDouble phi_proton = userVars[kPhi_proton]; GDouble sinSqTh = sinSqTheta_proton; GDouble sin2Th = sin2Theta_proton; -GDouble cosSqTh = 1.0 - sinSqTh; +GDouble cosSqTh = cosTheta_proton * cosTheta_proton; GDouble cphi = cos(phi_proton); GDouble sphi = sin(phi_proton); @@ -243,7 +243,7 @@ GDouble s2phi = sin(2.0 * phi_proton); GDouble sinSqThPi = sinSqTheta_pim; GDouble sin2ThPi = sin2Theta_pim; -GDouble cosSqThPi = 1.0 - sinSqThPi; +GDouble cosSqThPi = cosTheta_pim * cosTheta_pim; GDouble cphiPi = cos(phi_pim); GDouble sphiPi = sin(phi_pim); @@ -408,9 +408,7 @@ TwoPiAngles_Delta_DoubleSDMEs::calcUserVars( GDouble** pKin, GDouble* userVars ) // vector meson production from K. Schilling et. al. GDouble Pgamma; - if(polFraction > 0.) { // for fitting with constant polarization - Pgamma = polFraction; - } + Pgamma = polFraction; // else{ // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ diff --git a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc index 8ee350cd5..fbf8b3d84 100755 --- a/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc +++ b/src/libraries/AMPTOOLS_AMPS/TwoPiAngles_Delta_factorized.cc @@ -225,10 +225,8 @@ TwoPiAngles_Delta_factorized::calcUserVars( GDouble** pKin, GDouble* userVars ) userVars[kBigPhi] = atan2(y.Dot(eps), beam.Vect().Unit().Dot(eps.Cross(y))); // vector meson production from K. Schilling et. al. - GDouble Pgamma; - if(polFraction > 0.) { // for fitting with constant polarization - Pgamma = polFraction; - } + GDouble Pgamma; // for fitting with constant polarization + Pgamma = polFraction; // else{ // int bin = polFrac_vs_E->GetXaxis()->FindBin(pKin[0][0]); // if (bin == 0 || bin > polFrac_vs_E->GetXaxis()->GetNbins()){ diff --git a/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc b/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc index cc5536192..76bb35a94 100755 --- a/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc +++ b/src/programs/AmplitudeAnalysis/twopidelta_plotter/twopidelta_plotter.cc @@ -783,8 +783,27 @@ outfile << "r10_3m1_2_single" << "\t" << r10_3m1_2_single_value << "\t" << r10_3 double rt10_3m1_0_minus_rt10_3m1_1_error = sqrt(results.parError("rt10_3m1_0")*results.parError("rt10_3m1_0") + results.parError("rt10_3m1_1")*results.parError("rt10_3m1_1") - 2*results.covariance("rt10_3m1_0","rt10_3m1_1")); outfile << "rt10_3m1_0_minus_rt10_3m1_1" << "\t" << rt10_3m1_0_minus_rt10_3m1_1_value << "\t" << rt10_3m1_0_minus_rt10_3m1_1_error << "\n"; + double rt1m1_31_0_plus_rt1m1_31_1_value = results.parValue("rt1m1_31_0") + results.parValue("rt1m1_31_1"); + double rt1m1_31_0_plus_rt1m1_31_1_error = sqrt(results.parError("rt1m1_31_0")*results.parError("rt1m1_31_0") + results.parError("rt1m1_31_1")*results.parError("rt1m1_31_1") + 2*results.covariance("rt1m1_31_0","rt1m1_31_1")); + outfile << "rt1m1_31_0_plus_rt1m1_31_1" << "\t" << rt1m1_31_0_plus_rt1m1_31_1_value << "\t" << rt1m1_31_0_plus_rt1m1_31_1_error << "\n"; + + double rt1m1_31_0_minus_rt1m1_31_1_value = results.parValue("rt1m1_31_0") - results.parValue("rt1m1_31_1"); + double rt1m1_31_0_minus_rt1m1_31_1_error = sqrt(results.parError("rt1m1_31_0")*results.parError("rt1m1_31_0") + results.parError("rt1m1_31_1")*results.parError("rt1m1_31_1") - 2*results.covariance("rt1m1_31_0","rt1m1_31_1")); + outfile << "rt1m1_31_0_minus_rt1m1_31_1" << "\t" << rt1m1_31_0_minus_rt1m1_31_1_value << "\t" << rt1m1_31_0_minus_rt1m1_31_1_error << "\n"; + + double rt1m1_3m1_0_plus_rt1m1_3m1_1_value = results.parValue("rt1m1_3m1_0") + results.parValue("rt1m1_3m1_1"); + double rt1m1_3m1_0_plus_rt1m1_3m1_1_error = sqrt(results.parError("rt1m1_3m1_0")*results.parError("rt1m1_3m1_0") + results.parError("rt1m1_3m1_1")*results.parError("rt1m1_3m1_1") + 2*results.covariance("rt1m1_3m1_0","rt1m1_3m1_1")); + outfile << "rt1m1_3m1_0_plus_rt1m1_3m1_1" << "\t" << rt1m1_3m1_0_plus_rt1m1_3m1_1_value << "\t" << rt1m1_3m1_0_plus_rt1m1_3m1_1_error << "\n"; + + double rt1m1_3m1_0_minus_rt1m1_3m1_1_value = results.parValue("rt1m1_3m1_0") - results.parValue("rt1m1_3m1_1"); + double rt1m1_3m1_0_minus_rt1m1_3m1_1_error = sqrt(results.parError("rt1m1_3m1_0")*results.parError("rt1m1_3m1_0") + results.parError("rt1m1_3m1_1")*results.parError("rt1m1_3m1_1") - 2*results.covariance("rt1m1_3m1_0","rt1m1_3m1_1")); + outfile << "rt1m1_3m1_0_minus_rt1m1_3m1_1" << "\t" << rt1m1_3m1_0_minus_rt1m1_3m1_1_value << "\t" << rt1m1_3m1_0_minus_rt1m1_3m1_1_error << "\n"; + + + + // covariance matrix From 8aae1497c922fd7d90b532a146590542bf09b7e8 Mon Sep 17 00:00:00 2001 From: Niklas Herrmann Date: Mon, 13 Jul 2026 08:07:22 -0400 Subject: [PATCH 5/5] Trigger CI