<commit_before>#include "Scatter.h"

#include "minimization.h"
#include "DMNscattering.h"
#include "Kinematics.h"
#include "Random.h"
#include "constants.h"
#include "decay.h"

#include <cmath>
#include <iostream>
#include <algorithm>
#include <fstream>

const double mp = MASS_PROTON;
const double mn = MASS_NEUTRON;
const double Mdelta = MASS_DELTA;
const double convmcm = 100.0;
const double tol_abs=1e-20;
const double tol_frac=1e-10;
const double Delta_to_pi0 = 2.0/3.0;

using std::cout;
using std::endl;
using namespace std::placeholders;
using std::string; using std::vector;
using std::shared_ptr;
using std::list;

//This may eventually get moved into Parameter.
const string form_factor_filename = "data/delta_production_form_factor.dat";

double Pion_Inelastic::Ermax(double E, double mx, double MN){
    return ((E + MN)*sqrt(pow(pow(Mdelta,2) + 2*E*MN + pow(MN,2),2)/(2*E*MN + pow(MN,2) + pow(mx,2)))*sqrt(pow(2*E*MN + pow(MN,2) + pow(mx,2),2)) + 
     sqrt((E - mx)*(E + mx))*sqrt((2*E*MN + pow(MN,2) + pow(mx,2))*(2*E*MN + pow(MN,2) + Mdelta*(-Mdelta + 2*mx))*(2*E*MN + pow(MN,2) - Mdelta*(Mdelta + 2*mx))))/
   (2.*(E + MN)*sqrt((2*E*MN + pow(MN,2) + pow(mx,2))/pow(E + MN,2))*sqrt(pow(2*E*MN + pow(MN,2) + pow(mx,2),2)));
}

double Pion_Inelastic::Ermin(double E, double mx, double MN){
    return ((E + MN)*sqrt(pow(pow(Mdelta,2) + 2*E*MN + pow(MN,2),2)/(2*E*MN + pow(MN,2) + pow(mx,2)))*sqrt(pow(2*E*MN + pow(MN,2) + pow(mx,2),2)) - 
     sqrt((E - mx)*(E + mx))*sqrt((2*E*MN + pow(MN,2) + pow(mx,2))*(2*E*MN + pow(MN,2) + Mdelta*(-Mdelta + 2*mx))*(2*E*MN + pow(MN,2) - Mdelta*(Mdelta + 2*mx))))/
   (2.*(E + MN)*sqrt((2*E*MN + pow(MN,2) + pow(mx,2))/pow(E + MN,2))*sqrt(pow(2*E*MN + pow(MN,2) + pow(mx,2),2)));<commit_msg>Testing with parameter files<commit_after>#include "Scatter.h"

#include "minimization.h"
#include "DMNscattering.h"
#include "Kinematics.h"
#include "Random.h"
#include "constants.h"
#include "decay.h"

#include <cmath>
#include <iostream>
#include <algorithm>
#include <fstream>

const double mp = MASS_PROTON;
const double mn = MASS_NEUTRON;
const double Mdelta = MASS_DELTA;
const double convmcm = 100.0;
const double tol_abs=1e-20;
const double tol_frac=1e-10;
const double Delta_to_pi0 = 2.0/3.0;

using std::cout;
using std::endl;
using namespace std::placeholders;
using std::string; using std::vector;
using std::shared_ptr;
using std::list;

//This may eventually get moved into Parameter.
const string form_factor_filename = "Source/data/delta_production_form_factor.dat";

double Pion_Inelastic::Ermax(double E, double mx, double MN){
    return ((E + MN)*sqrt(pow(pow(Mdelta,2) + 2*E*MN + pow(MN,2),2)/(2*E*MN + pow(MN,2) + pow(mx,2)))*sqrt(pow(2*E*MN + pow(MN,2) + pow(mx,2),2)) + 
     sqrt((E - mx)*(E + mx))*sqrt((2*E*MN + pow(MN,2) + pow(mx,2))*(2*E*MN + pow(MN,2) + Mdelta*(-Mdelta + 2*mx))*(2*E*MN + pow(MN,2) - Mdelta*(Mdelta + 2*mx))))/
   (2.*(E + MN)*sqrt((2*E*MN + pow(MN,2) + pow(mx,2))/pow(E + MN,2))*sqrt(pow(2*E*MN + pow(MN,2) + pow(mx,2),2)));
}

double Pion_Inelastic::Ermin(double E, double mx, double MN){
    return ((E + MN)*sqrt(pow(pow(Mdelta,2) + 2*E*MN + pow(MN,2),2)/(2*E*MN + pow(MN,2) + pow(mx,2)))*sqrt(pow(2*E*MN + pow(MN,2) + pow(mx,2),2)) - 
     sqrt((E - mx)*(E + mx))*sqrt((2*E*MN + pow(MN,2) + pow(mx,2))*(2*E*MN + pow(MN,2) + Mdelta*(-Mdelta + 2*mx))*(2*E*MN + pow(MN,2) - Mdelta*(Mdelta + 2*mx))))/
   (2.*(E + MN)*sqrt((2*E*MN + pow(MN,2) + pow(mx,2))/pow(E + MN,2))*sqrt(pow(2*E*MN + pow(MN,2) + pow(mx,2),2)));
{'fraction_non_alphanumeric': 0.234036488027366, 'fraction_numerical': 0.04161915621436716, 'mean_word_length': 5.633270321361058, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2986468', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1555, 'n_words': 286}