From c087fd4d0bcffd002f4c17750d121d1be16d9223 Mon Sep 17 00:00:00 2001 From: Love_Preet Date: Mon, 28 Oct 2024 14:10:42 -0600 Subject: [PATCH] Made Changes to the README, src/main.cxx, and included the Test_EIC.json, test sample files --- .gitignore | 3 +- HEPMC3_Converter.C | 265 --- README.md | 44 +- Test_EIC.json | 41 + bill_notes | 85 - json_examples/Config.json | 48 - json_examples/Config_EIC.json.original | 53 - json_examples/README | 7 - reference_output/eic_DEMPgen_EIC_test.root | Bin 0 -> 17989 bytes reference_output/eic_DEMPgen_EIC_test.txt | 45 + .../eic_input_DEMPgen_EIC_test.dat | 659 +++++++ reference_output/reference_README.md | 9 + shell_script_archive/batch_runEIC.sh | 40 - shell_script_archive/batch_runEIC_10on100.sh | 39 - shell_script_archive/batch_runEIC_5on100.sh | 39 - shell_script_archive/batch_runEIC_5on41.sh | 39 - shell_script_archive/run_EIC_batch.csh | 24 - .../run_EIC_batch_10on100.csh | 26 - shell_script_archive/run_EIC_batch_5on100.csh | 26 - shell_script_archive/run_EIC_batch_5on41.csh | 26 - sjdkay_notes | 35 - src/eic_evgen/archived_routines/KPlus_prod.cc | 1097 ----------- .../archived_routines/PiPlus_prod.cc | 1285 ------------- .../archived_routines/PiPlus_prod.cc.SolveFn | 1285 ------------- src/eic_evgen/archived_routines/legacy.h | 21 - .../archived_routines/legacy_function.cc | 1513 --------------- .../archived_routines/legacy_function.h | 21 - src/main.cxx | 1649 +++++++++-------- 28 files changed, 1625 insertions(+), 6799 deletions(-) delete mode 100755 HEPMC3_Converter.C create mode 100644 Test_EIC.json delete mode 100644 bill_notes delete mode 100644 json_examples/Config.json delete mode 100644 json_examples/Config_EIC.json.original delete mode 100644 json_examples/README create mode 100644 reference_output/eic_DEMPgen_EIC_test.root create mode 100644 reference_output/eic_DEMPgen_EIC_test.txt create mode 100644 reference_output/eic_input_DEMPgen_EIC_test.dat create mode 100644 reference_output/reference_README.md delete mode 100755 shell_script_archive/batch_runEIC.sh delete mode 100755 shell_script_archive/batch_runEIC_10on100.sh delete mode 100755 shell_script_archive/batch_runEIC_5on100.sh delete mode 100755 shell_script_archive/batch_runEIC_5on41.sh delete mode 100755 shell_script_archive/run_EIC_batch.csh delete mode 100755 shell_script_archive/run_EIC_batch_10on100.csh delete mode 100755 shell_script_archive/run_EIC_batch_5on100.csh delete mode 100755 shell_script_archive/run_EIC_batch_5on41.csh delete mode 100644 sjdkay_notes delete mode 100644 src/eic_evgen/archived_routines/KPlus_prod.cc delete mode 100644 src/eic_evgen/archived_routines/PiPlus_prod.cc delete mode 100644 src/eic_evgen/archived_routines/PiPlus_prod.cc.SolveFn delete mode 100644 src/eic_evgen/archived_routines/legacy.h delete mode 100644 src/eic_evgen/archived_routines/legacy_function.cc delete mode 100644 src/eic_evgen/archived_routines/legacy_function.h diff --git a/.gitignore b/.gitignore index 3cdaf75..76cee4a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ data/RootFiles/ data/LundFiles data/OutputFiles data/OutputFiles/ -*.root *.lund build/ *_job.txt @@ -11,4 +10,4 @@ Config_EIC_* sjdkay_job.txt *#* .cc* -.h* \ No newline at end of file +.h* diff --git a/HEPMC3_Converter.C b/HEPMC3_Converter.C deleted file mode 100755 index 90b8835..0000000 --- a/HEPMC3_Converter.C +++ /dev/null @@ -1,265 +0,0 @@ -// Original file from Love Preet, University of Regina -// This file converts nEvents from an input HEPMC3 file (raw from DEMPGen or afterburned) into an output root tree. -// Modified on - 04/03/23 - by Stephen JD Kay University of Regina - -#define HEPMC3_Converter_cxx - -// Include relevant stuff -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// SJDK - 04/03/23 - Read in a few things as arguments -void HEPMC3_Converter(Long_t nEvents = -1, string InputHEPMC3File = "", string OutputRootFile = "", string FileType = ""){ - - // 04/04/23 - SJDK - Explicitly set batch mode so it doesn't spam stuff to screen - gROOT->SetBatch(kTRUE); - - // SJDK - 04/03/23 - Explicitly require 3 input arguments - if(nEvents == -1){ - cout << "Enter a the number of events to convert: "; - cin >> nEvents; - if( nEvents<=0 ) return; - } - - if(InputHEPMC3File == ""){ - cout << "Enter a HEPMC3 file to convert: "; - cin >> InputHEPMC3File; - } - - if(OutputRootFile == "") { - cout << "Enter a root file to write to: "; - cin >> OutputRootFile; - } - if(FileType == ""){ - cout << "File type not specified, enter raw or AB. Raw for DEMPGen output, AB for afterburned files." << endl << "Defaulting to raw." << endl; - FileType = "raw"; - } - else if (FileType != "raw" && FileType != "AB"){ - cout << "Invalid file type specified, enter only raw or AB. Defaulting to raw." << endl; - FileType = "raw"; - } - - Long_t nSkip; // SJDK - 04/04/23 - Number of lines to skip, depends upon file type - if (FileType == "raw"){ - nSkip = 2; - } - else if (FileType == "AB"){ - nSkip = 21; - } - - TString TInputHEPMC3File = InputHEPMC3File; - TString TOutputRootFile = OutputRootFile; - - if (gSystem->AccessPathName(TInputHEPMC3File) == kTRUE){ - cerr << "!!!!! ERROR !!!!! " << endl << TInputHEPMC3File << " not found" << endl << "!!!!! ERRROR !!!!!" << endl; - exit; - } - - fstream HEPMC3In; - HEPMC3In.open(TInputHEPMC3File, ios::in); - - //............................................................................................................................................. - // Stored the whole file in a vector - //............................................................................................................................................. - string s; - vector v; - Long_t nLines = 0; - Long_t nEvents_read = 0; - - for (Long_t i = 0; i nEvents_read){ - cerr << "!!!!! ERROR !!!!! " << endl << "Requested to process more events - ("<< nEvents << ") than are actually in the file - (" << nEvents_read << ")" << endl << "Double check and try again!" << endl << "!!!!! ERRROR !!!!!" << endl; - exit; - } - else if (nEvents != nEvents_read){ - cout << endl << "!!!!! NOTICE !!!!!" << endl << "Requested number of events to process is SMALLER than the number of events in the file, this is fine, but re-run if you want all events." << endl; - cout << "There are - " << nEvents_read << " in your input HEPMC3 file" << endl << "!!!!! NOTICE !!!!!" << endl << endl; - } - - //............................................................................................................................................. - // Getting the values from the vector - //............................................................................................................................................. - vector weight; - string w1,w2; // columns in the weight line - double w3,w4; // colums in the weight line - - vector e_px; - vector e_py; - vector e_pz; - vector e_E; - string l_e; // columns in the outgoing electron line - double id_e,vid_e,pdg_e,px_e,py_e,pz_e,en_e,m_e,s_e; // columns in the outgoing electron line - - vector k_px; - vector k_py; - vector k_pz; - vector k_E; - string l_k; // columns in the outgoing kaon line - double id_k,vid_k,pdg_k,px_k,py_k,pz_k,en_k,m_k,s_k; // columns in the outgoing kaon line - - vector l_px; - vector l_py; - vector l_pz; - vector l_E; - string l_l; // columns in the outgoing lambda line - double id_l,vid_l,pdg_l,px_l,py_l,pz_l,en_l,m_l,s_l; // columns in the outgoing lambda line - if(nEvents <= nEvents_read){ // Only process if less than or equal to the # events in the file - for(int i=0; i>w1>>w3>>w2>>w4; - weight.push_back(w4); - - } - - int o_e=(6+(i*9)); // Accessing the outgoing particle(i.e.electron) line from the whole file - - stringstream o_e_l; // Extract the doubles from the vector using stringstream (accessing the outgoing particle line for each event) - - - o_e_l << v[o_e]; // store the vector to string stream - - //cout << o_e_l.str() <>l_e>>id_e>>vid_e>>pdg_e>>px_e>>py_e>>pz_e>>en_e>>m_e>>s_e; - //cout<<" "<>l_k>>id_k>>vid_k>>pdg_k>>px_k>>py_k>>pz_k>>en_k>>m_k>>s_k; - k_px.push_back(px_k); - k_py.push_back(py_k); - k_pz.push_back(pz_k); - k_E.push_back(en_k); - } - //............................................................................................................................................. - int o_l=(8+(i*9)); // Accessing the outgoing particle(i.e.lambda) line from the whole file - - stringstream o_l_l; // Extract the doubles from the vector using stringstream (accessing the outgoing particle line for each event) - - o_l_l << v[o_l]; // store the vector to string stream - - while (! o_l_l.eof()) { - - o_l_l >>l_l>>id_l>>vid_l>>pdg_l>>px_l>>py_l>>pz_l>>en_l>>m_l>>s_l; - l_px.push_back(px_l); - l_py.push_back(py_l); - l_pz.push_back(pz_l); - l_E.push_back(en_l); - } - }//-> End of for loop over the events - - //............................................................................................................................................. - // Storing the weights in Root TTree - //............................................................................................................................................. - - double w_gp,e_px_gp,e_py_gp,e_pz_gp,e_E_gp; - double k_px_gp,k_py_gp,k_pz_gp,k_E_gp; - double l_px_gp,l_py_gp,l_pz_gp,l_E_gp; - - TFile *OutputFile = new TFile(TOutputRootFile,"RECREATE"); - - TTree *tree = new TTree("Truth_Events","Truth_Events"); - - tree->Branch("w_gp", &w_gp); // weights of generated particles - - tree->Branch("e_px_gp", &e_px_gp); // momentum of generated particles (i.e. electrons) - tree->Branch("e_py_gp", &e_py_gp); - tree->Branch("e_pz_gp", &e_pz_gp); - tree->Branch("e_E_gp", &e_E_gp); - - tree->Branch("k_px_gp", &k_px_gp); // momentum of generated particles (i.e. kaons) - tree->Branch("k_py_gp", &k_py_gp); - tree->Branch("k_pz_gp", &k_pz_gp); - tree->Branch("k_E_gp", &k_E_gp); - - tree->Branch("l_px_gp", &l_px_gp); // momentum of generated particles (i.e. lambdas) - tree->Branch("l_py_gp", &l_py_gp); - tree->Branch("l_pz_gp", &l_pz_gp); - tree->Branch("l_E_gp", &l_E_gp); - - - for (int j=0; jFill(); - } - - //OutputFile->Print(); // 04/04/23 - Don't print to screen to prevent spam when running - OutputFile->Write(); - OutputFile->Close(); - - cout << "Created output root file - " << TOutputRootFile << " - sucessfully." < Main void End diff --git a/README.md b/README.md index 041c2c0..d4eb092 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,49 @@ The jobs the script creates and submits all execute the Process_EIC.csh script d ### json_examples -- There were several .json files clogging up the main directory, many of these were very outdated. As such, I've moved them all to a subfolder - +- There were several .json files clogging up the main directory, many of these were very outdated. These outdated files are now in a subfolder - - json_examples - This folder has .json config files for a variety of different conditions. - Due to several of them being quite outdated, the Config_EIC.json file in the main (the directory of this README) directory should be consulted to see the options that are actually available. + +## File/Directory Structure + +The files within the top level directory and the directory structure of the generator are outlined below. Note that files within subdirectories are not outlined in full. Please refer to comments within each source/header files and README files within subdirectories (where applicable) for details on individual files within subdirectories. + +### Top Level Directory Files + +- [Batch_Submission_EIC.sh](Batch_Submission_EIC.sh) - Shell script to generate and submit EIC event generation jobs to a local batch queueing system. See file comments and description above for details on usage. +- [JLab_Batch_Submission.sh](JLab_Batch_Submission.sh) - Shell script to generate and submit EIC event generation jobs to the JLab farm batch queueing system. See file comments and description above for details on usage. +- [Process_EIC.csh](Process_EIC.csh) - .csh script that creates a `.json` config file based upon inputs and runs DEMPgen with produced configuration file. See file comments and description above for details on usage. +- [Process_EIC_iFarm.csh](Process_EIC_iFarm.csh) - .csh script that creates a `.json` config file based upon inputs and runs DEMPgen with produced configuration file. This version is configured for use on the JLab iFarm system. See file comments and description above for details on usage. +- [Config_EIC.json](Config_EIC.json) - An example `.json` config file for EIC event generation. Used by shell scripts above. See comments within file for details on flags. +- [Config_SoLID.json](Config_SoLID.json) - An example `.json` config file for SoLID event generation. See comments within file for details on flags. +- [CMakeLists.txt](CMakeLists.txt)- CMakeLists.txt file. +- [LICENSE](LICENSE) - Copyright and license information. +- [EvGenFlowChart.xml](EvGenFlowChart.xml) - Event generation flow chart. +- [Test_EIC.json](Test_EIC.json) - `.json` file with all configuration options to gereate a test EIC event sample. See `reference_README.md` within the `reference_output` directory for details. +- [README.md](README.md) - The README file. + +### Directory Structure + +- [data/](data/) - Stores output files from DEMPgen. + - [data/input/](data/input) - Contains input cross-section files. +- [debug/](debug) - Contains debug files for the SoLID module. +- [include/](include) - Contains header files for the SoLID module and the following subdirectory: + - [json/](include/json/) - Contains `.json` files associated with the header files for the SoLID module. +- [src/](src/) - Contains source files for DEMPgen and the following subdirectories: + - [eic_evgen/](src/eic_evgen/) - Contains source files, header files, and pion cross-section parameterization files for the EIC module. Also contains the following subdirectories: + - [CrossSection_Params/](src/eic_evgen/CrossSection_Params/) - Contains kaon cross-section parameterization files for the EIC module. + - [process_routine/](src/eic_evgen/process_routine/) - Contains the main DEMPgen processing routine. +- [Dec2023_ePIC_Simulation_Campaign/](Dec2023_ePIC_Simulation_Campaign/) - Contain information about the files submitted to the ePIC simulation campaign in December 2023 respectively, see documentation within directory for more details. +- [Jul2024_ePIC_Simulation_Campaign/](Jul2024_ePIC_Simulation_Campaign/) - Contain information about the files submitted to the ePIC simulation campaign in July 2024, see documentation within directory for more details. +- [reference_output/](reference_output/) - Contains test sample files and the instructions on how to reproduce them, as detailed in the `reference_README.md` file within this directory. + +### Instructions for Comprehensive Test Run + +Instructions for a comprehensive test run, and a reference file to compare to (using for example, diff) are included in - + +- [reference_output/reference_README.md](reference_output/reference_README.md) + +## License +DEMPgen is licensed under the GNU General Public License v3.0. \ No newline at end of file diff --git a/Test_EIC.json b/Test_EIC.json new file mode 100644 index 0000000..ea9494d --- /dev/null +++ b/Test_EIC.json @@ -0,0 +1,41 @@ +// SJDK - 09/02/22 - University of Regina + +// !!!!! PLEASE READ THE COMMENTS BELOW !!!!! +// This is a template config file for running DEMPGen for EIC events, consult this file for the availble options +// DO NOT EDIT THIS FILE - It is used by the two shell scripts in this folder to automatically create a new config file with the conditions you want +// Either copy this file to a new name and edit it as you want OR just execute the shell scripts +// !!!!! PLEASE READ THE COMMENTS ABOVE !!!!! + +{ + // This is an exmaple Json configuration file that will accept + // parameters for both EIC and Solid simulation. + //Config + // All values should use units of MeV for energies and momenta, + // and degrees for angles. + // n_events indicates number of attempts + // "experiment" : "eic" or "solid" + "experiment" : "eic", + + "file_name" : "DEMPgen_EIC_test", + "n_events" : 100000, + "generator_seed": 24432, + + //************************************** + /// This section if for EIC simulation only + "Kinematics_type" : 1, // Kinematics type (1->FF, 2->TSSA) + "ROOTOut": "true", // Enable or disable root file output, true or false + "ejectile": "Pion+", // Choices: omega, pi+, pi0, K+ + "recoil_hadron": "neutron", // Choices: Neutron, proton, Lambda or Sigma0 + "ebeam": 5, // Electron beam energy in GeV + "hbeam": 100, // Hadron beam energy in GeV + "hbeam_part":"Proton", // Hadron beam particle, proton, deut or helium3, work in progress, will need to be added to shell script later on as an argument + "OutputType": "HEPMC3", // choices: LUND (Docker), Pythia6 (ECCE Fun4All) or HEPMC3 (ePIC) + "det_location": "ip6", // choices: ip6 for STAR, ip8 for PHENIX + "calc_method": "Analytical", // choices: Analytical or Solve, affects how the ejectile/recoil hadron 4-vectors are calculated. Default is analytical + "Ee_Low": 0.5, // The minimum scattered electron energy that will be generated as a fraction of the electron beam energy + "Ee_High": 2.5, // The maximum scattered electron energy that will be generated as a fraction of the electron beam energy + "e_Theta_Low": 60.0, // The minimum scattered electron angle (theta) that will be generated in degrees + "e_Theta_High": 175.0, // The maximum scattered electron angle (theta) that will be generated in degrees + "EjectileX_Theta_Low": 0.0, // The minimum ejectile angle (theta) that will be generated in degrees + "EjectileX_Theta_High": 100.0, // The maximum ejectile angle (theta) that will be generated in degrees +} diff --git a/bill_notes b/bill_notes deleted file mode 100644 index 9cc2748..0000000 --- a/bill_notes +++ /dev/null @@ -1,85 +0,0 @@ -Note Feb 24th, 2020: - -Work on eic_evgen - -1. Initiating process for massive input parameters are separated into a different eic_pim.cc. Global parameters are now decleared in the eic_pim.h and defined in eic_pim.cc. - -2. eic.cc are not made into a function can be called, my the main.cc. - -3. tssa_sigL_Para.h and tssa_sigT_Para.h are not merged into tssa_sig_Para.h, the headers properly declared in the header files and functions are defined in tssa_sig_Para.cc. - - -/*--------------------------------------------------*/ -Note Feb 25, 2020: - -1. eic_evgen is included as part of the DEMP_EvGen - - -/*--------------------------------------------------*/ -Note Mar 5, 2020: - -1. Generator name change DEMP_EvGen to DEMPgen -2. Main function in eiv_evgen is modified to accept Config.json file - - -/*--------------------------------------------------*/ -Note Mar 30, 2020: - - -1. Coding structure changes: - -Old code: DEMP->EIC->PiPlus_production_routine - -New code: DEMP->EIC->Reaction_rountine->XXX_production_routine - -Note that at the Reaction_rountine, it takes care of determining which sub process is selected, and the particle type is now an option in the Json configuration file. - -The event loop is intentionally left at the each sub process level, since one may want to have a customized output or other actions at the end of the run (like as in the PiPlus case, Ahmed really wanted to know how many events at a certain Q2 or W cuts). - -2. Sub process subroutine dir added. - -Note that for all subroutines, the source files are stored under: - -DEMPgen/src/eic_evgen/process_routine/ - -Note that we currently have Pi0_prod.cc, and PiPlus_prod.cc. The header file for the function is store in DEMPgen/src/eic_evgen/reaction_rountine.h. - -To create a new subroutine, one just have to declare the daughter class in reaction_rountine.h (with only process_reaction and customized Get_cross_section functions), add a if statement in the reaction_rountine.cc and create a new XXX_prod.cc file. - -3. The original PionPlus process routine (written by Ahmed) is now made to be generic. The code will determine which produced particle and which recoiled nucleon automatically. Ahmed's code are now converted to the Mother process routine, which other sub process routine can give borrow its structure and functions. - -I compared the functionality of new generic form of the code and old, and yes, they are exactly the same (with the same set of parameter, the numerical calculated results are 100% match ). However, the distribution are not 100% same due to how the random number generator is defined. If Stephen can further validate this would be fantastic. - -4. Using the particleType.h (under include/) and naming the produced particle. - -particleType.h is the particle data base used by GlueX analysis software, which has large data base of particle mass. The new code now uses the same naming convention as the GlueX. - -In terms of the particle naming in the Json file, it is extremely flexible. As an example: pi+, Pi+, piplus, PiPlus, Piplus, are all acceptable form of pi+. Same goes for all other changed particles such as k+, etc. pi, pi0, Pi0, PI0, Pion0, are all acceptable form of pi0. The code will standardize the names and get the particle mass from the library. - - - -5. In terms of performance compared to the old code, the new code run quite a bit faster see performance comparison - ----------------------------------------- - -New code test: -Time : Real time 0:03:50, CP time 230.730 -Event: 100000000 -Recorded events: 1768 -Memory used: 0.2G - ---------------------------------------- - -Org code test: -Time : Real time 0:05:45, CP time 344.940 -Event: 100000000 -Recorded events: 1708 -Memory used: 0.1G - ----------------------------------------- - -6: Random generator is now initiallied during the sub process routine initialiation, in the reaction class. - -7. Now, the recoil nucleon and produced particle X will assigned with the PDG type ID automatically when outputing the LUND files. - - diff --git a/json_examples/Config.json b/json_examples/Config.json deleted file mode 100644 index f468615..0000000 --- a/json_examples/Config.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - // This is an exmaple Json configuration file that will accept - // parameters for both EIC and Solid simulation. - //Config - // All values should use units of MeV for energies and momenta, - // and degrees for angles. - // n_events indicates number of attempts - // "experiment" : "eic" or "solid" -// "experiment" : "solid", -// "output_file" : "RootFiles/Test.root", - - "experiment" : "eic", - - "file_name" : "example_output", - "n_events" : 1000000, - "generator_seed": 1234567, - - //************************************** - /// This section if for EIC simulation only - "Targ_dir" : 1, // Target Direction (1->Up, 2->Down) - "Kinematics_type" : 1, // Kinematics type (1->FF, 2->TSSA) - - //************************************** - /// This section is Solid only - - "beam_energy": 11000, - "targ_pol_x": 0, - "targ_pol_y": 0, - "targ_pol_z": 0, - "scat_elec_Emin": 1100.0, - "scat_elec_Emax": 9900.0, - "scat_elec_thetamin": 5.0, - "scat_elec_thetamax": 27.0, - "prod_pion_thetamin": 5.0, - "prod_pion_thetamax": 20.0, - "multiple_scattering": false, - "ionisation": false, - "bremsstrahlung": false, - "final_state_interaction": false, - "fermi_momentum": false, - "weight_cut": true, - "w_cut": true, - "w_min": 2, - "Qsq_cut": true, - "Qsq_min": 4, - "t_cut": true, - "t_min": -1.2 -} diff --git a/json_examples/Config_EIC.json.original b/json_examples/Config_EIC.json.original deleted file mode 100644 index 548c956..0000000 --- a/json_examples/Config_EIC.json.original +++ /dev/null @@ -1,53 +0,0 @@ -{ - // This is an exmaple Json configuration file that will accept - // parameters for both EIC and Solid simulation. - //Config - // All values should use units of MeV for energies and momenta, - // and degrees for angles. - // n_events indicates number of attempts - // "experiment" : "eic" or "solid" - // "experiment" : "solid", - "experiment" : "eic", - - "file_name" : "DEMPGen_PionPlus_org", -// "file_name" : "DEMPGen_PionPlus_test", - "n_events" : 100000000, - "output_file" : "RootFiles/Test.root", - "generator_seed": 1234567, - - //************************************** - /// This section if for EIC simulation only - "Targ_dir" : 1, // Target Direction (1->Up, 2->Down) - "Kinematics_type" : 1, // Kinematics type (1->FF, 2->TSSA) - // "particle": "omega", // Choices: omega, pi+, pi0 - //"particle": "omega", // Choices: omega, pi+, pi0 - "particle": "Pion+", // Choices: omega, pi+, pi0 - //"particle": "Pi0", // Choices: omega, pi+, pi0 - //"particle": "Pi0", // Choices: omega, pi+, pi0 - - //************************************** - /// This section is Solid only - - "beam_energy": 11000, - "targ_pol_x": 0, - "targ_pol_y": 0, - "targ_pol_z": 0, - "scat_elec_Emin": 1100.0, - "scat_elec_Emax": 9900.0, - "scat_elec_thetamin": 5.0, - "scat_elec_thetamax": 27.0, - "prod_pion_thetamin": 5.0, - "prod_pion_thetamax": 20.0, - "multiple_scattering": false, - "ionization": false, - "bremsstrahlung": false, - "final_state_interaction": false, - "fermi_momentum": false, - "weight_cut": true, - "w_cut": true, - "w_min": 2, - "Qsq_cut": true, - "Qsq_min": 5, - "t_cut": true, - "t_min": -0.5 -} diff --git a/json_examples/README b/json_examples/README deleted file mode 100644 index 4ee2a26..0000000 --- a/json_examples/README +++ /dev/null @@ -1,7 +0,0 @@ -SJDK - 09/02/22 - University of Regina - -This folder contains some example .json files that feed into DEMPGen to run it. - -Some of these are quite outdated, double check they have the relevant arguments for what you want to try and do. - -In the main directory, there is a active .json file for EIC files. Consult this if you want to see what is should look like. \ No newline at end of file diff --git a/reference_output/eic_DEMPgen_EIC_test.root b/reference_output/eic_DEMPgen_EIC_test.root new file mode 100644 index 0000000000000000000000000000000000000000..3ede2e849a0bfd29aebc55b979d3ae53c4daa6e0 GIT binary patch literal 17989 zcmbun2UHZx_V7DIC1;VGB}tNuK$Q|CNKS*OfFuFQSph*oL?xplAX#!01Vo?*6a9>F!;-e!Xkg?p?UMxOk#a+pkb4lr;*as)9nP zY+~C6*n)#C?)cab8x%^S1cjnfLg7&C5(K`!PqkJU^63L!Wc?cU+yAYj81?ssysIZd zQR;tR8GAPrioj6S{(%jzu!xSAr>mFeUw?Rr*w|Z{E30Vf+SxdptEelPd)jz-3cLR$ z=l}K(Q3QY830tsYqh4T(JGT6NM{HMk{=d3`n}D~BLgA|YeZDUC%)bvD>VGw?&lz5~ z^l-HCBvJ9UarQK^vA4VLN%(i$1BHh|1^o59^Vp(}y+{HIY;;|kYf_H^dK4)w6XNl} z-qJxo!_*t3tra|)l>QEyoopsgI&i=}hF6cgbvpr6zM+==FcEN3L?qqfs0a6H^NZKk z&LFX1u!Kb_C6MGQ5anfB0WWgZ*62Qa1Bvgt3VsF7z$XE>vD2auv_0%r{&;>8v{_H8 z?>|li9jCMxQi`@g^mmaHMs@&_QG}DzAVrn=p_(e-9h-#@Dm7bQ@;Fl#|u1I zc!mN*Jpi&wYRl8EgQn!BL$>C%ccWXQZ25t%s%{BEQq5GDkGsV7rU{*0f1H)UU%%!0_lRoOQw zmV=!jAVG#DL}CZr)wvQ?6dMI7{%*X=(ZmX zEZy>dF3N;JirxDXU#B}e^@ecqb&z=mf5kfi;shZI7&8VTtK7(|e+uMHyTzW(xPq+V&=t$z3m`@N_G~jD8o0#Xs_d`L12KkiqRnfUffAE= zN~Gu)@Wga6&Am<&`0x8TI>_n+hBxIC#!rWU_Vow1lPFz4iE68E^zSFY0>d~Kzd{F= zg4f}x3^kCCOEb0ciU96cti8q+qd>Q~RcjDGmP6b(|Hh^Ezi33^<^QYoKU@-dSXp|S z+nBrh{u7mNP{@fH*CJ+q6FD8U{8D^l2`oJ9BWNqS1WCD>1Y9-NzyOIzk$?F|NJ!H_ z9e2Wy9C+$Dnh1^|E5n*@hAAExlr`Tny#fkSyP>Xk_1=dlicpg6wGFVP{>%d(M-_v! z8pKh%{sf#{d3qLhK^N)68}?J4q{C3Z{n9a`P6}okBgjv};z4)0pLL#h4{}x(6Pl^+ z4C*yiTSrD5A+Dx>I!OW}awguWOgixt;}a)(6@$h6$iBhe)pB!ff0g0p5G^yQ_Jej&dK zX4?xs`sE8j@{2T${q^2p@5655?>FLL^iuA1zm5px?2kGACr2}gf3dz^EB8Gll)H_G zmJr3Do&%?6aS0g0psvq-tT!PciIQ_>#BI#^%=GD-`a}>1njslweqidR8Oi5ojTrn( zZWMYsZQ$@L?Sq3EHw=O2wW0*Ed5A||{tO8h!Qfi;t$drMM>Z_TFFmdB0bAEf3a&&Z zBAb1dUt+7|A=NpDmwqo(kpo|QhMkX2VD?ffe=oZuvXh^IwzwgQ!6CEem<@XY&aTzt z>L|X0lpoxvGlOX`q)KUVx1?~91KY$NbCpVDZ#VMJA)6c6t8DdKb_j>K8U9NIk1iuW zU*_2cfb@T&k`VqQm45$)%FRYOb3P|CWYa8C;O9doNO1gGp1DL25*Q!EMubPf^J90Y zOm{9~&TY)472pqnjW3Fdt@lHblXqITxG5z-r*p(c=g9%GyStS9?Z*yS54_$rOPB@r z<-*>4w`B$m77|WAv~{3MBxL5?a|&>_vu5bN!-#As7%tN&20|hNH2z`6Z*cbeUJChD zH!z6e`BQKtgPduf#a=&qg6z@f2z7;aLi~k#zaqSMVC3Gqcaf?P*!B6Y`RSMuIXNbJ zUousWoP;!}d=vA>;QLKfaYjfYr?T(YXgylNcCd$K179$5G{4XwlfeFqOXMa>;*DW?b98^bOKQqD|S$<&oQ`WgE?+2 zn&2d~W`{M>9h`YdxZPfjfT*cGrms;=VDkt+{zb()q}u!-@tW*5m=D;0t-_{@>{KVx zJ2?JEnvKGlq}Lt5{KgpjVip2cVke*Vpi;pP_eVl2OMPJ6o6*TZ%^ggOA8kmIts^Ib zO?B>24Xl=utovDCL^d_q#M-ocz=_^(q9OGHuyE1q4+p;ySiejbS`*U(4v@FB;dyGv zfn}ZNBXJMphHQ}&oKBCxra=R+Q_a&>ANalWw7T=kuq-k64^>U(C9u40u!7! zQ26_?7`y{PuZC}2|3u~a-hZU>;XhM}p;~!-a%@P%GPgGHmO?Pzxv0QJoXVPzPl$^){AZNaD;&8g3(wn@ z47K%@L3K+x40UrVWpbzlh9a(RX``D3L*;+vsE*J! zCHD?6)Uxdt%wh>K)RMGD^|G$mI){6suL?shAl07q_$P)Mu8;zzeGD1re&}>K8HT#i z)xTqJ8bfs_zC{!N4u(nzKeM5e5JRK#46 z%8eIWI;RE*$?1?&w6H~ErG+HoCk+6&s*7pfCD zKE3W5-qx?;w;`12Y8Co}vvN~OB9Ya zL*le^NY}r{aK+h|{A+>zKUfx-Te4eMHJ@Kw zB1}x#3~Xt(Z!3vX>>3<0_#)04{i^N{#+O8??olq2^+e%TMG@Kdx}VDLPv=e3uAK%1 z;11ti`w$n&p4-gLM#K&GSPVLeBG}EIvXn54MSFPn+7a%3?5s{*8Too$Jn4&bvA`=+ z-Gd-~b2h^8h|Zh~ok4d=v}N&#qW2@Vr=H+OFApBI5s9f;7mU~y;}3Y!x`@`ryzAA~ z;?3$T;#IVkPop3V*C-&6tdU9p4z(o%mX3G_vi5FbV>>2z!DS(q56)fF?_EwbaFV&r zo$P!HtTG8lDQ;ch*X;3pVr&5?-wKQ#6Jf2qa?JZw#ikg)&Y3~|N-h8Xn-Yq% zb6tJAD_9QW|Bb_&|BFMi?f>NPoQ;Ex)qn9L<5A!=!?8Nakq@k=J?sy@6^x8~9u@-nl ztd6Xw<|rTRj)0?%v9U5Wd(iaoD1~Fi7MXf|w~oalAGE%Gxv9T$h%AfM-?-n>f(#1{ zaMI;OAbTD?WzHezK}UehDpWMe^B6UyAdpytc8a<1!wfl(#3beOe_-+-y+|yROT+$tmMxxO#a{B{ zzyQ0(DUlShH~NVjyFH^JrPjinTYqOkbp95^Pip$9I`tDlG8&VnCT764wP`vzk2f+l z7N(zPDi4klEBS)RKO%FZxb^O?k;t0LlPiJ5M94hv0E3vfKA5WHI6S*^9XUGjN$)$j z4z`NJ%yVA;#1KAonXP>xgKX&>8{d<216~>E1usbvu$dz!o|M=NCR2x)aBhzw2P)Eo z*M-}V`bwqBaq{=bs^D9znMNhBcQ?GhQBWN${j$uh`04|WsP9N`cu0Z0%irSw(GO%S z{T$?THv`l05q$I8fnaklz=2F?6XJZ3QkVMV1NIfU8HP88;CW#RcEL?PyL7kJha?bWM*g2D>7;lzDR>LHQK+sEMJsPySUFX4|8kOATzV;$>B=Qsr z8~a$lMTh4G1jt^}R9-PYG1w}tV(%on4Q48B*Pee|L1v9NO?YrOk-b-mhRczpV8HT$ z)lFVWP|s&~p7{eVGB!NNT5^sIoNh2-S9%@D&k=l zyHnbITK|HK%}P!hsvIJ7XyNk5n_ggNvxQqh{S0h{ePbn4aYSacp54e7PDYkI%OzQv z*TJ?Ioq^99KC&w3$S65|39NoR{;6F25&Rxj=jfGAH>JpH^buwH~? zP%GAe?4BsQ8m3(Ved|0Ii38WbxIVu9(U31hIfL~H_b>m%Bn|UFF!_%@WIPH|u&8#Z zP_ckh|J^&r{V|YIthVcp-6)hT)|%i+A%z^=m-uD1uR)H?WNPMp7I66Ot~ObE5IAu4 z(U|+=W##!dTksew5hrErJ@Z| z4IK*n_N;@_)tr$eO@WZzQe}50u@~Y?-Bkw{10kLRH~P7GEZAqIdv8~24B2tszcT^CQ#rZj|qT>Y8dD!JzPHaG$B4l{u2QJtqxMZY4n*|xHGJ9Vm z^N?leXmmB#8Pcp+7){V#hfFimJ0ZH|kaP1-jSDd~H|Is1^%6*0caybrnS#Avu2+96J9 z=+CzTH^A-`zxlDI2gLa;SWftB37$ib5)$JMfo;TK>7!i~26ibBQ2P$)I%G&UZ*7Ysy9Ywi(Lk{cs6re+D^xA6GwmNdXCm+IA|B3Lv5V=(A%Y zc5oVR8YO&r9kLJ2QeJwT4|x>!L=Pj8#HAX zU0nJh>9@<_zou3pKH1#^8PZd*!#mwBRr3ri%hnE?;VVMwP)pWNHRs`#u35~U-6j;c zHOJrjBO3DL&HAu@ZikfBc+&I}+mImq%JuQ^PDptlztV#99V8Y=G)Z%b0Gm&==C)Y5 z;5m|LHuTumHsAm5tGxGM|s)+p7@uTsGC zvtu-&6E2Wv)-`~ab_^1*)4qHtE&xuK7WZ5EbRa%O&qk#4cSyW7X=$jH2M*iKMFQVu zK!J=RZjDKODCjDF-yl~2;v^MQK2+s`)g4+${f@L2@xYh!_ocsMN?7knX&yn#r2 z)Y1SZe9TRl+wukIvL;psn;%Owt$J=&X12M3VfB-Mg*9U&-e0|&WNCd1pdsd1PT?VT{dSq-Tf*?0gLwLEO4q5B> zWT^MhLk1S<`=v)ASZq*Ry2W!3>Cc`|_cy==({;)h6}vwnlU}86munip$ZSQYXhlBg zl+894ni2w&ossvFql}S{r7QBqtlz=!?6xuPH$tE*(70v)K_RkCO($n3Q;f_z6JH3j zr$Z(J{YEZiw}GCKp9DejhM=b|@mhJBFY;%k%2*HA3Yn|P{eeRkf_z>qyMNl00me`C z8uD@>vbdPhgepEo#+i0PKiZHZxiNMJ57(H$+)Gb`avW@6C0OwH{IeFY?A;b1uqpyZ zSYy?2g>{ksPSf4^#@nEOYCQrt4j@zBFCoYA46=d{hi0ZKfOsbIS!*gZ(nLC}c)ole znTkIjqbc5ijH9SdHXaRu^^muUb8@h5846{pKtho@3_lK- z7aV5dbnHV`_UnAK>9UYj33?nm&PQM%=9Adm+hQ;;KXGYPb`*5?|CX+z$A*<9r)x@E zvXHjq&plHSACd23!eaZku&;go-*{S&vj3sassuJ?`l&a;G;Vsyl#n7aP(K7;S*|1FHYi3- zR2;H=>C7w6f(f+w5rhw5PyOJFM@4fjAyNFrnO{EoW8@ezS`)URNjv6Q95kx8*+Q?Wm()VI)P8ue4=syio;9 zH^zxFK7}LeH9VhC4)|c$;?f98_myZp#AEev-JdY~2tYz}q!v^%A0ui1|Nd6GDTJ z+r8%3%^=!ElCr_D1fm}vSw6e24$=DO)q|`aL9~Pr_X@8hG--YNdp;lz>X$L_JbGsX zjgd_Ca5ObUtBR4xTV_GDCW_{!y(C137GDx!--pHnFB0z2_d;U@RgXiqdWgR8P3jpv zFGPC}-JxF}h9+SRc`wLEAiDl1>-{_V5KX-oNW9Sj(f2;K3_7GjbfE~j)0rbgx6N)J zx@3K-Cp1~(HPX{LhG=bAC)_LxO^zP; zs<%W!H1CgB=00r@UGqSzWfrS1)dGVX*%8o)ht70q2`f+S^0fuSO=xt?`0i=#7&Nf* z%{Xeh1x*4oelsS0g(mL|Z-x`CKy+mMPM9qoG*RG9Xh?w21l4_Ypuq^5MAG>R&aFZd zj=`bdvg*+ImFz*%j2bl7t!me;K_wkDck|2U4-xAT2{S3GD;pIgNED*!uAGt?mq(OA6_c0IpO1kq+DK?y%p zA)2$Y`2!Jlykh!gKBxLaBX24yLx)&sWa(i3tDg&^-6Ixi=`avYt~TkXUJKFh(B|c< z4bTLg_T)$ME;MQO9U-~=>Yv<6wzL0alJM`j`@gx9CbQRCpL$_YutNoE6z@TkZhUeN zhj=WKtH}v{ThKWF&b}DkAT$m({d9bJ9*blz`^WB2SS0(mXXhBPUCk;CQ|X2V<)&}r zEh4Z;_K)14JB8>+jx_2c0$3!A8V4wEV^#D`xgw|&n*1PB-}_XJMKW#tR>&o2jG+jc zR`kXWaRqbaw;xy}z2?Lo(L(gI%h6}l-wA zOw}$(h^^oK%;xjMKGIP#xF5fsVv+n&*NrCuO>ly4uaJdckt`6KXO4#^oKlk&o>o{S zYv>hA4xzCg|CBTj7VUNlCz3~b&c{eU$QiSPVd9Bi>j zx{$R<;b8T>{Ik|O1{z{GE9@nTpc8}?#W__0VXy&C=F4ACCckqbi%SR|7*jJR8{NG|A4Y-~dlQ@z=g{$ebW z{i)Fdepn=<{%wVG<6j`6IAi}4NnE`v{}dmOLP1(0(FIwW2at~WW>5FW3CJO&GkE>r z8k7(qix?+agWTmUCQd_-pxE1_QPlf%ND(z&O1A0+sm`7{_L|H>s<;Zy)yHE{W++Ir zX6PQIlXpAEKerDl^bIFnU-3h_n+zq~rH>$~VO$B}RyU-gOwAyrX@xR!8^e!ey&+HG z257HZhLm3kQ#}^)Am!POpJU;qkdjd2W|UP2WQ}PVI4Hs{WC!GNj3Rd+ea%$Dvp0kA z0+rq*onr{3E$%$beVGr*yEDh7MY$ou$2VR4N7Hyl;}7mhp}|A`}x$v@E;iGti3LfLvzbC9$8 zU2QNuALI<7k?rP?fJ`a&Uwsr9A(w878lRp!WqcNL;|l*_3yXyuFN>0x0|Df`cA?k*kqPAH%E^D-qzXAU_gdFg1|j?9qH%T` zd&pJ)-quSY4svZrv{1JVLbhqjgek%skp1M=EKj@wXJdO=xg>iVg-;(*bkqI&lGYg=$0>i(1KjI zt&=TJ{y?r8snr9PAjnaAhn-8&AJRDS%9s}(LbirSmr{OSgj~1wOFW8JAv@iZiu{v& z$RX>S{w}c?a$CQnkhUU*Y#XeP-&#zj zn}dh^kXx5!weXo2Z2w5{L8s8pqL#|;H+9Rr8kW+YAJLK#o zl!;4r>$Y~#wPV_s4`!4d|n5ZCy#Zqoz_7& z=8eI3lm*z_M}@Cb@Pe(HAQv?jPcXUWr2W7H1y+XnK-w${Y|^P}-oV55vn*D|3!9=h zPq?VonUMxI+HRHopbG+v?!MW+#Oz?h+ZCtHK@_Y;M*EI>Wq|dTWW@zLS1^*=6fbxS z+i(AR+>JN_u(e!9Km0ie%zdYi-m^e~!LANYHePIhMZB^x+E_XLs8PYO+h83@^DE&S z2b?*#Tid9aKtmwQ_U16D)z>y(K3Ko7s+cc2&qrse$JN=Qe8WvQaknr;*rrG371 zzh)gQbZ8BHL&bvy`oSH`1xheo`6zeL$pUNw-<^qtses6qw}X(bJ~Ij>|@S zy8Rn=P{VWCWPLUWEG-j-I)qh&t+&=^lB(mNles0S^a>U?+~|L^jcR`ri2V>y_*d(H zXvFh1zxPkpF&YJOb}oqs#m?GoO63(yB>6_Y$=>ulLDWA9BxT|M1il~ zByy@EdffJCJvgpy|A22lyy*9x62XfYuLwSAlOZDE-(Y#${6ua-@r8xvvO- zyoS)KiqL5A;YZ=X_dRPov3(gWX8i>GWqc$J4r#YaM_^o+$R3|8G-wkp4 z#S8L8+PQ>2ScA&q#LbfiYAQ_H=Y0&VXv zurcqZfb#kZzFZo8@UdFprQsh9P_|#Vm$tMIvJH=!ibQxpg)?2Q^0+w2(BiPn?|BXK z>joT^(y2i!4RPW|Z~(}BE|aTk>ke9SnV+92ii5`VdQqmN6i}7Fa{+g&2$ZuvmEPoB z0(k`CLo$m7pn4$fPOu6A_X>nAAFuF)ml*a9UD=QsPD(m;V|>D?M(ACPrvVYcvkEBMG> z7+~mB0Gb5EBU!(qK!NEM`#4H@6rt870HK7zDX|KTaRqaRfO*Zl45pqCsk5$gyxtBq(V#mu{Y<1z9}{4Q;_oAe&KA z+N@_C6kJpzETZ)WA8wY*RS16u>B)?5sPD>P`+xVsb@U1-JYP>-R!s`hS>p%4JnjLR zMzdj8ai4;${sX<8dzV2rZMleWu_Z{{8X4GUCIab9x=FFqM4%u@NX+l30_0TMavr_F zj`KCsDblNEAdhhsSKIgx$aQ*tf&aEI$X(>&gPNNlFWyTEb&U*U{W9V7vuOmcm>cK8E%g@DF32K9!f*(eU?0TS( znJ6@9)DPqz++S(D*aUKw4-8N6)4w{3E5$e?q21!sLKTdkv z-3FxgUp6K+y8?<1(%n`A2tYPVm=)3cK#;fePUcrwF?fHmZuQ3Hdmsmt-?KYc1~NGKbsG=*#TMbdp$Vmg4vF5U3t)U>d z_DAg4fCCDJ-||=DI}gL(spJZOCBBQ?!Ln#gU})%WWAiVINT+P$VdZY`>S^!d%_IH>ASsjQJhSiloT32 zIQ3?Veu1{1>i<+Gr6B9sMO{hVaULI}sdP<}#ThNwG+T1|kez^au* z&AmK)YZG_w>egolV}pm+DE+Q=eYs1ie3x?jDLt)cb|>n~Qg8fSO4YlRyT$Y&G4vrP z;{;8qU-a8+*fDo?ReZArt|#BLVN>=>lj~3E-wQ6OXgSW#W4*m(OwnPWAXBi|;ATXz z%e{0h>$*hQG>&w4f?SD%sHbH6Lf&r6-5~jKml>S01M8f*fCGn*6q_Sv9r4)E*qHeK;UaEkSc?eN1#p zH1VlA)BH^2$vRYX6tr_bv~&8g;ss@iJU_Ve z22%X=6stS`QmPi;QRLX8_<-3xyqPMb6Z5MUD~)pOz~TJlT^Yq4JZy@BW2-*)Wp4LsOwG=JN%|Dz2& z*i*13@c)NV{CgJ?)}l&_|1Amp>vDhXP5R5C-n94dBsIXAPD>{ncXel57iwh}uX_*t z*dN$CJK9)dD-TbsQ9YzYiA!URYP;E;=-c0o6w3#DPBk`vyy4`H93J2vef^;IN~De1 z4>_MRd`;uK;Ibyt)_Zytk}lo%tFg=1qOIKb(eo`HDIZEkPEpFgrH< z_k@x)?S)-R&}4AN3jx-&+zet$FYUee3s=8vb|^P0Q)FKCv0dBSkq^`E_sPC>NjcPV4BGIl1WjDN-`uNU;UHcf6Tqf z{fs%fLHfN#+ULi%c;o&-_0VU)5$(-gFMiCqoAkbTfz+sYmyK#dg5ZjMp(SQWjwM|FiR36)lZbLTY* zQmzs-vTV6Mn$EiN&|ID2((C8fv&p2r+KuBR@PiasaPBD|w=mKK!sgoYU?bE#e+R!4 zJZVZjBSLNCqYwuzBILJ&Mxq4{W{?n*N`R6ic5|${!PJQ#G}5Hv<|h!&sV5~64l4MB z`&4dUsHG(`b{@8)i8H8w|8eQ;h4v}mm*%tbgq(q0X=lF2>Pnw;aLoGgNd`Qe+Y$(0 zw&SooxO?U9?@Kc_Uo~!%7)Mt3D()>G4ujL45}Ur$1aFJN$6uQcnIy8moQNHij>Hq3isD3n)qExwCN8^a4K=nyZE2*{Us!h1|rJu~lG#wnT~Z+k_Z!R|iN zRYdoIbW8!mSH+4Oq$S=eWE+vzW~;}6ijHjbP)=8)Ra`Zg7u3Eeo^!A4ocTrROGY1R zsLYyo-#)UlWfC3rZ!)?+!10=BVUB2F{Zf{Jz>C#J`euWMs^BjhRbl1`!!XY|6VB>R z%G<)U=Ugpv{Aw=$wmce>x*w)^eDL@)!>y*KNtG8(IYdqp(lW9%NrprU$JXM^D=esL zJk;T_UDe&acAkyj8#=c!DpQ)|OK*vmlUNYV+bBYDe-))zY`;rK-4BV{#s_L;^#6HRN%-k{6+S~5yn-8t$7q;{rEN7Md?@1Y}Zai-f_iZ(Fy_S_# z;fyqp(%A@P8-4z^^HH?W@U4E<`~4}Q@2i5}RweI!5Agmn6K9}zhbcyQ-Bl}0!x;}VG$>~WGX=P(g*+2&)E9yZ~KH-dg{p`mbuAGC! z{N94Q#B@@QT*#FR55ui(UcXtQ(oyj6ivJ~@+}_(_%Rg|L{_B@38nl9JUu5~?N^d2` z6TD7gar13*tJY>t;UzDxAKPUQD;JRTVzs=p1DhMW7&FWMXjt3gR$g{^mi;OB(!#?W z)9o*j?LN=juYSv3EMIs#?|*aLZUdJ_N<99L0Hek`C&Sc&6Z>riHors67oDTJ@C4ydGv;~ zSIN;1wf>z+)SnBruP}K?II#Jo(~EEF#g?5dO=tVAkr++wZF|wmp0n6nR2xoqXU-j` z#_tlJ>#aX2`4x0G2j~6HISD?yIUOSB#k{Vm@~xXSjyLt}kJr9PvZvP?ORkTFnzb~_VtDnZ zfB&%;c;U@WK#1y-9xtB4!PvFJXQZ_Igp02|o|K#qIIGZ587NJRxF12N@0M$9h@La$ z>EJwc{(d>oiiF13;QJWwak5Uaj<)g($8;UrXXCpHvRZ{UNjO?BR9jp*imN4(R#>{+ z8oayhc=dM-39J@2$v>u63#Uv0~*>GBc2l*dtanbz?^=;~)UpqkEoPU{@% ztyB<7b2{CwMd|aMIc<{aR12|-6-~<*oup9Jl{iPN-_y7ywC;bt;tTJ+*Ftl3sF=Db z6}+_(%jTZikn0^E8ua%0Rn)qjbAQU{1}6vg3pM%Kp=zBJjn~hW6eb&~_?4Z7)edtx zURNlkFO2pvS0H5mKf+eu+Evhvv+b4o;nfxE<#CYR7BBYFH)iGvB8DFr)Gs@sKd3Lf zW&SYN$|#tWGauA;j^ujefHKCj&RA1_kjer>Pakqw-)%VDity#GJ;`-eReP5a^+#{j z%YtZhYjF8~%H46vFjDy8S@+U;VYg{7rr8R|0%ll?zgAY4gOgeeB6l3Q z9iyhplOFYD3aY=jrId8>rL6+>1*NH(GlFJWy2KYv=%%(^v97~CxuwVBmwIos5+$dE zIP@TL3rDH9ic-C(Lds9eX-($%irtrf27R-O-Pw~MDC)S=b&2vb25+&8;(jLm`-r>j zOf2_9^l>mWZI}g%i!n~a^@6&X_s^2a`##4EHgkyE$gm9Z zq4+*;$ZOrLav-4rcN2R>yyHGCG<%0B{kQQO z&OJW4R#>6e5ilBBWbdWcTPC|kSgM96qh&etAkWf3zoWydlSsT_+?#HoSQQl9p5Vt9 z-M{hXV0?{wYc?*=)Q*O8c%#Q8kO}2YAiDoz=BjVq>$SjdXRXmKV|EjAUaU3Bti-KK z-?1-)>st7E|BNQxNmHc`r=!x-YtQ_^ZIrFQ0u2W>gxXu*Jav!d<{({u`YtxarPTJ` zuDF!CyWY7{m+FSV6v87;vfX6RuTZbNQy-3&yistyLPL3pMzM&)PuNJc-|}&^RD!mc z$H=9sfdvfh(2qlHeGjU;`Jmq+OOlJyB#4 z?H~E-%eA}h>gw(F0~>qGdIL^}PVQR5^(56@NQ5K78)v)-N$!${P zT`b9Qw(k}9X`(l+gi@5D%^xtD(kvtl1>~b+pA{#ExZ(^F&aKwEz3f^dKfLn!-n-i| zW@m@PhdE%<(oVlu=n1kA^3{Z>R(1UIf!H)A&qVei>ucY)Rw+9*vSd zFB_L#)AD$m`s?9Hha_sh(rWh&eR}GyLabP(akrA6t#{`ur|e_qOX}URD`@{ZhF?|8 zdPCl~cxbc_l$my3QnrO{$@4Z+4vk6$N;8#-d+poekGb8j@)z34&?#lxdx;x0(>_Vk z!L!Y2R`lFZVo*Sy?q(7<9S0K=gQdp3D3z(bg|=Z0?m|vqKKLaRnr*V=n06^2gkxY>zHyl*JgFw`br;-6Hyu`z>B5-OaN zuSy1fFN_>saR2(Qf##vvaRF;><@i`fN98!{DZ$&jOSH8_P0FjjTB-6y_a3Z8d_F5` zer_Cr|JIaCU;GY@jXYcUopkb=$rZ}dlcuu5=j;O;yOcqwnhn?f15}Mjtdd#O5s`2M zL#bfUYFuyX2u0Ol`5v#GxOe-(9}~34Nxriz?_^k#WQd_7r*({z-_bctX*Cpya(G7d z%*+0Z9r-J+2{w8sJ@lONt1yiliOS2rm!|9*#{@SYSMPgz%1 zm^Aq-{_scmKgpdq>4}}cov9lvjNKPF>FT^2;BIUH&c0YpwKau`i$`26c5SbIuR&2d zV?g8aQv9+QT}-in5IKuY;d3V15AUjPn+VD`YDK7{)yIQLJ5+z&n8{*I`jz?Wea4ha zyrk{2rJ{qnH7}uctg$Q)vHu|mybM5ofp@h5~6k7L$TH{Oc|ja-rqZBE>+A@PliA^OEH zC~w4V`$bl)QUIM$DkFB;^pjM^+Te`U(CJrgcS3<-(K*9{g`x^JA3hf1S!Y9Myda9J zMGoeUHDw3#L5*Tn%n`rv%<$Ehz7udvWYUkFxa2%OiF!2qxI$4p&S^-7)R9d-xk%C3 zh;w4t+Sagw0pSJJ&2cj@)fQb zP0q|1r9AUAjAk;@kGbMIn$`Y?aLm*BP>x{ct-bL~&2GRZf297)l$m`J%F92OBUCeA zM1=D^dLm473(XUL{ielyyP;alWZvF#i|~trA??Co)l7z@hi_RlRW7%E+eCk@;uC8* z=s{=gp>@U$E7$ua+8PU4`W5#wY4HQD_Mz`y?%-H@o0m|2tIN6>mD4AD5U=oXyW7q- zXJ?+lU&V@U#L3^R&p6)w();(lsL;n_tMt5IOq2(>7kDL4R=Kb8ibm225{jJ4Og}PH zdDNR1Hs)_;@%s7q8S{_7?p6;nu3Qw6sXwb4lNg@fW2dl@QhoB&UD%Xv!CF7+E1qYo zhOd*)=o7sVZ_48(=R12;-V{$y{`O3eSc3J-K$ozL+?rey z{mCMC&=dPpcfp`*%QrgPLLVygw!78s;~nn$FX(UWX^m~>)rUU{*)Uv>UdT#$(?olU zZ{;5nIrmERYd4SO=AN+$q?yIQVmS> zng^7=N3vXPy?fE}qJjBP&=hHu^O67Kjoy95O3AU|35_VbRYfMdNakY^%@*rIY_P=O g?_dt`{~gTv`+vS*Ln!}e!5nPtMODQ|G9LAR0gDAF%K!iX literal 0 HcmV?d00001 diff --git a/reference_output/eic_DEMPgen_EIC_test.txt b/reference_output/eic_DEMPgen_EIC_test.txt new file mode 100644 index 0000000..f0d43ce --- /dev/null +++ b/reference_output/eic_DEMPgen_EIC_test.txt @@ -0,0 +1,45 @@ +Seed used for the Random Number Generator 24432 + +Total events tried 100000 +Total events cut 99927 99.927 % +Total events recorded 73 0.073 % +Total events cut + recorded = events tried? Yes! :) + +Cut details - +Events cut due to ejectile (X) energy NaN 6226 6.226 % +Events cut due to conservation law check failure 1218 1.218 % +Events cut due to negative Wsq value 38576 38.576 % +Events cut due to qsq < 3.5 or qsq > 35.0 273 0.273 % +Events cut due to W < 2.0 or W > 10.2 39771 39.771 % +Events cut due to -t > 1.3 GeV 13863 13.863 % +Events cut due to -ve cross section value 0 0 % +Events cut due to -ve weight value 0 0 % + +Conservation law checks details - +Total events PASSING conservation law check with tolerance 1.00e-05 92556 +Events cut due to energy conservation check ONLY 1218 1.218 % +Events cut due to momentum conservation check ONLY 0 0 % +Events cut due to energy AND momentum conservation checks 0 0 % +Events cut due to px conservation law check 0 0 % +Events cut due to py conservation law check 0 0 % +Events cut due to pz conservation law check 0 0 % +Events cut due to px and py conservation law checks 0 0 % +Events cut due to px and pz conservation law checks 0 0 % +Events cut due to py and pz conservation law checks 0 0 % +Events cut due to px, py and pz conservation law checks 0 0 % + +Weight correction factors - +Ratio of phase space factors (fPSF_org/fPSF) 0.325334 +Ratio of tried to physical events 1.85254 + 1. If the first ratio is not ~1.0 (+/- 0.05), check the number of recorded events. If the number of recorded events is < 50,000, increase the number of attempted events to generate more data. If the the ratio does not converge to ~1.0, multiply all individual event weights by this factor during analysis. Alternatively, this number can be treated as a tolerance on weights. + 2. If the second ratio is large (> XX), then again, multiply all invidiual event weights by this factor during analysis. Again, this could also be considered as a tolerance on weights. + +Energies, angles, and phase space factors - + User-defined Calculated Actual +Scattered electron energies (Low) 2.5 4.9 4.92549 +Scattered electron energies (High) 12.5 6.62 5.93269 +Scattered electron angles (Low) 60 116.925 125.522 +Scattered electron angles (High) 175 158.785 158.238 +Scattered ejectile angles (Low) 0 1.5 6.72664 +Scattered ejectile angles (High) 100 73.4 63.4974 +Phase space factors (fPSF fSF_org) 23.2418 7.56137 diff --git a/reference_output/eic_input_DEMPgen_EIC_test.dat b/reference_output/eic_input_DEMPgen_EIC_test.dat new file mode 100644 index 0000000..cd76496 --- /dev/null +++ b/reference_output/eic_input_DEMPgen_EIC_test.dat @@ -0,0 +1,659 @@ +HepMC::Version 3.02.02 +HepMC::Asciiv3-START_EVENT_LISTING +E 0 1 5 +U GEV MM +A 0 weight 1.113318353036991e+00 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.834751050001213e+00 -1.172418948851223e+00 -4.481933563734104e+00 4.982831156877801e+00 5.109989383783055e-04 1 +P 4 -1 211 1.914653512116908e+00 8.706648226491454e-01 3.889295207484010e+00 4.423805189083668e+00 1.395701799999783e-01 1 +P 5 -1 2112 -7.990246211569456e-02 3.017541262020774e-01 9.559263838236207e+01 9.559776532972188e+01 9.395654205006568e-01 1 +E 1 1 5 +U GEV MM +A 0 weight 1.041321814699380e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.928315861824099e+00 -1.147352378065654e+00 -4.506074536172350e+00 5.033838250190020e+00 5.109989592357673e-04 1 +P 4 -1 211 1.039179654811648e+00 9.190931282452068e-01 1.905508389097609e+00 2.361158315197990e+00 1.395701799999974e-01 1 +P 5 -1 2112 8.891362070124514e-01 2.282592498204470e-01 9.760056617318673e+01 9.760940511029536e+01 9.395654205006568e-01 1 +E 2 1 5 +U GEV MM +A 0 weight 3.098209058474295e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 7.962451089091800e-01 2.748331517815946e+00 -4.337025784773433e+00 5.195875799534843e+00 5.109989522832801e-04 1 +P 4 -1 211 -5.142798127841716e-01 -1.917775330735242e+00 4.048571830464395e+00 4.511403290173583e+00 1.395701799999783e-01 1 +P 5 -1 2112 -2.819652961250079e-01 -8.305561870807049e-01 9.528845398042102e+01 9.529712258597493e+01 9.395654205016248e-01 1 +E 3 1 5 +U GEV MM +A 0 weight 3.307853591205361e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 3.517629939605619e+00 2.667468209213616e+00 -3.824370996513354e+00 5.840797960832715e+00 5.109989522832801e-04 1 +P 4 -1 211 -3.708168557916786e+00 -1.777715753939577e+00 2.568087584656136e+01 2.600841501201816e+01 1.395701799996983e-01 1 +P 5 -1 2112 1.905386183111673e-01 -8.897524552740390e-01 7.314349517606398e+01 7.315518870283249e+01 9.395654205011408e-01 1 +E 4 1 5 +U GEV MM +A 0 weight 1.752135618549886e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 3.913077539644362e-01 3.109064231450827e+00 -4.225594164772665e+00 5.260707980878651e+00 5.109989557595237e-04 1 +P 4 -1 211 2.185435804725094e-01 -2.992480039859442e+00 8.570603645558664e+00 9.081708251751518e+00 1.395701800000037e-01 1 +P 5 -1 2112 -6.098513344369448e-01 -1.165841915913848e-01 9.065499054532599e+01 9.066198544305317e+01 9.395654204987208e-01 1 +E 5 1 5 +U GEV MM +A 0 weight 2.209448222581490e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.759645600453628e+00 -2.993117575854382e+00 -3.831106073206743e+00 5.590328314891085e+00 5.109989557595237e-04 1 +P 4 -1 211 -1.946254211148522e+00 2.576060863412271e+00 8.819550100361136e+00 9.392972843266559e+00 1.395701799999528e-01 1 +P 5 -1 2112 -8.133913893051056e-01 4.170567124421109e-01 9.001155599895760e+01 9.002110051752572e+01 9.395654205006568e-01 1 +E 6 1 5 +U GEV MM +A 0 weight 4.964206757909928e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.590896052645568e+00 1.108213658581492e+00 -4.566801865864325e+00 4.961327171893791e+00 5.109989557595237e-04 1 +P 4 -1 211 1.320402642330753e+00 -1.235772734252190e-01 1.672941498656741e+00 2.139380184411910e+00 1.395701799999942e-01 1 +P 5 -1 2112 2.704934103148159e-01 -9.846363851562729e-01 9.789386039331957e+01 9.790369431937764e+01 9.395654204987208e-01 1 +E 7 1 5 +U GEV MM +A 0 weight 1.454220161358887e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -9.331414426314509e-01 -1.849927284348280e+00 -4.545509652294458e+00 4.995462157754227e+00 5.109989453307929e-04 1 +P 4 -1 211 -1.784194420482387e-02 1.274499539491754e+00 1.589954500750584e+00 2.042572535000893e+00 1.395701800000005e-01 1 +P 5 -1 2112 9.509833868362754e-01 5.754277448565258e-01 9.795555517765585e+01 9.796636698292824e+01 9.395654205016248e-01 1 +E 8 1 5 +U GEV MM +A 0 weight 2.939542165675490e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.048906177958656e+00 2.455613547062823e-01 -4.625625309927883e+00 5.065049523347989e+00 5.109989557595237e-04 1 +P 4 -1 211 1.105874365639205e+00 -4.980181033364663e-01 2.296880040142243e+00 2.601176252732181e+00 1.395701799999942e-01 1 +P 5 -1 2112 9.430318123194515e-01 2.524567486301840e-01 9.732874529589762e+01 9.733817589960317e+01 9.395654204996888e-01 1 +E 9 1 5 +U GEV MM +A 0 weight 3.271242531965875e+00 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 4.610352558132583e+00 -1.435283291223354e+00 -3.446952221954530e+00 5.932694895062595e+00 5.109989314258181e-04 1 +P 4 -1 211 -4.658191072678122e+00 1.725271375850678e+00 1.965075855964854e+01 2.026936351232207e+01 1.395701799999019e-01 1 +P 5 -1 2112 4.783851454554042e-02 -2.899880846273243e-01 7.879619368841797e+01 7.880234326829869e+01 9.395654205001728e-01 1 +E 10 1 5 +U GEV MM +A 0 weight 3.225605907143926e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.007577985203163e+00 1.030825439462583e+00 -4.531070247610120e+00 5.061972767924890e+00 5.109989383783055e-04 1 +P 4 -1 211 -1.012405436640973e+00 -7.458509177845529e-01 1.793456415690246e+00 2.194817557298555e+00 1.395701800000005e-01 1 +P 5 -1 2112 -9.951725485621897e-01 -2.849745216780299e-01 9.773761385803185e+01 9.774761135045989e+01 9.395654204996888e-01 1 +E 11 1 5 +U GEV MM +A 0 weight 1.301629047040074e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.205450486450063e+00 1.514289463977895e+00 -4.588392115638271e+00 4.979912240589037e+00 5.109989418545492e-04 1 +P 4 -1 211 -8.005375748913195e-01 -9.772349344423797e-01 1.666799065890970e+00 2.096079074631422e+00 1.395701799999942e-01 1 +P 5 -1 2112 -4.049129115587426e-01 -5.370545295355151e-01 9.792159307585929e+01 9.792841036046289e+01 9.395654205006568e-01 1 +E 12 1 5 +U GEV MM +A 0 weight 3.170557879232293e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.241455329493022e+00 1.357484373567441e-01 -4.469180142913550e+00 5.001611844524741e+00 5.109989557595237e-04 1 +P 4 -1 211 1.405360988527623e+00 -7.548642627768436e-01 2.187424363648071e+00 2.710934293766517e+00 1.395701799999910e-01 1 +P 5 -1 2112 8.360943409653994e-01 6.191158254200996e-01 9.728175580537747e+01 9.729185553739211e+01 9.395654205016248e-01 1 +E 13 1 5 +U GEV MM +A 0 weight 5.760203156533954e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.824832914500252e+00 2.529003368964604e-01 -4.614927208965119e+00 4.969056968018413e+00 5.109989592357673e-04 1 +P 4 -1 211 -1.439645615057176e+00 6.159830000205277e-01 2.799671849110927e+00 3.210865436469905e+00 1.395701799999974e-01 1 +P 5 -1 2112 -3.851872994430751e-01 -8.688833369169880e-01 9.681525538596618e+01 9.682447927119505e+01 9.395654205006568e-01 1 +E 14 1 5 +U GEV MM +A 0 weight 2.146858296801560e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -3.596106704967793e-01 1.997542695883857e+00 -4.614713066822365e+00 5.041336490102112e+00 5.109989418545492e-04 1 +P 4 -1 211 -2.884930886530880e-01 -1.749381668283221e+00 4.464821499915328e+00 4.806004093295945e+00 1.395701799999910e-01 1 +P 5 -1 2112 6.481037591498678e-01 -2.481610276006361e-01 9.514989159301903e+01 9.515706109228529e+01 9.395654204987208e-01 1 +E 15 1 5 +U GEV MM +A 0 weight 2.140162335572285e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -4.648177368874041e+00 -1.077473566216127e+00 -3.486437054820858e+00 5.909462389824912e+00 5.109989453307929e-04 1 +P 4 -1 211 5.225043729580737e+00 1.230109571123410e+00 2.371927726542844e+01 2.431949517079695e+01 1.395701800001055e-01 1 +P 5 -1 2112 -5.768663607066956e-01 -1.526360049072823e-01 7.476715981550440e+01 7.477544411506150e+01 9.395654205011408e-01 1 +E 16 1 5 +U GEV MM +A 0 weight 2.421288595627257e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 6.799989025860094e-01 3.127609290026478e+00 -4.184328148148110e+00 5.268105987077579e+00 5.109989592357673e-04 1 +P 4 -1 211 -1.147205096828710e+00 -2.809783747319013e+00 8.189986911323484e+00 8.735349431115109e+00 1.395701800000037e-01 1 +P 5 -1 2112 4.672061942427016e-01 -3.178255427074646e-01 9.099434126293662e+01 9.100094625749065e+01 9.395654204987208e-01 1 +E 17 1 5 +U GEV MM +A 0 weight 1.638483984291405e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 3.078292353655859e-01 1.988863580135981e+00 -4.623290399383386e+00 5.042335922634229e+00 5.109989453307929e-04 1 +P 4 -1 211 -5.517760661911151e-01 -1.207027757107110e+00 2.526547024000194e+00 2.857322616240216e+00 1.395701800000037e-01 1 +P 5 -1 2112 2.439468308255298e-01 -7.818358230288709e-01 9.709674340149519e+01 9.710474313680893e+01 9.395654205016248e-01 1 +E 18 1 5 +U GEV MM +A 0 weight 2.734385261385765e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.980851671240625e+00 4.062590195534770e-01 -4.598706711675143e+00 5.023636473268271e+00 5.109989557595237e-04 1 +P 4 -1 211 1.393015221998313e+00 5.281779587062814e-03 2.426827136670860e+00 2.801693968359487e+00 1.395701799999974e-01 1 +P 5 -1 2112 5.878364492423127e-01 -4.115407991405398e-01 9.717187960111626e+01 9.717907123405558e+01 9.395654205006568e-01 1 +E 19 1 5 +U GEV MM +A 0 weight 3.543302697149436e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.183361285055661e-01 -1.956786700568018e+00 -4.596099027163719e+00 4.996713335728272e+00 5.109989453307929e-04 1 +P 4 -1 211 -4.532394120155369e-02 1.165818406670657e+00 1.507344832290092e+00 1.911218222902615e+00 1.395701800000005e-01 1 +P 5 -1 2112 -7.301218730401181e-02 7.909682938973601e-01 9.808875422098561e+01 9.809647011705246e+01 9.395654204996888e-01 1 +E 20 1 5 +U GEV MM +A 0 weight 2.023622432587465e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.286858804861379e+00 -1.443274668658308e+00 -4.402239785771845e+00 5.166476590009406e+00 5.109989453307929e-04 1 +P 4 -1 211 -2.578289247588471e+00 5.820136573264810e-01 8.003155629340977e+00 8.429489617061183e+00 1.395701800000546e-01 1 +P 5 -1 2112 2.914304427270931e-01 8.612610113318268e-01 9.139908418254285e+01 9.140843546861275e+01 9.395654204996888e-01 1 +E 21 1 5 +U GEV MM +A 0 weight 8.688480964788007e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.950136438199565e+00 2.614132834045858e+00 -4.322169143615327e+00 5.414597766110673e+00 5.109989453307929e-04 1 +P 4 -1 211 1.692425317345985e+00 -1.579398968288774e+00 1.036474405770710e+01 1.062102649336424e+01 1.395701800000546e-01 1 +P 5 -1 2112 2.577111208535807e-01 -1.034733865757084e+00 8.895742511202022e+01 8.896877741620844e+01 9.395654204996888e-01 1 +E 22 1 5 +U GEV MM +A 0 weight 3.529321404102984e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.350203304299079e+00 4.591637762979158e-01 -4.536310398561074e+00 5.129561310503632e+00 5.109989488070365e-04 1 +P 4 -1 211 -1.472995916309303e+00 -1.199686356995308e-01 3.180584534563344e+00 3.509944053637358e+00 1.395701799999974e-01 1 +P 5 -1 2112 -8.772073879897755e-01 -3.391951405983850e-01 9.635572589010972e+01 9.636489631154235e+01 9.395654204996888e-01 1 +E 23 1 5 +U GEV MM +A 0 weight 4.918823510428310e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.802410424602125e+00 1.404242797608964e+00 -4.455586784468764e+00 5.007278205612675e+00 5.109989453307929e-04 1 +P 4 -1 211 -1.038977879943040e+00 -9.428212119219740e-01 1.598447916137475e+00 2.131408559711258e+00 1.395701799999974e-01 1 +P 5 -1 2112 -7.634325446590845e-01 -4.614215856869902e-01 9.785713889444327e+01 9.786571491035940e+01 9.395654204996888e-01 1 +E 24 1 5 +U GEV MM +A 0 weight 1.688419260580105e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.191317502961567e+00 -1.874032607998953e+00 -4.509891177193040e+00 5.026962731108069e+00 5.109989557595237e-04 1 +P 4 -1 211 1.738006471442100e+00 1.460580679619584e+00 5.388695996832325e+00 5.849058624930562e+00 1.395701800000037e-01 1 +P 5 -1 2112 -5.466889684805322e-01 4.134519283793688e-01 9.412119520647271e+01 9.412838031964473e+01 9.395654205006568e-01 1 +E 25 1 5 +U GEV MM +A 0 weight 2.503179024704897e-05 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -5.094780517436417e-01 -1.844910881543085e+00 -4.560695165169046e+00 4.946029184786603e+00 5.109989557595237e-04 1 +P 4 -1 211 1.678156396991241e-01 8.693092627564586e-01 5.794867696503699e-01 1.067307563257591e+00 1.395701799999997e-01 1 +P 5 -1 2112 3.416624120445182e-01 9.756016187866267e-01 9.898120842163067e+01 9.899106492763919e+01 9.395654205025928e-01 1 +E 26 1 5 +U GEV MM +A 0 weight 1.410875577020548e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.722862293277175e-01 -2.559512549154216e+00 -4.406481127866614e+00 5.103167689908296e+00 5.109989557595237e-04 1 +P 4 -1 211 -6.119836515095944e-01 1.691983431365953e+00 3.110125419450982e+00 3.595788075177999e+00 1.395701799999974e-01 1 +P 5 -1 2112 3.396974221818776e-01 8.675291177882630e-01 9.629635573452762e+01 9.630544591059706e+01 9.395654204996888e-01 1 +E 27 1 5 +U GEV MM +A 0 weight 6.335006752195130e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.260951432906757e-01 -1.889066633134677e+00 -4.573239447149019e+00 4.949645647080615e+00 5.109989557595237e-04 1 +P 4 -1 211 1.999373372290021e-01 1.448432517223966e+00 2.031077328316475e+00 2.506528803847345e+00 1.395701799999974e-01 1 +P 5 -1 2112 -3.260324805196772e-01 4.406341159107112e-01 9.754216214494453e+01 9.754822722475538e+01 9.395654204996888e-01 1 +E 28 1 5 +U GEV MM +A 0 weight 3.026658935175932e-05 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.622607740412329e+00 1.281604177335368e+00 -4.531985268890043e+00 4.981390958875417e+00 5.109989453307929e-04 1 +P 4 -1 211 -8.810721773827703e-01 -4.942033888380927e-01 8.416132023548083e-01 1.322239686600058e+00 1.395701800000013e-01 1 +P 5 -1 2112 -7.415355630295584e-01 -7.874007884972750e-01 9.869037209264722e+01 9.870077103020787e+01 9.395654204987208e-01 1 +E 29 1 5 +U GEV MM +A 0 weight 5.114165656465041e-06 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 5.415357317155127e-01 -1.744363636490530e+00 -4.574616982540454e+00 4.925767579078674e+00 5.109989557595237e-04 1 +P 4 -1 211 -4.402983506066612e-01 6.431337164900837e-01 3.886455153437319e-01 8.820480636424077e-01 1.395701799999997e-01 1 +P 5 -1 2112 -1.012373811088510e-01 1.101229920000446e+00 9.918597149330871e+01 9.919658603296227e+01 9.395654205006568e-01 1 +E 30 1 5 +U GEV MM +A 0 weight 9.772621215136189e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 9.348571918917468e-01 -1.715016220140775e+00 -4.597850237587688e+00 4.995544582223520e+00 5.109989557595237e-04 1 +P 4 -1 211 -1.465779965488993e+00 1.185422338737109e+00 4.226822532261009e+00 4.630253295747487e+00 1.395701799999655e-01 1 +P 5 -1 2112 5.309227735972470e-01 5.295938814036660e-01 9.537102773143866e+01 9.537860379771233e+01 9.395654204996888e-01 1 +E 31 1 5 +U GEV MM +A 0 weight 6.409273349600847e+00 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 6.029439169054588e-01 -2.078263604167940e+00 -4.693966159394495e+00 5.168756092330441e+00 5.109989522832801e-04 1 +P 4 -1 211 2.381981507852386e-01 2.205669948560792e+00 1.868425671597830e+01 1.881602102317988e+01 1.395701799994946e-01 1 +P 5 -1 2112 -8.411420676906969e-01 -1.274063443928526e-01 8.100970946952818e+01 8.101962456017303e+01 9.395654204996888e-01 1 +E 32 1 5 +U GEV MM +A 0 weight 6.171817309598035e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 3.298092317684123e+00 -2.353737104597832e+00 -3.947139590566066e+00 5.656624656282365e+00 5.109989453307929e-04 1 +P 4 -1 211 -2.794679345113065e+00 1.515171147372817e+00 1.278758120705434e+01 1.317754488552353e+01 1.395701800003092e-01 1 +P 5 -1 2112 -5.034129725710572e-01 8.385659572250147e-01 8.615955840962370e+01 8.617023213387746e+01 9.395654205001728e-01 1 +E 33 1 5 +U GEV MM +A 0 weight 6.097276263526791e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.242536993725634e+00 -2.412501456547818e+00 -4.360978902432327e+00 5.136360453395173e+00 5.109989453307929e-04 1 +P 4 -1 211 -1.194552632836077e+00 3.022489787427066e+00 1.033183431095201e+01 1.083183643579550e+01 1.395701799999528e-01 1 +P 5 -1 2112 -4.798436088955623e-02 -6.099883308792482e-01 8.902914461759229e+01 8.903620478649268e+01 9.395654205001728e-01 1 +E 34 1 5 +U GEV MM +A 0 weight 2.216237442087281e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -7.726304676422269e-01 2.064610026879397e+00 -4.576293874065066e+00 5.079570679254830e+00 5.109989488070365e-04 1 +P 4 -1 211 3.685722519239421e-02 -1.645342493667313e+00 3.839518187775980e+00 4.179699765045815e+00 1.395701800000164e-01 1 +P 5 -1 2112 7.357732424498332e-01 -4.192675332120846e-01 9.573677571240108e+01 9.574513123138274e+01 9.395654205016248e-01 1 +E 35 1 5 +U GEV MM +A 0 weight 4.154198380840580e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.238024509109058e+00 -5.537680750720707e-01 -4.526263245979262e+00 5.079613372823224e+00 5.109989592357673e-04 1 +P 4 -1 211 1.206488574793784e+00 6.821438804727618e-01 2.303561917417830e+00 2.691990396954885e+00 1.395701800000069e-01 1 +P 5 -1 2112 1.031535934315274e+00 -1.283758054006911e-01 9.722270135467342e+01 9.723279790590526e+01 9.395654205006568e-01 1 +E 36 1 5 +U GEV MM +A 0 weight 7.225245666871096e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -6.321999937129936e-01 2.012063898149623e+00 -4.495454396085500e+00 4.965600512595848e+00 5.109989522832801e-04 1 +P 4 -1 211 -2.573013342481245e-01 -2.003517523623341e+00 3.566958946376814e+00 4.101580476396202e+00 1.395701800000037e-01 1 +P 5 -1 2112 8.895013279611187e-01 -8.546374526282079e-03 9.592849547582065e+01 9.593722068669129e+01 9.395654205006568e-01 1 +E 37 1 5 +U GEV MM +A 0 weight 1.849936844075337e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -3.541048478051839e-02 -2.294850643290976e+00 -4.556446408595098e+00 5.101842560581863e+00 5.109989557595237e-04 1 +P 4 -1 211 -4.195804460826894e-01 1.374810277961285e+00 2.934708865632078e+00 3.270802197059260e+00 1.395701799999910e-01 1 +P 5 -1 2112 4.549909308632083e-01 9.200403653296904e-01 9.662173756907502e+01 9.663175691804224e+01 9.395654204977528e-01 1 +E 38 1 5 +U GEV MM +A 0 weight 6.071317056565038e-05 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 3.697278618167023e-01 1.845148999688629e+00 -4.551835384116529e+00 4.925492782257497e+00 5.109989522832801e-04 1 +P 4 -1 211 1.792786442712466e-02 -9.540046961010530e-01 6.389750680203471e-01 1.156812578252251e+00 1.395701800000005e-01 1 +P 5 -1 2112 -3.876557262438263e-01 -8.911443035875761e-01 9.891286034220816e+01 9.892209631517359e+01 9.395654204987208e-01 1 +E 39 1 5 +U GEV MM +A 0 weight 1.039047425315747e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 7.126062856526169e-01 1.966114466499593e+00 -4.552395417462257e+00 5.009762280965224e+00 5.109989557595237e-04 1 +P 4 -1 211 -1.101518618127559e+00 -1.035217081913410e+00 2.448188576383616e+00 2.880646596416754e+00 1.395701799999974e-01 1 +P 5 -1 2112 3.889123324749427e-01 -9.308973845861833e-01 9.710420686719063e+01 9.711399279830138e+01 9.395654205006568e-01 1 +E 40 1 5 +U GEV MM +A 0 weight 1.662490599749242e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 3.761756441344740e+00 2.111311165719572e+00 -3.770612341220817e+00 5.729394736913965e+00 5.109989522832801e-04 1 +P 4 -1 211 -3.153535744648165e+00 -2.094855205934873e+00 1.419118419008173e+01 1.468817192773073e+01 1.395701800000037e-01 1 +P 5 -1 2112 -6.082206966965741e-01 -1.645595978469964e-02 8.457942817725107e+01 8.458683501103866e+01 9.395654204996888e-01 1 +E 41 1 5 +U GEV MM +A 0 weight 2.548699412850425e-05 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.478018383765982e+00 1.186283664933679e+00 -4.563404265739329e+00 4.941302058175206e+00 5.109989557595237e-04 1 +P 4 -1 211 -5.484479367845876e-01 -7.201214120573800e-01 6.114842804614836e-01 1.101255123876169e+00 1.395701800000013e-01 1 +P 5 -1 2112 -9.295704469813938e-01 -4.661622528762991e-01 9.895192001138983e+01 9.896184449363199e+01 9.395654204996888e-01 1 +E 42 1 5 +U GEV MM +A 0 weight 4.259258265623896e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 4.711094521692097e-01 4.486958333585189e+00 -3.642075582539411e+00 5.798228523721918e+00 5.109989314258181e-04 1 +P 4 -1 211 -4.907439210221525e-01 -3.446928302037150e+00 1.070295209385593e+01 1.125587880504784e+01 1.395701799998510e-01 1 +P 5 -1 2112 1.963446885294337e-02 -1.040030031548040e+00 8.793912351479547e+01 8.795029434691359e+01 9.395654204996888e-01 1 +E 43 1 5 +U GEV MM +A 0 weight 1.923493852553464e+01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.989348429101219e+00 7.653773227147926e-01 -4.689882230884880e+00 5.151534258760512e+00 5.109989557595237e-04 1 +P 4 -1 211 2.153803394969251e+00 -1.475558913051148e+00 2.213564417995712e+01 2.228951247261546e+01 1.395701800001055e-01 1 +P 5 -1 2112 -1.644549658680317e-01 7.101815903363550e-01 7.755423807703974e+01 7.756335494430738e+01 9.395654204996888e-01 1 +E 44 1 5 +U GEV MM +A 0 weight 7.844132162933343e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.512082564110712e+00 -1.357568828075035e+00 -4.341387872294118e+00 5.196267973333597e+00 5.109989557595237e-04 1 +P 4 -1 211 -1.900262072532731e+00 1.230643394621970e+00 5.362700110410956e+00 5.822672188813311e+00 1.395701800000037e-01 1 +P 5 -1 2112 -6.118204915779800e-01 1.269254334530649e-01 9.397868778799516e+01 9.398546151353645e+01 9.395654205006568e-01 1 +E 45 1 5 +U GEV MM +A 0 weight 2.797665601991396e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.778495813493031e+00 -1.744853384879009e-01 -4.315447386459487e+00 5.135520472684875e+00 5.109989488070365e-04 1 +P 4 -1 211 -2.278487234255092e+00 6.785158804319430e-01 4.919677212007175e+00 5.465765415945847e+00 1.395701800000164e-01 1 +P 5 -1 2112 -5.000085792379382e-01 -5.040305419440421e-01 9.439577020056431e+01 9.440311578705264e+01 9.395654204996888e-01 1 +E 46 1 5 +U GEV MM +A 0 weight 7.582355447513831e-05 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.066527228993845e+00 7.795253413106805e-01 -4.479098976068517e+00 4.994048702651635e+00 5.109989453307929e-04 1 +P 4 -1 211 1.034156427946107e+00 -6.981136037867073e-01 1.251257260403954e+00 1.772559360956116e+00 1.395701799999989e-01 1 +P 5 -1 2112 1.032370801047739e+00 -8.141173752397322e-02 9.822784174177654e+01 9.823779361207559e+01 9.395654205006568e-01 1 +E 47 1 5 +U GEV MM +A 0 weight 3.145678213373736e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.812898113133803e+00 9.241802819670005e-01 -4.302846445624287e+00 5.223120981194079e+00 5.109989488070365e-04 1 +P 4 -1 211 1.995205335577901e+00 -1.471826869711438e+00 6.347304680719368e+00 6.815781335294606e+00 1.395701799999783e-01 1 +P 5 -1 2112 8.176927775559025e-01 5.476465877444376e-01 9.295554179101691e+01 9.296549935919467e+01 9.395654204987208e-01 1 +E 48 1 5 +U GEV MM +A 0 weight 1.257992292653068e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.755499710432259e+00 2.066186880363989e-01 -4.477720659816452e+00 5.261696732509882e+00 5.109989627120108e-04 1 +P 4 -1 211 -1.919984941363959e+00 3.965712518407714e-01 7.464827998463177e+00 7.719245287891551e+00 1.395701800000292e-01 1 +P 5 -1 2112 -8.355147690683002e-01 -6.031899398771703e-01 9.201289268746525e+01 9.202345965528190e+01 9.395654204987208e-01 1 +E 49 1 5 +U GEV MM +A 0 weight 2.129396052004630e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -3.079898627833476e+00 5.144168984427451e-01 -4.201873166426908e+00 5.235087264887989e+00 5.109989522832801e-04 1 +P 4 -1 211 2.416829190565316e+00 1.178039927296091e-01 4.981812803137531e+00 5.540115500395446e+00 1.395701799999528e-01 1 +P 5 -1 2112 6.630694372681610e-01 -6.322208911723542e-01 9.422006038940137e+01 9.422919891039993e+01 9.395654205016248e-01 1 +E 50 1 5 +U GEV MM +A 0 weight 3.995316147037714e+00 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.156424996521477e+00 6.313457213477118e-01 -4.503489269368294e+00 5.032909898450598e+00 5.109989522832801e-04 1 +P 4 -1 211 -2.529086942264636e+00 -4.978578376431962e-01 6.974506221962815e+00 7.436891828134890e+00 1.395701800000037e-01 1 +P 5 -1 2112 3.726619457431603e-01 -1.334878837045156e-01 9.252898307351747e+01 9.253459994909785e+01 9.395654204996888e-01 1 +E 51 1 5 +U GEV MM +A 0 weight 1.747881323604523e+00 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 6.030707577703753e-01 -1.823186626457771e+00 -4.665317727008852e+00 5.045086081409827e+00 5.109989383783055e-04 1 +P 4 -1 211 -1.321080492016593e+00 1.933864082526259e+00 9.474279237799269e+00 9.760457513201493e+00 1.395701800000037e-01 1 +P 5 -1 2112 7.180097342462182e-01 -1.106774560684883e-01 9.019103851532157e+01 9.019885808107202e+01 9.395654204996888e-01 1 +E 52 1 5 +U GEV MM +A 0 weight 7.649764442452253e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.518770332030703e+00 9.589900681268118e-01 -4.395734076976842e+00 5.156194747379049e+00 5.109989522832801e-04 1 +P 4 -1 211 2.979766511809169e+00 -5.744897801624284e-01 1.013451571849241e+01 1.058002531452196e+01 1.395701800000546e-01 1 +P 5 -1 2112 -4.609961797784663e-01 -3.845002879643833e-01 8.926121838459640e+01 8.926818161378233e+01 9.395654205006568e-01 1 +E 53 1 5 +U GEV MM +A 0 weight 9.346489880257593e+00 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.672626901329149e+00 -1.143340296276475e+00 -4.560211396547188e+00 4.990033669872210e+00 5.109989522832801e-04 1 +P 4 -1 211 -1.730348163271465e+00 1.052841199297079e+00 4.360841792325561e+00 4.810301480147860e+00 1.395701799999910e-01 1 +P 5 -1 2112 5.772126194231669e-02 9.049909697939620e-02 9.519936963033362e+01 9.520406652566329e+01 9.395654205006568e-01 1 +E 54 1 5 +U GEV MM +A 0 weight 2.399850072760029e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.681765896041032e+00 1.832475698950115e+00 -4.160542497258017e+00 5.278252517739311e+00 5.109989557595237e-04 1 +P 4 -1 211 3.328035909865785e+00 -2.457796937973415e+00 1.514510140798936e+01 1.570064219384335e+01 1.395701799999019e-01 1 +P 5 -1 2112 -6.462700138247528e-01 6.253212390233001e-01 8.401544111538064e+01 8.402550696410070e+01 9.395654205006568e-01 1 +E 55 1 5 +U GEV MM +A 0 weight 2.878636098331145e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.382178356857501e+00 7.842358725695627e-01 -4.424789967651035e+00 5.086115034744144e+00 5.109989488070365e-04 1 +P 4 -1 211 -1.475985296797739e+00 -3.819619190978860e-01 2.179921097480974e+00 2.663824943646248e+00 1.395701799999910e-01 1 +P 5 -1 2112 -9.061930600597614e-01 -4.022739534716768e-01 9.724486889628206e+01 9.725446169729298e+01 9.395654205006568e-01 1 +E 56 1 5 +U GEV MM +A 0 weight 5.309901937900761e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.298751695224165e+00 1.010755083444666e+00 -4.398182956171091e+00 5.064572911122814e+00 5.109989522832801e-04 1 +P 4 -1 211 1.532176678861043e+00 -4.984259329076789e-01 2.188403247329709e+00 2.721136232148070e+00 1.395701799999974e-01 1 +P 5 -1 2112 7.665750163631224e-01 -5.123291505369870e-01 9.720977973495337e+01 9.721869253241248e+01 9.395654204996888e-01 1 +E 57 1 5 +U GEV MM +A 0 weight 4.326000794453088e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.085950994918020e+00 1.609274940705818e+00 -4.620119430679195e+00 5.011442827470601e+00 5.109989522832801e-04 1 +P 4 -1 211 6.805394230157384e-01 -7.295144563536967e-01 1.213753953475491e+00 1.577340718751101e+00 1.395701799999989e-01 1 +P 5 -1 2112 4.054115719022824e-01 -8.797604843521215e-01 9.840636550331568e+01 9.841561812946165e+01 9.395654205016248e-01 1 +E 58 1 5 +U GEV MM +A 0 weight 4.074495814052363e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.203536671390714e+00 -1.586362318997286e+00 -4.524609395971832e+00 4.943393204445020e+00 5.109989488070365e-04 1 +P 4 -1 211 -6.782148170361830e-01 1.371772901115605e+00 1.961505477369881e+00 2.491730282992087e+00 1.395701799999974e-01 1 +P 5 -1 2112 -5.253218543545300e-01 2.145894178816805e-01 9.756310394471393e+01 9.756927818824626e+01 9.395654205016248e-01 1 +E 59 1 5 +U GEV MM +A 0 weight 2.959580572633622e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.177583439547973e+00 -1.697233237480542e+00 -4.624291159937665e+00 5.064718394195661e+00 5.109989453307929e-04 1 +P 4 -1 211 5.579546228718262e-01 1.220646016492845e+00 2.805052446553983e+00 3.112730171702587e+00 1.395701800000164e-01 1 +P 5 -1 2112 6.196288166761469e-01 4.765872209876966e-01 9.681923873949567e+01 9.682695310978512e+01 9.395654205025928e-01 1 +E 60 1 5 +U GEV MM +A 0 weight 3.853966881045408e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 4.257242373746435e+00 3.219400545931041e-01 -3.739185187227972e+00 5.675320621170104e+00 5.109989592357673e-04 1 +P 4 -1 211 -3.451766126699283e+00 -6.657134437277423e-01 1.036951503569926e+01 1.095007697202749e+01 1.395701799999528e-01 1 +P 5 -1 2112 -8.054762470471510e-01 3.437733891346382e-01 8.836967017764069e+01 8.837900408248575e+01 9.395654205011408e-01 1 +E 61 1 5 +U GEV MM +A 0 weight 1.692419038020813e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.591897107510842e+00 1.371514084945483e+00 -4.553299141674034e+00 5.014750304929912e+00 5.109989418545492e-04 1 +P 4 -1 211 1.152431290706388e+00 -8.579956090406125e-01 2.211192701686091e+00 2.640664186159843e+00 1.395701799999942e-01 1 +P 5 -1 2112 4.394658168044541e-01 -5.135184759048702e-01 9.734210646609995e+01 9.734898718459360e+01 9.395654204977528e-01 1 +E 62 1 5 +U GEV MM +A 0 weight 5.830766723291728e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 6.922145669095817e-01 -2.009308480232780e+00 -4.509000283024243e+00 4.984733231458813e+00 5.109989661882544e-04 1 +P 4 -1 211 -1.856306511865911e-01 1.278584791230004e+00 1.430459380095922e+00 1.932597133464259e+00 1.395701799999974e-01 1 +P 5 -1 2112 -5.065839157229900e-01 7.307236890027760e-01 9.807854092904030e+01 9.808707131076029e+01 9.395654205025928e-01 1 +E 63 1 5 +U GEV MM +A 0 weight 8.960564633837228e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.354158730715836e+00 1.453450235509141e+00 -4.654838104700412e+00 5.061005976796150e+00 5.109989557595237e-04 1 +P 4 -1 211 6.439035277536913e-01 -9.446311485218117e-01 2.227622412343626e+00 2.507732283744051e+00 1.395701799999974e-01 1 +P 5 -1 2112 7.102552029621451e-01 -5.088190869873296e-01 9.742721571846877e+01 9.743566341514315e+01 9.395654205006568e-01 1 +E 64 1 5 +U GEV MM +A 0 weight 7.072893603107326e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.131538643691731e+00 -1.190026645850368e+00 -4.460797959298960e+00 5.085109546724707e+00 5.109989557595237e-04 1 +P 4 -1 211 1.376184665537560e+00 9.593490590682079e-01 2.918392226391331e+00 3.369084129700884e+00 1.395701799999974e-01 1 +P 5 -1 2112 7.553539781541713e-01 2.306775867821605e-01 9.654240575901962e+01 9.655020799925776e+01 9.395654204996888e-01 1 +E 65 1 5 +U GEV MM +A 0 weight 9.761307622692344e-05 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.953550347348857e+00 -8.060928024477110e-01 -4.575532984335938e+00 5.040004654526711e+00 5.109989522832801e-04 1 +P 4 -1 211 -1.016936565403044e+00 2.664465080551364e-01 1.296710892382609e+00 1.675139604115863e+00 1.395701800000005e-01 1 +P 5 -1 2112 -9.366137819458129e-01 5.396462943925746e-01 9.827882211806531e+01 9.828925741704076e+01 9.395654204987208e-01 1 +E 66 1 5 +U GEV MM +A 0 weight 9.234456167282033e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 4.161564151029114e+00 1.993213022487824e+00 -3.565115039021659e+00 5.831085648378357e+00 5.109989453307929e-04 1 +P 4 -1 211 -3.217705524911425e+00 -2.276427854453570e+00 1.272032333574277e+01 1.331772721685516e+01 1.395701800000037e-01 1 +P 5 -1 2112 -9.438586261176874e-01 2.832148319657460e-01 8.584479172939089e+01 8.585558881044985e+01 9.395654205001728e-01 1 +E 67 1 5 +U GEV MM +A 0 weight 6.108693226307073e-02 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -3.533021117392082e+00 -2.610185579273355e+00 -3.718559268307700e+00 5.755257619535550e+00 5.109989592357673e-04 1 +P 4 -1 211 3.133502819495681e+00 2.056810403785882e+00 1.319644172265945e+01 1.371914220830157e+01 1.395701800002074e-01 1 +P 5 -1 2112 3.995182978964021e-01 5.533751754874734e-01 8.552211757176023e+01 8.553000184784625e+01 9.395654205016248e-01 1 +E 68 1 5 +U GEV MM +A 0 weight 2.044727789920162e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.587550004467955e+00 -1.398605919318940e+00 -4.536231792592315e+00 5.005378374457360e+00 5.109989522832801e-04 1 +P 4 -1 211 8.301184249599368e-01 1.042237593736999e+00 1.746320134976361e+00 2.201015595180040e+00 1.395701800000037e-01 1 +P 5 -1 2112 7.574315795080186e-01 3.563683255819405e-01 9.778991168372795e+01 9.779800770604596e+01 9.395654205006568e-01 1 +E 69 1 5 +U GEV MM +A 0 weight 8.596116322894451e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -1.497694365594693e+00 1.464370365726071e+00 -4.522517169155782e+00 4.984037598893046e+00 5.109989522832801e-04 1 +P 4 -1 211 1.187585652054260e+00 -1.436832846442496e+00 3.299318668460622e+00 3.792074870144205e+00 1.395701799999974e-01 1 +P 5 -1 2112 3.101087135404343e-01 -2.753751928357519e-02 9.622319852680715e+01 9.622828920664608e+01 9.395654204977528e-01 1 +E 70 1 5 +U GEV MM +A 0 weight 4.360453107404509e-04 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 1.482125736488032e+00 -1.226556103035961e+00 -4.551826597132457e+00 4.941686170138419e+00 5.109989453307929e-04 1 +P 4 -1 211 -1.119461339901611e+00 3.740322813773522e-01 1.155807712154107e+00 1.657849553387400e+00 1.395701800000005e-01 1 +P 5 -1 2112 -3.626643965864196e-01 8.525238216586085e-01 9.839601891109034e+01 9.840486595215754e+01 9.395654205006568e-01 1 +E 71 1 5 +U GEV MM +A 0 weight 4.442589210171057e-03 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 2.329339824776431e+00 5.354342460994010e-01 -4.511884506389951e+00 5.105841351952404e+00 5.109989592357673e-04 1 +P 4 -1 211 -2.113619429270592e+00 5.100118703838765e-01 6.127087724388474e+00 6.502936491864254e+00 1.395701800000292e-01 1 +P 5 -1 2112 -2.157203955058385e-01 -1.045446116483277e+00 9.338479680811346e+01 9.339562383186669e+01 9.395654204996888e-01 1 +E 72 1 5 +U GEV MM +A 0 weight 3.000115840701669e-01 +P 1 0 11 6.123233963758798e-16 0.000000000000000e+00 -4.999999973888007e+00 5.000000000000000e+00 5.109989488070365e-04 4 +P 2 0 2212 -0.000000000000000e+00 -0.000000000000000e+00 1.000000000000000e+02 1.000044016756834e+02 9.382720881592784e-01 4 +V -1 0 [1,2] +P 3 -1 11 -2.230121374545862e-01 -2.496664924598478e+00 -4.428312855724985e+00 5.088518956284970e+00 5.109989418545492e-04 1 +P 4 -1 211 4.042005056791879e-01 2.053832895164616e+00 4.327185962174376e+00 4.808911082192703e+00 1.395701800000292e-01 1 +P 5 -1 2112 -1.811883682246011e-01 4.428320294338624e-01 9.510112691966259e+01 9.510697163720569e+01 9.395654205016248e-01 1 diff --git a/reference_output/reference_README.md b/reference_output/reference_README.md new file mode 100644 index 0000000..9d12884 --- /dev/null +++ b/reference_output/reference_README.md @@ -0,0 +1,9 @@ +# Instructions to generate the test sample +Follow the instructions in the `README.md` file to install DEMPgen from GitHub: [https://github.com/JeffersonLab/DEMPgen](https://github.com/JeffersonLab/DEMPgen/releases). The test sample can be generated by running the following command in the `data/` folder: +``` +./../build/DEMPgen ../Test_EIC.json +``` +The output will include`.ROOT`, `.DAT`, and `.TXT` files, which will be saved in the `data/OutputFiles/` folder. The generated files will be identical to the files in the `data/OutputFiles/reference_output` folder. + +The file `Test_EIC.json` contains all the configuration options for the EIC event generation. It is located in the `DEMPgen` folder. + diff --git a/shell_script_archive/batch_runEIC.sh b/shell_script_archive/batch_runEIC.sh deleted file mode 100755 index 6ce6f8d..0000000 --- a/shell_script_archive/batch_runEIC.sh +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/bash -# Batch submission job script, executes run_EIC_batch.csh script - -echo "Running as ${USER}" # Checks who you're running this as -NumFiles=$1 -NumEvents=$2 -if [[ -z "$3" ]]; then - echo "No output format specified, script will default to Pythia6 (Fun4All)" - OutputType="Pythia6" -else OutputType=$3 -fi - -##Output history file## -historyfile=hist.$( date "+%Y-%m-%d_%H-%M-%S" ).log # Creates a log file - -i=1 -while [[ $i -le $NumFiles ]]; do - batch="${USER}_EICDempGen_5on100_${i}_Job.txt" # The name of the job submission script it'll create each time - echo "Running ${batch} for file ${i}" - cp /dev/null ${batch} - RandomSeed=$(od -An -N3 -i /dev/urandom) - echo "#!/bin/csh" >> ${batch} # Tells your job which shell to run in - echo "#PBS -N DEMPGen_5on100_${NumEvents}_${i}" >> ${batch} # Name your job - echo "#PBS -m abe" >> ${batch} # Email you on job start, end or error - #echo "#PBS -M ${USER}@jlab.org" >>${batch} # Your email address, change it to be what you like - echo "#PBS -r n" >> ${batch} # Don't re-run if it crashes - echo "#PBS -o /home/${USER}/trq_output/DEMPGen_5on100_${NumEvents}_${i}.out" >> ${batch} # Output directory and file name, set to what you like - echo "#PBS -e /home/${USER}/trq_output/DEMPGen_5on100_${NumEvents}_${i}.err" >> ${batch} # Error output directory and file name - echo "date" >> ${batch} - echo "cd /home/apps/DEMPgen/" >> ${batch} # Tell your job to go to the directory with the script you want to run - echo "./run_EIC_batch.csh ${i} ${NumEvents} ${RandomSeed} ${OutputType}" >> ${batch} # Run your script, change this to what you like - echo "date">>${batch} - echo "exit">>${batch} # End of your job script - echo "Submitting batch" - eval "qsub ${batch} 2>/dev/null" # Use qsub to actually submit your job - echo " " - i=$(( $i + 1 )) - sleep 2 - rm ${batch} -done diff --git a/shell_script_archive/batch_runEIC_10on100.sh b/shell_script_archive/batch_runEIC_10on100.sh deleted file mode 100755 index 40240a1..0000000 --- a/shell_script_archive/batch_runEIC_10on100.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -# Batch submission job script, executes run_EIC_batch_10on100.csh script - -echo "Running as ${USER}" # Checks who you're running this as -NumFiles=$1 -NumEvents=$2 -if [[ -z "$3" ]]; then - echo "No output format specified, script will default to Pythia6 (Fun4All)" - OutputType="Pythia6" -else OutputType=$3 -fi -##Output history file## -historyfile=hist.$( date "+%Y-%m-%d_%H-%M-%S" ).log # Creates a log file - -i=1 -while [[ $i -le $NumFiles ]]; do - batch="${USER}_EICDempGen_10on100_${i}_Job.txt" # The name of the job submission script it'll create each time - echo "Running ${batch} for file ${i}" - cp /dev/null ${batch} - RandomSeed=$(od -An -N3 -i /dev/random) - echo "#!/bin/csh" >> ${batch} # Tells your job which shell to run in - echo "#PBS -N DEMPGen_10on100_${NumEvents}_${i}" >> ${batch} # Name your job - echo "#PBS -m abe" >> ${batch} # Email you on job start, end or error - #echo "#PBS -M ${USER}@jlab.org" >>${batch} # Your email address, change it to be what you like - echo "#PBS -r n" >> ${batch} # Don't re-run if it crashes - echo "#PBS -o /home/${USER}/trq_output/DEMPGen_10on100_${NumEvents}_${i}.out" >> ${batch} # Output directory and file name, set to what you like - echo "#PBS -e /home/${USER}/trq_output/DEMPGen_10on100_${NumEvents}_${i}.err" >> ${batch} # Error output directory and file name - echo "date" >> ${batch} - echo "cd /home/apps/DEMPgen/" >> ${batch} # Tell your job to go to the directory with the script you want to run - echo "./run_EIC_batch_10on100.csh ${i} ${NumEvents} ${RandomSeed} ${OutputType}" >> ${batch} # Run your script, change this to what you like - echo "date">>${batch} - echo "exit">>${batch} # End of your job script - echo "Submitting batch" - eval "qsub ${batch} 2>/dev/null" # Use qsub to actually submit your job - echo " " - i=$(( $i + 1 )) - sleep 2 - rm ${batch} -done diff --git a/shell_script_archive/batch_runEIC_5on100.sh b/shell_script_archive/batch_runEIC_5on100.sh deleted file mode 100755 index 095a859..0000000 --- a/shell_script_archive/batch_runEIC_5on100.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -# Batch submission job script, executes run_EIC_batch_5on100.csh script - -echo "Running as ${USER}" # Checks who you're running this as -NumFiles=$1 -NumEvents=$2 -if [[ -z "$3" ]]; then - echo "No output format specified, script will default to Pythia6 (Fun4All)" - OutputType="Pythia6" -else OutputType=$3 -fi -##Output history file# -historyfile=hist.$( date "+%Y-%m-%d_%H-%M-%S" ).log # Creates a log file - -i=1 -while [[ $i -le $NumFiles ]]; do - batch="${USER}_EICDempGen_5on100_${i}_Job.txt" # The name of the job submission script it'll create each time - echo "Running ${batch} for file ${i}" - cp /dev/null ${batch} - RandomSeed=$(od -An -N3 -i /dev/random) - echo "#!/bin/csh" >> ${batch} # Tells your job which shell to run in - echo "#PBS -N DEMPGen_5on100_${NumEvents}_${i}" >> ${batch} # Name your job - echo "#PBS -m abe" >> ${batch} # Email you on job start, end or error - #echo "#PBS -M ${USER}@jlab.org" >>${batch} # Your email address, change it to be what you like - echo "#PBS -r n" >> ${batch} # Don't re-run if it crashes - echo "#PBS -o /home/${USER}/trq_output/DEMPGen_5on100_${NumEvents}_${i}.out" >> ${batch} # Output directory and file name, set to what you like - echo "#PBS -e /home/${USER}/trq_output/DEMPGen_5on100_${NumEvents}_${i}.err" >> ${batch} # Error output directory and file name - echo "date" >> ${batch} - echo "cd /home/apps/DEMPgen/" >> ${batch} # Tell your job to go to the directory with the script you want to run - echo "./run_EIC_batch_5on100.csh ${i} ${NumEvents} ${RandomSeed} ${OutputType}" >> ${batch} # Run your script, change this to what you like - echo "date">>${batch} - echo "exit">>${batch} # End of your job script - echo "Submitting batch" - eval "qsub ${batch} 2>/dev/null" # Use qsub to actually submit your job - echo " " - i=$(( $i + 1 )) - sleep 2 - rm ${batch} -done diff --git a/shell_script_archive/batch_runEIC_5on41.sh b/shell_script_archive/batch_runEIC_5on41.sh deleted file mode 100755 index 02ed79f..0000000 --- a/shell_script_archive/batch_runEIC_5on41.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -# Batch submission job script, executes run_EIC_batch_5on41.csh script - -echo "Running as ${USER}" # Checks who you're running this as -NumFiles=$1 -NumEvents=$2 -if [[ -z "$3" ]]; then - echo "No output format specified, script will default to Pythia6 (Fun4All)" - OutputType="Pythia6" -else OutputType=$3 -fi -##Output history file## -historyfile=hist.$( date "+%Y-%m-%d_%H-%M-%S" ).log # Creates a log file - -i=1 -while [[ $i -le $NumFiles ]]; do - batch="${USER}_EICDempGen_5on41_${i}_Job.txt" # The name of the job submission script it'll create each time - echo "Running ${batch} for file ${i}" - cp /dev/null ${batch} - RandomSeed=$(od -An -N3 -i /dev/random) - echo "#!/bin/csh" >> ${batch} # Tells your job which shell to run in - echo "#PBS -N DEMPGen_5on41_${NumEvents}_${i}" >> ${batch} # Name your job - echo "#PBS -m abe" >> ${batch} # Email you on job start, end or error - #echo "#PBS -M ${USER}@jlab.org" >>${batch} # Your email address, change it to be what you like - echo "#PBS -r n" >> ${batch} # Don't re-run if it crashes - echo "#PBS -o /home/${USER}/trq_output/DEMPGen_5on41_${NumEvents}_${i}.out" >> ${batch} # Output directory and file name, set to what you like - echo "#PBS -e /home/${USER}/trq_output/DEMPGen_5on41_${NumEvents}_${i}.err" >> ${batch} # Error output directory and file name - echo "date" >> ${batch} - echo "cd /home/apps/DEMPgen/" >> ${batch} # Tell your job to go to the directory with the script you want to run - echo "./run_EIC_batch_5on41.csh ${i} ${NumEvents} ${RandomSeed} ${OutputType}" >> ${batch} # Run your script, change this to what you like - echo "date">>${batch} - echo "exit">>${batch} # End of your job script - echo "Submitting batch" - eval "qsub ${batch} 2>/dev/null" # Use qsub to actually submit your job - echo " " - i=$(( $i + 1 )) - sleep 2 - rm ${batch} -done diff --git a/shell_script_archive/run_EIC_batch.csh b/shell_script_archive/run_EIC_batch.csh deleted file mode 100755 index 7d4af56..0000000 --- a/shell_script_archive/run_EIC_batch.csh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/csh - -set FileNum=$1 -set NumEvents=$2 -set RandomSeed=$3 - -if ( ! $?4 ) then - echo "Output type not specified, defaulting to Pythia6" - set OutputType="Pythia6" -else - set OutputType=$4 -endif - -echo "Running target polarisation up, FF setting for file $FileNum with $NumEvents events per file using random seed $RandomSeed using $OutputType format output format." -cp Config_EIC.json Config_EIC_$FileNum.json -sed -i 's/"file_name" \:.*/"file_name" \: "DEMPGen_5on100_'$NumEvents'_'$FileNum'",/' Config_EIC_$FileNum.json -sed -i 's/"n_events" \:.*/"n_events" \: '$NumEvents',/' Config_EIC_$FileNum.json -sed -i 's/"generator_seed"\:.*/"generator_seed" \: '$RandomSeed',/' Config_EIC_$FileNum.json -sed -i 's/"OutputType"\:.*/"OutputType"\: "'$OutputType'",/' Config_EIC_$FileNum.json -cd data/ -./../build/DEMPgen ../Config_EIC_$FileNum.json -sleep 5 -mv "LundFiles/eic_input_DEMPGen_5on100_"$NumEvents"_"$FileNum".dat" "LundFiles/eic_DEMPGen_5on100_"$NumEvents"_"$FileNum".dat" -rm -rf ../Config_EIC_$FileNum.json diff --git a/shell_script_archive/run_EIC_batch_10on100.csh b/shell_script_archive/run_EIC_batch_10on100.csh deleted file mode 100755 index 236698e..0000000 --- a/shell_script_archive/run_EIC_batch_10on100.csh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/csh - -set FileNum=$1 -set NumEvents=$2 -set RandomSeed=$3 - -if ( ! $?4 ) then - echo "Output type not specified, defaulting to Pythia6" - set OutputType="Pythia6" -else - set OutputType=$4 -endif - -echo "Running target polarisation up, FF setting for file $FileNum with $NumEvents events per file using random seed $RandomSeed using $OutputType output format." -cp Config_EIC.json Config_EIC_10on100_$FileNum.json -sed -i 's/"file_name" \:.*/"file_name" \: "DEMPGen_10on100_'$NumEvents'_'$FileNum'",/' Config_EIC_10on100_$FileNum.json -sed -i 's/"n_events" \:.*/"n_events" \: '$NumEvents',/' Config_EIC_10on100_$FileNum.json -sed -i 's/"generator_seed"\:.*/"generator_seed" \: '$RandomSeed',/' Config_EIC_10on100_$FileNum.json -sed -i 's/"ebeam"\:.*/"ebeam" \: '10.0',/' Config_EIC_10on100_$FileNum.json -sed -i 's/"hbeam"\:.*/"hbeam" \: '100.0',/' Config_EIC_10on100_$FileNum.json -sed -i 's/"OutputType"\:.*/"OutputType"\: "'$OutputType'",/' Config_EIC_10on100_$FileNum.json -cd data/ -./../build/DEMPgen ../Config_EIC_10on100_$FileNum.json -sleep 5 -mv "LundFiles/eic_input_DEMPGen_10on100_"$NumEvents"_"$FileNum".dat" "LundFiles/eic_DEMPGen_10on100_"$NumEvents"_"$FileNum".dat" -rm -rf ../Config_EIC_10on100_$FileNum.json diff --git a/shell_script_archive/run_EIC_batch_5on100.csh b/shell_script_archive/run_EIC_batch_5on100.csh deleted file mode 100755 index 57cd9b8..0000000 --- a/shell_script_archive/run_EIC_batch_5on100.csh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/csh - -set FileNum=$1 -set NumEvents=$2 -set RandomSeed=$3 - -if ( ! $?4 ) then - echo "Output type not specified, defaulting to Pythia6" - set OutputType="Pythia6" -else - set OutputType=$4 -endif - -echo "Running target polarisation up, FF setting for file $FileNum with $NumEvents events per file using random seed $RandomSeed using $OutputType output format." -cp Config_EIC.json Config_EIC_5on100_$FileNum.json -sed -i 's/"file_name" \:.*/"file_name" \: "DEMPGen_5on100_'$NumEvents'_'$FileNum'",/' Config_EIC_5on100_$FileNum.json -sed -i 's/"n_events" \:.*/"n_events" \: '$NumEvents',/' Config_EIC_5on100_$FileNum.json -sed -i 's/"generator_seed"\:.*/"generator_seed" \: '$RandomSeed',/' Config_EIC_5on100_$FileNum.json -sed -i 's/"ebeam"\:.*/"ebeam" \: '5.0',/' Config_EIC_5on100_$FileNum.json -sed -i 's/"hbeam"\:.*/"hbeam" \: '100.0',/' Config_EIC_5on100_$FileNum.json -sed -i 's/"OutputType"\:.*/"OutputType"\: "'$OutputType'",/' Config_EIC_5on100_$FileNum.json -cd data/ -./../build/DEMPgen ../Config_EIC_5on100_$FileNum.json -sleep 5 -mv "LundFiles/eic_input_DEMPGen_5on100_"$NumEvents"_"$FileNum".dat" "LundFiles/eic_DEMPGen_5on100_"$NumEvents"_"$FileNum".dat" -rm -rf ../Config_EIC_5on100_$FileNum.json diff --git a/shell_script_archive/run_EIC_batch_5on41.csh b/shell_script_archive/run_EIC_batch_5on41.csh deleted file mode 100755 index f720397..0000000 --- a/shell_script_archive/run_EIC_batch_5on41.csh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/csh - -set FileNum=$1 -set NumEvents=$2 -set RandomSeed=$3 - -if ( ! $?4 ) then - echo "Output type not specified, defaulting to Pythia6" - set OutputType="Pythia6" -else - set OutputType=$4 -endif - -echo "Running target polarisation up, FF setting for file $FileNum with $NumEvents events per file using random seed $RandomSeed using $OutputType output format." -cp Config_EIC.json Config_EIC_5on41_$FileNum.json -sed -i 's/"file_name" \:.*/"file_name" \: "DEMPGen_5on41_'$NumEvents'_'$FileNum'",/' Config_EIC_5on41_$FileNum.json -sed -i 's/"n_events" \:.*/"n_events" \: '$NumEvents',/' Config_EIC_5on41_$FileNum.json -sed -i 's/"generator_seed"\:.*/"generator_seed" \: '$RandomSeed',/' Config_EIC_5on41_$FileNum.json -sed -i 's/"ebeam"\:.*/"ebeam" \: '5.0',/' Config_EIC_5on41_$FileNum.json -sed -i 's/"hbeam"\:.*/"hbeam" \: '41.0',/' Config_EIC_5on41_$FileNum.json -sed -i 's/"OutputType"\:.*/"OutputType"\: "'$OutputType'",/' Config_EIC_5on41_$FileNum.json -cd data/ -./../build/DEMPgen ../Config_EIC_5on41_$FileNum.json -sleep 5 -mv "LundFiles/eic_input_DEMPGen_5on41_"$NumEvents"_"$FileNum".dat" "LundFiles/eic_DEMPGen_5on41_"$NumEvents"_"$FileNum".dat" -rm -rf ../Config_EIC_5on41_$FileNum.json diff --git a/sjdkay_notes b/sjdkay_notes deleted file mode 100644 index d06999c..0000000 --- a/sjdkay_notes +++ /dev/null @@ -1,35 +0,0 @@ -Stephen JD Kay - University of Regina -stephen.kay@uregina.ca -26/11/20 - -######################################################################################################################################## - -Some notes on where to change or modify certain things to tweak the generator output as needed for different EIC/detector configurations - -######################################################################################################################################## - -Beam Energy - Tweak the energy of each beam (e/p) on line 224/225 of eic_pim.cc in src/eic_evgen -Luminosity - Adjust the luminosity on line 129 of eic_pim.cc in src/eic_evgen -Beam Crossing Angle - Adjust line 665 of PiPlus_prod.cc in src/eic_evgen/process_routine - -######################################################################################################################################## -######################################################## Q2/W/t thresholds ############################################################# -######################################################################################################################################## - -Lines that may be present in the .json file are ONLY for SoLID event generation - -Change these for EIC running in src/eic_evgen/process_routine/PiPlus_prod.cc - -Relevant lines in src/eic_evgen/process_routine/PiPlus_prod.cc are as follows - - -Q2 - Line 256, Line 819 for comment in output file -W - Line 387, Line 817 for comment in output file -t - Line 484, Line 820 for comment in output file - -######################################################################################################################################## -##################################################### Comments/Future Changes ########################################################## -######################################################################################################################################## - -Can't tweak any of these variables for EIC runs in the .json file which is a bit odd. -These are all variables that are likely to be changed so it might be nice to modify the generator so that these are read in as items from -the config file. \ No newline at end of file diff --git a/src/eic_evgen/archived_routines/KPlus_prod.cc b/src/eic_evgen/archived_routines/KPlus_prod.cc deleted file mode 100644 index 4031eab..0000000 --- a/src/eic_evgen/archived_routines/KPlus_prod.cc +++ /dev/null @@ -1,1097 +0,0 @@ -#include "reaction_routine.h" -#include "eic.h" - -using namespace std; - -KPlus_Production::KPlus_Production() { - - cout << "Program Start" << endl; - -} - -/// KPlus_Production -// 09/02/22 - SJDK - Added new hadron string argument -KPlus_Production::KPlus_Production(TString particle_str, TString hadron_str) { - - rParticle = particle_str; - rHadron = hadron_str; - -} - -KPlus_Production::~KPlus_Production() { - - ppiOut.close(); - ppiDetails.close(); - -} - -void KPlus_Production::process_reaction() { - - Init(); - - if (gOutputType == "Pythia6"){ - KPlus_Pythia6_Out_Init(); - } - else if (gOutputType == "HEPMC3"){ - KPlus_HEPMC3_Out_Init(); - } - - for( long long int i = 0; i < rNEvents; i++ ) { - - rNEvent_itt = i; - fNGenerated ++; - - Progress_Report(); // This is happens at each 10% of the total event is processed - Processing_Event(); - } - - Detail_Output(); - -} - -void KPlus_Production::Init() { - - pim* myPim; - - pd = dynamic_cast(myPim); - rParticle_charge = ExtractCharge(rParticle); - - sTFile = Form("./LundFiles/eic_%s.txt", gfile_name.Data()); - sLFile= Form("./LundFiles/eic_input_%s.dat", gfile_name.Data()); - - ppiOut.open( sLFile.c_str() ); - ppiDetails.open( sTFile.c_str() ); - - qsq_ev = 0, t_ev = 0, w_neg_ev = 0, w_ev = 0; - rNEvents = fNEvents; - rNEvent_itt = 0; - - // 02/06/21 SJDK - // Set these values once the beam energies are read in - fPSF = ( fEBeam * ( fScatElec_E_Hi - fScatElec_E_Lo ) *( sin( fScatElec_Theta_F ) - sin( fScatElec_Theta_I ) ) * 2 * fPI *( sin( fPion_Theta_F ) - sin( fPion_Theta_I ) ) * 2 * fPI ); - fElectron_Kin_Col_GeV = fEBeam; - fElectron_Kin_Col = fElectron_Kin_Col_GeV * 1000.0; - - // cout << rNEvents << " " << fNEvents << endl; - - rFermiMomentum = pd->fermiMomentum(); - - // Proton in collider (lab) frame - - r_lproton = GetProtonVector_lab(); - r_lprotong = GetProtonVector_lab() * fm; - - /// Electron in collider (lab) frame - - cout << "Fermi momentum: " << rFermiMomentum << endl; - - r_lelectron = GetElectronVector_lab(); - r_lelectrong = r_lelectron * fm; - - ///*--------------------------------------------------*/ - /// Getting the particle mass from the data base - /// Particle X is the produced meson, in this case, the K+ - ///*--------------------------------------------------*/ - produced_X = ParticleEnum(rParticle); - fX_Mass = ParticleMass(produced_X)*1000; //MeV - fX_Mass_GeV = fX_Mass/1000; //GeV - - cout << rParticle << " " << produced_X << " " << fX_Mass_GeV << endl; - cout << rParticle_charge << endl; - - if(rHadron == "Lambda"){ - rParticle_scat_hadron = "Lambda"; - recoil_hadron = Lambda; - f_Scat_hadron_Mass = fLambda_Mass; - f_Scat_hadron_Mass_GeV = f_Scat_hadron_Mass/1000; - cout<<"Particle = "<Uniform( cos( fScatElec_Theta_I ) , cos( fScatElec_Theta_F ) ) ); - fScatElec_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi); - fScatElec_Energy_Col = fRandom->Uniform( fScatElec_E_Lo * fElectron_Energy_Col , fScatElec_E_Hi * fElectron_Energy_Col ); - - // ---------------------------------------------------- - // Produced Particle X in Collider frame - // ---------------------------------------------------- - - - /// The generic produced particle in the exclusive reaction is labelled as X - fX_Theta_Col = acos( fRandom->Uniform( cos(fX_Theta_I), cos(fX_Theta_F ) ) ); - fX_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi ); - - // --------------------------------------------------------------------- - // Specify the energy and solid angle of scatterd electron in Collider (lab) frame - // --------------------------------------------------------------------- - - fScatElec_Mom_Col = sqrt( pow( fScatElec_Energy_Col,2) - pow( fElectron_Mass , 2) ); - fScatElec_MomZ_Col = ( fScatElec_Mom_Col * cos(fScatElec_Theta_Col) ); - fScatElec_MomX_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * cos(fScatElec_Phi_Col) ); - fScatElec_MomY_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * sin(fScatElec_Phi_Col) ); - - r_lscatelec.SetPxPyPzE( fScatElec_MomX_Col, fScatElec_MomY_Col, fScatElec_MomZ_Col, fScatElec_Energy_Col); - - r_lscatelecg = r_lscatelec * fm; - - // ---------------------------------------------------- - // Photon in collider (lab) frame and Qsq - // ---------------------------------------------------- - - r_lphoton = r_lelectron - r_lscatelec; - r_lphotong = r_lelectrong - r_lscatelecg; - - fQsq_GeV = -1.* r_lphotong.Mag2(); - - if ( fQsq_GeV < 3.0 ) { - qsq_ev++; - return; - } - - // ---------------------------------------------------- - // W square, Invariant Mass (P_g + P_p)^2 - // ---------------------------------------------------- - - TLorentzVector lwg; - lwg = r_lprotong + r_lphotong; - fW_GeV = lwg.Mag(); - fWSq_GeV = lwg.Mag2(); - - if ( fWSq_GeV < 0 ) { - w_neg_ev++; - return; - } - - // --------------------------------------------------------- - // Kaon momentum in collider frame, analytic solution starts - // --------------------------------------------------------- - - double fupx = sin( fX_Theta_Col ) * cos( fX_Phi_Col ); - double fupy = sin( fX_Theta_Col ) * sin( fX_Phi_Col ); - double fupz = cos( fX_Theta_Col ); - - double fuqx = sin( r_lphoton.Theta() ) * cos( r_lphoton.Phi() ); - double fuqy = sin( r_lphoton.Theta() ) * sin( r_lphoton.Phi() ); - double fuqz = cos( r_lphoton.Theta() ); - - double fa = -(r_lphoton.Vect()).Mag() * ( fupx * fuqx + fupy * fuqy + fupz * fuqz ); - double fb = pow ( (r_lphoton.Vect()).Mag() , 2 ); - double fc = r_lphoton.E() + fProton_Mass; - - fa = ( fa - std::abs( (r_lproton.Vect()).Mag() ) * ( ( ( r_lproton.X() / (r_lproton.Vect()).Mag() ) * fupx ) + - ( ( r_lproton.Y() / (r_lproton.Vect()).Mag() ) * fupy ) + - ( ( r_lproton.Z() / (r_lproton.Vect()).Mag() ) * fupz ) ) ); - - double factor = ( pow( (r_lproton.Vect()).Mag() , 2 ) + 2.0 * (r_lphoton.Vect()).Mag() * (r_lproton.Vect()).Mag() * - ( ( ( r_lproton.X() / (r_lproton.Vect()).Mag() ) * fuqx ) + - ( ( r_lproton.Y() / (r_lproton.Vect()).Mag() ) * fuqy ) + - ( ( r_lproton.Z() / (r_lproton.Vect()).Mag() ) * fuqz ) ) ); - - fb = fb + factor; - fc = r_lphoton.E() + r_lproton.E(); - - double ft = fc * fc - fb + fX_Mass * fX_Mass - fProton_Mass * fProton_Mass; - - double fQA = 4.0 * ( fa * fa - fc * fc ); - double fQB = 4.0 * fc * ft; - - double fQC = -4.0 * fa * fa * fX_Mass * fX_Mass - ft * ft; - - fradical = fQB * fQB - 4.0 * fQA * fQC; - - fepi1 = ( -fQB - sqrt( fradical ) ) / ( 2.0 * fQA ); - fepi2 = ( -fQB + sqrt( fradical ) ) / ( 2.0 * fQA ); - - // --------------------------------------------------------- - // Particle X momentum in collider frame, analytic solution ends - // --------------------------------------------------------- - - r_lX.SetPxPyPzE( (sqrt( pow( fepi1 , 2) - pow(fX_Mass , 2) ) ) * sin(fX_Theta_Col) * cos(fX_Phi_Col), - ( sqrt( pow( fepi1 , 2) - pow(fX_Mass , 2) ) ) * sin(fX_Theta_Col) * sin(fX_Phi_Col), - ( sqrt( pow( fepi1 , 2) - pow(fX_Mass , 2) ) ) * cos(fX_Theta_Col), - fepi1 ); - - r_lX_g = r_lX * fm; - - // ---------------------------------------------------- - // Scattered proton collider (lab) frame - // ---------------------------------------------------- - - r_l_scat_hadron.SetPxPyPzE( ( r_lproton + r_lelectron - r_lscatelec - r_lX).X(), - ( r_lproton + r_lelectron - r_lscatelec - r_lX ).Y(), - ( r_lproton + r_lelectron - r_lscatelec - r_lX ).Z(), - sqrt( pow( ( ( ( r_lproton + r_lelectron - r_lscatelec - r_lX ).Vect() ).Mag()),2) + - pow( f_Scat_hadron_Mass ,2 ) ) ); - - r_l_scat_hadron_g = r_l_scat_hadron * fm; - - // ---------------------------------------------------------------------------------------------- - // Calculate w = (proton + photon)^2 - // ---------------------------------------------------------------------------------------------- - - if ( fW_GeV < 3.0 || fW_GeV > 10.6 ) { - w_ev++; - return; - } - - r_lw = r_lproton + r_lphoton; - fW = r_lw.Mag(); - - - // ---------------------------------------------------------------------------------------------- - // Calculate w prime w' = (proton + photon - pion)^2 - // ---------------------------------------------------------------------------------------------- - - lwp = r_lprotong + r_lphotong - r_lX_g; - fW_Prime_GeV = lwp.Mag(); - - fsini = r_lelectron + r_lproton; - fsfin = r_lscatelec + r_lX + r_l_scat_hadron; - - fsinig = fsini * fm; - fsfing = fsfin * fm; - // SJDK 15/06/21 - Mandlestam S conservation check - doesn't actually seem to be utilised? - fMandSConserve = std::abs( fsinig.Mag() - fsfing.Mag() ); - - // SJDK 15/06/21 - Added integer counters for conservation law check and for NaN check - if (r_lX.E() != r_lX.E()){ // SJDK 15/06/21 - If the energy of the produced meson is not a number, return and add to counter - fNaN++; - return; - } - kSConserve = false; - if( std::abs( fsinig.Mag() - fsfing.Mag() ) < fDiff ) { - kSConserve = true; - } - // For the Kaon case, the energy difference threshold is set higher for now - if ( pd->CheckLaws( r_lelectron, r_lproton, r_lscatelec, r_lX, r_l_scat_hadron, 10) != 1 ){ - fConserve++; - return; - } - - //////////////////////////////////////////////////////////////////////////////////////////// - // Start // - // Transformation of e', pi- and recoil proton to target's rest frame without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - lproton_rf = r_lproton; - lproton_rf.Boost(-beta_col_rf); - lproton_rfg = lproton_rf * fm; - - lelectron_rf = r_lelectron; - lelectron_rf.Boost(-beta_col_rf); - lelectron_rfg = lelectron_rf * fm; - - lscatelec_rf = r_lscatelec; - lscatelec_rf.Boost(-beta_col_rf); - lscatelec_rfg = lscatelec_rf * fm; - - lphoton_rf = r_lphoton; - lphoton_rf.Boost(-beta_col_rf); - lphoton_rfg = lphoton_rf * fm; - - lX_rf = r_lX; - lX_rf.Boost(-beta_col_rf); - lX_rfg = lX_rf * fm; - - l_scat_hadron_rf = r_l_scat_hadron; - l_scat_hadron_rf.Boost(-beta_col_rf); - l_scat_hadron_rf_g = l_scat_hadron_rf * fm; - - //////////////////////////////////////////////////////////////////////////////////////////// - // End // - // Transformation of e', pi- and recoil proton to target's rest frmae without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - - // ----------------------------------------------------------------------------------------- - // Calculate -t - // ----------------------------------------------------------------------------------------- - - fBeta_CM_RF = (lphoton_rf.Vect()).Mag() / ( lphoton_rf.E() + fProton_Mass ); - fGamma_CM_RF = ( lphoton_rf.E() + fProton_Mass ) / fW; - fX_Energy_CM = ( pow( fW , 2) + pow(fX_Mass , 2) - pow(f_Scat_hadron_Mass , 2) ) / ( 2.0 * fW); - fX_Mom_CM = sqrt( pow(fX_Energy_CM , 2) - pow(fX_Mass , 2)); - fX_Energy_CM_GeV = fX_Energy_CM / 1000.0; - fX_Mom_CM_GeV = fX_Mom_CM / 1000.0; - - // this equation is valid for parallel kinematics only! - fT_Para = ( pow(((r_lphoton.Vect()).Mag() - (r_lX.Vect()).Mag()),2) - pow((r_lphoton.E() - r_lX.E()),2)); - fT_Para_GeV = fT_Para/1000000.0; - - lt = r_lphoton - r_lX; - ltg = lt * fm; - - fT = -1.*lt.Mag2(); - fT_GeV = -1.*ltg.Mag2(); - - if ( gKinematics_type == 1 && fT_GeV > 1.2 ) { - t_ev++; - return; - } - - if ( gKinematics_type == 2 && fT_GeV > 1.3 ) { - t_ev++; - return; - } - - fx = fQsq_GeV / ( 2.0 * r_lprotong.Dot( r_lphotong ) ); - fy = r_lprotong.Dot( r_lphotong ) / r_lprotong.Dot( r_lelectrong ); - fz = r_lX.E()/r_lphoton.E(); - - // ------------------------------------------------------------------------------------------------------- - // Calculation of Phi ( azimuthal angle of pion momentum w.r.t lepton plane in target's rest frame) - // Calculation of PhiS ( azimuthal angle of target polarization w.r.t lepton plane in target's rest frame) - // ------------------------------------------------------------------------------------------------------- - - v3Photon.SetX( lphoton_rfg.X() ); - v3Photon.SetY( lphoton_rfg.Y() ); - v3Photon.SetZ( lphoton_rfg.Z() ); - - v3Electron.SetX( lelectron_rfg.X() ); - v3Electron.SetY( lelectron_rfg.Y() ); - v3Electron.SetZ( lelectron_rfg.Z() ); - - v3X.SetX( lX_rfg.X() ) ; - v3X.SetY( lX_rfg.Y() ) ; - v3X.SetZ( lX_rfg.Z() ); - - v3S.SetX( -1 ); - v3S.SetY( 0 ); - v3S.SetZ( 0 ); - - v3PhotonUnit = v3Photon.Unit(); - v3QxL = v3Photon.Cross(v3Electron); - v3QxP = v3Photon.Cross(v3X); - v3QxS = v3Photon.Cross(v3S); - v3LxP = v3Electron.Cross(v3X); - v3LxS = v3Electron.Cross(v3S); - v3PxL = v3X.Cross(v3Electron); - v3QUnitxL = v3PhotonUnit.Cross(v3Electron); - v3QUnitxP = v3PhotonUnit.Cross(v3X); - v3QUnitxS = v3PhotonUnit.Cross(v3S); - - // Get the Phi scattering angle with respect to the electron scattering plane - fPhi = Get_Phi_X_LeptonPlane_RF (); - - // Get the Phi scattering angle with respect to the electron scattering plane - fPhiS = Get_Phi_TargPol_LeptonPlane_RF(); - - fTheta_X_Photon_RF = fRAD2DEG * acos( ( v3Photon.Dot( v3X ) ) / ( v3Photon.Mag() * v3X.Mag() ) ); - if ( fTheta_X_Photon_RF < 0 ) { fTheta_X_Photon_RF = 180.0 + fTheta_X_Photon_RF; } - - // ----------------------------------------------------------------------------------- - // If we have fermi momentum then epsilon should be in rest frame - // The theta angle of scattered angle used in expression of epsilon is the angle - // with respect to direction of incoming electron in the rest frame of target nucleon - // epsilon=1./(1.+ 2.*(pgam_restg**2)/q2g * *(tand(thscat_rest/2.))**2) - // ----------------------------------------------------------------------------------- - - double fTheta_EEp = (lelectron_rf.Vect()).Angle(lscatelec_rf.Vect()); - - fEpsilon = 1.0 / ( 1.0 + 2.0 * ( pow( (lphoton_rfg.Vect()).Mag(),2)/fQsq_GeV ) * pow( tan( fTheta_EEp / 2 ) , 2 ) ); - - // ---------------------------------------------------- - // Virtual Photon flux factor in units of 1/(GeV*Sr) - // ---------------------------------------------------- - fFlux_Factor_Col = (fAlpha/(2.0*pow(fPi,2))) * (r_lscatelecg.E() / r_lelectrong.E()) * - ( pow(fW_GeV,2) - pow(fProton_Mass_GeV,2) ) / (2.0*fProton_Mass_GeV*fQsq_GeV*(1.0 - fEpsilon)); - - fFlux_Factor_RF = ( fAlpha / ( 2.0 * pow( fPi , 2 ) ) ) * ( lscatelec_rfg.E() / lelectron_rfg.E() ) * - ( pow( fW_GeV , 2 ) - pow( fProton_Mass_GeV , 2 ) ) / - ( 2.0 * fProton_Mass_GeV * fQsq_GeV * ( 1.0 - fEpsilon ) ); - - // ---------------------------------------------------- - // Jacobian dt/dcos(theta*)dphi in units of GeV2/sr - // ---------------------------------------------------- - fJacobian_CM = ( (lphoton_rfg.Vect()).Mag() - fBeta_CM_RF * lphoton_rfg.E() ) / ( fGamma_CM_RF * ( 1.0 - pow(fBeta_CM_RF,2) ) ); - - fA = fJacobian_CM * fX_Mom_CM_GeV / fPi; - - // ---------------------------------------------------- - // Jacobian dOmega* / dOmega dimensionless - // ---------------------------------------------------- - fJacobian_CM_RF = ( pow((lX_rf.Vect()).Mag(),2)*fW) / - ( fX_Mom_CM * std::abs( ( fProton_Mass + lphoton_rf.E()) * (lX_rf.Vect()).Mag() - - ( lX_rf.E() * (lphoton_rf.Vect()).Mag() * cos( lX_rf.Theta() ) ) ) ); - - fJacobian_CM_Col = ( ( pow((r_lX.Vect()).Mag(),2) * fW ) / - ( fX_Mom_CM * std::abs( ( fProton_Mass + r_lphoton.E() ) * (r_lX.Vect()).Mag() - - ( r_lX.E() * (r_lphoton.Vect()).Mag() * cos( r_lX.Theta() ) ) ) ) ); - - - // cout << lX_rf.Vect().Mag() << " " << << << << << << << << endl; - // cout << fJacobian_CM_RF << " " << fJacobian_CM_Col << endl; - - // ----------------------------------------------------------------------------------------------------------- - // CKY sigma L and T starts - // ----------------------------------------------------------------------------------------------------------- - - // r_fSig_T = 1; - // r_fSig_L = 1; - // - // ------------------------------------------------------------------------------------------- - - r_fSig = Get_Total_Cross_Section(); - - // ----------------------------------------------------------------------------------------------------------- - // CKY sigma L and T ends - // ----------------------------------------------------------------------------------------------------------- - - fSigma_Col = r_fSig * fFlux_Factor_Col * fA * fJacobian_CM_Col; - - if ( ( fSigma_Col <= 0 ) || std::isnan( fSigma_Col ) ) { - fNSigmaNeg ++; - return; - } - - // ----------------------------------------------------------------------------------------------------------- - // ----------------------------------------------------------------------------------------------------------- - // Lab cross section Phase Space Conversion Luminosity Total events tried - // Hz = ub / ( sr^2 * GeV ) * GeV * sr^2 * ( cm^2 / ub ) * ( # / ( cm^2 * sec ) ) / ( # ) - - // SJDK 11/05/21 - This is the previous non unit weight - // SJDK 24/06/21 - Explicitly taking the absolute value of the weigth such that the value is positive! - fEventWeight = abs(fSigma_Col * fPSF * fuBcm2 * fLumi / fNEvents); // in Hz - // SJDK 21/06/21 - Commenting out "unit weight" calculation for now, reverting to old version - // SJDK 11/05/21 - New weight calculation, division by ceiling weight value to attempt to get a "unit" value - //fEventWeight = abs(fSigma_Col * fPSF * fuBcm2 * fLumi )/fEventWeightCeil; - // if ( (fEventWeight > 1) || (fEventWeight <= 0) ){ - // fNWeightUnphys ++; - // return; - // } - // SJDK 21/06/21 - Reversed sign of condition here, actually want to reject those with a value less than the random number - // fEventWeightRn = fRandom->Uniform( 0, 1.0); - // if ( fEventWeight < fEventWeightRn ){ - // fNWeightReject ++; - // return; - // } - fNRecorded++; - fLundRecorded++; - fRatio = fNRecorded / fNGenerated; - - if (gOutputType == "Pythia6"){ - KPlus_Pythia6_Output(); - } - else if (gOutputType == "LUND"){ - Lund_Output(); - } - else if (gOutputType == "HEPMC3"){ - KPlus_HEPMC3_Output(); - } -} - -void KPlus_Production::Progress_Report() { - - dFractTime = time(0); - - if ( rNEvent_itt % ( rNEvents / 10 ) == 0 ) { - cout << "Event: " << setw(8) << rNEvent_itt - << " % of events " << setw(4) << ((1.0*rNEvent_itt)/(1.0*rNEvents))*100.0 - << " Day: " << dFractTime.GetDay() - << " Time: " << dFractTime.GetHour() - << ":" << dFractTime.GetMinute() - << ":" << dFractTime.GetSecond() - << endl; - } -} - -TLorentzVector KPlus_Production::GetProtonVector_lab() { - - // Crossing angle - // fProton_Theta_Col = 0.050; - // fProton_Theta_Col = 0.025; - // Set crossing angle to 0 for fun4all, also required for ATHENA simulations - fProton_Theta_Col = 0.0; - - // fProton_Phi_Col = fPi; - fProton_Phi_Col = fProton_incidence_phi; - - fProton_Mom_Col = fPBeam * 1e3; - fVertex_X = 0.; - fVertex_Y = 0.; - fVertex_Z = 0.; - - - TLorentzVector lproton( fProton_Mom_Col * sin(fProton_Theta_Col) * cos(fProton_Phi_Col), - fProton_Mom_Col * sin(fProton_Theta_Col) * sin(fProton_Phi_Col), - fProton_Mom_Col * cos(fProton_Theta_Col), - sqrt( pow( fProton_Mom_Col , 2 ) + pow( fProton_Mass , 2 ) ) ); - - return lproton; - -} - -//*--------------------------------------------------*/ -// Proton in collider (lab) frame -// ---------------------------------------------------- - -void KPlus_Production::Consider_Proton_Fermi_Momentum() { - - fProton_Mom_Col = fProton_Mom_Col + rFermiMomentum; - fProton_Theta_Col = acos( fRandom->Uniform( cos(0.0) , cos(fPi) ) ); - fProton_Phi_Col = fRandom->Uniform( 0 , 360 ); - - double px, py, pz, e; - - px = fProton_Mom_Col * sin(fProton_Theta_Col) * cos(fProton_Phi_Col); - py = fProton_Mom_Col * sin(fProton_Theta_Col) * sin(fProton_Phi_Col); - pz = fProton_Mom_Col * cos(fProton_Theta_Col); - e = sqrt( pow( fProton_Mom_Col , 2 ) + pow( fProton_Mass , 2 ) ); - - r_lproton.SetPxPyPzE(px,py,pz,e); - - r_lprotong = r_lproton*fm; - -} - -// ---------------------------------------------------- -// Electron in collider (lab) frame -// ---------------------------------------------------- - -TLorentzVector KPlus_Production::GetElectronVector_lab() { - - fElectron_Energy_Col = fElectron_Kin_Col; - fElectron_Mom_Col = sqrt( pow(fElectron_Energy_Col , 2) - pow(fElectron_Mass , 2) ); - fElectron_Theta_Col = fPi; - fElectron_Phi_Col = 0.0; - fElectron_MomZ_Col = fElectron_Mom_Col * cos(fElectron_Theta_Col); - fElectron_MomX_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * cos(fElectron_Phi_Col); - fElectron_MomY_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * sin(fElectron_Phi_Col); - - cout << "Define: " << fElectron_MomZ_Col << " "<< fElectron_Mom_Col << " " << cos(fElectron_Theta_Col) << endl; - - TLorentzVector lelectron( fElectron_MomX_Col, fElectron_MomY_Col, fElectron_MomZ_Col, fElectron_Energy_Col); - - return lelectron; - -} - -Double_t KPlus_Production::Get_Phi_X_LeptonPlane_RF () { - - fCos_Phi_X_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_X_LeptonPlane_RF = ( ( v3LxP.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_X_LeptonPlane_RF >= 0 ) - fPhi_X_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); - if ( fSin_Phi_X_LeptonPlane_RF < 0 ) - fPhi_X_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ) ); - - return fPhi_X_LeptonPlane_RF; - -} - -Double_t KPlus_Production::Get_Phi_TargPol_LeptonPlane_RF () { - - fCos_Phi_TargPol_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_TargPol_LeptonPlane_RF = ( ( v3LxS.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_TargPol_LeptonPlane_RF >= 0 ) - fPhi_TargPol_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); - if ( fSin_Phi_TargPol_LeptonPlane_RF < 0 ) - fPhi_TargPol_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ) ); - - return fPhi_TargPol_LeptonPlane_RF; - -} - -Double_t KPlus_Production::Get_Total_Cross_Section() { - - Double_t total_sig; - - if(rParticle_scat_hadron == "Lambda"){ - total_sig = GetKPlus_CrossSection(); - //total_sig = GetKLambda_CrossSection(); -> SJDK 08/02/22 Not implemented yet - } - else if (rParticle_scat_hadron == "Sigma0"){ - total_sig = GetKPlus_CrossSection(); - //total_sig = GetKSigma_CrossSection(); -> SJDK 08/02/22 Not implemented yet - } - - return total_sig; - -} - -/*--------------------------------------------------*/ -/// Charged Pi+ module: -/// Author: Z. Ahmed -/// Date: 2017 -/// Modified by A. Usman to switch to Kaon production - June/July 2021 - -Double_t KPlus_Production::GetKPlus_CrossSection(){ - - double_t sig_total; - - // -------------------------------------------------------------------------------------------------- - // CKY sigma L and T starts - // -------------------------------------------------------------------------------------------------- - double lpar0 = 0., lpar1 = 0., lpar2 = 0., lpar3 = 0., lpar4 = 0., lpar5 = 0., lpar6 = 0.; - double tpar0 = 0., tpar1 = 0., tpar2 = 0., tpar3 = 0., tpar4 = 0.; - - - lpar0 = 0.; lpar1 = 0.; lpar2 = 0.; lpar3 = 0.; lpar4 = 0.; lpar5 = 0.; lpar6 = 0.; - tpar0 = 0.; tpar1 = 0.; tpar2 = 0.; tpar3 = 0.; tpar4 = 0.; - - fSig_L = 0; - fSig_T = 0; - - if ( ( fT_GeV > 0. ) && ( fT_GeV < 0.15 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLonglandau = new TF1("sigmaL","landau", 0.0 , 0.15 ); - fitCKYLonglandau->FixParameter( 0 , lpar0 ); - fitCKYLonglandau->FixParameter( 1 , lpar1 ); - fitCKYLonglandau->FixParameter( 2 , lpar2 ); - fSig_L = fitCKYLonglandau->Eval(fT_GeV); - if ( lpar0 == 0 || lpar1 == 0 || lpar2 == 0 ) - fSig_L = 0; - fitCKYLonglandau = NULL; - delete fitCKYLonglandau; - } - else if ( ( fT_GeV > 0.15 ) && ( fT_GeV < 0.5 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLongexpo1 = new TF1("sigmaL","expo", 0.15 , 0.5 ); - fitCKYLongexpo1->FixParameter( 0 , lpar3 ); - fitCKYLongexpo1->FixParameter( 1 , lpar4 ); - fSig_L = fitCKYLongexpo1->Eval(fT_GeV); - if ( lpar3 == 0 || lpar4 == 0 ) - fSig_L = 0; - fitCKYLongexpo1 = NULL; - delete fitCKYLongexpo1; - } - else if ( ( fT_GeV > 0.5 ) && ( fT_GeV < 1.3 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLongexpo2 = new TF1("sigmaL","expo", 0.5 , 1.3 ); - fitCKYLongexpo2->FixParameter( 0 , lpar5 ); - fitCKYLongexpo2->FixParameter( 1 , lpar6 ); - fSig_L = fitCKYLongexpo2->Eval(fT_GeV); - if ( lpar5 == 0 || lpar6 == 0 ) - fSig_L = 0; - fitCKYLongexpo2 = NULL; - delete fitCKYLongexpo2; - } - else { - fSig_L = 0; - } - // SJDK - 02/06/22 - The validity range here was inconsistent, this only went from 0.0 to 0.15, leaving a gap between 0.15 to 0.2 - // I changed the range to remove this gap. - if ( ( fT_GeV > 0.0 ) && ( fT_GeV < 0.2 ) ) { - eicSigmaT( fW_GeV, fQsq_GeV, tpar0, tpar1, tpar2 , tpar3 , tpar4 ); - TF1 *fitCKYTranspol2 = new TF1("sigmaL","pol2", 0.0 , 0.2 ); - fitCKYTranspol2->FixParameter( 0 , tpar0 ); - fitCKYTranspol2->FixParameter( 1 , tpar1 ); - fitCKYTranspol2->FixParameter( 2 , tpar2 ); - fSig_T = fitCKYTranspol2->Eval(fT_GeV); - if ( tpar0 == 0 || tpar1 == 0 || tpar2 == 0 ) - fSig_T = 0; - fitCKYTranspol2 = NULL; - delete fitCKYTranspol2; - } - else if ( ( fT_GeV > 0.2 ) && ( fT_GeV < 1.3 ) ) { - eicSigmaT( fW_GeV, fQsq_GeV, tpar0, tpar1, tpar2 , tpar3 , tpar4 ); - TF1 *fitCKYTransexpo = new TF1("sigmaL","expo", 0.2 , 1.3 ); - fitCKYTransexpo->FixParameter( 0 , tpar3 ); - fitCKYTransexpo->FixParameter( 1 , tpar4 ); - fSig_T = fitCKYTransexpo->Eval(fT_GeV); - if ( tpar3 == 0 || tpar4 == 0 ) - fSig_T = 0; - fitCKYTransexpo = NULL; - delete fitCKYTransexpo; - } - - // ------------------------------------------------------------------------------------------------ - // Improving the Kaon Sigma_L following GH's fortran code (pole_ration.f) located in main driectory - // Added by AU on July 10, 2021 - // ------------------------------------------------------------------------------------------------ - - double mkg = 0, mpig = 0, hbarc = 0, gpoleKL = 0, gpoleKS = 0, gpolepi = 0, gpoleKhyp = 0, r2_dip = 0, r2_mono = 0, Fpi_mono = 0, Fpi_dip = 0, pmono = 0, Fpi_fit = 0, fpisq = 0, Fkk = 0, fksq = 0, lNpi = 0, lNk = 0, gkhypn = 0, gpinn = 0, dl_poleKhyp = 0, dl_polepi = 0, ratio_Khyp_pi = 0, FT_GeV_neg = 0; - - gpoleKL = -13.3; - gpoleKS = -3.5; - gpolepi = 13.1; - - r2_dip = 0.411; - r2_mono = 0.431; - - hbarc = 0.197; - mkg = fX_Mass_GeV; - mpig = 0.13957; - - FT_GeV_neg = -1.0 * fT_GeV; - - if ( recoil_hadron = Lambda ) { - gpoleKhyp = gpoleKL; - } - else if ( recoil_hadron = Sigma0 ) { - gpoleKhyp = gpoleKS; - } - - Fpi_mono = 1.0 / ( 1.0 + ( r2_mono * fQsq_GeV) / (6 * (hbarc * hbarc))); - Fpi_dip = 1.0 / ( 1.0 + ( r2_dip * fQsq_GeV) / (12 * (hbarc * hbarc))) * ( 1.0 + ( r2_dip * fQsq_GeV) / (12 * (hbarc * hbarc))); - pmono = 0.85; - - Fpi_fit = pmono * Fpi_mono + (1 - pmono) * Fpi_dip; - fpisq = Fpi_fit * Fpi_fit; - - Fkk = 0.9 / (1.0 + fQsq_GeV / 0.462 ); - fksq = Fkk * Fkk; - - lNpi = 0.44; - lNk = (0.44+0.80)/2; - - gkhypn = gpoleKhyp * ((lNk * lNk) - (mkg * mkg)) / ((lNk * lNk) - FT_GeV_neg); - gpinn = gpolepi * ((lNpi * lNpi) - (mpig * mpig)) / ((lNpi * lNpi) - FT_GeV_neg); - - dl_poleKhyp = ((gkhypn * gkhypn) * fksq) / ((FT_GeV_neg - (mkg * mkg))*(FT_GeV_neg - (mkg * mkg))); - dl_polepi = ((gpinn * gpinn) * fpisq) / ((FT_GeV_neg - (mpig * mpig))*(FT_GeV_neg - (mpig * mpig))); - - ratio_Khyp_pi = dl_poleKhyp / dl_polepi; - - // -------------------------------------------------------------------------------- - - fSig_VR = (0.1* fSig_T) + fEpsilon * (ratio_Khyp_pi* fSig_L); - sig_total = fSig_VR; - - return sig_total; -} - -/*--------------------------------------------------*/ -/// Output generator detail - -void KPlus_Production::Detail_Output() { - - ppiDetails << "Total events tried " << setw(20) << fNGenerated << endl; - ppiDetails << "Total events recorded " << setw(20) << fNRecorded << endl; - // 09/02/22 - Commented out, not used anymore - //ppiDetails << "Max weight value " << setw(20) << fEventWeightCeil << endl; - ppiDetails << "Number of events with w more than 10.6 " << setw(20) << w_ev << endl; - ppiDetails << "Number of events with wsq negative " << setw(20) << w_neg_ev << endl; - ppiDetails << "Number of events with qsq less than 5 " << setw(20) << qsq_ev << endl; - ppiDetails << "Number of events with Meson (X) energy NaN " << setw(20) << fNaN << endl; - ppiDetails << "Number of events failing conservation law check " << setw(20) << fConserve << endl; - ppiDetails << "Total events passing conservation laws " << setw(20) << conserve << endl; - ppiDetails << "Total events failed energy conservation " << setw(20) << ene << endl; - ppiDetails << "Total events failed momentum conserveation " << setw(20) << mom << endl; - - ppiDetails << "Number of events with -t more than threshold " << setw(20) << t_ev << endl; - ppiDetails << "Number of events with w less than threshold " << setw(20) << fWSqNeg << endl; - ppiDetails << "Number of events with mom not conserve " << setw(20) << fNMomConserve << endl; - ppiDetails << "Number of events with Sigma negative " << setw(20) << fNSigmaNeg << endl; - ppiDetails << "Number of lund events " << setw(20) << fLundRecorded << endl; - - ppiDetails << "Seed used for the Random Number Generator " << setw(20) << fSeed << endl; - -} - -/*--------------------------------------------------*/ -/// Output format functions follow - -void KPlus_Production::Lund_Output() { - - ppiOut << "3" - << " \t " << fPhi // var 1 - << " \t " << fPhiS // var 2 - << " \t " << fx // var 3 - << " \t " << "1" - << " \t " << fQsq_GeV // var 4 - << " \t " << fT_GeV // var 5 - << " \t " << fW_GeV // var 6 - << " \t " << fEpsilon // var 7 - << " \t " << fEventWeight // var 8 - << endl; - - // Produced Particle X - ppiOut << setw(10) << "1" - << setw(10) << "1" - << setw(10) << "1" - // << setw(10) << "11111111111" - << setw(10) << PDGtype(produced_X) - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << r_lX_g.X() - << setw(16) << r_lX_g.Y() - << setw(16) << r_lX_g.Z() - << setw(16) << r_lX_g.E() - << setw(16) << fX_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Scattered electron - ppiOut << setw(10) << "2" - << setw(10) << "-1" - << setw(10) << "1" - << setw(10) << "11" - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << r_lscatelecg.X() - << setw(16) << r_lscatelecg.Y() - << setw(16) << r_lscatelecg.Z() - << setw(16) << r_lscatelecg.E() - << setw(16) << fElectron_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Recoiled hadron - ppiOut << setw(10) << "3" - << setw(10) << "1" - << setw(10) << "1" - << setw(10) << PDGtype(recoil_hadron) - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << r_l_scat_hadron_g.X() - << setw(16) << r_l_scat_hadron_g.Y() - << setw(16) << r_l_scat_hadron_g.Z() - << setw(16) << r_l_scat_hadron_g.E() - << setw(16) << f_Scat_hadron_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; -} - -void KPlus_Production::KPlus_Pythia6_Out_Init() { - - print_itt = 0; - - ppiOut << "DEMP Event FILE" << endl; - ppiOut << "============================================" << endl; - ppiOut << "I, ievent, nParticles, Weight" << endl; - ppiOut << "============================================" << endl; - ppiOut << "I K(I,1) K(I,2) K(I,3) K(I,4) K(I,5) P(I,1) P(I,2) P(I,3) P(I,4) P(I,5) V(I,1) V(I,2) V(I,3)" << endl; - ppiOut << "============================================" << endl; - -} - -void KPlus_Production::KPlus_Pythia6_Output() { - - ppiOut << "0" << " \t\t\t " << print_itt << " \t\t\t " << "1" << " \t\t\t " << fEventWeight << endl; // var 1 - - print_itt++; - - ppiOut << "============================================" << endl; - - ///*--------------------------------------------------*/ - // Initial State - - ppiOut << "1" - << setw(6) << "21" - << setw(6) << "11" - << setw(6) << "0" - << setw(6) << "3" - << setw(6) << "4" - - << setw(14) << r_lelectrong.X() - << setw(14) << r_lelectrong.Y() - << setw(14) << r_lelectrong.Z() - << setw(14) << r_lelectrong.E() - << setw(14) << fElectron_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ppiOut << "2" - << setw(6) << "21" - << setw(6) << "2212" - << setw(6) << "0" - << setw(6) << "5" - << setw(6) << "6" - - << setw(14) << r_lprotong.X() - << setw(14) << r_lprotong.Y() - << setw(14) << r_lprotong.Z() - << setw(14) << r_lprotong.E() - << setw(14) << fProton_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ppiOut << "3" - << setw(6) << "21" - << setw(6) << "22" - << setw(6) << "1" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_lphotong.X() - << setw(14) << r_lphotong.Y() - << setw(14) << r_lphotong.Z() - << setw(14) << r_lphotong.E() - << setw(14) << r_lphotong.M() - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ///*--------------------------------------------------*/ - // Final State - - // Scattered electron - ppiOut << "4" - << setw(6) << "1" - << setw(6) << "11" - << setw(6) << "1" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_lscatelecg.X() - << setw(14) << r_lscatelecg.Y() - << setw(14) << r_lscatelecg.Z() - << setw(14) << r_lscatelecg.E() - << setw(14) << fElectron_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - // Recoiled hadron - ppiOut << "5" - << setw(6) << "1" - << setw(6) << PDGtype(recoil_hadron) - << setw(6) << "2" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_l_scat_hadron_g.X() - << setw(14) << r_l_scat_hadron_g.Y() - << setw(14) << r_l_scat_hadron_g.Z() - << setw(14) << r_l_scat_hadron_g.E() - << setw(14) << f_Scat_hadron_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - // Produced Particle X - ppiOut << "6" - << setw(6) << "1" - << setw(6) << PDGtype(produced_X) - << setw(6) << "2" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_lX_g.X() - << setw(14) << r_lX_g.Y() - << setw(14) << r_lX_g.Z() - << setw(14) << r_lX_g.E() - << setw(14) << fX_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ppiOut << "=============== Event finished ===============" << endl; - -} - -void KPlus_Production::KPlus_HEPMC3_Out_Init() { - - print_itt = 0; - ppiOut << "HepMC::Version 3.02.02" << endl; - ppiOut << "HepMC::Asciiv3-START_EVENT_LISTING" << endl; - -} - -void KPlus_Production::KPlus_HEPMC3_Output() { - - // HEPMC3 output for Athena/EPIC simulations - - // First line - E - Event# - #Vertices - #Particles - ppiOut << "E" << " " << print_itt << " " << "1" << " " << 5 << endl; - print_itt++; - // Second line, Units - U - ENERGY UNIT - DISTANCE UNIT - ppiOut << "U" << " " << "GEV" << " " << "MM" << endl; - // Third line, optional attributes, the weight - ppiOut << "A" << " " << "0" << " " << "weight" << " " << fEventWeight << endl; - // Beam particles, particle line - P - Particle ID - Parent Vertex ID - PDG id - px - py - pz - energy - particle mass - status (4, incoming beam particle) - ppiOut << "P" << " " << "1" << " " << "0" << " " << "11" << " " << r_lelectrong.X() << " " << r_lelectrong.Y() << " " << r_lelectrong.Z() << " " << r_lelectrong.E() << " " << fElectron_Mass_GeV << " " << "4" << endl; - ppiOut << "P" << " " << "2" << " " << "0" << " " << "2212" << " " << r_lprotong.X() << " " << r_lprotong.Y() << " " << r_lprotong.Z() << " " << r_lprotong.E() << " " << fProton_Mass_GeV << " " << "4" << endl; - // Vertex line - V - 1 - 0 - [1,2] - ppiOut << "V" << " " << "-1" << " " << "0" << " " << "[1,2]" << endl; - // Output particles, particle line - P - Particle ID - Parent Vertex ID - PDG id - px - py - pz - energy - particle mass - status (1, undecayed physical particle) - // Scattered electron - ppiOut << "P" << " " << "3" << " " << "-1" << " " << "11" << " " << r_lscatelecg.X() << " " << r_lscatelecg.Y() << " " << r_lscatelecg.Z() << " " << r_lscatelecg.E() << " " << fElectron_Mass_GeV << " " << "1" << endl; - // Produced meson - ppiOut << "P" << " " << "4" << " " << "-1" << " " << PDGtype(produced_X) << " " << r_lX_g.X() << " " << r_lX_g.Y() << " " << r_lX_g.Z() << " " << r_lX_g.E() << " " << fX_Mass_GeV << " " << "1" << endl; - // Recoil nucleon - ppiOut << "P" << " " << "5" << " " << "-1" << " " << PDGtype(recoil_hadron) << " " << r_l_scat_hadron_g.X() << " " << r_l_scat_hadron_g.Y() << " " << r_l_scat_hadron_g.Z() << " " << r_l_scat_hadron_g.E() << " " << f_Scat_hadron_Mass_GeV << " " << "1" << endl; - -} diff --git a/src/eic_evgen/archived_routines/PiPlus_prod.cc b/src/eic_evgen/archived_routines/PiPlus_prod.cc deleted file mode 100644 index 45ee450..0000000 --- a/src/eic_evgen/archived_routines/PiPlus_prod.cc +++ /dev/null @@ -1,1285 +0,0 @@ -#include "reaction_routine.h" - -#include "eic.h" - -using namespace std; - -PiPlus_Production::PiPlus_Production() { - - cout << "Program Start" << endl; - -} - -/*--------------------------------------------------*/ -/// PiPlus_Production - -PiPlus_Production::PiPlus_Production(TString particle_str) { - - rParticle = particle_str; - -} - -PiPlus_Production::~PiPlus_Production() { - - ppiOut.close(); - ppiDetails.close(); - -} - -void PiPlus_Production::process_reaction() { - - Init(); - - if (gOutputType == "Pythia6"){ - PiPlus_Pythia6_Out_Init(); - } - else if (gOutputType == "HEPMC3"){ - PiPlus_HEPMC3_Out_Init(); - } - - for( long long int i = 0; i < rNEvents; i++ ) { - - rNEvent_itt = i; - fNGenerated ++; - - Progress_Report(); // This is happens at each 10% of the total event is processed - Processing_Event(); - } - - Detail_Output(); - -} - -void PiPlus_Production::Init() { - - pim* myPim; - - pd = dynamic_cast(myPim); - - rParticle_charge = ExtractCharge(rParticle); - - sTFile = Form("./LundFiles/eic_%s.txt", gfile_name.Data()); - sLFile= Form("./LundFiles/eic_input_%s.dat", gfile_name.Data()); - - ppiOut.open( sLFile.c_str() ); - ppiDetails.open( sTFile.c_str() ); - - qsq_ev = 0, t_ev = 0, w_neg_ev = 0, w_ev = 0; - rNEvents = fNEvents; - rNEvent_itt = 0; - - // 02/06/21 SJDK - // Set these values once the beam energies are read in - fPSF = ( fEBeam * ( fScatElec_E_Hi - fScatElec_E_Lo ) *( sin( fScatElec_Theta_F ) - sin( fScatElec_Theta_I ) ) * 2 * fPI *( sin( fPion_Theta_F ) - sin( fPion_Theta_I ) ) * 2 * fPI ); - fElectron_Kin_Col_GeV = fEBeam; - fElectron_Kin_Col = fElectron_Kin_Col_GeV * 1000.0; - - // cout << rNEvents << " " << fNEvents << endl; - - rFermiMomentum = pd->fermiMomentum(); - - // ---------------------------------------------------- - // Proton in collider (lab) frame - - r_lproton = GetProtonVector_lab(); - r_lprotong = GetProtonVector_lab() * fm; - - // ---------------------------------------------------- - // Electron in collider (lab) frame - - cout << "Fermi momentum: " << rFermiMomentum << endl; - - r_lelectron = GetElectronVector_lab(); - r_lelectrong = r_lelectron * fm; - - ///*--------------------------------------------------*/ - /// Getting the particle mass from the data base - - produced_X = ParticleEnum(rParticle); - fX_Mass = ParticleMass(produced_X)*1000; //MeV - fX_Mass_GeV = fX_Mass/1000; //GeV - - cout << rParticle << " " << produced_X << " " << fX_Mass_GeV << endl; - cout << rParticle_charge << endl; - - - ///*--------------------------------------------------*/ - /// This rParticle_charge is referring to the charge of the produced meson - - if (rParticle_charge == "+" ) { - rParticle_scat_nucleon = "Neutron"; - recoil_nucleon = Neutron; - f_Scat_Nucleon_Mass = fNeutron_Mass; - f_Scat_Nucleon_Mass_GeV = f_Scat_Nucleon_Mass/1000; - } - else if (rParticle_charge == "0" ) { - rParticle_scat_nucleon = "Proton"; - recoil_nucleon = Proton; - f_Scat_Nucleon_Mass = fProton_Mass; - f_Scat_Nucleon_Mass_GeV = f_Scat_Nucleon_Mass/1000; - } - else { - cerr << "Is the overall charge of the reaction conserved? " << endl; - cerr << "Please double check the input file and processes!" << endl; - cerr << "Exiting the program!" << endl; - exit(0); - } - - rDEG2RAD = fPI/180.0; - - fX_Theta_I = 0.0 * rDEG2RAD ; - fX_Theta_F = 50.0 * rDEG2RAD; - - cout << "Produced particle in exclusive production: " << rParticle << "; with mass: " << fX_Mass << " MeV "<< endl; - cout << fEBeam << " GeV electrons on " << fPBeam << " GeV ions" << endl; - - // Set luminosity value based upon beam energy combination - // See slide 11 in https://indico.cern.ch/event/1072579/contributions/4796856/attachments/2456676/4210776/CAP-EIC-June-7-2022-Seryi-r2.pdf - if ((fEBeam == 5.0 ) && (fPBeam == 41.0) ){ - fLumi = 0.44e33; - } - else if ((fEBeam == 5.0 ) && (fPBeam == 100.0) ){ - fLumi = 3.68e33; - } - else if ((fEBeam == 10.0 ) && (fPBeam == 100.0) ){ - fLumi = 4.48e33; - } - else if ((fEBeam == 18.0 ) && (fPBeam == 275.0) ){ - fLumi = 1.54e33; - } - - - - /*--------------------------------------------------*/ - - CoinToss = new TRandom3(); - - F = new TF1("F", - "[6]-sqrt([7]**2+x**2)-sqrt([8]**2+([3]-[0]*x)**2+([4]-[1]*x)**2+([5]-[2]*x)**2)", - 0, 12000); - - extern Json::Value obj; - - char AngleGenName[100] = "AngleGen"; - double dummy[2] = {0,1}; - double ThetaRange[2] = {obj["prod_pion_thetamin"].asDouble()*TMath::DegToRad(), - obj["prod_pion_thetamax"].asDouble()*TMath::DegToRad()}; - - double PhiRange[2] = {0, 360*TMath::DegToRad()}; - AngleGen = new CustomRand(AngleGenName, dummy, - ThetaRange, PhiRange); - - UnitVect = new TVector3(0,0,1); - - ///*--------------------------------------------------*/ - // Produced hadron and recoilded nucleon from the solve function - - r_lX_solved = new Particle(); - r_l_scat_nucleon_solved = new Particle(); - - Interaction = new Particle(); - Target = new Particle(); - Initial = new Particle(); - Final = new Particle(); - - VertBeamElec = new Particle(); - VertScatElec = new Particle(); - - Photon = new Particle(); - -// ///*--------------------------------------------------*/ -// /// For testing -// Photon = new Particle(); -// VertBeamElec->SetPxPyPzE(0, 0, 11000, 11000); -// VertScatElec->SetPxPyPzE(15.934, 1106.06, 2281.09, 2535.16); -// Target->SetPxPyPzE(0, 0, 0, 939.565); -// //*--------------------------------------------------*/ - - - -} - -void PiPlus_Production::Processing_Event() { - - // ---------------------------------------------------- - // Considering Fermi momentum for the proton - // ---------------------------------------------------- - - if( kCalcFermi ) { - Consider_Proton_Fermi_Momentum(); - } - - // ---------------------------------------------------- - // Boost vector from collider (lab) frame to protons rest frame (Fix target) - // ---------------------------------------------------- - - beta_col_rf = r_lproton.BoostVector(); - fGamma_Col_RF = 1.0/sqrt( 1 - pow( beta_col_rf.Mag() , 2 ) ); - - // --------------------------------------------------------------------- - // Specify the energy and solid angle of scatterd electron in Collider (lab) frame - // --------------------------------------------------------------------- - fScatElec_Theta_Col = acos( fRandom->Uniform( cos( fScatElec_Theta_I ) , cos( fScatElec_Theta_F ) ) ); - fScatElec_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi); - fScatElec_Energy_Col = fRandom->Uniform( fScatElec_E_Lo * fElectron_Energy_Col , fScatElec_E_Hi * fElectron_Energy_Col ); - - // ---------------------------------------------------- - // Produced Particle X in Collider frame - // ---------------------------------------------------- - - /// The generic produced particle in the exclusive reaction is labelled as X - fX_Theta_Col = acos( fRandom->Uniform( cos(fX_Theta_I), cos(fX_Theta_F ) ) ); - fX_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi ); - - // --------------------------------------------------------------------- - // Specify the energy and solid angle of scatterd electron in Collider (lab) frame - // --------------------------------------------------------------------- - - fScatElec_Mom_Col = sqrt( pow( fScatElec_Energy_Col,2) - pow( fElectron_Mass , 2) ); - fScatElec_MomZ_Col = ( fScatElec_Mom_Col * cos(fScatElec_Theta_Col) ); - fScatElec_MomX_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * cos(fScatElec_Phi_Col) ); - fScatElec_MomY_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * sin(fScatElec_Phi_Col) ); - - r_lscatelec.SetPxPyPzE( fScatElec_MomX_Col, fScatElec_MomY_Col, fScatElec_MomZ_Col, fScatElec_Energy_Col); - - r_lscatelecg = r_lscatelec * fm; - - // ---------------------------------------------------- - // Photon in collider (lab) frame and Qsq - // ---------------------------------------------------- - - r_lphoton = r_lelectron - r_lscatelec; - r_lphotong = r_lelectrong - r_lscatelecg; - - fQsq_GeV = -1.* r_lphotong.Mag2(); - - if ( fQsq_GeV < 3.0 ) { - qsq_ev++; - return; - } - - // ---------------------------------------------------- - // W square, Invariant Mass (P_g + P_p)^2 - // ---------------------------------------------------- - - TLorentzVector lwg; - lwg = r_lprotong + r_lphotong; - fW_GeV = lwg.Mag(); - fWSq_GeV = lwg.Mag2(); - - - if ( fWSq_GeV < 0 ) { - w_neg_ev++; - return; - } - - ///*--------------------------------------------------*/ - // 13/12/22 - SJDK - This is the start of the block that will need to be replaced by the ROOT function Rory used to determine the pion momentum - // --------------------------------------------------------- - // pion momentum in collider frame, analytic solution starts - // --------------------------------------------------------- - - ///*--------------------------------------------------*/ - /// Modifier: Ishan Goel - /// Date: March 22, 2023 - /// This Solve function is the same as the one implemented in the SoLID generator part - // Removing cases with no solution - if(!Solve()){ - return; - } - - /*--------------------------------------------------*/ - - double fupx = sin( fX_Theta_Col ) * cos( fX_Phi_Col ); - double fupy = sin( fX_Theta_Col ) * sin( fX_Phi_Col ); - double fupz = cos( fX_Theta_Col ); - - double fuqx = sin( r_lphoton.Theta() ) * cos( r_lphoton.Phi() ); - double fuqy = sin( r_lphoton.Theta() ) * sin( r_lphoton.Phi() ); - double fuqz = cos( r_lphoton.Theta() ); - - double fa = -(r_lphoton.Vect()).Mag() * ( fupx * fuqx + fupy * fuqy + fupz * fuqz ); - double fb = pow ( (r_lphoton.Vect()).Mag() , 2 ); - double fc = r_lphoton.E() + fProton_Mass; - - fa = ( fa - std::abs( (r_lproton.Vect()).Mag() ) * ( ( ( r_lproton.X() / (r_lproton.Vect()).Mag() ) * fupx ) + - ( ( r_lproton.Y() / (r_lproton.Vect()).Mag() ) * fupy ) + - ( ( r_lproton.Z() / (r_lproton.Vect()).Mag() ) * fupz ) ) ); - - double factor = ( pow( (r_lproton.Vect()).Mag() , 2 ) + 2.0 * (r_lphoton.Vect()).Mag() * (r_lproton.Vect()).Mag() * - ( ( ( r_lproton.X() / (r_lproton.Vect()).Mag() ) * fuqx ) + - ( ( r_lproton.Y() / (r_lproton.Vect()).Mag() ) * fuqy ) + - ( ( r_lproton.Z() / (r_lproton.Vect()).Mag() ) * fuqz ) ) ); - - fb = fb + factor; - fc = r_lphoton.E() + r_lproton.E(); - - double ft = fc * fc - fb + fX_Mass * fX_Mass - fProton_Mass * fProton_Mass; - - double fQA = 4.0 * ( fa * fa - fc * fc ); - double fQB = 4.0 * fc * ft; - - double fQC = -4.0 * fa * fa * fX_Mass * fX_Mass - ft * ft; - - fradical = fQB * fQB - 4.0 * fQA * fQC; - - fepi1 = ( -fQB - sqrt( fradical ) ) / ( 2.0 * fQA ); - fepi2 = ( -fQB + sqrt( fradical ) ) / ( 2.0 * fQA ); - - ///--------------------------------------------------------- - /// Particle X momentum in collider frame, analytic solution - /// And obtain recoiled proton in collider (lab) frame - ///--------------------------------------------------------- - -// r_lX.SetPxPyPzE( (sqrt( pow( fepi1 , 2) - pow(fX_Mass , 2) ) ) * sin(fX_Theta_Col) * cos(fX_Phi_Col), -// ( sqrt( pow( fepi1 , 2) - pow(fX_Mass , 2) ) ) * sin(fX_Theta_Col) * sin(fX_Phi_Col), -// ( sqrt( pow( fepi1 , 2) - pow(fX_Mass , 2) ) ) * cos(fX_Theta_Col), -// fepi1 ); -// -// r_l_scat_nucleon.SetPxPyPzE( ( r_lproton + r_lelectron - r_lscatelec - r_lX).X(), -// ( r_lproton + r_lelectron - r_lscatelec - r_lX ).Y(), -// ( r_lproton + r_lelectron - r_lscatelec - r_lX ).Z(), -// sqrt( pow( ( ( ( r_lproton + r_lelectron - r_lscatelec - r_lX ).Vect() ).Mag()),2) + -// pow( f_Scat_Nucleon_Mass , 2) ) ); - - ///-------------------------------------------------- - /// Output with the Solve Function - /// Setting the solution values to X and recoiled nucleon - - r_lX.SetPxPyPzE(r_lX_solved->Px(), r_lX_solved->Py(), r_lX_solved->Pz(), r_lX_solved->E()); - r_l_scat_nucleon.SetPxPyPzE(r_l_scat_nucleon_solved->Px(), r_l_scat_nucleon_solved->Py(), r_l_scat_nucleon_solved->Pz(), r_l_scat_nucleon_solved->E()); - - ///-------------------------------------------------- - - r_lX_g = r_lX * fm; - r_l_scat_nucleon_g = r_l_scat_nucleon * fm; - - // ---------------------------------------------------------------------------------------------- - // Calculate w = (proton + photon)^2 - // ---------------------------------------------------------------------------------------------- - - if ( fW_GeV < 3.0 || fW_GeV > 10.6 ) { - w_ev++; - return; - } - - r_lw = r_lproton + r_lphoton; - fW = r_lw.Mag(); - - // ---------------------------------------------------------------------------------------------- - // Calculate w prime w' = (proton + photon - pion)^2 - // ---------------------------------------------------------------------------------------------- - - lwp = r_lprotong + r_lphotong - r_lX_g; - fW_Prime_GeV = lwp.Mag(); - - fsini = r_lelectron + r_lproton; - fsfin = r_lscatelec + r_lX + r_l_scat_nucleon; - - fsinig = fsini * fm; - fsfing = fsfin * fm; - // SJDK 15/06/21 - Mandlestam S conservation check - doesn't actually seem to be utilised? - fMandSConserve = std::abs( fsinig.Mag() - fsfing.Mag() ); - - // SJDK 15/06/21 - Added integer counters for conservation law check and for NaN check - if (r_lX.E() != r_lX.E()){ // SJDK 15/06/21 - If the energy of the produced meson is not a number, return and add to counter - fNaN++; - return; - } - kSConserve = false; - if( std::abs( fsinig.Mag() - fsfing.Mag() ) < fDiff ) { - kSConserve = true; - } - - if ( pd->CheckLaws( r_lelectron, r_lproton, r_lscatelec, r_lX, r_l_scat_nucleon, 0.5) != 1 ){ - fConserve++; - return; - } - - //////////////////////////////////////////////////////////////////////////////////////////// - // Start // - // Transformation of e', pi- and recoil proton to target's rest frame without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - lproton_rf = r_lproton; - lproton_rf.Boost(-beta_col_rf); - lproton_rfg = lproton_rf * fm; - - lelectron_rf = r_lelectron; - lelectron_rf.Boost(-beta_col_rf); - lelectron_rfg = lelectron_rf * fm; - - lscatelec_rf = r_lscatelec; - lscatelec_rf.Boost(-beta_col_rf); - lscatelec_rfg = lscatelec_rf * fm; - - lphoton_rf = r_lphoton; - lphoton_rf.Boost(-beta_col_rf); - lphoton_rfg = lphoton_rf * fm; - - lX_rf = r_lX; - lX_rf.Boost(-beta_col_rf); - lX_rfg = lX_rf * fm; - - l_scat_nucleon_rf = r_l_scat_nucleon; - l_scat_nucleon_rf.Boost(-beta_col_rf); - l_scat_nucleon_rf_g = l_scat_nucleon_rf * fm; - - //////////////////////////////////////////////////////////////////////////////////////////// - // End // - // Transformation of e', pi- and recoil proton to target's rest frmae without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - - // ----------------------------------------------------------------------------------------- - // Calculate -t - // ----------------------------------------------------------------------------------------- - - fBeta_CM_RF = (lphoton_rf.Vect()).Mag() / (lphoton_rf.E() + fProton_Mass ); - fGamma_CM_RF = (lphoton_rf.E() + fProton_Mass) / fW; - fX_Energy_CM = (pow(fW , 2) + pow(fX_Mass , 2) - pow(f_Scat_Nucleon_Mass , 2) ) / ( 2.0 * fW); - fX_Mom_CM = sqrt(pow(fX_Energy_CM , 2) - pow(fX_Mass , 2)); - fX_Energy_CM_GeV = fX_Energy_CM / 1000.0; - fX_Mom_CM_GeV = fX_Mom_CM / 1000.0; - - // this equation is valid for parallel kinematics only! - fT_Para = ( pow(((r_lphoton.Vect()).Mag() - (r_lX.Vect()).Mag()),2) - pow((r_lphoton.E() - r_lX.E()),2)); - fT_Para_GeV = fT_Para/1000000.0; - - lt = r_lphoton - r_lX; - ltg = lt * fm; - - fT = -1.*lt.Mag2(); - fT_GeV = -1.*ltg.Mag2(); - - if ( gKinematics_type == 1 && fT_GeV > 0.5 ) { - t_ev++; - return; - } - - if ( gKinematics_type == 2 && fT_GeV > 1.3 ) { - t_ev++; - return; - } - - fx = fQsq_GeV / ( 2.0 * r_lprotong.Dot( r_lphotong ) ); - fy = r_lprotong.Dot( r_lphotong ) / r_lprotong.Dot( r_lelectrong ); - fz = r_lX.E()/r_lphoton.E(); - - // ------------------------------------------------------------------------------------------------------- - // Calculation of Phi ( azimuthal angle of pion momentum w.r.t lepton plane in target's rest frame) - // Calculation of PhiS ( azimuthal angle of target polarization w.r.t lepton plane in target's rest frame) - // ------------------------------------------------------------------------------------------------------- - - v3Photon.SetX( lphoton_rfg.X() ); - v3Photon.SetY( lphoton_rfg.Y() ); - v3Photon.SetZ( lphoton_rfg.Z() ); - - v3Electron.SetX( lelectron_rfg.X() ); - v3Electron.SetY( lelectron_rfg.Y() ); - v3Electron.SetZ( lelectron_rfg.Z() ); - - v3X.SetX( lX_rfg.X() ) ; - v3X.SetY( lX_rfg.Y() ) ; - v3X.SetZ( lX_rfg.Z() ); - - v3S.SetX( -1 ); - v3S.SetY( 0 ); - v3S.SetZ( 0 ); - - v3PhotonUnit = v3Photon.Unit(); - v3QxL = v3Photon.Cross(v3Electron); - v3QxP = v3Photon.Cross(v3X); - v3QxS = v3Photon.Cross(v3S); - v3LxP = v3Electron.Cross(v3X); - v3LxS = v3Electron.Cross(v3S); - v3PxL = v3X.Cross(v3Electron); - v3QUnitxL = v3PhotonUnit.Cross(v3Electron); - v3QUnitxP = v3PhotonUnit.Cross(v3X); - v3QUnitxS = v3PhotonUnit.Cross(v3S); - - /*--------------------------------------------------*/ - // Get the Phi scattering angle with respect to the electron scattering plane - fPhi = Get_Phi_X_LeptonPlane_RF (); - - /*--------------------------------------------------*/ - // Get the Phi scattering angle with respect to the electron scattering plane - fPhiS = Get_Phi_TargPol_LeptonPlane_RF(); - - fTheta_X_Photon_RF = fRAD2DEG * acos( ( v3Photon.Dot( v3X ) ) / ( v3Photon.Mag() * v3X.Mag() ) ); - if ( fTheta_X_Photon_RF < 0 ) { fTheta_X_Photon_RF = 180.0 + fTheta_X_Photon_RF; } - - // ----------------------------------------------------------------------------------- - // If we have fermi momentum then epsilon should be in rest frame - // The theta angle of scattered angle used in expression of epsilon is the angle - // with respect to direction of incoming electron in the rest frame of target nucleon - // epsilon=1./(1.+ 2.*(pgam_restg**2)/q2g * *(tand(thscat_rest/2.))**2) - // ----------------------------------------------------------------------------------- - - double fTheta_EEp = (lelectron_rf.Vect()).Angle(lscatelec_rf.Vect()); - - fEpsilon = 1.0 / ( 1.0 + 2.0 * ( pow( (lphoton_rfg.Vect()).Mag(),2)/fQsq_GeV ) * pow( tan( fTheta_EEp / 2 ) , 2 ) ); - - // ---------------------------------------------------- - // Virtual Photon flux factor in units of 1/(GeV*Sr) - // ---------------------------------------------------- - fFlux_Factor_Col = (fAlpha/(2.0*pow(fPi,2))) * (r_lscatelecg.E() / r_lelectrong.E()) * - ( pow(fW_GeV,2) - pow(fProton_Mass_GeV,2) ) / (2.0*fProton_Mass_GeV*fQsq_GeV*(1.0 - fEpsilon)); - - fFlux_Factor_RF = ( fAlpha / ( 2.0 * pow( fPi , 2 ) ) ) * ( lscatelec_rfg.E() / lelectron_rfg.E() ) * - ( pow( fW_GeV , 2 ) - pow( fProton_Mass_GeV , 2 ) ) / - ( 2.0 * fProton_Mass_GeV * fQsq_GeV * ( 1.0 - fEpsilon ) ); - - // ---------------------------------------------------- - // Jacobian dt/dcos(theta*)dphi in units of GeV2/sr - // ---------------------------------------------------- - fJacobian_CM = ( (lphoton_rfg.Vect()).Mag() - fBeta_CM_RF * lphoton_rfg.E() ) / ( fGamma_CM_RF * ( 1.0 - pow(fBeta_CM_RF,2) ) ); // Eqn 22 in paper - - fA = fJacobian_CM * fX_Mom_CM_GeV / fPi; // Eqn 21 in paper - - // ---------------------------------------------------- - // Jacobian dOmega* / dOmega dimensionless - // ---------------------------------------------------- - fJacobian_CM_RF = ( pow((lX_rf.Vect()).Mag(),2)*fW) / - ( fX_Mom_CM * std::abs( ( fProton_Mass + lphoton_rf.E()) * (lX_rf.Vect()).Mag() - - ( lX_rf.E() * (lphoton_rf.Vect()).Mag() * cos( lX_rf.Theta() ) ) ) ); // Differs from next line in photon vect -> lphoton_rf vs r_lphoton - - fJacobian_CM_Col = ( ( pow((r_lX.Vect()).Mag(),2) * fW ) / // This one is actually used subsequently, so this must be Eqn 20 - ( fX_Mom_CM * std::abs( ( fProton_Mass + r_lphoton.E() ) * (r_lX.Vect()).Mag() - - ( r_lX.E() * (r_lphoton.Vect()).Mag() * cos( r_lX.Theta() ) ) ) ) ); - - - // cout << lX_rf.Vect().Mag() << " " << << << << << << << << endl; - // cout << fJacobian_CM_RF << " " << fJacobian_CM_Col << endl; - - // ----------------------------------------------------------------------------------------------------------- - // CKY sigma L and T starts - // ----------------------------------------------------------------------------------------------------------- - // r_fSig_T = 1; - // r_fSig_L = 1; - // ------------------------------------------------------------------------------------------- - - r_fSig = Get_Total_Cross_Section(); - - // ----------------------------------------------------------------------------------------------------------- - // CKY sigma L and T ends - // ----------------------------------------------------------------------------------------------------------- - - fSigma_Col = r_fSig * fFlux_Factor_Col * fA * fJacobian_CM_Col; - - if ( ( fSigma_Col <= 0 ) || std::isnan( fSigma_Col ) ) { - fNSigmaNeg ++; - return; - } - - // ----------------------------------------------------------------------------------------------------------- - // Lab cross section Phase Space Conversion Luminosity Total events tried - // Hz = ub / ( sr^2 * GeV ) * GeV * sr^2 * ( cm^2 / ub ) * ( # / ( cm^2 * sec ) ) / ( # ) - - // SJDK 11/05/21 - This is the previous non unit weight - // SJDK 24/06/21 - Explicitly taking the absolute value of the weigth such that the value is positive! - fEventWeight = abs(fSigma_Col * fPSF * fuBcm2 * fLumi / fNEvents); // in Hz - // SJDK 21/06/21 - Commenting out "unit weight" calculation for now, reverting to old version - // SJDK 11/05/21 - New weight calculation, division by ceiling weight value to attempt to get a "unit" value - //fEventWeight = abs(fSigma_Col * fPSF * fuBcm2 * fLumi )/fEventWeightCeil; - // if ( (fEventWeight > 1) || (fEventWeight <= 0) ){ - // fNWeightUnphys ++; - // return; - // } - // SJDK 21/06/21 - Reversed sign of condition here, actually want to reject those with a value less than the random number - // fEventWeightRn = fRandom->Uniform( 0, 1.0); - // if ( fEventWeight < fEventWeightRn ){ - // fNWeightReject ++; - // return; - // } - - fNRecorded++; - fLundRecorded++; - fRatio = fNRecorded / fNGenerated; - - if (gOutputType == "Pythia6"){ - PiPlus_Pythia6_Output(); - } - else if (gOutputType == "LUND"){ - Lund_Output(); - } - else if (gOutputType == "HEPMC3"){ - PiPlus_HEPMC3_Output(); - } -} - -void PiPlus_Production::Progress_Report() { - - dFractTime = time(0); - - if ( rNEvent_itt % ( rNEvents / 10 ) == 0 ) { - cout << "Event: " << setw(8) << rNEvent_itt - << " % of events " << setw(4) << ((1.0*rNEvent_itt)/(1.0*rNEvents))*100.0 - << " Day: " << dFractTime.GetDay() - << " Time: " << dFractTime.GetHour() - << ":" << dFractTime.GetMinute() - << ":" << dFractTime.GetSecond() - << endl; - } -} - -TLorentzVector PiPlus_Production::GetProtonVector_lab() { - - ///*--------------------------------------------------*/ - // // SJDK - 12/01/22 - // // Crossing angle - // // Set crossing angle to 0 for fun4all, also required for ATHENA simulations - // fProton_Theta_Col = 0.050; - // fProton_Theta_Col = 0.025; - - fProton_Theta_Col = 0.0; - - ///*--------------------------------------------------*/ - fProton_Phi_Col = fProton_incidence_phi; - - fProton_Mom_Col = fPBeam * 1e3; - fVertex_X = 0.; - fVertex_Y = 0.; - fVertex_Z = 0.; - - TLorentzVector lproton( fProton_Mom_Col * sin(fProton_Theta_Col) * cos(fProton_Phi_Col), - fProton_Mom_Col * sin(fProton_Theta_Col) * sin(fProton_Phi_Col), - fProton_Mom_Col * cos(fProton_Theta_Col), - sqrt( pow( fProton_Mom_Col , 2 ) + pow( fProton_Mass , 2 ) ) ); - - return lproton; - -} - -//*--------------------------------------------------*/ -// Proton in collider (lab) frame -// ---------------------------------------------------- - -void PiPlus_Production::Consider_Proton_Fermi_Momentum() { - - fProton_Mom_Col = fProton_Mom_Col + rFermiMomentum; - fProton_Theta_Col = acos( fRandom->Uniform( cos(0.0) , cos(fPi) ) ); - fProton_Phi_Col = fRandom->Uniform( 0 , 360 ); - - double px, py, pz, e; - - px = fProton_Mom_Col * sin(fProton_Theta_Col) * cos(fProton_Phi_Col); - py = fProton_Mom_Col * sin(fProton_Theta_Col) * sin(fProton_Phi_Col); - pz = fProton_Mom_Col * cos(fProton_Theta_Col); - e = sqrt( pow( fProton_Mom_Col , 2 ) + pow( fProton_Mass , 2 ) ); - - r_lproton.SetPxPyPzE(px,py,pz,e); - - r_lprotong = r_lproton*fm; - -} - -// ---------------------------------------------------- -// Electron in collider (lab) frame -// ---------------------------------------------------- - -TLorentzVector PiPlus_Production::GetElectronVector_lab() { - - fElectron_Energy_Col = fElectron_Kin_Col; - fElectron_Mom_Col = sqrt( pow(fElectron_Energy_Col , 2) - pow(fElectron_Mass , 2) ); - fElectron_Theta_Col = fPi; - fElectron_Phi_Col = 0.0; - fElectron_MomZ_Col = fElectron_Mom_Col * cos(fElectron_Theta_Col); - fElectron_MomX_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * cos(fElectron_Phi_Col); - fElectron_MomY_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * sin(fElectron_Phi_Col); - - cout << "Define: " << fElectron_MomZ_Col << " "<< fElectron_Mom_Col << " " << cos(fElectron_Theta_Col) << endl; - - TLorentzVector lelectron( fElectron_MomX_Col, fElectron_MomY_Col, fElectron_MomZ_Col, fElectron_Energy_Col); - - return lelectron; - -} - -Double_t PiPlus_Production::Get_Phi_X_LeptonPlane_RF () { - - fCos_Phi_X_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_X_LeptonPlane_RF = ( ( v3LxP.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_X_LeptonPlane_RF >= 0 ) - fPhi_X_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); - if ( fSin_Phi_X_LeptonPlane_RF < 0 ) - fPhi_X_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ) ); - - return fPhi_X_LeptonPlane_RF; - -} - -Double_t PiPlus_Production::Get_Phi_TargPol_LeptonPlane_RF () { - - fCos_Phi_TargPol_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_TargPol_LeptonPlane_RF = ( ( v3LxS.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_TargPol_LeptonPlane_RF >= 0 ) - fPhi_TargPol_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); - if ( fSin_Phi_TargPol_LeptonPlane_RF < 0 ) - fPhi_TargPol_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ) ); - - return fPhi_TargPol_LeptonPlane_RF; - -} - -Double_t PiPlus_Production::Get_Total_Cross_Section() { - - Double_t total_sig; - - Particle_t p = ParticleEnum(rParticle); - - switch (p) { - - case Pi0: total_sig = GetPi0_CrossSection(); - case PiPlus: total_sig = GetPiPlus_CrossSection(); - } - - return total_sig; - -} - -Double_t PiPlus_Production::GetPi0_CrossSection() { - - double_t sig_total; - return sig_total; - -} - -/*--------------------------------------------------*/ -/// Charged Pi+ moduel: -/// Author: Z. Ahmed -/// Date: 2017 - -Double_t PiPlus_Production::GetPiPlus_CrossSection(){ - - double_t sig_total; - - // -------------------------------------------------------------------------------------------------- - // CKY sigma L and T starts - // -------------------------------------------------------------------------------------------------- - double lpar0 = 0., lpar1 = 0., lpar2 = 0., lpar3 = 0., lpar4 = 0., lpar5 = 0., lpar6 = 0.; - double tpar0 = 0., tpar1 = 0., tpar2 = 0., tpar3 = 0., tpar4 = 0.; - - - lpar0 = 0.; lpar1 = 0.; lpar2 = 0.; lpar3 = 0.; lpar4 = 0.; lpar5 = 0.; lpar6 = 0.; - tpar0 = 0.; tpar1 = 0.; tpar2 = 0.; tpar3 = 0.; tpar4 = 0.; - - fSig_L = 0; - fSig_T = 0; - - if ( ( fT_GeV > 0. ) && ( fT_GeV < 0.15 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLonglandau = new TF1("sigmaL","landau", 0.0 , 0.15 ); - fitCKYLonglandau->FixParameter( 0 , lpar0 ); - fitCKYLonglandau->FixParameter( 1 , lpar1 ); - fitCKYLonglandau->FixParameter( 2 , lpar2 ); - fSig_L = fitCKYLonglandau->Eval(fT_GeV); - if ( lpar0 == 0 || lpar1 == 0 || lpar2 == 0 ) - fSig_L = 0; - fitCKYLonglandau = NULL; - delete fitCKYLonglandau; - } - else if ( ( fT_GeV > 0.15 ) && ( fT_GeV < 0.5 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLongexpo1 = new TF1("sigmaL","expo", 0.15 , 0.5 ); - fitCKYLongexpo1->FixParameter( 0 , lpar3 ); - fitCKYLongexpo1->FixParameter( 1 , lpar4 ); - fSig_L = fitCKYLongexpo1->Eval(fT_GeV); - if ( lpar3 == 0 || lpar4 == 0 ) - fSig_L = 0; - fitCKYLongexpo1 = NULL; - delete fitCKYLongexpo1; - } - else if ( ( fT_GeV > 0.5 ) && ( fT_GeV < 1.3 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLongexpo2 = new TF1("sigmaL","expo", 0.5 , 1.3 ); - fitCKYLongexpo2->FixParameter( 0 , lpar5 ); - fitCKYLongexpo2->FixParameter( 1 , lpar6 ); - fSig_L = fitCKYLongexpo2->Eval(fT_GeV); - if ( lpar5 == 0 || lpar6 == 0 ) - fSig_L = 0; - fitCKYLongexpo2 = NULL; - delete fitCKYLongexpo2; - } - else { - fSig_L = 0; - } - - // ------------------------------------------------------------------------------------------- - // SJDK - 02/06/22 - The validity range here was inconsistent, this only went from 0.0 to 0.15, leaving a gap between 0.15 to 0.2 - // I changed the range to remove this gap. - if ( ( fT_GeV > 0.0 ) && ( fT_GeV < 0.2 ) ) { - eicSigmaT( fW_GeV, fQsq_GeV, tpar0, tpar1, tpar2 , tpar3 , tpar4 ); - TF1 *fitCKYTranspol2 = new TF1("sigmaL","pol2", 0.0 , 0.2 ); - fitCKYTranspol2->FixParameter( 0 , tpar0 ); - fitCKYTranspol2->FixParameter( 1 , tpar1 ); - fitCKYTranspol2->FixParameter( 2 , tpar2 ); - fSig_T = fitCKYTranspol2->Eval(fT_GeV); - if ( tpar0 == 0 || tpar1 == 0 || tpar2 == 0 ) - fSig_T = 0; - fitCKYTranspol2 = NULL; - delete fitCKYTranspol2; - } - else if ( ( fT_GeV > 0.2 ) && ( fT_GeV < 1.3 ) ) { - eicSigmaT( fW_GeV, fQsq_GeV, tpar0, tpar1, tpar2 , tpar3 , tpar4 ); - TF1 *fitCKYTransexpo = new TF1("sigmaL","expo", 0.2 , 1.3 ); - fitCKYTransexpo->FixParameter( 0 , tpar3 ); - fitCKYTransexpo->FixParameter( 1 , tpar4 ); - fSig_T = fitCKYTransexpo->Eval(fT_GeV); - if ( tpar3 == 0 || tpar4 == 0 ) - fSig_T = 0; - fitCKYTransexpo = NULL; - delete fitCKYTransexpo; - } - - // ------------------------------------------------------------------------------------------- - - fSig_VR = fSig_T + fEpsilon * fSig_L; - - sig_total = fSig_VR; - - return sig_total; -} - -/*--------------------------------------------------*/ -/// Output generator detail - -void PiPlus_Production::Detail_Output() { - - ppiDetails << "Total events tried " << setw(20) << fNGenerated << endl; - ppiDetails << "Total events recorded " << setw(20) << fNRecorded << endl; - // 09/02/22 - Commented out, not used anymore - //ppiDetails << "Max weight value " << setw(20) << fEventWeightCeil << endl; - ppiDetails << "Number of events with w more than 10.6 " << setw(20) << w_ev << endl; - ppiDetails << "Number of events with wsq negative " << setw(20) << w_neg_ev << endl; - ppiDetails << "Number of events with qsq less than 3 " << setw(20) << qsq_ev << endl; - ppiDetails << "Number of events with Meson (X) energy NaN " << setw(20) << fNaN << endl; - ppiDetails << "Number of events failing conservation law check " << setw(20) << fConserve << endl; - ppiDetails << "Total events passing conservation laws " << setw(20) << conserve << endl; - ppiDetails << "Total events failed energy conservation " << setw(20) << ene << endl; - ppiDetails << "Total events failed momentum conservation " << setw(20) << mom << endl; - ppiDetails << "Number of events with -t more than threshold " << setw(20) << t_ev << endl; - // SJDK 21/06/21 - Commenting out, reverting to old weight determination - //ppiDetails << "Number of events with unit weight outside of 0 to 1 " << setw(20) << fNWeightUnphys << endl; - //ppiDetails << "Number of events with unit weight less than random number " << setw(20) << fNWeightReject << endl; - ppiDetails << "Number of events with w less than threshold " << setw(20) << fWSqNeg << endl; - ppiDetails << "Number of events with mom not conserve " << setw(20) << fNMomConserve << endl; - ppiDetails << "Number of events with Sigma negative " << setw(20) << fNSigmaNeg << endl; - ppiDetails << "Number of lund events " << setw(20) << fLundRecorded << endl; - - ppiDetails << "Seed used for the Random Number Generator " << setw(20) << fSeed << endl; - -} - -////*-------------------------------------------------- -/// Functions for different output formats follow - -void PiPlus_Production::Lund_Output() { - - ppiOut << "3" - << " \t " << fPhi // var 1 - << " \t " << fPhiS // var 2 - << " \t " << fx // var 3 - << " \t " << "1" - << " \t " << fQsq_GeV // var 4 - << " \t " << fT_GeV // var 5 - << " \t " << fW_GeV // var 6 - << " \t " << fEpsilon // var 7 - << " \t " << fEventWeight // var 8 - << endl; - - // Produced Particle X - ppiOut << setw(10) << "1" - << setw(10) << "1" - << setw(10) << "1" - << setw(10) << PDGtype(produced_X) - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << r_lX_g.X() - << setw(16) << r_lX_g.Y() - << setw(16) << r_lX_g.Z() - << setw(16) << r_lX_g.E() - << setw(16) << fX_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Scattered electron - ppiOut << setw(10) << "2" - << setw(10) << "-1" - << setw(10) << "1" - << setw(10) << "11" - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << r_lscatelecg.X() - << setw(16) << r_lscatelecg.Y() - << setw(16) << r_lscatelecg.Z() - << setw(16) << r_lscatelecg.E() - << setw(16) << fElectron_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Recoiled neutron - ppiOut << setw(10) << "3" - << setw(10) << "1" - << setw(10) << "1" - << setw(10) << PDGtype(recoil_nucleon) - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << r_l_scat_nucleon_g.X() - << setw(16) << r_l_scat_nucleon_g.Y() - << setw(16) << r_l_scat_nucleon_g.Z() - << setw(16) << r_l_scat_nucleon_g.E() - << setw(16) << f_Scat_Nucleon_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; -} - -void PiPlus_Production::PiPlus_Pythia6_Out_Init() { - - print_itt = 0; - - ppiOut << "DEMP Event FILE" << endl; - ppiOut << "============================================" << endl; - ppiOut << "I, ievent, nParticles, Weight" << endl; - ppiOut << "============================================" << endl; - ppiOut << "I K(I,1) K(I,2) K(I,3) K(I,4) K(I,5) P(I,1) P(I,2) P(I,3) P(I,4) P(I,5) V(I,1) V(I,2) V(I,3)" << endl; - ppiOut << "============================================" << endl; - -} - -void PiPlus_Production::PiPlus_Pythia6_Output() { - - ppiOut << "0" << " \t\t\t " << print_itt << " \t\t\t " << "1" << " \t\t\t " << fEventWeight << endl; // var 1 - - print_itt++; - - ppiOut << "============================================" << endl; - - ///*--------------------------------------------------*/ - // Initial State - - ppiOut << "1" - << setw(6) << "21" - << setw(6) << "11" - << setw(6) << "0" - << setw(6) << "3" - << setw(6) << "4" - - << setw(14) << r_lelectrong.X() - << setw(14) << r_lelectrong.Y() - << setw(14) << r_lelectrong.Z() - << setw(14) << r_lelectrong.E() - << setw(14) << fElectron_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ppiOut << "2" - << setw(6) << "21" - << setw(6) << "2212" - << setw(6) << "0" - << setw(6) << "5" - << setw(6) << "6" - - << setw(14) << r_lprotong.X() - << setw(14) << r_lprotong.Y() - << setw(14) << r_lprotong.Z() - << setw(14) << r_lprotong.E() - << setw(14) << fProton_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ppiOut << "3" - << setw(6) << "21" - << setw(6) << "22" - << setw(6) << "1" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_lphotong.X() - << setw(14) << r_lphotong.Y() - << setw(14) << r_lphotong.Z() - << setw(14) << r_lphotong.E() - << setw(14) << r_lphotong.M() - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - - ///*--------------------------------------------------*/ - // Final State - - // Scattered electron - ppiOut << "4" - << setw(6) << "1" - << setw(6) << "11" - << setw(6) << "1" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_lscatelecg.X() - << setw(14) << r_lscatelecg.Y() - << setw(14) << r_lscatelecg.Z() - << setw(14) << r_lscatelecg.E() - << setw(14) << fElectron_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - // Recoiled nucleon - ppiOut << "5" - << setw(6) << "1" - << setw(6) << PDGtype(recoil_nucleon) - << setw(6) << "2" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_l_scat_nucleon_g.X() - << setw(14) << r_l_scat_nucleon_g.Y() - << setw(14) << r_l_scat_nucleon_g.Z() - << setw(14) << r_l_scat_nucleon_g.E() - << setw(14) << f_Scat_Nucleon_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - // Produced Particle X - ppiOut << "6" - << setw(6) << "1" - << setw(6) << PDGtype(produced_X) - << setw(6) << "2" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_lX_g.X() - << setw(14) << r_lX_g.Y() - << setw(14) << r_lX_g.Z() - << setw(14) << r_lX_g.E() - << setw(14) << fX_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ppiOut << "=============== Event finished ===============" << endl; - -} - -/*--------------------------------------------------*/ - -void PiPlus_Production::PiPlus_HEPMC3_Out_Init() { - - print_itt = 0; - ppiOut << "HepMC::Version 3.02.02" << endl; - ppiOut << "HepMC::Asciiv3-START_EVENT_LISTING" << endl; - -} - -/*--------------------------------------------------*/ - -void PiPlus_Production::PiPlus_HEPMC3_Output() { - - // HEPMC3 output for Athena/EPIC simulations - - // First line - E - Event# - #Vertices - #Particles - ppiOut << "E" << " " << print_itt << " " << "1" << " " << 5 << endl; - print_itt++; - // Second line, Units - U - ENERGY UNIT - DISTANCE UNIT - ppiOut << "U" << " " << "GEV" << " " << "MM" << endl; - // Third line, optional attributes, the weight - ppiOut << "A" << " " << "0" << " " << "weight" << " " << fEventWeight << endl; - // Beam particles, particle line - P - Particle ID - Parent Vertex ID - PDG id - px - py - pz - energy - particle mass - status (4, incoming beam particle) - ppiOut << "P" << " " << "1" << " " << "0" << " " << "11" << " " << r_lelectrong.X() << " " << r_lelectrong.Y() << " " << r_lelectrong.Z() << " " << r_lelectrong.E() << " " << fElectron_Mass_GeV << " " << "4" << endl; - ppiOut << "P" << " " << "2" << " " << "0" << " " << "2212" << " " << r_lprotong.X() << " " << r_lprotong.Y() << " " << r_lprotong.Z() << " " << r_lprotong.E() << " " << fProton_Mass_GeV << " " << "4" << endl; - // Vertex line - V - 1 - 0 - [1,2] - ppiOut << "V" << " " << "-1" << " " << "0" << " " << "[1,2]" << endl; - // Output particles, particle line - P - Particle ID - Parent Vertex ID - PDG id - px - py - pz - energy - particle mass - status (1, undecayed physical particle) - // Scattered electron - ppiOut << "P" << " " << "3" << " " << "-1" << " " << "11" << " " << r_lscatelecg.X() << " " << r_lscatelecg.Y() << " " << r_lscatelecg.Z() << " " << r_lscatelecg.E() << " " << fElectron_Mass_GeV << " " << "1" << endl; - // Produced meson - ppiOut << "P" << " " << "4" << " " << "-1" << " " << PDGtype(produced_X) << " " << r_lX_g.X() << " " << r_lX_g.Y() << " " << r_lX_g.Z() << " " << r_lX_g.E() << " " << fX_Mass_GeV << " " << "1" << endl; - // Recoil nucleon - ppiOut << "P" << " " << "5" << " " << "-1" << " " << PDGtype(recoil_nucleon) << " " << r_l_scat_nucleon_g.X() << " " << r_l_scat_nucleon_g.Y() << " " << r_l_scat_nucleon_g.Z() << " " << r_l_scat_nucleon_g.E() << " " << f_Scat_Nucleon_Mass_GeV << " " << "1" << endl; - -} - -/*--------------------------------------------------*/ - -bool PiPlus_Production::SolnCheck() -{ - - // Double Checking for solution viability - if (TMath::Abs(f_Scat_Nucleon_Mass-r_l_scat_nucleon_solved->M())>1){ - //cerr << "Mass Missmatch" << endl; - //cerr << TMath::Abs(proton_mass_mev-Proton->M()) << endl; - return false; - } - if (TMath::Abs(W_in()-W_out())>1){ - //cerr << "W Missmatch" << endl; - //cerr << TMath::Abs(W_in()-W_out()) << endl; - return false; - } - *Final = *r_l_scat_nucleon_solved + *r_lX_solved; - - if (TMath::Abs(Initial->Px()-Final->Px())>1){ - //cerr << "Px Missmatch" << endl; - //cerr << TMath::Abs(Initial->Px()-Final->Px()) << endl; - return false; - } - - if (TMath::Abs(Initial->Py()-Final->Py())>1){ - //cerr << "Py Missmatch" << endl; - //cerr << TMath::Abs(Initial->Py()-Final->Py()) << endl; - return false; - } - - if (TMath::Abs(Initial->Pz()-Final->Pz())>1){ - //cerr << "Pz Missmatch" << endl; - //cerr << TMath::Abs(Initial->Pz()-Final->Pz()) << endl; - return false; - } - - if (TMath::Abs(Initial->E()-Final->E())>1){ - return false; - } - return true; -} - -/*--------------------------------------------------*/ -double PiPlus_Production::W_in() -{ - return (*Interaction+*Target).Mag2(); -} - -/*--------------------------------------------------*/ -double PiPlus_Production::W_out() -{ - return (*r_l_scat_nucleon_solved+*r_lX_solved).Mag2(); -} - -/*--------------------------------------------------*/ - -int PiPlus_Production::Solve() -{ -// double theta = AngleGen->Theta(); -// double phi = AngleGen->Phi(); -// theta = 0.282478; -// phi = 3.49651; -// cout << " Theta Phi: "<< theta << " " << phi << endl; - - - // Setting the initial values for solve function - VertBeamElec->SetPxPyPzE(r_lelectron.Px(), r_lelectron.Py(), r_lelectron.Pz(), r_lelectron.E()); - VertScatElec->SetPxPyPzE(r_lscatelec.Px(), r_lscatelec.Py(), r_lscatelec.Pz(), r_lscatelec.E()); - Target->SetPxPyPzE(r_lproton.Px(), r_lproton.Py(), r_lproton.Pz(), r_lproton.E()); - - *Photon = *VertBeamElec - *VertScatElec; - *Interaction = *Photon; - - *Initial = *Interaction+*Target; - - /*--------------------------------------------------*/ - - theta = fX_Theta_Col; - phi = fX_Phi_Col; - - return this->Solve(theta, phi); - -} - -/*--------------------------------------------------*/ - -int PiPlus_Production::Solve(double theta, double phi) -{ - - - W_in_val = W_in(); - - if (W_in_val<0){ - return 0; - } - - UnitVect->SetTheta(theta); - UnitVect->SetPhi(phi); - UnitVect->SetMag(1); - - double* pars = new double[9]; - - pars[0] = UnitVect->X(); - pars[1] = UnitVect->Y(); - pars[2] = UnitVect->Z(); - pars[3] = Initial->Px(); - pars[4] = Initial->Py(); - pars[5] = Initial->Pz(); - pars[6] = Initial->E(); - pars[7] = fX_Mass; - pars[8] = f_Scat_Nucleon_Mass; - - F->SetParameters(pars); - - P = F->GetX(0, 0, pars[6], 0.0001, 10000); - - Particle * r_lX_temp = new Particle(fX_Mass, - P*pars[0], - P*pars[1], - P*pars[2]); - r_lX_solved->SetPxPyPzE(r_lX_temp->Px(), r_lX_temp->Py(), r_lX_temp->Pz(), r_lX_temp->E()); - - Particle * r_l_nucleon_temp= new Particle(); - *r_l_nucleon_temp = *Initial-*r_lX_solved; - r_l_scat_nucleon_solved->SetPxPyPzE(r_l_nucleon_temp->Px(), r_l_nucleon_temp->Py(), r_l_nucleon_temp->Pz(), r_l_nucleon_temp->E()); - - delete r_lX_temp; - delete r_l_nucleon_temp; - delete[] pars; - - if (TMath::Abs(F->Eval(P)) < 1){ - if (SolnCheck()){ - return 1; - } - } - - ///*--------------------------------------------------*/ - /// Modifier: Ishan Goel - /// Date: March 22, 2023 - /// Commenting out second solution as it is not giving any solution ever - /// Check for Second solution: - // P2 = F->GetX(0, P+100, pars[6], 0.0001, 10000); - ///Try second solution - // Particle * Pion2 = new Particle(pion_mass_mev, - // P*pars[0], - // P*pars[1], - // P*pars[2]); - // Pion->SetPxPyPzE(Pion2->Px(), Pion2->Py(), Pion2->Pz(), Pion2->E()); - // Particle * Proton2 = new Particle(); - // *Proton2 = *Initial - * Pion; - // Proton_Particle->SetPxPyPzE(Proton2->Px(), Proton2->Py(), Proton2->Pz(), Proton2->E()); - // delete Pion2; - // delete Proton2; - // if (TMath::Abs(F->Eval(P2)) < 1){ - // if (SolnCheck()){ - // return 1; - // } - // } - ///*--------------------------------------------------*/ - - return 0; - -} - - - - - diff --git a/src/eic_evgen/archived_routines/PiPlus_prod.cc.SolveFn b/src/eic_evgen/archived_routines/PiPlus_prod.cc.SolveFn deleted file mode 100644 index 45ee450..0000000 --- a/src/eic_evgen/archived_routines/PiPlus_prod.cc.SolveFn +++ /dev/null @@ -1,1285 +0,0 @@ -#include "reaction_routine.h" - -#include "eic.h" - -using namespace std; - -PiPlus_Production::PiPlus_Production() { - - cout << "Program Start" << endl; - -} - -/*--------------------------------------------------*/ -/// PiPlus_Production - -PiPlus_Production::PiPlus_Production(TString particle_str) { - - rParticle = particle_str; - -} - -PiPlus_Production::~PiPlus_Production() { - - ppiOut.close(); - ppiDetails.close(); - -} - -void PiPlus_Production::process_reaction() { - - Init(); - - if (gOutputType == "Pythia6"){ - PiPlus_Pythia6_Out_Init(); - } - else if (gOutputType == "HEPMC3"){ - PiPlus_HEPMC3_Out_Init(); - } - - for( long long int i = 0; i < rNEvents; i++ ) { - - rNEvent_itt = i; - fNGenerated ++; - - Progress_Report(); // This is happens at each 10% of the total event is processed - Processing_Event(); - } - - Detail_Output(); - -} - -void PiPlus_Production::Init() { - - pim* myPim; - - pd = dynamic_cast(myPim); - - rParticle_charge = ExtractCharge(rParticle); - - sTFile = Form("./LundFiles/eic_%s.txt", gfile_name.Data()); - sLFile= Form("./LundFiles/eic_input_%s.dat", gfile_name.Data()); - - ppiOut.open( sLFile.c_str() ); - ppiDetails.open( sTFile.c_str() ); - - qsq_ev = 0, t_ev = 0, w_neg_ev = 0, w_ev = 0; - rNEvents = fNEvents; - rNEvent_itt = 0; - - // 02/06/21 SJDK - // Set these values once the beam energies are read in - fPSF = ( fEBeam * ( fScatElec_E_Hi - fScatElec_E_Lo ) *( sin( fScatElec_Theta_F ) - sin( fScatElec_Theta_I ) ) * 2 * fPI *( sin( fPion_Theta_F ) - sin( fPion_Theta_I ) ) * 2 * fPI ); - fElectron_Kin_Col_GeV = fEBeam; - fElectron_Kin_Col = fElectron_Kin_Col_GeV * 1000.0; - - // cout << rNEvents << " " << fNEvents << endl; - - rFermiMomentum = pd->fermiMomentum(); - - // ---------------------------------------------------- - // Proton in collider (lab) frame - - r_lproton = GetProtonVector_lab(); - r_lprotong = GetProtonVector_lab() * fm; - - // ---------------------------------------------------- - // Electron in collider (lab) frame - - cout << "Fermi momentum: " << rFermiMomentum << endl; - - r_lelectron = GetElectronVector_lab(); - r_lelectrong = r_lelectron * fm; - - ///*--------------------------------------------------*/ - /// Getting the particle mass from the data base - - produced_X = ParticleEnum(rParticle); - fX_Mass = ParticleMass(produced_X)*1000; //MeV - fX_Mass_GeV = fX_Mass/1000; //GeV - - cout << rParticle << " " << produced_X << " " << fX_Mass_GeV << endl; - cout << rParticle_charge << endl; - - - ///*--------------------------------------------------*/ - /// This rParticle_charge is referring to the charge of the produced meson - - if (rParticle_charge == "+" ) { - rParticle_scat_nucleon = "Neutron"; - recoil_nucleon = Neutron; - f_Scat_Nucleon_Mass = fNeutron_Mass; - f_Scat_Nucleon_Mass_GeV = f_Scat_Nucleon_Mass/1000; - } - else if (rParticle_charge == "0" ) { - rParticle_scat_nucleon = "Proton"; - recoil_nucleon = Proton; - f_Scat_Nucleon_Mass = fProton_Mass; - f_Scat_Nucleon_Mass_GeV = f_Scat_Nucleon_Mass/1000; - } - else { - cerr << "Is the overall charge of the reaction conserved? " << endl; - cerr << "Please double check the input file and processes!" << endl; - cerr << "Exiting the program!" << endl; - exit(0); - } - - rDEG2RAD = fPI/180.0; - - fX_Theta_I = 0.0 * rDEG2RAD ; - fX_Theta_F = 50.0 * rDEG2RAD; - - cout << "Produced particle in exclusive production: " << rParticle << "; with mass: " << fX_Mass << " MeV "<< endl; - cout << fEBeam << " GeV electrons on " << fPBeam << " GeV ions" << endl; - - // Set luminosity value based upon beam energy combination - // See slide 11 in https://indico.cern.ch/event/1072579/contributions/4796856/attachments/2456676/4210776/CAP-EIC-June-7-2022-Seryi-r2.pdf - if ((fEBeam == 5.0 ) && (fPBeam == 41.0) ){ - fLumi = 0.44e33; - } - else if ((fEBeam == 5.0 ) && (fPBeam == 100.0) ){ - fLumi = 3.68e33; - } - else if ((fEBeam == 10.0 ) && (fPBeam == 100.0) ){ - fLumi = 4.48e33; - } - else if ((fEBeam == 18.0 ) && (fPBeam == 275.0) ){ - fLumi = 1.54e33; - } - - - - /*--------------------------------------------------*/ - - CoinToss = new TRandom3(); - - F = new TF1("F", - "[6]-sqrt([7]**2+x**2)-sqrt([8]**2+([3]-[0]*x)**2+([4]-[1]*x)**2+([5]-[2]*x)**2)", - 0, 12000); - - extern Json::Value obj; - - char AngleGenName[100] = "AngleGen"; - double dummy[2] = {0,1}; - double ThetaRange[2] = {obj["prod_pion_thetamin"].asDouble()*TMath::DegToRad(), - obj["prod_pion_thetamax"].asDouble()*TMath::DegToRad()}; - - double PhiRange[2] = {0, 360*TMath::DegToRad()}; - AngleGen = new CustomRand(AngleGenName, dummy, - ThetaRange, PhiRange); - - UnitVect = new TVector3(0,0,1); - - ///*--------------------------------------------------*/ - // Produced hadron and recoilded nucleon from the solve function - - r_lX_solved = new Particle(); - r_l_scat_nucleon_solved = new Particle(); - - Interaction = new Particle(); - Target = new Particle(); - Initial = new Particle(); - Final = new Particle(); - - VertBeamElec = new Particle(); - VertScatElec = new Particle(); - - Photon = new Particle(); - -// ///*--------------------------------------------------*/ -// /// For testing -// Photon = new Particle(); -// VertBeamElec->SetPxPyPzE(0, 0, 11000, 11000); -// VertScatElec->SetPxPyPzE(15.934, 1106.06, 2281.09, 2535.16); -// Target->SetPxPyPzE(0, 0, 0, 939.565); -// //*--------------------------------------------------*/ - - - -} - -void PiPlus_Production::Processing_Event() { - - // ---------------------------------------------------- - // Considering Fermi momentum for the proton - // ---------------------------------------------------- - - if( kCalcFermi ) { - Consider_Proton_Fermi_Momentum(); - } - - // ---------------------------------------------------- - // Boost vector from collider (lab) frame to protons rest frame (Fix target) - // ---------------------------------------------------- - - beta_col_rf = r_lproton.BoostVector(); - fGamma_Col_RF = 1.0/sqrt( 1 - pow( beta_col_rf.Mag() , 2 ) ); - - // --------------------------------------------------------------------- - // Specify the energy and solid angle of scatterd electron in Collider (lab) frame - // --------------------------------------------------------------------- - fScatElec_Theta_Col = acos( fRandom->Uniform( cos( fScatElec_Theta_I ) , cos( fScatElec_Theta_F ) ) ); - fScatElec_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi); - fScatElec_Energy_Col = fRandom->Uniform( fScatElec_E_Lo * fElectron_Energy_Col , fScatElec_E_Hi * fElectron_Energy_Col ); - - // ---------------------------------------------------- - // Produced Particle X in Collider frame - // ---------------------------------------------------- - - /// The generic produced particle in the exclusive reaction is labelled as X - fX_Theta_Col = acos( fRandom->Uniform( cos(fX_Theta_I), cos(fX_Theta_F ) ) ); - fX_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi ); - - // --------------------------------------------------------------------- - // Specify the energy and solid angle of scatterd electron in Collider (lab) frame - // --------------------------------------------------------------------- - - fScatElec_Mom_Col = sqrt( pow( fScatElec_Energy_Col,2) - pow( fElectron_Mass , 2) ); - fScatElec_MomZ_Col = ( fScatElec_Mom_Col * cos(fScatElec_Theta_Col) ); - fScatElec_MomX_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * cos(fScatElec_Phi_Col) ); - fScatElec_MomY_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * sin(fScatElec_Phi_Col) ); - - r_lscatelec.SetPxPyPzE( fScatElec_MomX_Col, fScatElec_MomY_Col, fScatElec_MomZ_Col, fScatElec_Energy_Col); - - r_lscatelecg = r_lscatelec * fm; - - // ---------------------------------------------------- - // Photon in collider (lab) frame and Qsq - // ---------------------------------------------------- - - r_lphoton = r_lelectron - r_lscatelec; - r_lphotong = r_lelectrong - r_lscatelecg; - - fQsq_GeV = -1.* r_lphotong.Mag2(); - - if ( fQsq_GeV < 3.0 ) { - qsq_ev++; - return; - } - - // ---------------------------------------------------- - // W square, Invariant Mass (P_g + P_p)^2 - // ---------------------------------------------------- - - TLorentzVector lwg; - lwg = r_lprotong + r_lphotong; - fW_GeV = lwg.Mag(); - fWSq_GeV = lwg.Mag2(); - - - if ( fWSq_GeV < 0 ) { - w_neg_ev++; - return; - } - - ///*--------------------------------------------------*/ - // 13/12/22 - SJDK - This is the start of the block that will need to be replaced by the ROOT function Rory used to determine the pion momentum - // --------------------------------------------------------- - // pion momentum in collider frame, analytic solution starts - // --------------------------------------------------------- - - ///*--------------------------------------------------*/ - /// Modifier: Ishan Goel - /// Date: March 22, 2023 - /// This Solve function is the same as the one implemented in the SoLID generator part - // Removing cases with no solution - if(!Solve()){ - return; - } - - /*--------------------------------------------------*/ - - double fupx = sin( fX_Theta_Col ) * cos( fX_Phi_Col ); - double fupy = sin( fX_Theta_Col ) * sin( fX_Phi_Col ); - double fupz = cos( fX_Theta_Col ); - - double fuqx = sin( r_lphoton.Theta() ) * cos( r_lphoton.Phi() ); - double fuqy = sin( r_lphoton.Theta() ) * sin( r_lphoton.Phi() ); - double fuqz = cos( r_lphoton.Theta() ); - - double fa = -(r_lphoton.Vect()).Mag() * ( fupx * fuqx + fupy * fuqy + fupz * fuqz ); - double fb = pow ( (r_lphoton.Vect()).Mag() , 2 ); - double fc = r_lphoton.E() + fProton_Mass; - - fa = ( fa - std::abs( (r_lproton.Vect()).Mag() ) * ( ( ( r_lproton.X() / (r_lproton.Vect()).Mag() ) * fupx ) + - ( ( r_lproton.Y() / (r_lproton.Vect()).Mag() ) * fupy ) + - ( ( r_lproton.Z() / (r_lproton.Vect()).Mag() ) * fupz ) ) ); - - double factor = ( pow( (r_lproton.Vect()).Mag() , 2 ) + 2.0 * (r_lphoton.Vect()).Mag() * (r_lproton.Vect()).Mag() * - ( ( ( r_lproton.X() / (r_lproton.Vect()).Mag() ) * fuqx ) + - ( ( r_lproton.Y() / (r_lproton.Vect()).Mag() ) * fuqy ) + - ( ( r_lproton.Z() / (r_lproton.Vect()).Mag() ) * fuqz ) ) ); - - fb = fb + factor; - fc = r_lphoton.E() + r_lproton.E(); - - double ft = fc * fc - fb + fX_Mass * fX_Mass - fProton_Mass * fProton_Mass; - - double fQA = 4.0 * ( fa * fa - fc * fc ); - double fQB = 4.0 * fc * ft; - - double fQC = -4.0 * fa * fa * fX_Mass * fX_Mass - ft * ft; - - fradical = fQB * fQB - 4.0 * fQA * fQC; - - fepi1 = ( -fQB - sqrt( fradical ) ) / ( 2.0 * fQA ); - fepi2 = ( -fQB + sqrt( fradical ) ) / ( 2.0 * fQA ); - - ///--------------------------------------------------------- - /// Particle X momentum in collider frame, analytic solution - /// And obtain recoiled proton in collider (lab) frame - ///--------------------------------------------------------- - -// r_lX.SetPxPyPzE( (sqrt( pow( fepi1 , 2) - pow(fX_Mass , 2) ) ) * sin(fX_Theta_Col) * cos(fX_Phi_Col), -// ( sqrt( pow( fepi1 , 2) - pow(fX_Mass , 2) ) ) * sin(fX_Theta_Col) * sin(fX_Phi_Col), -// ( sqrt( pow( fepi1 , 2) - pow(fX_Mass , 2) ) ) * cos(fX_Theta_Col), -// fepi1 ); -// -// r_l_scat_nucleon.SetPxPyPzE( ( r_lproton + r_lelectron - r_lscatelec - r_lX).X(), -// ( r_lproton + r_lelectron - r_lscatelec - r_lX ).Y(), -// ( r_lproton + r_lelectron - r_lscatelec - r_lX ).Z(), -// sqrt( pow( ( ( ( r_lproton + r_lelectron - r_lscatelec - r_lX ).Vect() ).Mag()),2) + -// pow( f_Scat_Nucleon_Mass , 2) ) ); - - ///-------------------------------------------------- - /// Output with the Solve Function - /// Setting the solution values to X and recoiled nucleon - - r_lX.SetPxPyPzE(r_lX_solved->Px(), r_lX_solved->Py(), r_lX_solved->Pz(), r_lX_solved->E()); - r_l_scat_nucleon.SetPxPyPzE(r_l_scat_nucleon_solved->Px(), r_l_scat_nucleon_solved->Py(), r_l_scat_nucleon_solved->Pz(), r_l_scat_nucleon_solved->E()); - - ///-------------------------------------------------- - - r_lX_g = r_lX * fm; - r_l_scat_nucleon_g = r_l_scat_nucleon * fm; - - // ---------------------------------------------------------------------------------------------- - // Calculate w = (proton + photon)^2 - // ---------------------------------------------------------------------------------------------- - - if ( fW_GeV < 3.0 || fW_GeV > 10.6 ) { - w_ev++; - return; - } - - r_lw = r_lproton + r_lphoton; - fW = r_lw.Mag(); - - // ---------------------------------------------------------------------------------------------- - // Calculate w prime w' = (proton + photon - pion)^2 - // ---------------------------------------------------------------------------------------------- - - lwp = r_lprotong + r_lphotong - r_lX_g; - fW_Prime_GeV = lwp.Mag(); - - fsini = r_lelectron + r_lproton; - fsfin = r_lscatelec + r_lX + r_l_scat_nucleon; - - fsinig = fsini * fm; - fsfing = fsfin * fm; - // SJDK 15/06/21 - Mandlestam S conservation check - doesn't actually seem to be utilised? - fMandSConserve = std::abs( fsinig.Mag() - fsfing.Mag() ); - - // SJDK 15/06/21 - Added integer counters for conservation law check and for NaN check - if (r_lX.E() != r_lX.E()){ // SJDK 15/06/21 - If the energy of the produced meson is not a number, return and add to counter - fNaN++; - return; - } - kSConserve = false; - if( std::abs( fsinig.Mag() - fsfing.Mag() ) < fDiff ) { - kSConserve = true; - } - - if ( pd->CheckLaws( r_lelectron, r_lproton, r_lscatelec, r_lX, r_l_scat_nucleon, 0.5) != 1 ){ - fConserve++; - return; - } - - //////////////////////////////////////////////////////////////////////////////////////////// - // Start // - // Transformation of e', pi- and recoil proton to target's rest frame without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - lproton_rf = r_lproton; - lproton_rf.Boost(-beta_col_rf); - lproton_rfg = lproton_rf * fm; - - lelectron_rf = r_lelectron; - lelectron_rf.Boost(-beta_col_rf); - lelectron_rfg = lelectron_rf * fm; - - lscatelec_rf = r_lscatelec; - lscatelec_rf.Boost(-beta_col_rf); - lscatelec_rfg = lscatelec_rf * fm; - - lphoton_rf = r_lphoton; - lphoton_rf.Boost(-beta_col_rf); - lphoton_rfg = lphoton_rf * fm; - - lX_rf = r_lX; - lX_rf.Boost(-beta_col_rf); - lX_rfg = lX_rf * fm; - - l_scat_nucleon_rf = r_l_scat_nucleon; - l_scat_nucleon_rf.Boost(-beta_col_rf); - l_scat_nucleon_rf_g = l_scat_nucleon_rf * fm; - - //////////////////////////////////////////////////////////////////////////////////////////// - // End // - // Transformation of e', pi- and recoil proton to target's rest frmae without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - - // ----------------------------------------------------------------------------------------- - // Calculate -t - // ----------------------------------------------------------------------------------------- - - fBeta_CM_RF = (lphoton_rf.Vect()).Mag() / (lphoton_rf.E() + fProton_Mass ); - fGamma_CM_RF = (lphoton_rf.E() + fProton_Mass) / fW; - fX_Energy_CM = (pow(fW , 2) + pow(fX_Mass , 2) - pow(f_Scat_Nucleon_Mass , 2) ) / ( 2.0 * fW); - fX_Mom_CM = sqrt(pow(fX_Energy_CM , 2) - pow(fX_Mass , 2)); - fX_Energy_CM_GeV = fX_Energy_CM / 1000.0; - fX_Mom_CM_GeV = fX_Mom_CM / 1000.0; - - // this equation is valid for parallel kinematics only! - fT_Para = ( pow(((r_lphoton.Vect()).Mag() - (r_lX.Vect()).Mag()),2) - pow((r_lphoton.E() - r_lX.E()),2)); - fT_Para_GeV = fT_Para/1000000.0; - - lt = r_lphoton - r_lX; - ltg = lt * fm; - - fT = -1.*lt.Mag2(); - fT_GeV = -1.*ltg.Mag2(); - - if ( gKinematics_type == 1 && fT_GeV > 0.5 ) { - t_ev++; - return; - } - - if ( gKinematics_type == 2 && fT_GeV > 1.3 ) { - t_ev++; - return; - } - - fx = fQsq_GeV / ( 2.0 * r_lprotong.Dot( r_lphotong ) ); - fy = r_lprotong.Dot( r_lphotong ) / r_lprotong.Dot( r_lelectrong ); - fz = r_lX.E()/r_lphoton.E(); - - // ------------------------------------------------------------------------------------------------------- - // Calculation of Phi ( azimuthal angle of pion momentum w.r.t lepton plane in target's rest frame) - // Calculation of PhiS ( azimuthal angle of target polarization w.r.t lepton plane in target's rest frame) - // ------------------------------------------------------------------------------------------------------- - - v3Photon.SetX( lphoton_rfg.X() ); - v3Photon.SetY( lphoton_rfg.Y() ); - v3Photon.SetZ( lphoton_rfg.Z() ); - - v3Electron.SetX( lelectron_rfg.X() ); - v3Electron.SetY( lelectron_rfg.Y() ); - v3Electron.SetZ( lelectron_rfg.Z() ); - - v3X.SetX( lX_rfg.X() ) ; - v3X.SetY( lX_rfg.Y() ) ; - v3X.SetZ( lX_rfg.Z() ); - - v3S.SetX( -1 ); - v3S.SetY( 0 ); - v3S.SetZ( 0 ); - - v3PhotonUnit = v3Photon.Unit(); - v3QxL = v3Photon.Cross(v3Electron); - v3QxP = v3Photon.Cross(v3X); - v3QxS = v3Photon.Cross(v3S); - v3LxP = v3Electron.Cross(v3X); - v3LxS = v3Electron.Cross(v3S); - v3PxL = v3X.Cross(v3Electron); - v3QUnitxL = v3PhotonUnit.Cross(v3Electron); - v3QUnitxP = v3PhotonUnit.Cross(v3X); - v3QUnitxS = v3PhotonUnit.Cross(v3S); - - /*--------------------------------------------------*/ - // Get the Phi scattering angle with respect to the electron scattering plane - fPhi = Get_Phi_X_LeptonPlane_RF (); - - /*--------------------------------------------------*/ - // Get the Phi scattering angle with respect to the electron scattering plane - fPhiS = Get_Phi_TargPol_LeptonPlane_RF(); - - fTheta_X_Photon_RF = fRAD2DEG * acos( ( v3Photon.Dot( v3X ) ) / ( v3Photon.Mag() * v3X.Mag() ) ); - if ( fTheta_X_Photon_RF < 0 ) { fTheta_X_Photon_RF = 180.0 + fTheta_X_Photon_RF; } - - // ----------------------------------------------------------------------------------- - // If we have fermi momentum then epsilon should be in rest frame - // The theta angle of scattered angle used in expression of epsilon is the angle - // with respect to direction of incoming electron in the rest frame of target nucleon - // epsilon=1./(1.+ 2.*(pgam_restg**2)/q2g * *(tand(thscat_rest/2.))**2) - // ----------------------------------------------------------------------------------- - - double fTheta_EEp = (lelectron_rf.Vect()).Angle(lscatelec_rf.Vect()); - - fEpsilon = 1.0 / ( 1.0 + 2.0 * ( pow( (lphoton_rfg.Vect()).Mag(),2)/fQsq_GeV ) * pow( tan( fTheta_EEp / 2 ) , 2 ) ); - - // ---------------------------------------------------- - // Virtual Photon flux factor in units of 1/(GeV*Sr) - // ---------------------------------------------------- - fFlux_Factor_Col = (fAlpha/(2.0*pow(fPi,2))) * (r_lscatelecg.E() / r_lelectrong.E()) * - ( pow(fW_GeV,2) - pow(fProton_Mass_GeV,2) ) / (2.0*fProton_Mass_GeV*fQsq_GeV*(1.0 - fEpsilon)); - - fFlux_Factor_RF = ( fAlpha / ( 2.0 * pow( fPi , 2 ) ) ) * ( lscatelec_rfg.E() / lelectron_rfg.E() ) * - ( pow( fW_GeV , 2 ) - pow( fProton_Mass_GeV , 2 ) ) / - ( 2.0 * fProton_Mass_GeV * fQsq_GeV * ( 1.0 - fEpsilon ) ); - - // ---------------------------------------------------- - // Jacobian dt/dcos(theta*)dphi in units of GeV2/sr - // ---------------------------------------------------- - fJacobian_CM = ( (lphoton_rfg.Vect()).Mag() - fBeta_CM_RF * lphoton_rfg.E() ) / ( fGamma_CM_RF * ( 1.0 - pow(fBeta_CM_RF,2) ) ); // Eqn 22 in paper - - fA = fJacobian_CM * fX_Mom_CM_GeV / fPi; // Eqn 21 in paper - - // ---------------------------------------------------- - // Jacobian dOmega* / dOmega dimensionless - // ---------------------------------------------------- - fJacobian_CM_RF = ( pow((lX_rf.Vect()).Mag(),2)*fW) / - ( fX_Mom_CM * std::abs( ( fProton_Mass + lphoton_rf.E()) * (lX_rf.Vect()).Mag() - - ( lX_rf.E() * (lphoton_rf.Vect()).Mag() * cos( lX_rf.Theta() ) ) ) ); // Differs from next line in photon vect -> lphoton_rf vs r_lphoton - - fJacobian_CM_Col = ( ( pow((r_lX.Vect()).Mag(),2) * fW ) / // This one is actually used subsequently, so this must be Eqn 20 - ( fX_Mom_CM * std::abs( ( fProton_Mass + r_lphoton.E() ) * (r_lX.Vect()).Mag() - - ( r_lX.E() * (r_lphoton.Vect()).Mag() * cos( r_lX.Theta() ) ) ) ) ); - - - // cout << lX_rf.Vect().Mag() << " " << << << << << << << << endl; - // cout << fJacobian_CM_RF << " " << fJacobian_CM_Col << endl; - - // ----------------------------------------------------------------------------------------------------------- - // CKY sigma L and T starts - // ----------------------------------------------------------------------------------------------------------- - // r_fSig_T = 1; - // r_fSig_L = 1; - // ------------------------------------------------------------------------------------------- - - r_fSig = Get_Total_Cross_Section(); - - // ----------------------------------------------------------------------------------------------------------- - // CKY sigma L and T ends - // ----------------------------------------------------------------------------------------------------------- - - fSigma_Col = r_fSig * fFlux_Factor_Col * fA * fJacobian_CM_Col; - - if ( ( fSigma_Col <= 0 ) || std::isnan( fSigma_Col ) ) { - fNSigmaNeg ++; - return; - } - - // ----------------------------------------------------------------------------------------------------------- - // Lab cross section Phase Space Conversion Luminosity Total events tried - // Hz = ub / ( sr^2 * GeV ) * GeV * sr^2 * ( cm^2 / ub ) * ( # / ( cm^2 * sec ) ) / ( # ) - - // SJDK 11/05/21 - This is the previous non unit weight - // SJDK 24/06/21 - Explicitly taking the absolute value of the weigth such that the value is positive! - fEventWeight = abs(fSigma_Col * fPSF * fuBcm2 * fLumi / fNEvents); // in Hz - // SJDK 21/06/21 - Commenting out "unit weight" calculation for now, reverting to old version - // SJDK 11/05/21 - New weight calculation, division by ceiling weight value to attempt to get a "unit" value - //fEventWeight = abs(fSigma_Col * fPSF * fuBcm2 * fLumi )/fEventWeightCeil; - // if ( (fEventWeight > 1) || (fEventWeight <= 0) ){ - // fNWeightUnphys ++; - // return; - // } - // SJDK 21/06/21 - Reversed sign of condition here, actually want to reject those with a value less than the random number - // fEventWeightRn = fRandom->Uniform( 0, 1.0); - // if ( fEventWeight < fEventWeightRn ){ - // fNWeightReject ++; - // return; - // } - - fNRecorded++; - fLundRecorded++; - fRatio = fNRecorded / fNGenerated; - - if (gOutputType == "Pythia6"){ - PiPlus_Pythia6_Output(); - } - else if (gOutputType == "LUND"){ - Lund_Output(); - } - else if (gOutputType == "HEPMC3"){ - PiPlus_HEPMC3_Output(); - } -} - -void PiPlus_Production::Progress_Report() { - - dFractTime = time(0); - - if ( rNEvent_itt % ( rNEvents / 10 ) == 0 ) { - cout << "Event: " << setw(8) << rNEvent_itt - << " % of events " << setw(4) << ((1.0*rNEvent_itt)/(1.0*rNEvents))*100.0 - << " Day: " << dFractTime.GetDay() - << " Time: " << dFractTime.GetHour() - << ":" << dFractTime.GetMinute() - << ":" << dFractTime.GetSecond() - << endl; - } -} - -TLorentzVector PiPlus_Production::GetProtonVector_lab() { - - ///*--------------------------------------------------*/ - // // SJDK - 12/01/22 - // // Crossing angle - // // Set crossing angle to 0 for fun4all, also required for ATHENA simulations - // fProton_Theta_Col = 0.050; - // fProton_Theta_Col = 0.025; - - fProton_Theta_Col = 0.0; - - ///*--------------------------------------------------*/ - fProton_Phi_Col = fProton_incidence_phi; - - fProton_Mom_Col = fPBeam * 1e3; - fVertex_X = 0.; - fVertex_Y = 0.; - fVertex_Z = 0.; - - TLorentzVector lproton( fProton_Mom_Col * sin(fProton_Theta_Col) * cos(fProton_Phi_Col), - fProton_Mom_Col * sin(fProton_Theta_Col) * sin(fProton_Phi_Col), - fProton_Mom_Col * cos(fProton_Theta_Col), - sqrt( pow( fProton_Mom_Col , 2 ) + pow( fProton_Mass , 2 ) ) ); - - return lproton; - -} - -//*--------------------------------------------------*/ -// Proton in collider (lab) frame -// ---------------------------------------------------- - -void PiPlus_Production::Consider_Proton_Fermi_Momentum() { - - fProton_Mom_Col = fProton_Mom_Col + rFermiMomentum; - fProton_Theta_Col = acos( fRandom->Uniform( cos(0.0) , cos(fPi) ) ); - fProton_Phi_Col = fRandom->Uniform( 0 , 360 ); - - double px, py, pz, e; - - px = fProton_Mom_Col * sin(fProton_Theta_Col) * cos(fProton_Phi_Col); - py = fProton_Mom_Col * sin(fProton_Theta_Col) * sin(fProton_Phi_Col); - pz = fProton_Mom_Col * cos(fProton_Theta_Col); - e = sqrt( pow( fProton_Mom_Col , 2 ) + pow( fProton_Mass , 2 ) ); - - r_lproton.SetPxPyPzE(px,py,pz,e); - - r_lprotong = r_lproton*fm; - -} - -// ---------------------------------------------------- -// Electron in collider (lab) frame -// ---------------------------------------------------- - -TLorentzVector PiPlus_Production::GetElectronVector_lab() { - - fElectron_Energy_Col = fElectron_Kin_Col; - fElectron_Mom_Col = sqrt( pow(fElectron_Energy_Col , 2) - pow(fElectron_Mass , 2) ); - fElectron_Theta_Col = fPi; - fElectron_Phi_Col = 0.0; - fElectron_MomZ_Col = fElectron_Mom_Col * cos(fElectron_Theta_Col); - fElectron_MomX_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * cos(fElectron_Phi_Col); - fElectron_MomY_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * sin(fElectron_Phi_Col); - - cout << "Define: " << fElectron_MomZ_Col << " "<< fElectron_Mom_Col << " " << cos(fElectron_Theta_Col) << endl; - - TLorentzVector lelectron( fElectron_MomX_Col, fElectron_MomY_Col, fElectron_MomZ_Col, fElectron_Energy_Col); - - return lelectron; - -} - -Double_t PiPlus_Production::Get_Phi_X_LeptonPlane_RF () { - - fCos_Phi_X_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_X_LeptonPlane_RF = ( ( v3LxP.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_X_LeptonPlane_RF >= 0 ) - fPhi_X_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); - if ( fSin_Phi_X_LeptonPlane_RF < 0 ) - fPhi_X_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ) ); - - return fPhi_X_LeptonPlane_RF; - -} - -Double_t PiPlus_Production::Get_Phi_TargPol_LeptonPlane_RF () { - - fCos_Phi_TargPol_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_TargPol_LeptonPlane_RF = ( ( v3LxS.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_TargPol_LeptonPlane_RF >= 0 ) - fPhi_TargPol_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); - if ( fSin_Phi_TargPol_LeptonPlane_RF < 0 ) - fPhi_TargPol_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ) ); - - return fPhi_TargPol_LeptonPlane_RF; - -} - -Double_t PiPlus_Production::Get_Total_Cross_Section() { - - Double_t total_sig; - - Particle_t p = ParticleEnum(rParticle); - - switch (p) { - - case Pi0: total_sig = GetPi0_CrossSection(); - case PiPlus: total_sig = GetPiPlus_CrossSection(); - } - - return total_sig; - -} - -Double_t PiPlus_Production::GetPi0_CrossSection() { - - double_t sig_total; - return sig_total; - -} - -/*--------------------------------------------------*/ -/// Charged Pi+ moduel: -/// Author: Z. Ahmed -/// Date: 2017 - -Double_t PiPlus_Production::GetPiPlus_CrossSection(){ - - double_t sig_total; - - // -------------------------------------------------------------------------------------------------- - // CKY sigma L and T starts - // -------------------------------------------------------------------------------------------------- - double lpar0 = 0., lpar1 = 0., lpar2 = 0., lpar3 = 0., lpar4 = 0., lpar5 = 0., lpar6 = 0.; - double tpar0 = 0., tpar1 = 0., tpar2 = 0., tpar3 = 0., tpar4 = 0.; - - - lpar0 = 0.; lpar1 = 0.; lpar2 = 0.; lpar3 = 0.; lpar4 = 0.; lpar5 = 0.; lpar6 = 0.; - tpar0 = 0.; tpar1 = 0.; tpar2 = 0.; tpar3 = 0.; tpar4 = 0.; - - fSig_L = 0; - fSig_T = 0; - - if ( ( fT_GeV > 0. ) && ( fT_GeV < 0.15 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLonglandau = new TF1("sigmaL","landau", 0.0 , 0.15 ); - fitCKYLonglandau->FixParameter( 0 , lpar0 ); - fitCKYLonglandau->FixParameter( 1 , lpar1 ); - fitCKYLonglandau->FixParameter( 2 , lpar2 ); - fSig_L = fitCKYLonglandau->Eval(fT_GeV); - if ( lpar0 == 0 || lpar1 == 0 || lpar2 == 0 ) - fSig_L = 0; - fitCKYLonglandau = NULL; - delete fitCKYLonglandau; - } - else if ( ( fT_GeV > 0.15 ) && ( fT_GeV < 0.5 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLongexpo1 = new TF1("sigmaL","expo", 0.15 , 0.5 ); - fitCKYLongexpo1->FixParameter( 0 , lpar3 ); - fitCKYLongexpo1->FixParameter( 1 , lpar4 ); - fSig_L = fitCKYLongexpo1->Eval(fT_GeV); - if ( lpar3 == 0 || lpar4 == 0 ) - fSig_L = 0; - fitCKYLongexpo1 = NULL; - delete fitCKYLongexpo1; - } - else if ( ( fT_GeV > 0.5 ) && ( fT_GeV < 1.3 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLongexpo2 = new TF1("sigmaL","expo", 0.5 , 1.3 ); - fitCKYLongexpo2->FixParameter( 0 , lpar5 ); - fitCKYLongexpo2->FixParameter( 1 , lpar6 ); - fSig_L = fitCKYLongexpo2->Eval(fT_GeV); - if ( lpar5 == 0 || lpar6 == 0 ) - fSig_L = 0; - fitCKYLongexpo2 = NULL; - delete fitCKYLongexpo2; - } - else { - fSig_L = 0; - } - - // ------------------------------------------------------------------------------------------- - // SJDK - 02/06/22 - The validity range here was inconsistent, this only went from 0.0 to 0.15, leaving a gap between 0.15 to 0.2 - // I changed the range to remove this gap. - if ( ( fT_GeV > 0.0 ) && ( fT_GeV < 0.2 ) ) { - eicSigmaT( fW_GeV, fQsq_GeV, tpar0, tpar1, tpar2 , tpar3 , tpar4 ); - TF1 *fitCKYTranspol2 = new TF1("sigmaL","pol2", 0.0 , 0.2 ); - fitCKYTranspol2->FixParameter( 0 , tpar0 ); - fitCKYTranspol2->FixParameter( 1 , tpar1 ); - fitCKYTranspol2->FixParameter( 2 , tpar2 ); - fSig_T = fitCKYTranspol2->Eval(fT_GeV); - if ( tpar0 == 0 || tpar1 == 0 || tpar2 == 0 ) - fSig_T = 0; - fitCKYTranspol2 = NULL; - delete fitCKYTranspol2; - } - else if ( ( fT_GeV > 0.2 ) && ( fT_GeV < 1.3 ) ) { - eicSigmaT( fW_GeV, fQsq_GeV, tpar0, tpar1, tpar2 , tpar3 , tpar4 ); - TF1 *fitCKYTransexpo = new TF1("sigmaL","expo", 0.2 , 1.3 ); - fitCKYTransexpo->FixParameter( 0 , tpar3 ); - fitCKYTransexpo->FixParameter( 1 , tpar4 ); - fSig_T = fitCKYTransexpo->Eval(fT_GeV); - if ( tpar3 == 0 || tpar4 == 0 ) - fSig_T = 0; - fitCKYTransexpo = NULL; - delete fitCKYTransexpo; - } - - // ------------------------------------------------------------------------------------------- - - fSig_VR = fSig_T + fEpsilon * fSig_L; - - sig_total = fSig_VR; - - return sig_total; -} - -/*--------------------------------------------------*/ -/// Output generator detail - -void PiPlus_Production::Detail_Output() { - - ppiDetails << "Total events tried " << setw(20) << fNGenerated << endl; - ppiDetails << "Total events recorded " << setw(20) << fNRecorded << endl; - // 09/02/22 - Commented out, not used anymore - //ppiDetails << "Max weight value " << setw(20) << fEventWeightCeil << endl; - ppiDetails << "Number of events with w more than 10.6 " << setw(20) << w_ev << endl; - ppiDetails << "Number of events with wsq negative " << setw(20) << w_neg_ev << endl; - ppiDetails << "Number of events with qsq less than 3 " << setw(20) << qsq_ev << endl; - ppiDetails << "Number of events with Meson (X) energy NaN " << setw(20) << fNaN << endl; - ppiDetails << "Number of events failing conservation law check " << setw(20) << fConserve << endl; - ppiDetails << "Total events passing conservation laws " << setw(20) << conserve << endl; - ppiDetails << "Total events failed energy conservation " << setw(20) << ene << endl; - ppiDetails << "Total events failed momentum conservation " << setw(20) << mom << endl; - ppiDetails << "Number of events with -t more than threshold " << setw(20) << t_ev << endl; - // SJDK 21/06/21 - Commenting out, reverting to old weight determination - //ppiDetails << "Number of events with unit weight outside of 0 to 1 " << setw(20) << fNWeightUnphys << endl; - //ppiDetails << "Number of events with unit weight less than random number " << setw(20) << fNWeightReject << endl; - ppiDetails << "Number of events with w less than threshold " << setw(20) << fWSqNeg << endl; - ppiDetails << "Number of events with mom not conserve " << setw(20) << fNMomConserve << endl; - ppiDetails << "Number of events with Sigma negative " << setw(20) << fNSigmaNeg << endl; - ppiDetails << "Number of lund events " << setw(20) << fLundRecorded << endl; - - ppiDetails << "Seed used for the Random Number Generator " << setw(20) << fSeed << endl; - -} - -////*-------------------------------------------------- -/// Functions for different output formats follow - -void PiPlus_Production::Lund_Output() { - - ppiOut << "3" - << " \t " << fPhi // var 1 - << " \t " << fPhiS // var 2 - << " \t " << fx // var 3 - << " \t " << "1" - << " \t " << fQsq_GeV // var 4 - << " \t " << fT_GeV // var 5 - << " \t " << fW_GeV // var 6 - << " \t " << fEpsilon // var 7 - << " \t " << fEventWeight // var 8 - << endl; - - // Produced Particle X - ppiOut << setw(10) << "1" - << setw(10) << "1" - << setw(10) << "1" - << setw(10) << PDGtype(produced_X) - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << r_lX_g.X() - << setw(16) << r_lX_g.Y() - << setw(16) << r_lX_g.Z() - << setw(16) << r_lX_g.E() - << setw(16) << fX_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Scattered electron - ppiOut << setw(10) << "2" - << setw(10) << "-1" - << setw(10) << "1" - << setw(10) << "11" - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << r_lscatelecg.X() - << setw(16) << r_lscatelecg.Y() - << setw(16) << r_lscatelecg.Z() - << setw(16) << r_lscatelecg.E() - << setw(16) << fElectron_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Recoiled neutron - ppiOut << setw(10) << "3" - << setw(10) << "1" - << setw(10) << "1" - << setw(10) << PDGtype(recoil_nucleon) - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << r_l_scat_nucleon_g.X() - << setw(16) << r_l_scat_nucleon_g.Y() - << setw(16) << r_l_scat_nucleon_g.Z() - << setw(16) << r_l_scat_nucleon_g.E() - << setw(16) << f_Scat_Nucleon_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; -} - -void PiPlus_Production::PiPlus_Pythia6_Out_Init() { - - print_itt = 0; - - ppiOut << "DEMP Event FILE" << endl; - ppiOut << "============================================" << endl; - ppiOut << "I, ievent, nParticles, Weight" << endl; - ppiOut << "============================================" << endl; - ppiOut << "I K(I,1) K(I,2) K(I,3) K(I,4) K(I,5) P(I,1) P(I,2) P(I,3) P(I,4) P(I,5) V(I,1) V(I,2) V(I,3)" << endl; - ppiOut << "============================================" << endl; - -} - -void PiPlus_Production::PiPlus_Pythia6_Output() { - - ppiOut << "0" << " \t\t\t " << print_itt << " \t\t\t " << "1" << " \t\t\t " << fEventWeight << endl; // var 1 - - print_itt++; - - ppiOut << "============================================" << endl; - - ///*--------------------------------------------------*/ - // Initial State - - ppiOut << "1" - << setw(6) << "21" - << setw(6) << "11" - << setw(6) << "0" - << setw(6) << "3" - << setw(6) << "4" - - << setw(14) << r_lelectrong.X() - << setw(14) << r_lelectrong.Y() - << setw(14) << r_lelectrong.Z() - << setw(14) << r_lelectrong.E() - << setw(14) << fElectron_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ppiOut << "2" - << setw(6) << "21" - << setw(6) << "2212" - << setw(6) << "0" - << setw(6) << "5" - << setw(6) << "6" - - << setw(14) << r_lprotong.X() - << setw(14) << r_lprotong.Y() - << setw(14) << r_lprotong.Z() - << setw(14) << r_lprotong.E() - << setw(14) << fProton_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ppiOut << "3" - << setw(6) << "21" - << setw(6) << "22" - << setw(6) << "1" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_lphotong.X() - << setw(14) << r_lphotong.Y() - << setw(14) << r_lphotong.Z() - << setw(14) << r_lphotong.E() - << setw(14) << r_lphotong.M() - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - - ///*--------------------------------------------------*/ - // Final State - - // Scattered electron - ppiOut << "4" - << setw(6) << "1" - << setw(6) << "11" - << setw(6) << "1" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_lscatelecg.X() - << setw(14) << r_lscatelecg.Y() - << setw(14) << r_lscatelecg.Z() - << setw(14) << r_lscatelecg.E() - << setw(14) << fElectron_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - // Recoiled nucleon - ppiOut << "5" - << setw(6) << "1" - << setw(6) << PDGtype(recoil_nucleon) - << setw(6) << "2" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_l_scat_nucleon_g.X() - << setw(14) << r_l_scat_nucleon_g.Y() - << setw(14) << r_l_scat_nucleon_g.Z() - << setw(14) << r_l_scat_nucleon_g.E() - << setw(14) << f_Scat_Nucleon_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - // Produced Particle X - ppiOut << "6" - << setw(6) << "1" - << setw(6) << PDGtype(produced_X) - << setw(6) << "2" - << setw(6) << "0" - << setw(6) << "0" - - << setw(14) << r_lX_g.X() - << setw(14) << r_lX_g.Y() - << setw(14) << r_lX_g.Z() - << setw(14) << r_lX_g.E() - << setw(14) << fX_Mass_GeV - << setw(6) << fVertex_X - << setw(6) << fVertex_Y - << setw(6) << fVertex_Z - << endl; - - ppiOut << "=============== Event finished ===============" << endl; - -} - -/*--------------------------------------------------*/ - -void PiPlus_Production::PiPlus_HEPMC3_Out_Init() { - - print_itt = 0; - ppiOut << "HepMC::Version 3.02.02" << endl; - ppiOut << "HepMC::Asciiv3-START_EVENT_LISTING" << endl; - -} - -/*--------------------------------------------------*/ - -void PiPlus_Production::PiPlus_HEPMC3_Output() { - - // HEPMC3 output for Athena/EPIC simulations - - // First line - E - Event# - #Vertices - #Particles - ppiOut << "E" << " " << print_itt << " " << "1" << " " << 5 << endl; - print_itt++; - // Second line, Units - U - ENERGY UNIT - DISTANCE UNIT - ppiOut << "U" << " " << "GEV" << " " << "MM" << endl; - // Third line, optional attributes, the weight - ppiOut << "A" << " " << "0" << " " << "weight" << " " << fEventWeight << endl; - // Beam particles, particle line - P - Particle ID - Parent Vertex ID - PDG id - px - py - pz - energy - particle mass - status (4, incoming beam particle) - ppiOut << "P" << " " << "1" << " " << "0" << " " << "11" << " " << r_lelectrong.X() << " " << r_lelectrong.Y() << " " << r_lelectrong.Z() << " " << r_lelectrong.E() << " " << fElectron_Mass_GeV << " " << "4" << endl; - ppiOut << "P" << " " << "2" << " " << "0" << " " << "2212" << " " << r_lprotong.X() << " " << r_lprotong.Y() << " " << r_lprotong.Z() << " " << r_lprotong.E() << " " << fProton_Mass_GeV << " " << "4" << endl; - // Vertex line - V - 1 - 0 - [1,2] - ppiOut << "V" << " " << "-1" << " " << "0" << " " << "[1,2]" << endl; - // Output particles, particle line - P - Particle ID - Parent Vertex ID - PDG id - px - py - pz - energy - particle mass - status (1, undecayed physical particle) - // Scattered electron - ppiOut << "P" << " " << "3" << " " << "-1" << " " << "11" << " " << r_lscatelecg.X() << " " << r_lscatelecg.Y() << " " << r_lscatelecg.Z() << " " << r_lscatelecg.E() << " " << fElectron_Mass_GeV << " " << "1" << endl; - // Produced meson - ppiOut << "P" << " " << "4" << " " << "-1" << " " << PDGtype(produced_X) << " " << r_lX_g.X() << " " << r_lX_g.Y() << " " << r_lX_g.Z() << " " << r_lX_g.E() << " " << fX_Mass_GeV << " " << "1" << endl; - // Recoil nucleon - ppiOut << "P" << " " << "5" << " " << "-1" << " " << PDGtype(recoil_nucleon) << " " << r_l_scat_nucleon_g.X() << " " << r_l_scat_nucleon_g.Y() << " " << r_l_scat_nucleon_g.Z() << " " << r_l_scat_nucleon_g.E() << " " << f_Scat_Nucleon_Mass_GeV << " " << "1" << endl; - -} - -/*--------------------------------------------------*/ - -bool PiPlus_Production::SolnCheck() -{ - - // Double Checking for solution viability - if (TMath::Abs(f_Scat_Nucleon_Mass-r_l_scat_nucleon_solved->M())>1){ - //cerr << "Mass Missmatch" << endl; - //cerr << TMath::Abs(proton_mass_mev-Proton->M()) << endl; - return false; - } - if (TMath::Abs(W_in()-W_out())>1){ - //cerr << "W Missmatch" << endl; - //cerr << TMath::Abs(W_in()-W_out()) << endl; - return false; - } - *Final = *r_l_scat_nucleon_solved + *r_lX_solved; - - if (TMath::Abs(Initial->Px()-Final->Px())>1){ - //cerr << "Px Missmatch" << endl; - //cerr << TMath::Abs(Initial->Px()-Final->Px()) << endl; - return false; - } - - if (TMath::Abs(Initial->Py()-Final->Py())>1){ - //cerr << "Py Missmatch" << endl; - //cerr << TMath::Abs(Initial->Py()-Final->Py()) << endl; - return false; - } - - if (TMath::Abs(Initial->Pz()-Final->Pz())>1){ - //cerr << "Pz Missmatch" << endl; - //cerr << TMath::Abs(Initial->Pz()-Final->Pz()) << endl; - return false; - } - - if (TMath::Abs(Initial->E()-Final->E())>1){ - return false; - } - return true; -} - -/*--------------------------------------------------*/ -double PiPlus_Production::W_in() -{ - return (*Interaction+*Target).Mag2(); -} - -/*--------------------------------------------------*/ -double PiPlus_Production::W_out() -{ - return (*r_l_scat_nucleon_solved+*r_lX_solved).Mag2(); -} - -/*--------------------------------------------------*/ - -int PiPlus_Production::Solve() -{ -// double theta = AngleGen->Theta(); -// double phi = AngleGen->Phi(); -// theta = 0.282478; -// phi = 3.49651; -// cout << " Theta Phi: "<< theta << " " << phi << endl; - - - // Setting the initial values for solve function - VertBeamElec->SetPxPyPzE(r_lelectron.Px(), r_lelectron.Py(), r_lelectron.Pz(), r_lelectron.E()); - VertScatElec->SetPxPyPzE(r_lscatelec.Px(), r_lscatelec.Py(), r_lscatelec.Pz(), r_lscatelec.E()); - Target->SetPxPyPzE(r_lproton.Px(), r_lproton.Py(), r_lproton.Pz(), r_lproton.E()); - - *Photon = *VertBeamElec - *VertScatElec; - *Interaction = *Photon; - - *Initial = *Interaction+*Target; - - /*--------------------------------------------------*/ - - theta = fX_Theta_Col; - phi = fX_Phi_Col; - - return this->Solve(theta, phi); - -} - -/*--------------------------------------------------*/ - -int PiPlus_Production::Solve(double theta, double phi) -{ - - - W_in_val = W_in(); - - if (W_in_val<0){ - return 0; - } - - UnitVect->SetTheta(theta); - UnitVect->SetPhi(phi); - UnitVect->SetMag(1); - - double* pars = new double[9]; - - pars[0] = UnitVect->X(); - pars[1] = UnitVect->Y(); - pars[2] = UnitVect->Z(); - pars[3] = Initial->Px(); - pars[4] = Initial->Py(); - pars[5] = Initial->Pz(); - pars[6] = Initial->E(); - pars[7] = fX_Mass; - pars[8] = f_Scat_Nucleon_Mass; - - F->SetParameters(pars); - - P = F->GetX(0, 0, pars[6], 0.0001, 10000); - - Particle * r_lX_temp = new Particle(fX_Mass, - P*pars[0], - P*pars[1], - P*pars[2]); - r_lX_solved->SetPxPyPzE(r_lX_temp->Px(), r_lX_temp->Py(), r_lX_temp->Pz(), r_lX_temp->E()); - - Particle * r_l_nucleon_temp= new Particle(); - *r_l_nucleon_temp = *Initial-*r_lX_solved; - r_l_scat_nucleon_solved->SetPxPyPzE(r_l_nucleon_temp->Px(), r_l_nucleon_temp->Py(), r_l_nucleon_temp->Pz(), r_l_nucleon_temp->E()); - - delete r_lX_temp; - delete r_l_nucleon_temp; - delete[] pars; - - if (TMath::Abs(F->Eval(P)) < 1){ - if (SolnCheck()){ - return 1; - } - } - - ///*--------------------------------------------------*/ - /// Modifier: Ishan Goel - /// Date: March 22, 2023 - /// Commenting out second solution as it is not giving any solution ever - /// Check for Second solution: - // P2 = F->GetX(0, P+100, pars[6], 0.0001, 10000); - ///Try second solution - // Particle * Pion2 = new Particle(pion_mass_mev, - // P*pars[0], - // P*pars[1], - // P*pars[2]); - // Pion->SetPxPyPzE(Pion2->Px(), Pion2->Py(), Pion2->Pz(), Pion2->E()); - // Particle * Proton2 = new Particle(); - // *Proton2 = *Initial - * Pion; - // Proton_Particle->SetPxPyPzE(Proton2->Px(), Proton2->Py(), Proton2->Pz(), Proton2->E()); - // delete Pion2; - // delete Proton2; - // if (TMath::Abs(F->Eval(P2)) < 1){ - // if (SolnCheck()){ - // return 1; - // } - // } - ///*--------------------------------------------------*/ - - return 0; - -} - - - - - diff --git a/src/eic_evgen/archived_routines/legacy.h b/src/eic_evgen/archived_routines/legacy.h deleted file mode 100644 index a1fcc47..0000000 --- a/src/eic_evgen/archived_routines/legacy.h +++ /dev/null @@ -1,21 +0,0 @@ -# ifndef legacy_H -# define legacy_H - -#include -#include -#include - -#include "eic_pim.h" - -#include "TString.h" -#include "TF1.h" -#include "tssa_sig_Para.h" - -void Exclusive_Pion_Prodoction(pim); -void Exclusive_Omega_Prodoction(pim); - -double fSig_fpi_sigT (double, double); -double fSig_fpi_sigL (double, double); - -#endif - diff --git a/src/eic_evgen/archived_routines/legacy_function.cc b/src/eic_evgen/archived_routines/legacy_function.cc deleted file mode 100644 index 088e72d..0000000 --- a/src/eic_evgen/archived_routines/legacy_function.cc +++ /dev/null @@ -1,1513 +0,0 @@ -/*--------------------------------------------------*/ -// Author: Z. Ahmed -// Date: 2016 -// Pi Plus function - -#include "legacy_function.h" - - -using namespace std; - -void Exclusive_Pion_Prodoction(pim myPim) { - - ///*--------------------------------------------------*/ - /// Setting seed for generation and initiation - - -// kCalcFermi = true; - - string sTFile; - sTFile = Form("./LundFiles/eic_%s.txt", gfile_name.Data()); - -// string sRFile; -// sRFile = Form("./RootFiles/eic_%s.root", file_name.Data()); - - string sLFile; - sLFile= Form("./LundFiles/eic_input_%s.dat", gfile_name.Data()); - - ofstream ppiOut ( sLFile.c_str() ); - ofstream ppiDetails ( sTFile.c_str() ); - - // myPim.setrootfile( sRFile ); - - int qsq_ev = 0, t_ev = 0, w_neg_ev = 0, w_ev = 0; - double lpar0 = 0., lpar1 = 0., lpar2 = 0., lpar3 = 0., lpar4 = 0., lpar5 = 0., lpar6 = 0.; - double tpar0 = 0., tpar1 = 0., tpar2 = 0., tpar3 = 0., tpar4 = 0.; - -// t1->SetDirectory( f ); -// t1->SetAutoSave( 1000000000 ); - - long long int i; - for ( i = 0; i < fNEvents; i++ ) { - - TDatime dFractTime; - - fNGenerated ++; - - if ( i % ( fNEvents / 10 ) == 0 ) { - cout << "Event: " << setw(8) << i - << " % of events " << setw(4) << ((1.0*i)/(1.0*fNEvents))*100.0 - << " Day: " << dFractTime.GetDay() - << " Time: " << dFractTime.GetHour() - << ":" << dFractTime.GetMinute() - << ":" << dFractTime.GetSecond() - << endl; - } - - // ---------------------------------------------------- - // Proton in collider (lab) frame - // ---------------------------------------------------- - - fProton_Theta_Col = 50.0e-3; - fProton_Phi_Col = fPi; - fProton_Mom_Col = fPBeam * 1e3; - fVertex_X = 0.; - fVertex_Y = 0.; - fVertex_Z = 0.; - - if ( kCalcFermi ) { - fProton_Mom_Col = fProton_Mom_Col + myPim.fermiMomentum(); - fProton_Theta_Col = acos( fRandom->Uniform( cos(0.0) , cos(fPi) ) ); - fProton_Phi_Col = fRandom->Uniform( 0 , 360 ); - } - - TLorentzVector lproton( fProton_Mom_Col * sin(fProton_Theta_Col) * cos(fProton_Phi_Col), - fProton_Mom_Col * sin(fProton_Theta_Col) * sin(fProton_Phi_Col), - fProton_Mom_Col * cos(fProton_Theta_Col), - sqrt( pow( fProton_Mom_Col , 2 ) + pow( fProton_Mass , 2 ) ) ); - - TLorentzVector lprotong; - lprotong = lproton * fm; - - // ---------------------------------------------------- - // Boost vector from collider (lab) frame to protons rest frame (Fix target) - // ---------------------------------------------------- - - TVector3 beta_col_rf; - beta_col_rf = lproton.BoostVector(); - fGamma_Col_RF = 1.0/sqrt( 1 - pow( beta_col_rf.Mag() , 2 ) ); - - // ---------------------------------------------------- - // Electron in collider (lab) frame - // ---------------------------------------------------- - fElectron_Energy_Col = fElectron_Kin_Col; - fElectron_Mom_Col = sqrt( pow(fElectron_Energy_Col , 2) - pow(fElectron_Mass , 2) ); - fElectron_Theta_Col = fPi; - fElectron_Phi_Col = 0.0; - fElectron_MomZ_Col = fElectron_Mom_Col * cos(fElectron_Theta_Col); - fElectron_MomX_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * cos(fElectron_Phi_Col); - fElectron_MomY_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * sin(fElectron_Phi_Col); - - TLorentzVector lelectron( fElectron_MomX_Col, fElectron_MomY_Col, fElectron_MomZ_Col, fElectron_Energy_Col); - TLorentzVector lelectrong; - lelectrong = lelectron * fm; - - // --------------------------------------------------------------------- - // Specify the energy and solid angle of scatterd electron in Collider (lab) frame - // --------------------------------------------------------------------- - fScatElec_Theta_Col = acos( fRandom->Uniform( cos( fScatElec_Theta_I ) , cos( fScatElec_Theta_F ) ) ); - fScatElec_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi); - fScatElec_Energy_Col = fRandom->Uniform( fScatElec_E_Lo * fElectron_Energy_Col , fScatElec_E_Hi * fElectron_Energy_Col ); - fPion_Theta_Col = acos( fRandom->Uniform( cos(fPion_Theta_I ) , cos(fPion_Theta_F ) ) ); - fPion_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi ); - - -// fScatElec_Theta_Col = 2.42585; -// fScatElec_Phi_Col = 1.73913; -// fScatElec_Energy_Col = 5473.08; -// -// fPion_Theta_Col = 0.232649; -// fPion_Phi_Col = 4.68068; - - -// cout << fScatElec_Theta_Col << " " << fScatElec_Phi_Col << " " << fScatElec_Energy_Col << " " << fPion_Theta_Col << " " << fPion_Phi_Col << endl; - - - - // fScatElec_Theta_Col = 146.356*fDEG2RAD; - // fScatElec_Phi_Col = 11.8325*fDEG2RAD; - // fScatElec_Energy_Col = 5.25281*1000.0; - // fPion_Theta_Col = 14.5869*fDEG2RAD; - // fPion_Phi_Col = -168.57*fDEG2RAD; - - fScatElec_Mom_Col = sqrt( pow( fScatElec_Energy_Col,2) - pow( fElectron_Mass , 2) ); - fScatElec_MomZ_Col = ( fScatElec_Mom_Col * cos(fScatElec_Theta_Col) ); - fScatElec_MomX_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * cos(fScatElec_Phi_Col) ); - fScatElec_MomY_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * sin(fScatElec_Phi_Col) ); - - TLorentzVector lscatelec( fScatElec_MomX_Col, fScatElec_MomY_Col, fScatElec_MomZ_Col, fScatElec_Energy_Col); - TLorentzVector lscatelecg; - lscatelecg = lscatelec * fm; - - // ---------------------------------------------------- - // Photon in collider (lab) frame and Qsq - // ---------------------------------------------------- - - TLorentzVector lphoton; - lphoton = lelectron - lscatelec; - TLorentzVector lphotong; - lphotong = lelectrong - lscatelecg; - -// cout << "Check check Original: " << endl; -// -// cout << lphoton.Px() << " " << lphoton.Py() << " " << lphoton.Pz() << " " << lphoton.E() << endl; -// cout << lelectron.Px() << " " << lelectron.Py() << " " << lelectron.Pz() << " " << lelectron.E() << endl; -// cout << lscatelec.Px() << " " << lscatelec.Py() << " " << lscatelec.Pz() << " " << lscatelec.E() << endl; - -// exit(0); - - - - - - fQsq_GeV = -1.*lphotong.Mag2(); - - if ( fQsq_GeV < 5.0 ) { - qsq_ev++; - continue; - } - - // ---------------------------------------------------- - // W square, Invariant Mass (P_g + P_p)^2 - // ---------------------------------------------------- - - TLorentzVector lwg; - lwg = lprotong + lphotong; - fW_GeV = lwg.Mag(); - fWSq_GeV = lwg.Mag2(); - -// cout << lprotong.Px() << " " << lprotong.Py() << " " << lprotong.Pz() << " " << lprotong.E() << endl; -// cout << lphotong.Px() << " " << lphotong.Py() << " " << lphotong.Pz() << " " << lphotong.E() << endl; -// -// cout << "Org : " << fQsq_GeV << " " << fW_GeV << " "<< fWSq_GeV << endl; - - - if ( fWSq_GeV < 0 ) { - w_neg_ev++; - continue; - } - - // ---------------------------------------------------- - // Pion in Collider frame - // ---------------------------------------------------- - // fPion_Theta_Col = acos( fRandom->Uniform( cos(fPion_Theta_I ) , cos(fPion_Theta_F ) ) ); - // fPion_Phi_Col = fRandom->Uniform( 0 , 360 ); - - // --------------------------------------------------------- - // Pion momentum in collider frame, analytic solution starts - // --------------------------------------------------------- - - double fupx = sin( fPion_Theta_Col ) * cos( fPion_Phi_Col ); - double fupy = sin( fPion_Theta_Col ) * sin( fPion_Phi_Col ); - double fupz = cos( fPion_Theta_Col ); - - double fuqx = sin( lphoton.Theta() ) * cos( lphoton.Phi() ); - double fuqy = sin( lphoton.Theta() ) * sin( lphoton.Phi() ); - double fuqz = cos( lphoton.Theta() ); - - double fa = -(lphoton.Vect()).Mag() * ( fupx * fuqx + fupy * fuqy + fupz * fuqz ); - double fb = pow ( (lphoton.Vect()).Mag() , 2 ); - double fc = lphoton.E() + fProton_Mass; - -// cout.precision(10); -// cout << lphoton.Vect().X() << " " << lphoton.Vect().Y() << " " << lphoton.Vect().Z() << endl; -// cout << "AAAAAAAAAAABBBBBBBCCCCCCCCC " << fa << " " << fb << " " << fc << endl; - - - fa = ( fa - std::abs( (lproton.Vect()).Mag() ) * ( ( ( lproton.X() / (lproton.Vect()).Mag() ) * fupx ) + - ( ( lproton.Y() / (lproton.Vect()).Mag() ) * fupy ) + - ( ( lproton.Z() / (lproton.Vect()).Mag() ) * fupz ) ) ); - - double factor = ( pow( (lproton.Vect()).Mag() , 2 ) + 2.0 * (lphoton.Vect()).Mag() * (lproton.Vect()).Mag() * - ( ( ( lproton.X() / (lproton.Vect()).Mag() ) * fuqx ) + - ( ( lproton.Y() / (lproton.Vect()).Mag() ) * fuqy ) + - ( ( lproton.Z() / (lproton.Vect()).Mag() ) * fuqz ) ) ); - - fb = fb + factor; - fc = lphoton.E() + lproton.E(); - - double ft = fc * fc - fb + fPion_Mass * fPion_Mass - fProton_Mass * fProton_Mass; - - double fQA = 4.0 * ( fa * fa - fc * fc ); - double fQB = 4.0 * fc * ft; - double fQC = -4.0 * fa * fa * fPion_Mass * fPion_Mass - ft * ft; - - fradical = fQB * fQB - 4.0 * fQA * fQC; - - fepi1 = ( -fQB - sqrt( fradical ) ) / ( 2.0 * fQA ); - fepi2 = ( -fQB + sqrt( fradical ) ) / ( 2.0 * fQA ); - -// cout.precision(10); -// -// cout << fc*fc << " " << 99531.3*99531.3 << endl; -// cout << fb << " " << 9.83386e+09 << endl; -// -// cout << fc*fc - fb << " " << 99531.3*99531.3 - 9.83386e+09 << endl; -// -// cout << fc * fc << " " << fc * fc -fb << " " << 99531.3*99531.3 - 9.83386e+09 << endl; -// -// cout << "abc: " << fa << " " << fb << " " << fc << " " << ft << " " << fPion_Mass << " " << fProton_Mass << endl; -// -// cout << "epi: " << fQB << " " << fradical << " " << fQA << endl; -// -// cout << "org: " << factor << " " << fepi1 << " " << fepi2 << endl; -// -// -// cout << "X diagnose: " << fPion_Mass << " " << fepi1 << " " << fPion_Theta_Col << " " << fPion_Phi_Col << endl; - - - fPion_Mom_Same = 0; - if ( std::abs(fepi1 - fepi2) < fDiff ){ fPion_Mom_Same = 1; } - - // --------------------------------------------------------- - // Pion momentum in collider frame, analytic solution ends - // --------------------------------------------------------- - - TLorentzVector lpion( ( sqrt( pow( fepi1 , 2) - pow(fPion_Mass , 2) ) ) * sin(fPion_Theta_Col) * cos(fPion_Phi_Col), - ( sqrt( pow( fepi1 , 2) - pow(fPion_Mass , 2) ) ) * sin(fPion_Theta_Col) * sin(fPion_Phi_Col), - ( sqrt( pow( fepi1 , 2) - pow(fPion_Mass , 2) ) ) * cos(fPion_Theta_Col), - fepi1 ); - - TLorentzVector lpiong; - lpiong = lpion * fm; - - TLorentzVector lneutron( ( lproton + lelectron - lscatelec - lpion ).X(), - ( lproton + lelectron - lscatelec - lpion ).Y(), - ( lproton + lelectron - lscatelec - lpion ).Z(), - sqrt( pow( ( ( ( lproton + lelectron - lscatelec - lpion ).Vect() ).Mag()),2) + - pow( fNeutron_Mass ,2 ) ) ); - TLorentzVector lneutrong; - lneutrong = lneutron * fm; - - fNeutron_Mom_Col_GeV = (lneutrong.Vect()).Mag(); - fNeutron_MomZ_Col_GeV = lneutrong.Z(); - fNeutron_MomX_Col_GeV = lneutrong.X(); - fNeutron_MomY_Col_GeV = lneutrong.Y(); - fNeutron_Energy_Col_GeV = lneutrong.E(); - - -// cout << fW_GeV << endl; -// exit(0); - - // ------------------------------------------------------------------------------------------------- - // ------------------------------------------------------------------------------------------------- - // Calculate w = (proton + photon)^2 - // ------------------------------------------------------------------------------------------------- - // ------------------------------------------------------------------------------------------------- - - // cout << fW_GeV << endl; - if ( fW_GeV < 3.0 || fW_GeV > 10.6 ) { - w_ev++; - continue; - } - -// cout << fScatElec_Theta_Col << " " << fScatElec_Phi_Col << " " << fScatElec_Energy_Col << " " << fPion_Theta_Col << " " << fPion_Phi_Col << endl; - -// cout << fW_GeV << endl; - - - - - - - - - TLorentzVector lw; - lw = lproton + lphoton; - fW = lw.Mag(); - - // ------------------------------------------------------------------------------------------------- - // ------------------------------------------------------------------------------------------------- - // Calculate w prime w' = (proton + photon - pion)^2 - // ------------------------------------------------------------------------------------------------- - // ------------------------------------------------------------------------------------------------- - - TLorentzVector lwp = lprotong + lphotong - lpiong; - fW_Prime_GeV = lwp.Mag(); - - TLorentzVector fsini; - fsini = lelectron + lproton; - TLorentzVector fsfin; - fsfin = lscatelec + lpion + lneutron; - - TLorentzVector fsinig; - fsinig = fsini * fm; - TLorentzVector fsfing; - fsfing = fsfin * fm; - - fMandSConserve = std::abs( fsinig.Mag() - fsfing.Mag() ); - -// cout << fW_GeV << " " << fsinig.Mag() << " " << fsfing.Mag() << " " << fMandSConserve << endl; - -// cout << "E: " << lscatelec.Px() << " " << lscatelec.Py() << " " << lscatelec.Pz() << " " << lscatelec.E() << endl; -// cout << "X: " << lpion.Px() << " " << lpion.Py() << " " << lpion.Pz() << " " << lpion.E() << endl; -// cout << "N: " << lneutron.Px() << " " << lneutron.Py() << " " << lneutron.Pz() << " " << lneutron.E() << endl; - -// cout << fW_GeV << " " << fsinig.Mag() << " " << fsfing.Mag() << " " << fMandSConserve << endl; -// exit(0); - - - kSConserve = false; - if( std::abs( fsinig.Mag() - fsfing.Mag() ) < fDiff ) { - kSConserve = true; - } - - if ( myPim.CheckLaws( lelectron, lproton, lscatelec, lpion, lneutron) != 1 ) - continue; - - - - - - //////////////////////////////////////////////////////////////////////////////////////////// - // Start // - // Transformation of e', pi- and recoil proton to target's rest frmae without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - TLorentzVector lproton_rf; - lproton_rf = lproton; - lproton_rf.Boost(-beta_col_rf); - TLorentzVector lproton_rfg; - lproton_rfg = lproton_rf * fm; - - TLorentzVector lelectron_rf; - lelectron_rf = lelectron; - lelectron_rf.Boost(-beta_col_rf); - TLorentzVector lelectron_rfg; - lelectron_rfg = lelectron_rf * fm; - - TLorentzVector lscatelec_rf; - lscatelec_rf = lscatelec; - lscatelec_rf.Boost(-beta_col_rf); - TLorentzVector lscatelec_rfg; - lscatelec_rfg = lscatelec_rf * fm; - - TLorentzVector lphoton_rf; - lphoton_rf = lphoton; - lphoton_rf.Boost(-beta_col_rf); - TLorentzVector lphoton_rfg; - lphoton_rfg = lphoton_rf * fm; - - TLorentzVector lpion_rf; - lpion_rf = lpion; - lpion_rf.Boost(-beta_col_rf); - TLorentzVector lpion_rfg; - lpion_rfg = lpion_rf * fm; - - TLorentzVector lneutron_rf; - lneutron_rf = lneutron; - lneutron_rf.Boost(-beta_col_rf); - TLorentzVector lneutron_rfg; - lneutron_rfg = lneutron_rf * fm; - - //////////////////////////////////////////////////////////////////////////////////////////// - // End // - // Transformation of e', pi- and recoil proton to target's rest frmae without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - // fElectron_Energy_RF_GeV = lelectron_rf.E() / 1000.0; - // fElectron_Mom_RF_GeV = (lelectron_rf.Vect()).Mag() / 1000.0; - // fElectron_MomX_RF_GeV = lelectron_rf.X() / 1000.0; - // fElectron_MomY_RF_GeV = lelectron_rf.Y() / 1000.0; - // fElectron_MomZ_RF_GeV = lelectron_rf.Z() / 1000.0; - - fScatElec_Energy_RF_GeV = lscatelec_rf.E() / 1000.0; - fScatElec_Mom_RF_GeV = (lscatelec_rf.Vect()).Mag() / 1000.0; - fScatElec_MomX_RF_GeV = lscatelec_rf.X() / 1000.0; - fScatElec_MomY_RF_GeV = lscatelec_rf.Y() / 1000.0; - fScatElec_MomZ_RF_GeV = lscatelec_rf.Z() / 1000.0; - - fPion_Energy_RF_GeV = lpion_rf.E() / 1000.0; - fPion_Mom_RF_GeV = (lpion_rf.Vect()).Mag() / 1000.0; - fPion_MomX_RF_GeV = lpion_rf.X() / 1000.0; - fPion_MomY_RF_GeV = lpion_rf.Y() / 1000.0; - fPion_MomZ_RF_GeV = lpion_rf.Z() / 1000.0; - - fNeutron_Energy_RF_GeV = lneutron_rf.E() / 1000.0; - fNeutron_Mom_RF_GeV = (lneutron_rf.Vect()).Mag() / 1000.0; - fNeutron_MomX_RF_GeV = lneutron_rf.X() / 1000.0; - fNeutron_MomY_RF_GeV = lneutron_rf.Y() / 1000.0; - fNeutron_MomZ_RF_GeV = lneutron_rf.Z() / 1000.0; - - // if ( myPim.CheckLaws( lelectron_rf, lproton_rf, lscatelec_rf, lpion_rf, lneutron_rf ) != 1 ) - // continue; - - // ---------------------------------------------------------------------------------------------------- - // ---------------------------------------------------------------------------------------------------- - // Calculate -t - // ---------------------------------------------------------------------------------------------------- - // ---------------------------------------------------------------------------------------------------- - - fBeta_CM_RF = (lphoton_rf.Vect()).Mag() / ( lphoton_rf.E() + fProton_Mass ); - fGamma_CM_RF = ( lphoton_rf.E() + fProton_Mass ) / fW; - fPion_Energy_CM = ( pow( fW , 2) + pow(fPion_Mass , 2) - pow(fNeutron_Mass , 2) ) / ( 2.0 * fW); - fPion_Mom_CM = sqrt( pow(fPion_Energy_CM , 2) - pow(fPion_Mass , 2)); - fPion_Energy_CM_GeV = fPion_Energy_CM / 1000.0; - fPion_Mom_CM_GeV = fPion_Mom_CM / 1000.0; - - // this equation is valid for parallel kinematics only! - fT_Para = ( pow(((lphoton.Vect()).Mag() - (lpion.Vect()).Mag()),2) - pow((lphoton.E() - lpion.E()),2)); - fT_Para_GeV = fT_Para/1000000.0; - - TLorentzVector lt; - lt = lphoton - lpion; - TLorentzVector ltg; - ltg = lt * fm; - - fT = -1.*lt.Mag2(); - fT_GeV = -1.*ltg.Mag2(); - - - - - if ( gKinematics_type == 1 && fT_GeV > 0.5 ) { - t_ev++; - continue; - } - - if ( gKinematics_type == 2 && fT_GeV > 1.3 ) { - t_ev++; - continue; - } - - - -// cout << "Parameter: " << fScatElec_Theta_Col << " " << fScatElec_Phi_Col << " " << fScatElec_Energy_Col << " " << fPion_Theta_Col << " " << fPion_Phi_Col << endl; - -// cout << fT_GeV << endl; - -// exit(0); - - - fx = fQsq_GeV / ( 2.0 * lprotong.Dot( lphotong ) ); - fy = lprotong.Dot( lphotong ) / lprotong.Dot( lelectrong ); - fz = lpion.E()/lphoton.E(); - - // ------------------------------------------------------------------------------------------------------- - // ------------------------------------------------------------------------------------------------------- - - // ------------------------------------------------------------------------------------------------------- - // Calculation of Phi ( azimuthal angle of pion momentum w.r.t lepton plane in target's rest frame) - // Calculation of PhiS ( azimuthal angle of target polarization w.r.t lepton plane in target's rest frame) - // ------------------------------------------------------------------------------------------------------- - - TVector3 v3Photon; v3Photon.SetX( lphoton_rfg.X() ); v3Photon.SetY( lphoton_rfg.Y() ); v3Photon.SetZ( lphoton_rfg.Z() ); - TVector3 v3Electron; v3Electron.SetX( lelectron_rfg.X() ); v3Electron.SetY( lelectron_rfg.Y() ); v3Electron.SetZ( lelectron_rfg.Z() ); - TVector3 v3Pion; v3Pion.SetX( lpion_rfg.X() ) ; v3Pion.SetY( lpion_rfg.Y() ) ; v3Pion.SetZ( lpion_rfg.Z() ); - TVector3 v3S; v3S.SetX( -1 ); v3S.SetY( 0 ); v3S.SetZ( 0 ); - TVector3 v3PhotonUnit = v3Photon.Unit(); - TVector3 v3QxL = v3Photon.Cross(v3Electron); - TVector3 v3QxP = v3Photon.Cross(v3Pion); - TVector3 v3QxS = v3Photon.Cross(v3S); - TVector3 v3LxP = v3Electron.Cross(v3Pion); - TVector3 v3LxS = v3Electron.Cross(v3S); - TVector3 v3PxL = v3Pion.Cross(v3Electron); - TVector3 v3QUnitxL = v3PhotonUnit.Cross(v3Electron); - TVector3 v3QUnitxP = v3PhotonUnit.Cross(v3Pion); - TVector3 v3QUnitxS = v3PhotonUnit.Cross(v3S); - - fCos_Phi_Pion_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_Pion_LeptonPlane_RF = ( ( v3LxP.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_Pion_LeptonPlane_RF >= 0 ) - fPhi_Pion_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); - if ( fSin_Phi_Pion_LeptonPlane_RF < 0 ) - fPhi_Pion_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ) ); - - fCos_Phi_TargPol_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_TargPol_LeptonPlane_RF = ( ( v3LxS.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_TargPol_LeptonPlane_RF >= 0 ) - fPhi_TargPol_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); - if ( fSin_Phi_TargPol_LeptonPlane_RF < 0 ) - fPhi_TargPol_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ) ); - - fTheta_Pion_Photon_RF = fRAD2DEG * acos( ( v3Photon.Dot( v3Pion ) ) / ( v3Photon.Mag() * v3Pion.Mag() ) ); - if ( fTheta_Pion_Photon_RF < 0 ) { fTheta_Pion_Photon_RF = 180.0 + fTheta_Pion_Photon_RF; } - - fPhi = fPhi_Pion_LeptonPlane_RF; - fPhiS = fPhi_TargPol_LeptonPlane_RF; - - // ----------------------------------------------------------------------------------- - // If we have fermi momentum then epsilon should be in rest frame - // The theta angle of scattered angle used in expression of epsilon is the angle - // with respect to direction of incoming electron in the rest frame of target nucleon - // epsilon=1./(1.+ 2.*(pgam_restg**2)/q2g * *(tand(thscat_rest/2.))**2) - // ----------------------------------------------------------------------------------- - - double fTheta_EEp = (lelectron_rf.Vect()).Angle(lscatelec_rf.Vect()); - - fEpsilon = 1.0 / ( 1.0 + 2.0 * ( pow( (lphoton_rfg.Vect()).Mag(),2)/fQsq_GeV ) * pow( tan( fTheta_EEp / 2 ) , 2 ) ); - - // ---------------------------------------------------- - // Virtual Photon flux factor in units of 1/(GeV*Sr) - // ---------------------------------------------------- - fFlux_Factor_Col = (fAlpha/(2.0*pow(fPi,2))) * (lscatelecg.E() / lelectrong.E()) * - ( pow(fW_GeV,2) - pow(fProton_Mass_GeV,2) ) / (2.0*fProton_Mass_GeV*fQsq_GeV*(1.0 - fEpsilon)); - - fFlux_Factor_RF = ( fAlpha / ( 2.0 * pow( fPi , 2 ) ) ) * ( lscatelec_rfg.E() / lelectron_rfg.E() ) * - ( pow( fW_GeV , 2 ) - pow( fProton_Mass_GeV , 2 ) ) / - ( 2.0 * fProton_Mass_GeV * fQsq_GeV * ( 1.0 - fEpsilon ) ); - - // ---------------------------------------------------- - // Jacobian dt/dcos(theta*)dphi in units of GeV2/sr - // ---------------------------------------------------- - fJacobian_CM = ( (lphoton_rfg.Vect()).Mag() - fBeta_CM_RF * lphoton_rfg.E() ) / ( fGamma_CM_RF * ( 1.0 - pow(fBeta_CM_RF,2) ) ); - - fA = fJacobian_CM * fPion_Mom_CM_GeV / fPi; - - // ---------------------------------------------------- - // Jacobian dOmega* / dOmega dimensionless - // ---------------------------------------------------- - fJacobian_CM_RF = ( pow((lpion_rf.Vect()).Mag(),2)*fW) / - ( fPion_Mom_CM * std::abs( ( fProton_Mass + lphoton_rf.E()) * (lpion_rf.Vect()).Mag() - - ( lpion_rf.E() * (lphoton_rf.Vect()).Mag() * cos( lpion_rf.Theta() ) ) ) ); - - fJacobian_CM_Col = ( ( pow((lpion.Vect()).Mag(),2) * fW ) / - ( fPion_Mom_CM * std::abs( ( fProton_Mass + lphoton.E() ) * (lpion.Vect()).Mag() - - ( lpion.E() * (lphoton.Vect()).Mag() * cos( lpion.Theta() ) ) ) ) ); - - -// cout << fJacobian_CM_RF << " " << fJacobian_CM_Col << endl; - -// exit(0); - - - - // -------------------------------------------------------------------------------------------------- - // CKY sigma L and T starts - // -------------------------------------------------------------------------------------------------- - - lpar0 = 0.; lpar1 = 0.; lpar2 = 0.; lpar3 = 0.; lpar4 = 0.; lpar5 = 0.; lpar6 = 0.; - tpar0 = 0.; tpar1 = 0.; tpar2 = 0.; tpar3 = 0.; tpar4 = 0.; - - fSig_L = 0; - fSig_T = 0; - - if ( ( fT_GeV > 0. ) && ( fT_GeV < 0.15 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLonglandau = new TF1("sigmaL","landau", 0.0 , 0.15 ); - fitCKYLonglandau->FixParameter( 0 , lpar0 ); - fitCKYLonglandau->FixParameter( 1 , lpar1 ); - fitCKYLonglandau->FixParameter( 2 , lpar2 ); - fSig_L = fitCKYLonglandau->Eval(fT_GeV); - if ( lpar0 == 0 || lpar1 == 0 || lpar2 == 0 ) - fSig_L = 0; - fitCKYLonglandau = NULL; - delete fitCKYLonglandau; - } - else if ( ( fT_GeV > 0.15 ) && ( fT_GeV < 0.5 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLongexpo1 = new TF1("sigmaL","expo", 0.15 , 0.5 ); - fitCKYLongexpo1->FixParameter( 0 , lpar3 ); - fitCKYLongexpo1->FixParameter( 1 , lpar4 ); - fSig_L = fitCKYLongexpo1->Eval(fT_GeV); - if ( lpar3 == 0 || lpar4 == 0 ) - fSig_L = 0; - fitCKYLongexpo1 = NULL; - delete fitCKYLongexpo1; - } - else if ( ( fT_GeV > 0.5 ) && ( fT_GeV < 1.3 ) ) { - eicSigmaL( fW_GeV, fQsq_GeV, lpar0, lpar1, lpar2 , lpar3 , lpar4 , lpar5 , lpar6 ); - TF1 *fitCKYLongexpo2 = new TF1("sigmaL","expo", 0.5 , 1.3 ); - fitCKYLongexpo2->FixParameter( 0 , lpar5 ); - fitCKYLongexpo2->FixParameter( 1 , lpar6 ); - fSig_L = fitCKYLongexpo2->Eval(fT_GeV); - if ( lpar5 == 0 || lpar6 == 0 ) - fSig_L = 0; - fitCKYLongexpo2 = NULL; - delete fitCKYLongexpo2; - } - else { - fSig_L = 0; - } - - // ------------------------------------------------------------------------------------------- - - if ( ( fT_GeV > 0.0 ) && ( fT_GeV < 0.15 ) ) { - eicSigmaT( fW_GeV, fQsq_GeV, tpar0, tpar1, tpar2 , tpar3 , tpar4 ); - TF1 *fitCKYTranspol2 = new TF1("sigmaL","pol2", 0.0 , 0.2 ); - fitCKYTranspol2->FixParameter( 0 , tpar0 ); - fitCKYTranspol2->FixParameter( 1 , tpar1 ); - fitCKYTranspol2->FixParameter( 2 , tpar2 ); - fSig_T = fitCKYTranspol2->Eval(fT_GeV); - if ( tpar0 == 0 || tpar1 == 0 || tpar2 == 0 ) - fSig_T = 0; - fitCKYTranspol2 = NULL; - delete fitCKYTranspol2; - } - else if ( ( fT_GeV > 0.2 ) && ( fT_GeV < 1.3 ) ) { - eicSigmaT( fW_GeV, fQsq_GeV, tpar0, tpar1, tpar2 , tpar3 , tpar4 ); - TF1 *fitCKYTransexpo = new TF1("sigmaL","expo", 0.2 , 1.3 ); - fitCKYTransexpo->FixParameter( 0 , tpar3 ); - fitCKYTransexpo->FixParameter( 1 , tpar4 ); - fSig_T = fitCKYTransexpo->Eval(fT_GeV); - if ( tpar3 == 0 || tpar4 == 0 ) - fSig_T = 0; - fitCKYTransexpo = NULL; - delete fitCKYTransexpo; - } - - // ------------------------------------------------------------------------------------------- - - fSig_VR = fSig_T + fEpsilon * fSig_L; - - // ------------------------------------------------------------------------------------------- - // CKY sigma L and T ends - // ------------------------------------------------------------------------------------------- - - fSigma_Col = fSig_VR * fFlux_Factor_Col * fA * fJacobian_CM_Col; - - // cout << endl; - // cout << setw(12) << "Qsq" << setw(12) << "-t" << setw(12) << "W" - // << setw(12) << "x" << setw(12) << "y" << setw(12) << "z" - // << setw(12) << "epsilon" << setw(12) << "phi" << setw(12) << "phis" - // << setw(12) << "sig" - // << endl; - // cout << setw(12) << fQsq_GeV << setw(12) << fT_GeV << setw(12) << fW_GeV - // << setw(12) << fx << setw(12) << fy << setw(12) << fz - // << setw(12) << fEpsilon << setw(12) << fPhi << setw(12) << fPhiS - // << setw(12) << fSigma_Col - // << endl; - - // cout << endl; - // cout << setw(12) << "Particle" << setw(12) << "Px" << setw(12) << "Py" << setw(12) << "Pz" << setw(12) << "Energy" << endl; - // cout << setw(12) << "Pion" - // << setw(12) << lpiong.X() - // << setw(12) << lpiong.Y() - // << setw(12) << lpiong.Z() - // << setw(12) << lpiong.E() - // << endl; - // cout << setw(12) << "Elec" - // << setw(12) << lscatelecg.X() - // << setw(12) << lscatelecg.Y() - // << setw(12) << lscatelecg.Z() - // << setw(12) << lscatelecg.E() - // << endl; - // cout << setw(12) << "Neutron" - // << setw(12) << lneutrong.X() - // << setw(12) << lneutrong.Y() - // << setw(12) << lneutrong.Z() - // << setw(12) << lneutrong.E() - // << endl; - - if ( ( fSigma_Col <= 0 ) || std::isnan( fSigma_Col ) ) { - fNSigmaNeg ++; - continue; - } - - // -------------------------------------------------------------------------------------------------- - // -------------------------------------------------------------------------------------------------- - // Lab cross section Phase Space Conversion Luminosity Total events tried - // Hz = ub / ( sr^2 * GeV ) * GeV * sr^2 * ( cm^2 / ub ) * ( # / ( cm^2 * sec ) ) / ( # ) - - fEventWeight = fSigma_Col * fPSF * fuBcm2 * fLumi / fNEvents; // in Hz - - fNRecorded ++; - fLundRecorded++; - fRatio = fNRecorded / fNGenerated; - - -// cout << "Sigma: " << fSigma_Col << " " << fEventWeight << endl; -// exit(0); - - - - ////*-------------------------------------------------- - /// Outputing to LUND file -// t1->Fill(); - - ppiOut << "3" - << " \t " << fPhi // var 1 - << " \t " << fPhiS // var 2 - << " \t " << fx // var 3 - << " \t " << "1" - << " \t " << fQsq_GeV // var 4 - << " \t " << fT_GeV // var 5 - << " \t " << fW_GeV // var 6 - << " \t " << fEpsilon // var 7 - << " \t " << fEventWeight // var 8 - << endl; - - // Pion - - ppiOut << setw(10) << "1" - << setw(10) << "1" - << setw(10) << "1" - << setw(10) << "211" - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << lpiong.X() - << setw(16) << lpiong.Y() - << setw(16) << lpiong.Z() - << setw(16) << lpiong.E() - << setw(16) << fPion_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Electron - ppiOut << setw(10) << "2" - << setw(10) << "-1" - << setw(10) << "1" - << setw(10) << "11" - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << lscatelecg.X() - << setw(16) << lscatelecg.Y() - << setw(16) << lscatelecg.Z() - << setw(16) << lscatelecg.E() - << setw(16) << fElectron_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Neutron - ppiOut << setw(10) << "3" - << setw(10) << "1" - << setw(10) << "1" - << setw(10) << "2112" - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << lneutrong.X() - << setw(16) << lneutrong.Y() - << setw(16) << lneutrong.Z() - << setw(16) << lneutrong.E() - << setw(16) << fNeutron_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - - // break; - - // } - } // This is the loop over total events. - - ppiOut.close(); - - ppiDetails << "Total events tried " << setw(50) << fNGenerated << endl; - ppiDetails << "Total events recorded " << setw(50) << fNRecorded << endl; - - ppiDetails << "Seed used for the Random Number Generator " << setw(50) << fSeed << endl; - - ppiDetails << "Number of events with w more than 10.6 " << setw(50) << w_ev << endl; - ppiDetails << "Number of events with wsq negative " << setw(50) << w_neg_ev << endl; - ppiDetails << "Number of events with qsq less than 4 " << setw(50) << qsq_ev << endl; - ppiDetails << "Number of events with -t more than threshold " << setw(50) << t_ev << endl; - - ppiDetails << "Number of events with w less than threshold " << setw(50) << fWSqNeg << endl; - ppiDetails << "Number of events with mom not conserve " << setw(50) << fNMomConserve << endl; - ppiDetails << "Number of events with Sigma negative " << setw(50) << fNSigmaNeg << endl; - ppiDetails << "Number of lund events " << setw(50) << fLundRecorded << endl; - - ppiDetails.close(); - -} - - - -/*--------------------------------------------------*/ -/*--------------------------------------------------*/ -/*--------------------------------------------------*/ -/*--------------------------------------------------*/ -/// Omega Function -/// Author: Wenliang (Bill) Li -/// Date: March 08, 2020 -/// Comment: this is not completed and untested, the physics model is not implemented - - -void Exclusive_Omega_Prodoction(pim myPim) { - - cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl; - cout << "~ Omega electroproduction is chosen. ~" << endl; - - ///*--------------------------------------------------*/ - /// Setting seed for generation and initiation - - // kCalcFermi = true; - - string sTFile; - sTFile = Form("./LundFiles/eic_%s.txt", gfile_name.Data()); - -// string sRFile; -// sRFile = Form("./RootFiles/eic_%s.root", file_name.Data()); - - string sLFile; - sLFile= Form("./LundFiles/eic_input_%s.dat", gfile_name.Data()); - - ofstream ppiOut ( sLFile.c_str() ); - ofstream ppiDetails ( sTFile.c_str() ); - - // myPim.setrootfile( sRFile ); - - int qsq_ev = 0, t_ev = 0, w_neg_ev = 0, w_ev = 0; - -// t1->SetDirectory( f ); -// t1->SetAutoSave( 1000000000 ); - - long long int i; - for ( i = 0; i < fNEvents; i++ ) { - - TDatime dFractTime; - - fNGenerated ++; - - if ( i % ( fNEvents / 10 ) == 0 ) { - cout << "Event: " << setw(8) << i - << " % of events " << setw(4) << ((1.0*i)/(1.0*fNEvents))*100.0 - << " Day: " << dFractTime.GetDay() - << " Time: " << dFractTime.GetHour() - << ":" << dFractTime.GetMinute() - << ":" << dFractTime.GetSecond() - << endl; - } - - // ---------------------------------------------------- - // Proton in collider (lab) frame - // ---------------------------------------------------- - - fProton_Theta_Col = 50.0e-3; - fProton_Phi_Col = fPi; - fProton_Mom_Col = fPBeam * 1e3; - fVertex_X = 0.; - fVertex_Y = 0.; - fVertex_Z = 0.; - - if ( kCalcFermi ) { - fProton_Mom_Col = fProton_Mom_Col + myPim.fermiMomentum(); - fProton_Theta_Col = acos( fRandom->Uniform( cos(0.0) , cos(fPi) ) ); - fProton_Phi_Col = fRandom->Uniform( 0 , 360 ); - } - - TLorentzVector lproton( fProton_Mom_Col * sin(fProton_Theta_Col) * cos(fProton_Phi_Col), - fProton_Mom_Col * sin(fProton_Theta_Col) * sin(fProton_Phi_Col), - fProton_Mom_Col * cos(fProton_Theta_Col), - sqrt( pow( fProton_Mom_Col , 2 ) + pow( fProton_Mass , 2 ) ) ); - - TLorentzVector lprotong; - lprotong = lproton * fm; - - // ---------------------------------------------------- - // Boost vector from collider (lab) frame to protons rest frame (Fix target) - // ---------------------------------------------------- - - TVector3 beta_col_rf; - beta_col_rf = lproton.BoostVector(); - fGamma_Col_RF = 1.0/sqrt( 1 - pow( beta_col_rf.Mag() , 2 ) ); - - // ---------------------------------------------------- - // Electron in collider (lab) frame - // ---------------------------------------------------- - fElectron_Energy_Col = fElectron_Kin_Col; - fElectron_Mom_Col = sqrt( pow(fElectron_Energy_Col , 2) - pow(fElectron_Mass , 2) ); - fElectron_Theta_Col = fPi; - fElectron_Phi_Col = 0.0; - fElectron_MomZ_Col = fElectron_Mom_Col * cos(fElectron_Theta_Col); - fElectron_MomX_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * cos(fElectron_Phi_Col); - fElectron_MomY_Col = fElectron_Mom_Col * sin(fElectron_Theta_Col) * sin(fElectron_Phi_Col); - - TLorentzVector lelectron( fElectron_MomX_Col, fElectron_MomY_Col, fElectron_MomZ_Col, fElectron_Energy_Col); - TLorentzVector lelectrong; - lelectrong = lelectron * fm; - - // --------------------------------------------------------------------- - // Specify the energy and solid angle of scatterd electron in Collider (lab) frame - // --------------------------------------------------------------------- - fScatElec_Theta_Col = acos( fRandom->Uniform( cos( fScatElec_Theta_I ) , cos( fScatElec_Theta_F ) ) ); - fScatElec_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi); - fScatElec_Energy_Col = fRandom->Uniform( fScatElec_E_Lo * fElectron_Energy_Col , fScatElec_E_Hi * fElectron_Energy_Col ); - -// fPion_Theta_Col = acos( fRandom->Uniform( cos(fPion_Theta_I ) , cos(fPion_Theta_F ) ) ); -// fPion_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi ); - - fOmega_Theta_Col = acos( fRandom->Uniform( cos(fOmega_Theta_I ) , cos(fOmega_Theta_F ) ) ); - fOmega_Phi_Col = fRandom->Uniform( 0 , 2.0 * fPi ); - - - - // fScatElec_Theta_Col = 146.356*fDEG2RAD; - // fScatElec_Phi_Col = 11.8325*fDEG2RAD; - // fScatElec_Energy_Col = 5.25281*1000.0; - // fPion_Theta_Col = 14.5869*fDEG2RAD; - // fPion_Phi_Col = -168.57*fDEG2RAD; - - fScatElec_Mom_Col = sqrt( pow( fScatElec_Energy_Col,2) - pow( fElectron_Mass , 2) ); - fScatElec_MomZ_Col = ( fScatElec_Mom_Col * cos(fScatElec_Theta_Col) ); - fScatElec_MomX_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * cos(fScatElec_Phi_Col) ); - fScatElec_MomY_Col = ( fScatElec_Mom_Col * sin(fScatElec_Theta_Col) * sin(fScatElec_Phi_Col) ); - - TLorentzVector lscatelec( fScatElec_MomX_Col, fScatElec_MomY_Col, fScatElec_MomZ_Col, fScatElec_Energy_Col); - TLorentzVector lscatelecg; - lscatelecg = lscatelec * fm; - - // ---------------------------------------------------- - // Photon in collider (lab) frame and Qsq - // ---------------------------------------------------- - - TLorentzVector lphoton; - lphoton = lelectron - lscatelec; - TLorentzVector lphotong; - lphotong = lelectrong - lscatelecg; - - fQsq_GeV = -1.*lphotong.Mag2(); - - if ( fQsq_GeV < 5.0 ) { - qsq_ev++; - continue; - } - - // ---------------------------------------------------- - // W square, Invariant Mass (P_g + P_p)^2 - // ---------------------------------------------------- - - TLorentzVector lwg; - lwg = lprotong + lphotong; - fW_GeV = lwg.Mag(); - fWSq_GeV = lwg.Mag2(); - - if ( fWSq_GeV < 0 ) { - w_neg_ev++; - continue; - } - - // ---------------------------------------------------- - // Pion in Collider frame - // ---------------------------------------------------- - // fPion_Theta_Col = acos( fRandom->Uniform( cos(fPion_Theta_I ) , cos(fPion_Theta_F ) ) ); - // fPion_Phi_Col = fRandom->Uniform( 0 , 360 ); - - // --------------------------------------------------------- - // Pion momentum in collider frame, analytic solution starts - // --------------------------------------------------------- - - double fupx = sin( fOmega_Theta_Col ) * cos( fOmega_Phi_Col ); - double fupy = sin( fOmega_Theta_Col ) * sin( fOmega_Phi_Col ); - double fupz = cos( fOmega_Theta_Col ); - - double fuqx = sin( lphoton.Theta() ) * cos( lphoton.Phi() ); - double fuqy = sin( lphoton.Theta() ) * sin( lphoton.Phi() ); - double fuqz = cos( lphoton.Theta() ); - - double fa = -(lphoton.Vect()).Mag() * ( fupx * fuqx + fupy * fuqy + fupz * fuqz ); - double fb = pow ( (lphoton.Vect()).Mag() , 2 ); - double fc = lphoton.E() + fProton_Mass; - - fa = ( fa - std::abs( (lproton.Vect()).Mag() ) * ( ( ( lproton.X() / (lproton.Vect()).Mag() ) * fupx ) + - ( ( lproton.Y() / (lproton.Vect()).Mag() ) * fupy ) + - ( ( lproton.Z() / (lproton.Vect()).Mag() ) * fupz ) ) ); - - double factor = ( pow( (lproton.Vect()).Mag() , 2 ) + 2.0 * (lphoton.Vect()).Mag() * (lproton.Vect()).Mag() * - ( ( ( lproton.X() / (lproton.Vect()).Mag() ) * fuqx ) + - ( ( lproton.Y() / (lproton.Vect()).Mag() ) * fuqy ) + - ( ( lproton.Z() / (lproton.Vect()).Mag() ) * fuqz ) ) ); - - fb = fb + factor; - fc = lphoton.E() + lproton.E(); - -// double ft = fc * fc - fb + fPion_Mass * fPion_Mass - fProton_Mass * fProton_Mass; - double ft = fc * fc - fb + fOmega_Mass * fOmega_Mass - fProton_Mass * fProton_Mass; - - double fQA = 4.0 * ( fa * fa - fc * fc ); - double fQB = 4.0 * fc * ft; - -// double fQC = -4.0 * fa * fa * fPion_Mass * fPion_Mass - ft * ft; - double fQC = -4.0 * fa * fa * fOmega_Mass * fOmega_Mass - ft * ft; - - fradical = fQB * fQB - 4.0 * fQA * fQC; - - fepi1 = ( -fQB - sqrt( fradical ) ) / ( 2.0 * fQA ); - fepi2 = ( -fQB + sqrt( fradical ) ) / ( 2.0 * fQA ); - -// fPion_Mom_Same = 0; -// if ( std::abs(fepi1 - fepi2) < fDiff ){ fPion_Mom_Same = 1; } - - // --------------------------------------------------------- - // Pion momentum in collider frame, analytic solution ends - // --------------------------------------------------------- - - TLorentzVector lomega( ( sqrt( pow( fepi1 , 2) - pow(fOmega_Mass , 2) ) ) * sin(fOmega_Theta_Col) * cos(fOmega_Phi_Col), - ( sqrt( pow( fepi1 , 2) - pow(fOmega_Mass , 2) ) ) * sin(fOmega_Theta_Col) * sin(fOmega_Phi_Col), - ( sqrt( pow( fepi1 , 2) - pow(fOmega_Mass , 2) ) ) * cos(fOmega_Theta_Col), - fepi1 ); - - TLorentzVector lomega_g; - lomega_g = lomega * fm; - - TLorentzVector l_scat_proton( ( lproton + lelectron - lscatelec - lomega ).X(), - ( lproton + lelectron - lscatelec - lomega ).Y(), - ( lproton + lelectron - lscatelec - lomega ).Z(), - sqrt( pow( ( ( ( lproton + lelectron - lscatelec - lomega ).Vect() ).Mag()),2) + - pow( fProton_Mass ,2 ) ) ); - TLorentzVector l_scat_proton_g; - l_scat_proton_g = l_scat_proton * fm; - -// fNeutron_Mom_Col_GeV = (lneutrong.Vect()).Mag(); -// fNeutron_MomZ_Col_GeV = lneutrong.Z(); -// fNeutron_MomX_Col_GeV = lneutrong.X(); -// fNeutron_MomY_Col_GeV = lneutrong.Y(); -// fNeutron_Energy_Col_GeV = lneutrong.E(); - - - - - // -------------------------------------------------------------------------------------------------------- - // -------------------------------------------------------------------------------------------------------- - // Calculate w = (proton + photon)^2 - // -------------------------------------------------------------------------------------------------------- - // -------------------------------------------------------------------------------------------------------- - - // cout << fW_GeV << endl; - if ( fW_GeV < 3.0 || fW_GeV > 10.6 ) { - w_ev++; - continue; - } - - TLorentzVector lw; - lw = lproton + lphoton; - fW = lw.Mag(); - - // -------------------------------------------------------------------------------------------------------- - // -------------------------------------------------------------------------------------------------------- - // Calculate w prime w' = (proton + photon - pion)^2 - // -------------------------------------------------------------------------------------------------------- - // -------------------------------------------------------------------------------------------------------- - - TLorentzVector lwp = lprotong + lphotong - lomega_g; - fW_Prime_GeV = lwp.Mag(); - - TLorentzVector fsini; - fsini = lelectron + lproton; - TLorentzVector fsfin; - fsfin = lscatelec + lomega + l_scat_proton; - - TLorentzVector fsinig; - fsinig = fsini * fm; - TLorentzVector fsfing; - fsfing = fsfin * fm; - - fMandSConserve = std::abs( fsinig.Mag() - fsfing.Mag() ); - - kSConserve = false; - if( std::abs( fsinig.Mag() - fsfing.Mag() ) < fDiff ) { - kSConserve = true; - } - - if ( myPim.CheckLaws( lelectron, lproton, lscatelec, lomega, l_scat_proton) != 1 ) - continue; - - - - - - //////////////////////////////////////////////////////////////////////////////////////////// - // Start // - // Transformation of e', pi- and recoil proton to target's rest frmae without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - TLorentzVector lproton_rf; - lproton_rf = lproton; - lproton_rf.Boost(-beta_col_rf); - TLorentzVector lproton_rfg; - lproton_rfg = lproton_rf * fm; - - TLorentzVector lelectron_rf; - lelectron_rf = lelectron; - lelectron_rf.Boost(-beta_col_rf); - TLorentzVector lelectron_rfg; - lelectron_rfg = lelectron_rf * fm; - - TLorentzVector lscatelec_rf; - lscatelec_rf = lscatelec; - lscatelec_rf.Boost(-beta_col_rf); - TLorentzVector lscatelec_rfg; - lscatelec_rfg = lscatelec_rf * fm; - - TLorentzVector lphoton_rf; - lphoton_rf = lphoton; - lphoton_rf.Boost(-beta_col_rf); - TLorentzVector lphoton_rfg; - lphoton_rfg = lphoton_rf * fm; - - TLorentzVector lomega_rf; - lomega_rf = lomega; - lomega_rf.Boost(-beta_col_rf); - TLorentzVector lomega_rfg; - lomega_rfg = lomega_rf * fm; - - TLorentzVector l_scat_proton_rf; - l_scat_proton_rf = l_scat_proton; - l_scat_proton_rf.Boost(-beta_col_rf); - TLorentzVector l_scat_proton_rf_g; - l_scat_proton_rf_g = l_scat_proton_rf * fm; - - //////////////////////////////////////////////////////////////////////////////////////////// - // End // - // Transformation of e', pi- and recoil proton to target's rest frmae without energy loss // - //////////////////////////////////////////////////////////////////////////////////////////// - - // fElectron_Energy_RF_GeV = lelectron_rf.E() / 1000.0; - // fElectron_Mom_RF_GeV = (lelectron_rf.Vect()).Mag() / 1000.0; - // fElectron_MomX_RF_GeV = lelectron_rf.X() / 1000.0; - // fElectron_MomY_RF_GeV = lelectron_rf.Y() / 1000.0; - // fElectron_MomZ_RF_GeV = lelectron_rf.Z() / 1000.0; - -// fScatElec_Energy_RF_GeV = lscatelec_rf.E() / 1000.0; -// fScatElec_Mom_RF_GeV = (lscatelec_rf.Vect()).Mag() / 1000.0; -// fScatElec_MomX_RF_GeV = lscatelec_rf.X() / 1000.0; -// fScatElec_MomY_RF_GeV = lscatelec_rf.Y() / 1000.0; -// fScatElec_MomZ_RF_GeV = lscatelec_rf.Z() / 1000.0; - -// fPion_Energy_RF_GeV = lpion_rf.E() / 1000.0; -// fPion_Mom_RF_GeV = (lpion_rf.Vect()).Mag() / 1000.0; -// fPion_MomX_RF_GeV = lpion_rf.X() / 1000.0; -// fPion_MomY_RF_GeV = lpion_rf.Y() / 1000.0; -// fPion_MomZ_RF_GeV = lpion_rf.Z() / 1000.0; -// -// fNeutron_Energy_RF_GeV = lneutron_rf.E() / 1000.0; -// fNeutron_Mom_RF_GeV = (lneutron_rf.Vect()).Mag() / 1000.0; -// fNeutron_MomX_RF_GeV = lneutron_rf.X() / 1000.0; -// fNeutron_MomY_RF_GeV = lneutron_rf.Y() / 1000.0; -// fNeutron_MomZ_RF_GeV = lneutron_rf.Z() / 1000.0; - - // if ( myPim.CheckLaws( lelectron_rf, lproton_rf, lscatelec_rf, lpion_rf, lneutron_rf ) != 1 ) - // continue; - - // ----------------------------------------------------------------------------------------------------- - // ----------------------------------------------------------------------------------------------------- - // Calculate -t - // ----------------------------------------------------------------------------------------------------- - // ----------------------------------------------------------------------------------------------------- - -// fBeta_CM_RF = (lphoton_rf.Vect()).Mag() / ( lphoton_rf.E() + fProton_Mass ); -// fGamma_CM_RF = ( lphoton_rf.E() + fProton_Mass ) / fW; -// fPion_Energy_CM = ( pow( fW , 2) + pow(fPion_Mass , 2) - pow(fNeutron_Mass , 2) ) / ( 2.0 * fW); -// fPion_Mom_CM = sqrt( pow(fPion_Energy_CM , 2) - pow(fPion_Mass , 2)); -// fPion_Energy_CM_GeV = fPion_Energy_CM / 1000.0; -// fPion_Mom_CM_GeV = fPion_Mom_CM / 1000.0; - - - - fBeta_CM_RF = (lphoton_rf.Vect()).Mag() / ( lphoton_rf.E() + fProton_Mass ); - fGamma_CM_RF = ( lphoton_rf.E() + fProton_Mass ) / fW; - fOmega_Energy_CM = ( pow( fW , 2) + pow(fOmega_Mass , 2) - pow(fProton_Mass , 2) ) / ( 2.0 * fW); - fOmega_Mom_CM = sqrt( pow(fOmega_Energy_CM , 2) - pow(fOmega_Mass , 2)); - fOmega_Energy_CM_GeV = fOmega_Energy_CM / 1000.0; - fOmega_Mom_CM_GeV = fOmega_Mom_CM / 1000.0; - - - // this equation is valid for parallel kinematics only! - fT_Para = ( pow(((lphoton.Vect()).Mag() - (lomega.Vect()).Mag()),2) - pow((lphoton.E() - lomega.E()),2)); - fT_Para_GeV = fT_Para/1000000.0; - - TLorentzVector lt; - lt = lphoton - lomega; - TLorentzVector ltg; - ltg = lt * fm; - - fT = -1.*lt.Mag2(); - fT_GeV = -1.*ltg.Mag2(); - - if ( gKinematics_type == 1 && fT_GeV > 0.5 ) { - t_ev++; - continue; - } - - if ( gKinematics_type == 2 && fT_GeV > 1.3 ) { - t_ev++; - continue; - } - - fx = fQsq_GeV / ( 2.0 * lprotong.Dot( lphotong ) ); - fy = lprotong.Dot( lphotong ) / lprotong.Dot( lelectrong ); - fz = lomega.E()/lphoton.E(); - - // ------------------------------------------------------------------------------------------------------- - // ------------------------------------------------------------------------------------------------------- - - // ------------------------------------------------------------------------------------------------------- - // Calculation of Phi ( azimuthal angle of pion momentum w.r.t lepton plane in target's rest frame) - // Calculation of PhiS ( azimuthal angle of target polarization w.r.t lepton plane in target's rest frame) - // ------------------------------------------------------------------------------------------------------- - - TVector3 v3Photon; v3Photon.SetX( lphoton_rfg.X() ); v3Photon.SetY( lphoton_rfg.Y() ); v3Photon.SetZ( lphoton_rfg.Z() ); - TVector3 v3Electron; v3Electron.SetX( lelectron_rfg.X() ); v3Electron.SetY( lelectron_rfg.Y() ); v3Electron.SetZ( lelectron_rfg.Z() ); - TVector3 v3Omega; v3Omega.SetX( lomega_rfg.X() ) ; v3Omega.SetY( lomega_rfg.Y() ) ; v3Omega.SetZ( lomega_rfg.Z() ); - TVector3 v3S; v3S.SetX( -1 ); v3S.SetY( 0 ); v3S.SetZ( 0 ); - TVector3 v3PhotonUnit = v3Photon.Unit(); - TVector3 v3QxL = v3Photon.Cross(v3Electron); - TVector3 v3QxP = v3Photon.Cross(v3Omega); - TVector3 v3QxS = v3Photon.Cross(v3S); - TVector3 v3LxP = v3Electron.Cross(v3Omega); - TVector3 v3LxS = v3Electron.Cross(v3S); - TVector3 v3PxL = v3Omega.Cross(v3Electron); - TVector3 v3QUnitxL = v3PhotonUnit.Cross(v3Electron); - TVector3 v3QUnitxP = v3PhotonUnit.Cross(v3Omega); - TVector3 v3QUnitxS = v3PhotonUnit.Cross(v3S); - - fCos_Phi_Omega_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_Omega_LeptonPlane_RF = ( ( v3LxP.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_Omega_LeptonPlane_RF >= 0 ) - fPhi_Omega_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ); - if ( fSin_Phi_Omega_LeptonPlane_RF < 0 ) - fPhi_Omega_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxP ) ) / ( v3QUnitxL.Mag() * v3QUnitxP.Mag() ) ) ); - - fCos_Phi_TargPol_LeptonPlane_RF = ( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - fSin_Phi_TargPol_LeptonPlane_RF = ( ( v3LxS.Dot( v3PhotonUnit ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); // hep-ph/0410050v2 - if ( fSin_Phi_TargPol_LeptonPlane_RF >= 0 ) - fPhi_TargPol_LeptonPlane_RF = fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ); - if ( fSin_Phi_TargPol_LeptonPlane_RF < 0 ) - fPhi_TargPol_LeptonPlane_RF = 360.0 - std::abs( fRAD2DEG * acos( ( v3QUnitxL.Dot( v3QUnitxS ) ) / ( v3QUnitxL.Mag() * v3QUnitxS.Mag() ) ) ); - - fTheta_Omega_Photon_RF = fRAD2DEG * acos( ( v3Photon.Dot( v3Omega ) ) / ( v3Photon.Mag() * v3Omega.Mag() ) ); - if ( fTheta_Omega_Photon_RF < 0 ) { fTheta_Omega_Photon_RF = 180.0 + fTheta_Omega_Photon_RF; } - - fPhi = fPhi_Omega_LeptonPlane_RF; - fPhiS = fPhi_TargPol_LeptonPlane_RF; - - // ----------------------------------------------------------------------------------- - // If we have fermi momentum then epsilon should be in rest frame - // The theta angle of scattered angle used in expression of epsilon is the angle - // with respect to direction of incoming electron in the rest frame of target nucleon - // epsilon=1./(1.+ 2.*(pgam_restg**2)/q2g * *(tand(thscat_rest/2.))**2) - // ----------------------------------------------------------------------------------- - - double fTheta_EEp = (lelectron_rf.Vect()).Angle(lscatelec_rf.Vect()); - - fEpsilon = 1.0 / ( 1.0 + 2.0 * ( pow( (lphoton_rfg.Vect()).Mag(),2)/fQsq_GeV ) * pow( tan( fTheta_EEp / 2 ) , 2 ) ); - - // ---------------------------------------------------- - // Virtual Photon flux factor in units of 1/(GeV*Sr) - // ---------------------------------------------------- - fFlux_Factor_Col = (fAlpha/(2.0*pow(fPi,2))) * (lscatelecg.E() / lelectrong.E()) * - ( pow(fW_GeV,2) - pow(fProton_Mass_GeV,2) ) / (2.0*fProton_Mass_GeV*fQsq_GeV*(1.0 - fEpsilon)); - - fFlux_Factor_RF = ( fAlpha / ( 2.0 * pow( fPi , 2 ) ) ) * ( lscatelec_rfg.E() / lelectron_rfg.E() ) * - ( pow( fW_GeV , 2 ) - pow( fProton_Mass_GeV , 2 ) ) / - ( 2.0 * fProton_Mass_GeV * fQsq_GeV * ( 1.0 - fEpsilon ) ); - - // ---------------------------------------------------- - // Jacobian dt/dcos(theta*)dphi in units of GeV2/sr - // ---------------------------------------------------- - fJacobian_CM = ( (lphoton_rfg.Vect()).Mag() - fBeta_CM_RF * lphoton_rfg.E() ) / ( fGamma_CM_RF * ( 1.0 - pow(fBeta_CM_RF,2) ) ); - - fA = fJacobian_CM * fOmega_Mom_CM_GeV / fPi; - - // ---------------------------------------------------- - // Jacobian dOmega* / dOmega dimensionless - // ---------------------------------------------------- - fJacobian_CM_RF = ( pow((lomega_rf.Vect()).Mag(),2)*fW) / - ( fOmega_Mom_CM * std::abs( ( fProton_Mass + lphoton_rf.E()) * (lomega_rf.Vect()).Mag() - - ( lomega_rf.E() * (lphoton_rf.Vect()).Mag() * cos( lomega_rf.Theta() ) ) ) ); - - fJacobian_CM_Col = ( ( pow((lomega.Vect()).Mag(),2) * fW ) / - ( fOmega_Mom_CM * std::abs( ( fProton_Mass + lphoton.E() ) * (lomega.Vect()).Mag() - - ( lomega.E() * (lphoton.Vect()).Mag() * cos( lomega.Theta() ) ) ) ) ); - - - // ------------------------------------------------------------------------------------------- - // CKY sigma L and T starts - // ------------------------------------------------------------------------------------------- - - fSig_T = 1; - fSig_L = 1; - - // ------------------------------------------------------------------------------------------- - - fSig_fpi_6GeV = fSig_T + fEpsilon * fSig_L; - - // ------------------------------------------------------------------------------------------- - // CKY sigma L and T ends - // ------------------------------------------------------------------------------------------- - - fSigma_Col = fSig_fpi_6GeV * fFlux_Factor_Col * fA * fJacobian_CM_Col; - - // cout << endl; - // cout << setw(12) << "Qsq" << setw(12) << "-t" << setw(12) << "W" - // << setw(12) << "x" << setw(12) << "y" << setw(12) << "z" - // << setw(12) << "epsilon" << setw(12) << "phi" << setw(12) << "phis" - // << setw(12) << "sig" - // << endl; - // cout << setw(12) << fQsq_GeV << setw(12) << fT_GeV << setw(12) << fW_GeV - // << setw(12) << fx << setw(12) << fy << setw(12) << fz - // << setw(12) << fEpsilon << setw(12) << fPhi << setw(12) << fPhiS - // << setw(12) << fSigma_Col - // << endl; - - // cout << endl; - // cout << setw(12) << "Particle" << setw(12) << "Px" << setw(12) << "Py" << setw(12) << "Pz" << setw(12) << "Energy" << endl; - // cout << setw(12) << "Pion" - // << setw(12) << lpiong.X() - // << setw(12) << lpiong.Y() - // << setw(12) << lpiong.Z() - // << setw(12) << lpiong.E() - // << endl; - // cout << setw(12) << "Elec" - // << setw(12) << lscatelecg.X() - // << setw(12) << lscatelecg.Y() - // << setw(12) << lscatelecg.Z() - // << setw(12) << lscatelecg.E() - // << endl; - // cout << setw(12) << "Neutron" - // << setw(12) << lneutrong.X() - // << setw(12) << lneutrong.Y() - // << setw(12) << lneutrong.Z() - // << setw(12) << lneutrong.E() - // << endl; - - if ( ( fSigma_Col <= 0 ) || std::isnan( fSigma_Col ) ) { - fNSigmaNeg ++; - continue; - } - - // ----------------------------------------------------------------------------------------------------------- - // ----------------------------------------------------------------------------------------------------------- - // Lab cross section Phase Space Conversion Luminosity Total events tried - // Hz = ub / ( sr^2 * GeV ) * GeV * sr^2 * ( cm^2 / ub ) * ( # / ( cm^2 * sec ) ) / ( # ) - - fEventWeight = fSigma_Col * fPSF * fuBcm2 * fLumi / fNEvents; // in Hz - - fNRecorded ++; - fLundRecorded++; - fRatio = fNRecorded / fNGenerated; - - - - - ////*-------------------------------------------------- - /// Outputing to LUND file -// t1->Fill(); - - ppiOut << "3" - << " \t " << fPhi // var 1 - << " \t " << fPhiS // var 2 - << " \t " << fx // var 3 - << " \t " << "1" - << " \t " << fQsq_GeV // var 4 - << " \t " << fT_GeV // var 5 - << " \t " << fW_GeV // var 6 - << " \t " << fEpsilon // var 7 - << " \t " << fEventWeight // var 8 - << endl; - - // Pion - - ppiOut << setw(10) << "1" - << setw(10) << "1" - << setw(10) << "1" - << setw(10) << "211" - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << lomega_g.X() - << setw(16) << lomega_g.Y() - << setw(16) << lomega_g.Z() - << setw(16) << lomega_g.E() - << setw(16) << fPion_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Electron - ppiOut << setw(10) << "2" - << setw(10) << "-1" - << setw(10) << "1" - << setw(10) << "11" - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << lscatelecg.X() - << setw(16) << lscatelecg.Y() - << setw(16) << lscatelecg.Z() - << setw(16) << lscatelecg.E() - << setw(16) << fElectron_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - // Neutron - ppiOut << setw(10) << "3" - << setw(10) << "1" - << setw(10) << "1" - << setw(10) << "2112" - << setw(10) << "0" - << setw(10) << "0" - << setw(16) << l_scat_proton.X() - << setw(16) << l_scat_proton.Y() - << setw(16) << l_scat_proton.Z() - << setw(16) << l_scat_proton.E() - << setw(16) << fProton_Mass_GeV - << setw(16) << fVertex_X - << setw(16) << fVertex_Y - << setw(16) << fVertex_Z - << endl; - - - // break; - - } // This is the loop over total events. - - ppiOut.close(); - - ppiDetails << "Total events tried " << setw(50) << fNGenerated << endl; - ppiDetails << "Total events recorded " << setw(50) << fNRecorded << endl; - - ppiDetails << "Seed used for the Random Number Generator " << setw(50) << fSeed << endl; - - ppiDetails << "Number of events with w more than 10.6 " << setw(50) << w_ev << endl; - ppiDetails << "Number of events with wsq negative " << setw(50) << w_neg_ev << endl; - ppiDetails << "Number of events with qsq less than 4 " << setw(50) << qsq_ev << endl; - ppiDetails << "Number of events with -t more than threshold " << setw(50) << t_ev << endl; - - ppiDetails << "Number of events with w less than threshold " << setw(50) << fWSqNeg << endl; - ppiDetails << "Number of events with mom not conserve " << setw(50) << fNMomConserve << endl; - ppiDetails << "Number of events with Sigma negative " << setw(50) << fNSigmaNeg << endl; - ppiDetails << "Number of lund events " << setw(50) << fLundRecorded << endl; - - ppiDetails.close(); - -} - - -/*--------------------------------------------------*/ -/*--------------------------------------------------*/ -/*--------------------------------------------------*/ -/*--------------------------------------------------*/ -/*--------------------------------------------------*/ - -// Transverse Sigma model from 6 GeV Lab data - -double fSig_fpi_sigT (double q2_gev, double up) { - - double sigt; - - double t0 = 7.0; - double t1 = -6; - - sigt = t0/sqrt(q2_gev) + t1*up/sqrt(q2_gev); - -// wfactor= 1 / ((w_gev**2-m_p**2)**2) - - return sigt; - -} - - -/*--------------------------------------------------*/ -/*--------------------------------------------------*/ -// Transverse Sigma model from 6 GeV Lab data - - -double fSig_fpi_sigL (double q2_gev, double up) { - - double sigl; - - double l0 = 12; - double l1 = -40; - - sigl = l0/(q2_gev*q2_gev) + l1*up/(q2_gev*q2_gev); - return sigl; - -// wfactor= 1 / ((w_gev**2-m_p**2)**2) - -} - diff --git a/src/eic_evgen/archived_routines/legacy_function.h b/src/eic_evgen/archived_routines/legacy_function.h deleted file mode 100644 index a1fcc47..0000000 --- a/src/eic_evgen/archived_routines/legacy_function.h +++ /dev/null @@ -1,21 +0,0 @@ -# ifndef legacy_H -# define legacy_H - -#include -#include -#include - -#include "eic_pim.h" - -#include "TString.h" -#include "TF1.h" -#include "tssa_sig_Para.h" - -void Exclusive_Pion_Prodoction(pim); -void Exclusive_Omega_Prodoction(pim); - -double fSig_fpi_sigT (double, double); -double fSig_fpi_sigL (double, double); - -#endif - diff --git a/src/main.cxx b/src/main.cxx index d9b39c9..5507a1c 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -61,875 +61,880 @@ string get_date(void); int Gen_seed; int main(int argc, char** argv){ + + cout << endl << "DEMPgen Copyright (C) 2024 Z. Ahmed, R.S. Evans. I. Goel. G.M. Huber, S.J.D. Kay, W.B. Li, L. Preet, A. Usman." << endl; + cout << "This program comes with ABSOLUTELY NO WARRANTY." << endl; + cout << "This is free software, and you are welcome to redistribute it under certain conditions; contact authors for details." << endl; + cout << "See - https://github.com/JeffersonLab/DEMPgen - for author contact details." << endl << endl; - // Parsing of config file. - //ifstream ifs("../Config.json"); - ifstream ifs(argv[1]); - Json::Reader reader; - reader.parse(ifs, obj); + // Parsing of config file. + //ifstream ifs("../Config.json"); + ifstream ifs(argv[1]); + Json::Reader reader; + reader.parse(ifs, obj); - unsigned long long int nEvents = obj["n_events"].asUInt64(); - cout << "Generating "<< nEvents << " events."<BeamElec; - Particle* VertTargNeut = VertEvent->TargNeut; - Particle* VertScatElec = VertEvent->ScatElec; - Particle* VertProdPion = VertEvent->ProdPion; - Particle* VertProdProt = VertEvent->ProdProt; + // Retrieval of pointers to particles in VertEvent. + // For clarity: these are the same objects as are referenced by VertEvent, + // not copies. Operations on these objects affect the original. + Particle* VertBeamElec = VertEvent->BeamElec; + Particle* VertTargNeut = VertEvent->TargNeut; + Particle* VertScatElec = VertEvent->ScatElec; + Particle* VertProdPion = VertEvent->ProdPion; + Particle* VertProdProt = VertEvent->ProdProt; - Particle* Photon = VertEvent->VirtPhot; - Photon->SetName("VirtPhot"); + Particle* Photon = VertEvent->VirtPhot; + Photon->SetName("VirtPhot"); - Particle* FSIProt = new Particle(proton_mass_mev, "FSIProt", pid_prot); + Particle* FSIProt = new Particle(proton_mass_mev, "FSIProt", pid_prot); - Particle* InTotal = new Particle(); - Particle* OutTotal = new Particle(); + Particle* InTotal = new Particle(); + Particle* OutTotal = new Particle(); - VertBeamElec->SetThetaPhiE(0, 0, obj["beam_energy"].asDouble()); + VertBeamElec->SetThetaPhiE(0, 0, obj["beam_energy"].asDouble()); - double elecERange[2] = {obj["scat_elec_Emin"].asDouble(), - obj["scat_elec_Emax"].asDouble()}; - double elecThetaRange[2] = {obj["scat_elec_thetamin"].asDouble()/DEG, - obj["scat_elec_thetamax"].asDouble()/DEG}; - double elecPhiRange[2] = {0, 360/DEG}; + double elecERange[2] = {obj["scat_elec_Emin"].asDouble(), + obj["scat_elec_Emax"].asDouble()}; + double elecThetaRange[2] = {obj["scat_elec_thetamin"].asDouble()/DEG, + obj["scat_elec_thetamax"].asDouble()/DEG}; + double elecPhiRange[2] = {0, 360/DEG}; - TargetGen * NeutGen = new TargetGen(neutron_mass_mev, obj["fermi_momentum"].asBool()); + TargetGen * NeutGen = new TargetGen(neutron_mass_mev, obj["fermi_momentum"].asBool()); - ScatteredParticleGen * ElecGen = - new ScatteredParticleGen(electron_mass_mev, - elecERange, - elecThetaRange, - elecPhiRange); - - FSI* FSIobj = new FSI(); - - /* - Particle * Photon = new Particle(); - VertEvent->VirtPhot = Photon; - */ - - ProductGen * ProtonPionGen = new ProductGen(Photon, - VertTargNeut); - - int nSuccess = 0; - int nFail = 0; - int nNeg = 0; - int nCut = 0; - - int FSIfail = 0; - - int event_status = 0; - - - file_name = "RootFiles/Solid_DEMP_" + file_name + ".root"; - - TreeBuilder * Output = new TreeBuilder(file_name.Data(), "t1"); - - Output->AddEvent(VertEvent); - //Output->AddEvent(CofMEvent); - //Output->AddEvent(RestEvent); - Output->AddEvent(LCorEvent); - - //if (obj["final_state_interaction"].asBool()) - Output->AddParticle(FSIProt); - - Output->AddParticle(Photon); - - // These parameters are calculated using multiple reference frames (DEMPEvent objects), - // and need to be added to the output seperately. - double sigma_l; - double sigma_t; - double sigma_tt; - double sigma_lt; - - double sigma_uu; - double sigma_ut; - - double sigma_k0; - double sigma_k1; - double sigma_k2; - double sigma_k3; - double sigma_k4; - - double sigma_k5 = 0; - - double sigma; - - double weight; - double epsilon; - - double targetthickness, airthickness, targwindowthickness; - - targwindowthickness = 0.0120*Window_Density / Window_Thickness; - - Output -> AddDouble(&sigma_l,"sigma_l"); - Output -> AddDouble(&sigma_t,"sigma_t"); - Output -> AddDouble(&sigma_tt,"sigma_tt"); - Output -> AddDouble(&sigma_lt,"sigma_lt"); - Output -> AddDouble(&sigma_uu,"sigma_uu"); - Output -> AddDouble(&sigma_ut,"sigma_ut"); - - Output -> AddDouble(&sigma_k0,"AutPhiMinusPhiS"); - Output -> AddDouble(&sigma_k1,"AutPhiS"); - Output -> AddDouble(&sigma_k2,"Aut2PhiMinusPhiS"); - Output -> AddDouble(&sigma_k3,"AutPhiPlusPhiS"); - Output -> AddDouble(&sigma_k4,"Aut3PhiMinusPhiS"); - Output -> AddDouble(&sigma_k5,"Aut2PhiPlusPhiS"); - - Output -> AddDouble(&sigma, "sigma"); - - Output -> AddDouble(&weight,"weight"); - Output -> AddDouble(&epsilon, "epsilon"); - - //if(obj["final_state_interaction"].asBool()){ - Output -> AddDouble(FSIobj->PhaseShiftWeight, "PhaseShiftWeight"); - Output -> AddDouble(FSIobj->WilliamsWeight, "WilliamsWeight"); - Output -> AddDouble(FSIobj->DedrickWeight, "DedrickWeight"); - Output -> AddDouble(FSIobj->CatchenWeight, "CatchenWeight"); - //} - - // Event global variables to add to output - Output -> AddDouble(VertEvent->qsq_GeV, "Vert_Qsq_GeV"); - Output -> AddDouble(VertEvent->w_GeV, "Vert_w_GeV"); - Output -> AddDouble(VertEvent->t_GeV, "Vert_t_GeV"); - Output -> AddDouble(VertEvent->t_para_GeV, "Vert_t_para_GeV"); - Output -> AddDouble(VertEvent->t_prime_GeV, "Vert_t_prime_GeV"); - Output -> AddDouble(VertEvent->negt, "Vert_negt_GeV"); - Output -> AddDouble(VertEvent->x_B, "Vert_x_B"); - Output -> AddDouble(VertEvent->Phi_deg, "Vert_Phi"); - Output -> AddDouble(VertEvent->Phi_s_deg, "Vert_Phi_s"); - Output -> AddDouble(VertEvent->Theta_deg, "Vert_Theta"); - - Output -> AddDouble(LCorEvent->qsq_GeV, "Lab_Qsq_GeV"); - Output -> AddDouble(LCorEvent->w_GeV, "Lab_w_GeV"); - Output -> AddDouble(LCorEvent->t_GeV, "Lab_t_GeV"); - Output -> AddDouble(LCorEvent->t_para_GeV, "Lab_t_para_GeV"); - Output -> AddDouble(LCorEvent->t_prime_GeV, "Lab_t_prime_GeV"); - Output -> AddDouble(LCorEvent->negt, "Lab_negt_GeV"); - Output -> AddDouble(LCorEvent->x_B, "Lab_x_B"); - Output -> AddDouble(LCorEvent->Phi_deg, "Lab_Phi"); - Output -> AddDouble(LCorEvent->Phi_s_deg, "Lab_Phi_s"); - Output -> AddDouble(LCorEvent->Theta_deg, "Lab_Theta"); - - Output -> AddDouble(VertEvent->Vertex_x, "Vertex_x"); - Output -> AddDouble(VertEvent->Vertex_y, "Vertex_y"); - Output -> AddDouble(VertEvent->Vertex_z, "Vertex_z"); - - cout << "Starting Main Loop." << endl; - // Main loop of the generator - for (int i=0; iVertex_x = gRandom->Uniform(-0.25, 0.25); - *VertEvent->Vertex_y = gRandom->Uniform(-0.25,0.25); - *VertEvent->Vertex_z = gRandom->Uniform(-370,-330); - - // Reset inc. electron to beam energy - - VertBeamElec->SetThetaPhiE(0, 0, obj["beam_energy"].asDouble()); - - // Perform matter effects on inc electron - // These effects occur before the reaction, so affect the vertex values - targetthickness = ((*VertEvent->Vertex_z+370.0) * Helium_Density)/ - (ME->X0(Helium_Z, Helium_A)); - if (obj["ionisation"].asBool()){ - ME->IonLoss(VertBeamElec, Window_A, Window_Z, Window_Density, targwindowthickness); - ME->IonLoss(VertBeamElec, Helium_A, Helium_Z, Helium_Density, targetthickness); - } - if (obj["bremsstrahlung"].asBool()){ - ME->BremLoss(VertBeamElec, - targetthickness*ME->b(Helium_Z) - /ME->X0(Helium_Z, Helium_A)); - ME->BremLoss(VertBeamElec, - targwindowthickness*ME->b(Window_Z) - /ME->X0(Window_Z, Window_A)); - } - if (obj["multiple_scattering"].asBool()){ - ME->MultiScatter(VertBeamElec, - targetthickness / ME->X0(Helium_Z, Helium_A)); - ME->MultiScatter(VertBeamElec, - targwindowthickness / ME->X0(Window_Z, Window_A)); - } - - // Generate target and scattered electron - *VertTargNeut = *NeutGen->GetParticle(); - *VertScatElec = *ElecGen->GetParticle(); - - /*--------------------------------------------------*/ - /// Test only -// VertScatElec->Px() = 15.934; -// VertScatElec->Py() = 1106.06; -// VertScatElec->Pz() = 2281.09; -// VertScatElec->E() = 2535.16; - - VertScatElec->SetPxPyPzE(15.934, 1106.06, 2281.09, 2535.16); - - *Photon = *VertBeamElec - *VertScatElec; - - cout << " " << VertBeamElec->Px() << " " << VertBeamElec->Py() << " " << VertBeamElec->Pz() << " " << VertBeamElec->E() << " " << VertBeamElec->GetMass() << endl; + ScatteredParticleGen * ElecGen = + new ScatteredParticleGen(electron_mass_mev, + elecERange, + elecThetaRange, + elecPhiRange); + + FSI* FSIobj = new FSI(); + + /* + Particle * Photon = new Particle(); + VertEvent->VirtPhot = Photon; + */ + + ProductGen * ProtonPionGen = new ProductGen(Photon, + VertTargNeut); + + int nSuccess = 0; + int nFail = 0; + int nNeg = 0; + int nCut = 0; + + int FSIfail = 0; + + int event_status = 0; + + + file_name = "RootFiles/Solid_DEMP_" + file_name + ".root"; + + TreeBuilder * Output = new TreeBuilder(file_name.Data(), "t1"); + + Output->AddEvent(VertEvent); + //Output->AddEvent(CofMEvent); + //Output->AddEvent(RestEvent); + Output->AddEvent(LCorEvent); + + //if (obj["final_state_interaction"].asBool()) + Output->AddParticle(FSIProt); + + Output->AddParticle(Photon); + + // These parameters are calculated using multiple reference frames (DEMPEvent objects), + // and need to be added to the output seperately. + double sigma_l; + double sigma_t; + double sigma_tt; + double sigma_lt; + + double sigma_uu; + double sigma_ut; + + double sigma_k0; + double sigma_k1; + double sigma_k2; + double sigma_k3; + double sigma_k4; + + double sigma_k5 = 0; + + double sigma; + + double weight; + double epsilon; + + double targetthickness, airthickness, targwindowthickness; + + targwindowthickness = 0.0120*Window_Density / Window_Thickness; + + Output -> AddDouble(&sigma_l,"sigma_l"); + Output -> AddDouble(&sigma_t,"sigma_t"); + Output -> AddDouble(&sigma_tt,"sigma_tt"); + Output -> AddDouble(&sigma_lt,"sigma_lt"); + Output -> AddDouble(&sigma_uu,"sigma_uu"); + Output -> AddDouble(&sigma_ut,"sigma_ut"); + + Output -> AddDouble(&sigma_k0,"AutPhiMinusPhiS"); + Output -> AddDouble(&sigma_k1,"AutPhiS"); + Output -> AddDouble(&sigma_k2,"Aut2PhiMinusPhiS"); + Output -> AddDouble(&sigma_k3,"AutPhiPlusPhiS"); + Output -> AddDouble(&sigma_k4,"Aut3PhiMinusPhiS"); + Output -> AddDouble(&sigma_k5,"Aut2PhiPlusPhiS"); + + Output -> AddDouble(&sigma, "sigma"); + + Output -> AddDouble(&weight,"weight"); + Output -> AddDouble(&epsilon, "epsilon"); + + //if(obj["final_state_interaction"].asBool()){ + Output -> AddDouble(FSIobj->PhaseShiftWeight, "PhaseShiftWeight"); + Output -> AddDouble(FSIobj->WilliamsWeight, "WilliamsWeight"); + Output -> AddDouble(FSIobj->DedrickWeight, "DedrickWeight"); + Output -> AddDouble(FSIobj->CatchenWeight, "CatchenWeight"); + //} + + // Event global variables to add to output + Output -> AddDouble(VertEvent->qsq_GeV, "Vert_Qsq_GeV"); + Output -> AddDouble(VertEvent->w_GeV, "Vert_w_GeV"); + Output -> AddDouble(VertEvent->t_GeV, "Vert_t_GeV"); + Output -> AddDouble(VertEvent->t_para_GeV, "Vert_t_para_GeV"); + Output -> AddDouble(VertEvent->t_prime_GeV, "Vert_t_prime_GeV"); + Output -> AddDouble(VertEvent->negt, "Vert_negt_GeV"); + Output -> AddDouble(VertEvent->x_B, "Vert_x_B"); + Output -> AddDouble(VertEvent->Phi_deg, "Vert_Phi"); + Output -> AddDouble(VertEvent->Phi_s_deg, "Vert_Phi_s"); + Output -> AddDouble(VertEvent->Theta_deg, "Vert_Theta"); + + Output -> AddDouble(LCorEvent->qsq_GeV, "Lab_Qsq_GeV"); + Output -> AddDouble(LCorEvent->w_GeV, "Lab_w_GeV"); + Output -> AddDouble(LCorEvent->t_GeV, "Lab_t_GeV"); + Output -> AddDouble(LCorEvent->t_para_GeV, "Lab_t_para_GeV"); + Output -> AddDouble(LCorEvent->t_prime_GeV, "Lab_t_prime_GeV"); + Output -> AddDouble(LCorEvent->negt, "Lab_negt_GeV"); + Output -> AddDouble(LCorEvent->x_B, "Lab_x_B"); + Output -> AddDouble(LCorEvent->Phi_deg, "Lab_Phi"); + Output -> AddDouble(LCorEvent->Phi_s_deg, "Lab_Phi_s"); + Output -> AddDouble(LCorEvent->Theta_deg, "Lab_Theta"); + + Output -> AddDouble(VertEvent->Vertex_x, "Vertex_x"); + Output -> AddDouble(VertEvent->Vertex_y, "Vertex_y"); + Output -> AddDouble(VertEvent->Vertex_z, "Vertex_z"); + + cout << "Starting Main Loop." << endl; + // Main loop of the generator + for (int i=0; iVertex_x = gRandom->Uniform(-0.25, 0.25); + *VertEvent->Vertex_y = gRandom->Uniform(-0.25,0.25); + *VertEvent->Vertex_z = gRandom->Uniform(-370,-330); + + // Reset inc. electron to beam energy + + VertBeamElec->SetThetaPhiE(0, 0, obj["beam_energy"].asDouble()); + + // Perform matter effects on inc electron + // These effects occur before the reaction, so affect the vertex values + targetthickness = ((*VertEvent->Vertex_z+370.0) * Helium_Density)/ + (ME->X0(Helium_Z, Helium_A)); + if (obj["ionisation"].asBool()){ + ME->IonLoss(VertBeamElec, Window_A, Window_Z, Window_Density, targwindowthickness); + ME->IonLoss(VertBeamElec, Helium_A, Helium_Z, Helium_Density, targetthickness); + } + if (obj["bremsstrahlung"].asBool()){ + ME->BremLoss(VertBeamElec, + targetthickness*ME->b(Helium_Z) + /ME->X0(Helium_Z, Helium_A)); + ME->BremLoss(VertBeamElec, + targwindowthickness*ME->b(Window_Z) + /ME->X0(Window_Z, Window_A)); + } + if (obj["multiple_scattering"].asBool()){ + ME->MultiScatter(VertBeamElec, + targetthickness / ME->X0(Helium_Z, Helium_A)); + ME->MultiScatter(VertBeamElec, + targwindowthickness / ME->X0(Window_Z, Window_A)); + } + + // Generate target and scattered electron + *VertTargNeut = *NeutGen->GetParticle(); + *VertScatElec = *ElecGen->GetParticle(); + + /*--------------------------------------------------*/ + /// Test only + // VertScatElec->Px() = 15.934; + // VertScatElec->Py() = 1106.06; + // VertScatElec->Pz() = 2281.09; + // VertScatElec->E() = 2535.16; + + VertScatElec->SetPxPyPzE(15.934, 1106.06, 2281.09, 2535.16); + + *Photon = *VertBeamElec - *VertScatElec; + + cout << " " << VertBeamElec->Px() << " " << VertBeamElec->Py() << " " << VertBeamElec->Pz() << " " << VertBeamElec->E() << " " << VertBeamElec->GetMass() << endl; - cout << " " << VertScatElec->Px() << " " << VertScatElec->Py() << " " << VertScatElec->Pz() << " " << VertScatElec->E() << " " << VertScatElec->GetMass() << endl; + cout << " " << VertScatElec->Px() << " " << VertScatElec->Py() << " " << VertScatElec->Pz() << " " << VertScatElec->E() << " " << VertScatElec->GetMass() << endl; - cout << "asdasdabbbbb " << Photon->Px() << " " << Photon->Py() << " " - << Photon->Pz() << " " << Photon->E() << " " << Photon->GetMass() << endl; + cout << "asdasdabbbbb " << Photon->Px() << " " << Photon->Py() << " " + << Photon->Pz() << " " << Photon->E() << " " << Photon->GetMass() << endl; - // Solve for remaining particles - event_status = ProtonPionGen->Solve(); - if (event_status == 0) - nSuccess ++; - if (event_status == 1){ - nFail ++; - continue; - } - *VertProdPion = *ProtonPionGen->ProdPion(); - *VertProdProt = *ProtonPionGen->ProdProton(); - // cout<GetPid() << endl; + // Solve for remaining particles + event_status = ProtonPionGen->Solve(); + if (event_status == 0) + nSuccess ++; + if (event_status == 1){ + nFail ++; + continue; + } + *VertProdPion = *ProtonPionGen->ProdPion(); + *VertProdProt = *ProtonPionGen->ProdProton(); + // cout<GetPid() << endl; - VertEvent->Update(); - // VertEvent and its components are not to be modified beyond this point. - - // Copy VertEvent and boost to CofM frame. - *CofMEvent = *VertEvent; - CofMEvent->Boost(-VertEvent->CoM()); - CofMEvent->Update(); - - // Copy VertEvent and boost to rest frame - *RestEvent = *VertEvent; - RestEvent->Boost(-(VertEvent->TargNeut->Vect()*(1/VertEvent->TargNeut->E()))); - RestEvent->Update(); - - // Copy RestEvent and rotate to Trento coords. - *TConEvent = *RestEvent; - TConEvent->Rotate(RestEvent->VirtPhot->Theta(),-RestEvent->ScatElec->Phi()); - TConEvent->Update(); - - // Copy VertEvent onto LCorEvent, revert beamelec back to beam value - *LCorEvent = *VertEvent; - LCorEvent->BeamElec->SetThetaPhiE(0, 0, obj["beam_energy"].asDouble()); - LCorEvent->Update(); - - // Get cross-sections - sigma_l = Sig->sigma_l(); - sigma_t = Sig->sigma_t(); - sigma_lt = Sig->sigma_lt(); - sigma_tt = Sig->sigma_tt(); - sigma_uu = Sig->sigma_uu(); - sigma_ut = Sig->sigma_ut(); - - sigma_k0 = Sig->Sigma_k(0); - sigma_k1 = Sig->Sigma_k(1); - sigma_k2 = Sig->Sigma_k(2); - sigma_k3 = Sig->Sigma_k(3); - sigma_k4 = Sig->Sigma_k(4); - - sigma = Sig->sigma(); - - epsilon = Sig->epsilon(); - - // Cuts - - if (obj["Qsq_cut"].asBool()){ - if (*VertEvent->qsq_GeVw_GeVt_GeVUpdate(); + // VertEvent and its components are not to be modified beyond this point. + + // Copy VertEvent and boost to CofM frame. + *CofMEvent = *VertEvent; + CofMEvent->Boost(-VertEvent->CoM()); + CofMEvent->Update(); + + // Copy VertEvent and boost to rest frame + *RestEvent = *VertEvent; + RestEvent->Boost(-(VertEvent->TargNeut->Vect()*(1/VertEvent->TargNeut->E()))); + RestEvent->Update(); + + // Copy RestEvent and rotate to Trento coords. + *TConEvent = *RestEvent; + TConEvent->Rotate(RestEvent->VirtPhot->Theta(),-RestEvent->ScatElec->Phi()); + TConEvent->Update(); + + // Copy VertEvent onto LCorEvent, revert beamelec back to beam value + *LCorEvent = *VertEvent; + LCorEvent->BeamElec->SetThetaPhiE(0, 0, obj["beam_energy"].asDouble()); + LCorEvent->Update(); + + // Get cross-sections + sigma_l = Sig->sigma_l(); + sigma_t = Sig->sigma_t(); + sigma_lt = Sig->sigma_lt(); + sigma_tt = Sig->sigma_tt(); + sigma_uu = Sig->sigma_uu(); + sigma_ut = Sig->sigma_ut(); + + sigma_k0 = Sig->Sigma_k(0); + sigma_k1 = Sig->Sigma_k(1); + sigma_k2 = Sig->Sigma_k(2); + sigma_k3 = Sig->Sigma_k(3); + sigma_k4 = Sig->Sigma_k(4); + + sigma = Sig->sigma(); + + epsilon = Sig->epsilon(); + + // Cuts + + if (obj["Qsq_cut"].asBool()){ + if (*VertEvent->qsq_GeVw_GeVt_GeVweight(nEvents); + weight = Sig->weight(nEvents); - // Final State Interaction. + // Final State Interaction. - if (obj["final_state_interaction"].asBool()){ - *FSIobj->VertInPion = *VertProdPion; - FSIfail = FSIobj->Generate(); - if (FSIfail == 1){ - cout << "FSI Generation Failure!" << endl; - // No instances of this so far. - continue; - } - *FSIProt = *FSIobj->VertOutProt; - *LCorEvent->ProdPion = *FSIobj->VertOutPion; - //if (FSIfail == 0) cout << "FSI Generation Successful" << endl; - FSIobj -> CalculateWeights(); - } - - // Final Cons Law Check - - *InTotal = (*(VertEvent->BeamElec)+ - *(VertEvent->TargNeut) - ); - *OutTotal = (*(VertEvent->ScatElec)+ - *(LCorEvent->ProdPion)+ - *(VertEvent->ProdProt) - ); - if (obj["final_state_interaction"].asBool()){ - *InTotal += *(FSIobj->VertTargProt); - *OutTotal += *(FSIobj->VertOutProt); - } - - if ((*InTotal-*OutTotal).Px() > 1.0) - cout << "Px Violation" << endl; - if ((*InTotal-*OutTotal).Py() > 1.0) - cout << "Px Violation" << endl; - if ((*InTotal-*OutTotal).Pz() > 1.0) - cout << "Px Violation" << endl; - if ((*InTotal-*OutTotal).E() > 1.0) - cout << "Px Violation" << endl; - - //Matter Effects~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (obj["final_state_interaction"].asBool()){ + *FSIobj->VertInPion = *VertProdPion; + FSIfail = FSIobj->Generate(); + if (FSIfail == 1){ + cout << "FSI Generation Failure!" << endl; + // No instances of this so far. + continue; + } + *FSIProt = *FSIobj->VertOutProt; + *LCorEvent->ProdPion = *FSIobj->VertOutPion; + //if (FSIfail == 0) cout << "FSI Generation Successful" << endl; + FSIobj -> CalculateWeights(); + } + + // Final Cons Law Check + + *InTotal = (*(VertEvent->BeamElec)+ + *(VertEvent->TargNeut) + ); + *OutTotal = (*(VertEvent->ScatElec)+ + *(LCorEvent->ProdPion)+ + *(VertEvent->ProdProt) + ); + if (obj["final_state_interaction"].asBool()){ + *InTotal += *(FSIobj->VertTargProt); + *OutTotal += *(FSIobj->VertOutProt); + } + + if ((*InTotal-*OutTotal).Px() > 1.0) + cout << "Px Violation" << endl; + if ((*InTotal-*OutTotal).Py() > 1.0) + cout << "Px Violation" << endl; + if ((*InTotal-*OutTotal).Pz() > 1.0) + cout << "Px Violation" << endl; + if ((*InTotal-*OutTotal).E() > 1.0) + cout << "Px Violation" << endl; + + //Matter Effects~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - targetthickness = ((-330.0 - *VertEvent->Vertex_z) * Helium_Density)/ - (ME->X0(Helium_Z, Helium_A)); - // Assuming path along z only inside the target. - // Shape of target is not really being considered here. - // A similar approximation is made for through-air distances. - // Exact geometry of the detector is not considered, only large angle - // or small angle. - // If more detailed analysis is desired, geant can do it better. - // Turn off effects and use GEMC. - - - //cout << targetthickness << endl; - - if (obj["ionisation"].asBool()){ - - //Scattered Electron - ME->IonLoss(LCorEvent->ScatElec, Window_A, Window_Z, - Window_Density, targwindowthickness); - ME->IonLoss(LCorEvent->ScatElec, Helium_A, Helium_Z, - Helium_Density, targetthickness); - airthickness = 450 * Air_Density; - if (LCorEvent->ScatElec->Theta() < 16) // Large Angle - airthickness = 950 * Air_Density; - ME->IonLoss(LCorEvent->ScatElec, Air_A, Air_Z, - Air_Density, airthickness); - - //Proton - airthickness = 450 * Air_Density; - if (LCorEvent->ProdProt->Theta() < 16) // Large Angle - airthickness = 950 * Air_Density; - - ME->IonLoss(LCorEvent->ProdProt, Helium_A, Helium_Z, - Helium_Density, targetthickness); - - ME->IonLoss(LCorEvent->ProdProt, Window_A, Window_Z, - Window_Density, targwindowthickness); - - ME->IonLoss(LCorEvent->ProdProt, Air_A, Air_Z, - Air_Density, airthickness); - - //Pion - airthickness = 450 * Air_Density; - if (LCorEvent->ProdPion->Theta() < 16) // Large Angle - airthickness = 950 * Air_Density; - - ME->IonLoss(LCorEvent->ProdPion, Helium_A, Helium_Z, - Helium_Density, targetthickness); - - ME->IonLoss(LCorEvent->ProdPion, Window_A, Window_Z, - Window_Density, targwindowthickness); - - ME->IonLoss(LCorEvent->ProdPion, Air_A, Air_Z, - Air_Density, airthickness); - - } - - if (obj["bremsstrahlung"].asBool()){ - - //Scattered Electron - ME->BremLoss(LCorEvent->ScatElec, - targetthickness*ME->b(Helium_Z) - /ME->X0(Helium_Z, Helium_A)); - ME->BremLoss(LCorEvent->ScatElec, - targwindowthickness*ME->b(Window_Z) - /ME->X0(Window_Z, Window_A)); - airthickness = 450 * Air_Density / ME->X0(Air_Z, Air_A); - if (LCorEvent->ScatElec->Theta() < 16) // Large Angle - airthickness = 950 * Air_Density / ME->X0(Air_Z, Air_A); - ME->BremLoss(LCorEvent->ScatElec, airthickness*ME->b(Air_Z)); - - } - - if (obj["multiple_scattering"].asBool()){ - //Scattered Electron - ME->MultiScatter(LCorEvent->ScatElec, - targetthickness / ME->X0(Helium_Z, Helium_A)); - ME->MultiScatter(LCorEvent->ScatElec, - targwindowthickness / ME->X0(Window_Z, Window_A)); - airthickness = 450 * Air_Density / ME->X0(Air_Z,Air_A); - if (LCorEvent->ScatElec->Theta() < 16) // Large Angle - airthickness = 950 * Air_Density / ME->X0(Air_Z,Air_A); - ME->MultiScatter(LCorEvent->ScatElec, airthickness); - - //Proton - ME->MultiScatter(LCorEvent->ProdProt, - targetthickness / ME->X0(Helium_Z, Helium_A)); - ME->MultiScatter(LCorEvent->ProdProt, - targwindowthickness / ME->X0(Window_Z, Window_A)); - airthickness = 450 * Air_Density / ME->X0(Air_Z,Air_A); - if (LCorEvent->ProdProt->Theta() < 16) // Large Angle - airthickness = 950 * Air_Density / ME->X0(Air_Z,Air_A); - ME->MultiScatter(LCorEvent->ProdProt, airthickness); - - //Pion - ME->MultiScatter(LCorEvent->ProdPion, - targetthickness / ME->X0(Helium_Z, Helium_A)); - ME->MultiScatter(LCorEvent->ProdPion, - targwindowthickness / ME->X0(Window_Z, Window_A)); - airthickness = 450 * Air_Density / ME->X0(Air_Z,Air_A); - if (LCorEvent->ProdPion->Theta() < 16) // Large Angle - airthickness = 950 * Air_Density / ME->X0(Air_Z,Air_A); - ME->MultiScatter(LCorEvent->ProdPion, airthickness); - - } + targetthickness = ((-330.0 - *VertEvent->Vertex_z) * Helium_Density)/ + (ME->X0(Helium_Z, Helium_A)); + // Assuming path along z only inside the target. + // Shape of target is not really being considered here. + // A similar approximation is made for through-air distances. + // Exact geometry of the detector is not considered, only large angle + // or small angle. + // If more detailed analysis is desired, geant can do it better. + // Turn off effects and use GEMC. + + + //cout << targetthickness << endl; + + if (obj["ionisation"].asBool()){ + + //Scattered Electron + ME->IonLoss(LCorEvent->ScatElec, Window_A, Window_Z, + Window_Density, targwindowthickness); + ME->IonLoss(LCorEvent->ScatElec, Helium_A, Helium_Z, + Helium_Density, targetthickness); + airthickness = 450 * Air_Density; + if (LCorEvent->ScatElec->Theta() < 16) // Large Angle + airthickness = 950 * Air_Density; + ME->IonLoss(LCorEvent->ScatElec, Air_A, Air_Z, + Air_Density, airthickness); + + //Proton + airthickness = 450 * Air_Density; + if (LCorEvent->ProdProt->Theta() < 16) // Large Angle + airthickness = 950 * Air_Density; + + ME->IonLoss(LCorEvent->ProdProt, Helium_A, Helium_Z, + Helium_Density, targetthickness); + + ME->IonLoss(LCorEvent->ProdProt, Window_A, Window_Z, + Window_Density, targwindowthickness); + + ME->IonLoss(LCorEvent->ProdProt, Air_A, Air_Z, + Air_Density, airthickness); + + //Pion + airthickness = 450 * Air_Density; + if (LCorEvent->ProdPion->Theta() < 16) // Large Angle + airthickness = 950 * Air_Density; + + ME->IonLoss(LCorEvent->ProdPion, Helium_A, Helium_Z, + Helium_Density, targetthickness); + + ME->IonLoss(LCorEvent->ProdPion, Window_A, Window_Z, + Window_Density, targwindowthickness); + + ME->IonLoss(LCorEvent->ProdPion, Air_A, Air_Z, + Air_Density, airthickness); + + } + + if (obj["bremsstrahlung"].asBool()){ + + //Scattered Electron + ME->BremLoss(LCorEvent->ScatElec, + targetthickness*ME->b(Helium_Z) + /ME->X0(Helium_Z, Helium_A)); + ME->BremLoss(LCorEvent->ScatElec, + targwindowthickness*ME->b(Window_Z) + /ME->X0(Window_Z, Window_A)); + airthickness = 450 * Air_Density / ME->X0(Air_Z, Air_A); + if (LCorEvent->ScatElec->Theta() < 16) // Large Angle + airthickness = 950 * Air_Density / ME->X0(Air_Z, Air_A); + ME->BremLoss(LCorEvent->ScatElec, airthickness*ME->b(Air_Z)); + + } + + if (obj["multiple_scattering"].asBool()){ + //Scattered Electron + ME->MultiScatter(LCorEvent->ScatElec, + targetthickness / ME->X0(Helium_Z, Helium_A)); + ME->MultiScatter(LCorEvent->ScatElec, + targwindowthickness / ME->X0(Window_Z, Window_A)); + airthickness = 450 * Air_Density / ME->X0(Air_Z,Air_A); + if (LCorEvent->ScatElec->Theta() < 16) // Large Angle + airthickness = 950 * Air_Density / ME->X0(Air_Z,Air_A); + ME->MultiScatter(LCorEvent->ScatElec, airthickness); + + //Proton + ME->MultiScatter(LCorEvent->ProdProt, + targetthickness / ME->X0(Helium_Z, Helium_A)); + ME->MultiScatter(LCorEvent->ProdProt, + targwindowthickness / ME->X0(Window_Z, Window_A)); + airthickness = 450 * Air_Density / ME->X0(Air_Z,Air_A); + if (LCorEvent->ProdProt->Theta() < 16) // Large Angle + airthickness = 950 * Air_Density / ME->X0(Air_Z,Air_A); + ME->MultiScatter(LCorEvent->ProdProt, airthickness); + + //Pion + ME->MultiScatter(LCorEvent->ProdPion, + targetthickness / ME->X0(Helium_Z, Helium_A)); + ME->MultiScatter(LCorEvent->ProdPion, + targwindowthickness / ME->X0(Window_Z, Window_A)); + airthickness = 450 * Air_Density / ME->X0(Air_Z,Air_A); + if (LCorEvent->ProdPion->Theta() < 16) // Large Angle + airthickness = 950 * Air_Density / ME->X0(Air_Z,Air_A); + ME->MultiScatter(LCorEvent->ProdPion, airthickness); + + } - Output->Fill(); + Output->Fill(); - } + } - cout << endl; + cout << endl; - if (nSuccess>0) - Output->Save(); + if (nSuccess>0) + Output->Save(); - cout << "Successful Events: \t" << nSuccess << endl; - cout << "Failed Events: \t\t" << nFail << endl; - cout << "Negative Events: \t\t" << nNeg << endl; - cout << "Cut Events: \t\t" << nCut << endl; + cout << "Successful Events: \t" << nSuccess << endl; + cout << "Failed Events: \t\t" << nFail << endl; + cout << "Negative Events: \t\t" << nNeg << endl; + cout << "Cut Events: \t\t" << nCut << endl; - // Checks against old event generator: + // Checks against old event generator: - if(nEvents <0){ + if(nEvents <0){ - int tests = -nEvents; - int N = 10000; - - TFile * Check = new TFile("RootFiles/DEMP_Ee_11_Events_10000_File_0.root"); - TTree * t1 = (TTree*)Check->Get("t1"); - - cout << "Running Debug/Check Values" << endl; - - Double_t Epsilon, Qsq_GeV, T_GeV, W_GeV, x, y, z, WSq_GeV, EventWeight, PhaseShiftWeight, PhaseSpaceWeight; - Double_t Qsq_Corrected_GeV, T_Corrected_GeV, W_Corrected_GeV; - - double WilliamsWeight, DedrickWeight, CatchenWeight; + int tests = -nEvents; + int N = 10000; + + TFile * Check = new TFile("RootFiles/DEMP_Ee_11_Events_10000_File_0.root"); + TTree * t1 = (TTree*)Check->Get("t1"); + + cout << "Running Debug/Check Values" << endl; + + Double_t Epsilon, Qsq_GeV, T_GeV, W_GeV, x, y, z, WSq_GeV, EventWeight, PhaseShiftWeight, PhaseSpaceWeight; + Double_t Qsq_Corrected_GeV, T_Corrected_GeV, W_Corrected_GeV; + + double WilliamsWeight, DedrickWeight, CatchenWeight; - Double_t ScatElec_Energy_Col_GeV,ScatElec_MomX_Col_GeV,ScatElec_MomY_Col_GeV,ScatElec_MomZ_Col_GeV,ScatElec_Mom_Col_GeV; - Double_t ScatElec_Phi_Col,ScatElec_Theta_Col; - - Double_t ScatElec_Corrected_Energy_Col_GeV,ScatElec_Corrected_MomX_Col_GeV,ScatElec_Corrected_MomY_Col_GeV,ScatElec_Corrected_MomZ_Col_GeV,ScatElec_Corrected_Mom_Col_GeV; - Double_t ScatElec_Corrected_Phi_Col,ScatElec_Corrected_Theta_Col; - - Double_t Pion_FSI_Energy_Col_GeV,Pion_FSI_MomX_Col_GeV,Pion_FSI_MomY_Col_GeV,Pion_FSI_MomZ_Col_GeV, Pion_FSI_Mom_Col_GeV; - Double_t Pion_FSI_Phi_Col, Pion_FSI_Theta_Col; - - Double_t Pion_Energy_Col_GeV,Pion_MomX_Col_GeV,Pion_MomY_Col_GeV,Pion_MomZ_Col_GeV, Pion_Mom_Col_GeV; - Double_t Pion_Phi_Col, Pion_Theta_Col; - - Double_t Pion_Corrected_Energy_Col_GeV,Pion_Corrected_MomX_Col_GeV,Pion_Corrected_MomY_Col_GeV,Pion_Corrected_MomZ_Col_GeV, Pion_Corrected_Mom_Col_GeV; - Double_t Pion_Corrected_Phi_Col, Pion_Corrected_Theta_Col; - - Double_t RecoilProton_Energy_Col_GeV, RecoilProton_MomX_Col_GeV, RecoilProton_MomY_Col_GeV, RecoilProton_MomZ_Col_GeV, RecoilProton_Mom_Col_GeV; - Double_t RecoilProton_Phi_Col, RecoilProton_Theta_Col; - - Double_t RecoilProton_Corrected_Energy_Col_GeV, RecoilProton_Corrected_MomX_Col_GeV, RecoilProton_Corrected_MomY_Col_GeV, RecoilProton_Corrected_MomZ_Col_GeV; - Double_t RecoilProton_Corrected_Phi_Col, RecoilProton_Corrected_Theta_Col, RecoilProton_Corrected_Mom_Col_GeV; - - Double_t AsymPhiMinusPhi_S, AsymPhi_S, Asym2PhiMinusPhi_S, AsymPhiPlusPhi_S, Asym3PhiMinusPhi_S, Asym2PhiPlusPhi_S; - - double T_Para_GeV, T_Prime_GeV; - - t1->SetBranchAddress("Epsilon", &Epsilon ); - t1->SetBranchAddress("Qsq_GeV", &Qsq_GeV ); - t1->SetBranchAddress("T_GeV", &T_GeV ); - t1->SetBranchAddress("W_GeV", &W_GeV ); - t1->SetBranchAddress("T_Para_GeV", &T_Para_GeV); - //t1->SetBranchAddress("T_Prime_GeV", &T_Prime_GeV); - - t1->SetBranchAddress("Qsq_Corrected_GeV", &Qsq_Corrected_GeV ); - t1->SetBranchAddress("T_Corrected_GeV", &T_Corrected_GeV ); - t1->SetBranchAddress("W_Corrected_GeV", &W_Corrected_GeV ); + Double_t ScatElec_Energy_Col_GeV,ScatElec_MomX_Col_GeV,ScatElec_MomY_Col_GeV,ScatElec_MomZ_Col_GeV,ScatElec_Mom_Col_GeV; + Double_t ScatElec_Phi_Col,ScatElec_Theta_Col; + + Double_t ScatElec_Corrected_Energy_Col_GeV,ScatElec_Corrected_MomX_Col_GeV,ScatElec_Corrected_MomY_Col_GeV,ScatElec_Corrected_MomZ_Col_GeV,ScatElec_Corrected_Mom_Col_GeV; + Double_t ScatElec_Corrected_Phi_Col,ScatElec_Corrected_Theta_Col; + + Double_t Pion_FSI_Energy_Col_GeV,Pion_FSI_MomX_Col_GeV,Pion_FSI_MomY_Col_GeV,Pion_FSI_MomZ_Col_GeV, Pion_FSI_Mom_Col_GeV; + Double_t Pion_FSI_Phi_Col, Pion_FSI_Theta_Col; + + Double_t Pion_Energy_Col_GeV,Pion_MomX_Col_GeV,Pion_MomY_Col_GeV,Pion_MomZ_Col_GeV, Pion_Mom_Col_GeV; + Double_t Pion_Phi_Col, Pion_Theta_Col; + + Double_t Pion_Corrected_Energy_Col_GeV,Pion_Corrected_MomX_Col_GeV,Pion_Corrected_MomY_Col_GeV,Pion_Corrected_MomZ_Col_GeV, Pion_Corrected_Mom_Col_GeV; + Double_t Pion_Corrected_Phi_Col, Pion_Corrected_Theta_Col; + + Double_t RecoilProton_Energy_Col_GeV, RecoilProton_MomX_Col_GeV, RecoilProton_MomY_Col_GeV, RecoilProton_MomZ_Col_GeV, RecoilProton_Mom_Col_GeV; + Double_t RecoilProton_Phi_Col, RecoilProton_Theta_Col; + + Double_t RecoilProton_Corrected_Energy_Col_GeV, RecoilProton_Corrected_MomX_Col_GeV, RecoilProton_Corrected_MomY_Col_GeV, RecoilProton_Corrected_MomZ_Col_GeV; + Double_t RecoilProton_Corrected_Phi_Col, RecoilProton_Corrected_Theta_Col, RecoilProton_Corrected_Mom_Col_GeV; + + Double_t AsymPhiMinusPhi_S, AsymPhi_S, Asym2PhiMinusPhi_S, AsymPhiPlusPhi_S, Asym3PhiMinusPhi_S, Asym2PhiPlusPhi_S; + + double T_Para_GeV, T_Prime_GeV; + + t1->SetBranchAddress("Epsilon", &Epsilon ); + t1->SetBranchAddress("Qsq_GeV", &Qsq_GeV ); + t1->SetBranchAddress("T_GeV", &T_GeV ); + t1->SetBranchAddress("W_GeV", &W_GeV ); + t1->SetBranchAddress("T_Para_GeV", &T_Para_GeV); + //t1->SetBranchAddress("T_Prime_GeV", &T_Prime_GeV); + + t1->SetBranchAddress("Qsq_Corrected_GeV", &Qsq_Corrected_GeV ); + t1->SetBranchAddress("T_Corrected_GeV", &T_Corrected_GeV ); + t1->SetBranchAddress("W_Corrected_GeV", &W_Corrected_GeV ); - t1->SetBranchAddress("ScatElec_Energy_Col_GeV", &ScatElec_Energy_Col_GeV ); - t1->SetBranchAddress("ScatElec_MomX_Col_GeV", &ScatElec_MomX_Col_GeV ); - t1->SetBranchAddress("ScatElec_MomY_Col_GeV", &ScatElec_MomY_Col_GeV ); - t1->SetBranchAddress("ScatElec_MomZ_Col_GeV", &ScatElec_MomZ_Col_GeV ); - t1->SetBranchAddress("ScatElec_Mom_Col_GeV", &ScatElec_Mom_Col_GeV ); - t1->SetBranchAddress("ScatElec_Theta_Col", &ScatElec_Theta_Col ); - t1->SetBranchAddress("ScatElec_Phi_Col", &ScatElec_Phi_Col ); + t1->SetBranchAddress("ScatElec_Energy_Col_GeV", &ScatElec_Energy_Col_GeV ); + t1->SetBranchAddress("ScatElec_MomX_Col_GeV", &ScatElec_MomX_Col_GeV ); + t1->SetBranchAddress("ScatElec_MomY_Col_GeV", &ScatElec_MomY_Col_GeV ); + t1->SetBranchAddress("ScatElec_MomZ_Col_GeV", &ScatElec_MomZ_Col_GeV ); + t1->SetBranchAddress("ScatElec_Mom_Col_GeV", &ScatElec_Mom_Col_GeV ); + t1->SetBranchAddress("ScatElec_Theta_Col", &ScatElec_Theta_Col ); + t1->SetBranchAddress("ScatElec_Phi_Col", &ScatElec_Phi_Col ); - t1->SetBranchAddress("ScatElec_Corrected_Energy_Col_GeV", &ScatElec_Corrected_Energy_Col_GeV ); - t1->SetBranchAddress("ScatElec_Corrected_MomX_Col_GeV", &ScatElec_Corrected_MomX_Col_GeV ); - t1->SetBranchAddress("ScatElec_Corrected_MomY_Col_GeV", &ScatElec_Corrected_MomY_Col_GeV ); - t1->SetBranchAddress("ScatElec_Corrected_MomZ_Col_GeV", &ScatElec_Corrected_MomZ_Col_GeV ); - t1->SetBranchAddress("ScatElec_Corrected_Mom_Col_GeV", &ScatElec_Corrected_Mom_Col_GeV ); - t1->SetBranchAddress("ScatElec_Corrected_Theta_Col", &ScatElec_Corrected_Theta_Col ); - t1->SetBranchAddress("ScatElec_Corrected_Phi_Col", &ScatElec_Corrected_Phi_Col ); + t1->SetBranchAddress("ScatElec_Corrected_Energy_Col_GeV", &ScatElec_Corrected_Energy_Col_GeV ); + t1->SetBranchAddress("ScatElec_Corrected_MomX_Col_GeV", &ScatElec_Corrected_MomX_Col_GeV ); + t1->SetBranchAddress("ScatElec_Corrected_MomY_Col_GeV", &ScatElec_Corrected_MomY_Col_GeV ); + t1->SetBranchAddress("ScatElec_Corrected_MomZ_Col_GeV", &ScatElec_Corrected_MomZ_Col_GeV ); + t1->SetBranchAddress("ScatElec_Corrected_Mom_Col_GeV", &ScatElec_Corrected_Mom_Col_GeV ); + t1->SetBranchAddress("ScatElec_Corrected_Theta_Col", &ScatElec_Corrected_Theta_Col ); + t1->SetBranchAddress("ScatElec_Corrected_Phi_Col", &ScatElec_Corrected_Phi_Col ); - // t1->SetBranchAddress("Pion_FSI_Energy_Col_GeV", &Pion_FSI_Energy_Col_GeV ); - // t1->SetBranchAddress("Pion_FSI_MomX_Col_GeV", &Pion_FSI_MomX_Col_GeV ); - // t1->SetBranchAddress("Pion_FSI_MomY_Col_GeV", &Pion_FSI_MomY_Col_GeV ); - // t1->SetBranchAddress("Pion_FSI_MomZ_Col_GeV", &Pion_FSI_MomZ_Col_GeV ); - // t1->SetBranchAddress("Pion_FSI_Mom_Col_GeV", &Pion_FSI_Mom_Col_GeV ); - // t1->SetBranchAddress("Pion_FSI_Theta_Col", &Pion_FSI_Theta_Col ); - // t1->SetBranchAddress("Pion_FSI_Phi_Col", &Pion_FSI_Phi_Col ); + // t1->SetBranchAddress("Pion_FSI_Energy_Col_GeV", &Pion_FSI_Energy_Col_GeV ); + // t1->SetBranchAddress("Pion_FSI_MomX_Col_GeV", &Pion_FSI_MomX_Col_GeV ); + // t1->SetBranchAddress("Pion_FSI_MomY_Col_GeV", &Pion_FSI_MomY_Col_GeV ); + // t1->SetBranchAddress("Pion_FSI_MomZ_Col_GeV", &Pion_FSI_MomZ_Col_GeV ); + // t1->SetBranchAddress("Pion_FSI_Mom_Col_GeV", &Pion_FSI_Mom_Col_GeV ); + // t1->SetBranchAddress("Pion_FSI_Theta_Col", &Pion_FSI_Theta_Col ); + // t1->SetBranchAddress("Pion_FSI_Phi_Col", &Pion_FSI_Phi_Col ); - t1->SetBranchAddress("Pion_Energy_Col_GeV", &Pion_Energy_Col_GeV ); - t1->SetBranchAddress("Pion_MomX_Col_GeV", &Pion_MomX_Col_GeV ); - t1->SetBranchAddress("Pion_MomY_Col_GeV", &Pion_MomY_Col_GeV ); - t1->SetBranchAddress("Pion_MomZ_Col_GeV", &Pion_MomZ_Col_GeV ); - t1->SetBranchAddress("Pion_Mom_Col_GeV", &Pion_Mom_Col_GeV ); - t1->SetBranchAddress("Pion_Theta_Col", &Pion_Theta_Col ); - t1->SetBranchAddress("Pion_Phi_Col", &Pion_Phi_Col ); + t1->SetBranchAddress("Pion_Energy_Col_GeV", &Pion_Energy_Col_GeV ); + t1->SetBranchAddress("Pion_MomX_Col_GeV", &Pion_MomX_Col_GeV ); + t1->SetBranchAddress("Pion_MomY_Col_GeV", &Pion_MomY_Col_GeV ); + t1->SetBranchAddress("Pion_MomZ_Col_GeV", &Pion_MomZ_Col_GeV ); + t1->SetBranchAddress("Pion_Mom_Col_GeV", &Pion_Mom_Col_GeV ); + t1->SetBranchAddress("Pion_Theta_Col", &Pion_Theta_Col ); + t1->SetBranchAddress("Pion_Phi_Col", &Pion_Phi_Col ); - t1->SetBranchAddress("Pion_Corrected_Energy_Col_GeV", &Pion_Corrected_Energy_Col_GeV ); - t1->SetBranchAddress("Pion_Corrected_MomX_Col_GeV", &Pion_Corrected_MomX_Col_GeV ); - t1->SetBranchAddress("Pion_Corrected_MomY_Col_GeV", &Pion_Corrected_MomY_Col_GeV ); - t1->SetBranchAddress("Pion_Corrected_MomZ_Col_GeV", &Pion_Corrected_MomZ_Col_GeV ); - t1->SetBranchAddress("Pion_Corrected_Mom_Col_GeV", &Pion_Corrected_Mom_Col_GeV ); - t1->SetBranchAddress("Pion_Corrected_Theta_Col", &Pion_Corrected_Theta_Col ); - t1->SetBranchAddress("Pion_Corrected_Phi_Col", &Pion_Corrected_Phi_Col ); - - t1->SetBranchAddress("RecoilProton_Energy_Col_GeV", &RecoilProton_Energy_Col_GeV ); - t1->SetBranchAddress("RecoilProton_MomX_Col_GeV", &RecoilProton_MomX_Col_GeV ); - t1->SetBranchAddress("RecoilProton_MomY_Col_GeV", &RecoilProton_MomY_Col_GeV ); - t1->SetBranchAddress("RecoilProton_MomZ_Col_GeV", &RecoilProton_MomZ_Col_GeV ); - t1->SetBranchAddress("RecoilProton_Mom_Col_GeV", &RecoilProton_Mom_Col_GeV ); - t1->SetBranchAddress("RecoilProton_Theta_Col", &RecoilProton_Theta_Col ); - t1->SetBranchAddress("RecoilProton_Phi_Col", &RecoilProton_Phi_Col ); - - t1->SetBranchAddress("RecoilProton_Corrected_Energy_Col_GeV", &RecoilProton_Corrected_Energy_Col_GeV ); - t1->SetBranchAddress("RecoilProton_Corrected_MomX_Col_GeV", &RecoilProton_Corrected_MomX_Col_GeV ); - t1->SetBranchAddress("RecoilProton_Corrected_MomY_Col_GeV", &RecoilProton_Corrected_MomY_Col_GeV ); - t1->SetBranchAddress("RecoilProton_Corrected_MomZ_Col_GeV", &RecoilProton_Corrected_MomZ_Col_GeV ); - t1->SetBranchAddress("RecoilProton_Corrected_Mom_Col_GeV", &RecoilProton_Corrected_Mom_Col_GeV ); - t1->SetBranchAddress("RecoilProton_Corrected_Theta_Col", &RecoilProton_Corrected_Theta_Col ); - t1->SetBranchAddress("RecoilProton_Corrected_Phi_Col", &RecoilProton_Corrected_Phi_Col ); - - t1->SetBranchAddress("EventWeight", &EventWeight ); - t1->SetBranchAddress("WilliamsWeight", &WilliamsWeight ); - t1->SetBranchAddress("DedrickWeight", &DedrickWeight ); - t1->SetBranchAddress("CatchenWeight", &CatchenWeight ); - - double ZASig_T, ZASig_L, ZASig_LT, ZASig_TT, ZASigma_Lab, ZASigma_UU, RorySigma_UT; - double Theta, Phi, Phi_S; - - t1->SetBranchAddress("ZASig_T", &ZASig_T); - t1->SetBranchAddress("ZASig_L", &ZASig_L); - t1->SetBranchAddress("ZASig_LT", &ZASig_LT); - t1->SetBranchAddress("ZASig_TT", &ZASig_TT); - t1->SetBranchAddress("ZASigma_Lab", &ZASigma_Lab); - t1->SetBranchAddress("ZASigma_UU", &ZASigma_UU); - t1->SetBranchAddress("RorySigma_UT", &RorySigma_UT); - - t1->SetBranchAddress("AsymPhiMinusPhi_S", &AsymPhiMinusPhi_S); - t1->SetBranchAddress("AsymPhi_S", &AsymPhi_S); - t1->SetBranchAddress("Asym2PhiMinusPhi_S", &Asym2PhiMinusPhi_S); - t1->SetBranchAddress("AsymPhiPlusPhi_S", &AsymPhiPlusPhi_S); - t1->SetBranchAddress("Asym3PhiMinusPhi_S", &Asym3PhiMinusPhi_S); - t1->SetBranchAddress("Asym2PhiPlusPhi_S", &Asym2PhiPlusPhi_S); - - t1->SetBranchAddress("Phi", &Phi); - t1->SetBranchAddress("PhiS", &Phi_S); - t1->SetBranchAddress("Photon_Theta_Col", &Theta); - - double Jacobian_CM, Jacobian_CM_RF, Jacobian_CM_Col; - double Flux_Factor_RF, Flux_Factor_Col, A; - - t1->SetBranchAddress("Jacobian_CM",&Jacobian_CM); - t1->SetBranchAddress("Jacobian_CM_RF",&Jacobian_CM_RF); - t1->SetBranchAddress("Jacobian_CM_Col",&Jacobian_CM_Col); - t1->SetBranchAddress("A", &A); - - t1->SetBranchAddress("Flux_Factor_RF",&Flux_Factor_RF); - t1->SetBranchAddress("Flux_Factor_Col",&Flux_Factor_Col); - - bool ALERT = false; - for (int i=0; iGetEntry(i); - - - VertScatElec->SetThetaPhiE(ScatElec_Theta_Col/DEG, ScatElec_Phi_Col/DEG, - ScatElec_Energy_Col_GeV * 1000); - *VertTargNeut = *NeutGen->GetParticle(); - - /// Setting Photon - *Photon = *VertBeamElec - *VertScatElec; - - ProtonPionGen->Solve(Pion_Theta_Col/DEG,Pion_Phi_Col/DEG); - - - /// Setting Pion - *VertProdPion = *ProtonPionGen->ProdPion(); - /// Setting Proton - *VertProdProt = *ProtonPionGen->ProdProton(); - - VertEvent->Update(); - - *CofMEvent = *VertEvent; - CofMEvent->Boost(-VertEvent->CoM()); - CofMEvent->Update(); - - *RestEvent = *VertEvent; - RestEvent->Boost(-(VertEvent->TargNeut->Vect()*(1/VertEvent->TargNeut->E()))); - RestEvent->Update(); - - *TConEvent = *RestEvent; - TConEvent->Rotate(RestEvent->VirtPhot->Theta(),-RestEvent->ScatElec->Phi()); - TConEvent->Update(); - - double qsq_GeV = *VertEvent->qsq_GeV; - double w_GeV = *VertEvent->w_GeV; - double t_GeV = *VertEvent->t_GeV; - double t_prime_GeV = *VertEvent->t_prime_GeV; - double t_para_GeV = *VertEvent->t_para_GeV; - double phi = *TConEvent->Phi; - if (phi<0) phi+=2*TMath::Pi(); - double phi_s = *TConEvent->Phi_s; - if (phi_s<0) phi_s+=2*TMath::Pi(); - double theta = *RestEvent->Theta; - if (theta <0) theta+=2*TMath::Pi(); - - - sigma_l = Sig->sigma_l(); - sigma_t = Sig->sigma_t(); - sigma_lt = Sig->sigma_lt(); - sigma_tt = Sig->sigma_tt(); - sigma_uu = Sig->sigma_uu(); - sigma_ut = Sig->sigma_ut(); - - sigma_k0 = Sig->Sigma_k(0); - sigma_k1 = Sig->Sigma_k(1); - sigma_k2 = Sig->Sigma_k(2); - sigma_k3 = Sig->Sigma_k(3); - sigma_k4 = Sig->Sigma_k(4); - - sigma = Sig->sigma(); - - if (obj["final_state_interaction"].asBool()){ - *FSIobj->VertInPion = *VertProdPion; - FSIobj->VertOutPion -> SetPxPyPzE(Pion_Corrected_MomX_Col_GeV*1000, - Pion_Corrected_MomY_Col_GeV*1000, - Pion_Corrected_MomZ_Col_GeV*1000, - Pion_Corrected_Energy_Col_GeV*1000); - //FSIfail = FSIobj->Generate(); - //if (FSIfail == 1){ - // cout << "FSI Generation Failure!" << endl; - // continue; - //} - FSIobj->GenerateNoRandom(); - *FSIProt = *FSIobj->VertOutProt; - *LCorEvent->ProdPion = *FSIobj->VertOutPion; - FSIobj -> CalculateWeights(); - } - - int printw = 20; - - ALERT = false; - if(TMath::Abs((sigma-ZASigma_Lab)/sigma)>0.01) {ALERT = true; cout << "SIGMA:\t"<0.01) {ALERT = true; cout << "SIGMA_L:\t"<0.01) {ALERT = true; cout << "SIGMA_T:\t"<0.01) {ALERT = true; cout << "SIGMA_LT:\t"<0.01) {ALERT = true; cout << "SIGMA_TT:\t"<0.01) {ALERT = true; cout << "SIGMA_UU:\t"<0.01) {ALERT = true; cout << "SIGMA_UT:\t"<weight(N)-EventWeight)/EventWeight)>0.01) {ALERT = true; cout << "WEIGHT:\t"<weight(N)-EventWeight)/EventWeight)<E()/1000<Theta()*DEG<Phi()*DEG <E()/1000<Theta()*DEG<Phi()*DEG<E()/1000<Theta()*DEG<Phi()*DEG<epsilon()<jacobian_cm()<jacobian_cm_col()<fluxfactor_col()<jacobian_A()<weight(N)<weight(100000) << endl; - cout<Asyms->at(0)->PrintPars(); - - cout<WilliamsWeight<DedrickWeight<CatchenWeight<SetBranchAddress("Pion_Corrected_Energy_Col_GeV", &Pion_Corrected_Energy_Col_GeV ); + t1->SetBranchAddress("Pion_Corrected_MomX_Col_GeV", &Pion_Corrected_MomX_Col_GeV ); + t1->SetBranchAddress("Pion_Corrected_MomY_Col_GeV", &Pion_Corrected_MomY_Col_GeV ); + t1->SetBranchAddress("Pion_Corrected_MomZ_Col_GeV", &Pion_Corrected_MomZ_Col_GeV ); + t1->SetBranchAddress("Pion_Corrected_Mom_Col_GeV", &Pion_Corrected_Mom_Col_GeV ); + t1->SetBranchAddress("Pion_Corrected_Theta_Col", &Pion_Corrected_Theta_Col ); + t1->SetBranchAddress("Pion_Corrected_Phi_Col", &Pion_Corrected_Phi_Col ); + + t1->SetBranchAddress("RecoilProton_Energy_Col_GeV", &RecoilProton_Energy_Col_GeV ); + t1->SetBranchAddress("RecoilProton_MomX_Col_GeV", &RecoilProton_MomX_Col_GeV ); + t1->SetBranchAddress("RecoilProton_MomY_Col_GeV", &RecoilProton_MomY_Col_GeV ); + t1->SetBranchAddress("RecoilProton_MomZ_Col_GeV", &RecoilProton_MomZ_Col_GeV ); + t1->SetBranchAddress("RecoilProton_Mom_Col_GeV", &RecoilProton_Mom_Col_GeV ); + t1->SetBranchAddress("RecoilProton_Theta_Col", &RecoilProton_Theta_Col ); + t1->SetBranchAddress("RecoilProton_Phi_Col", &RecoilProton_Phi_Col ); + + t1->SetBranchAddress("RecoilProton_Corrected_Energy_Col_GeV", &RecoilProton_Corrected_Energy_Col_GeV ); + t1->SetBranchAddress("RecoilProton_Corrected_MomX_Col_GeV", &RecoilProton_Corrected_MomX_Col_GeV ); + t1->SetBranchAddress("RecoilProton_Corrected_MomY_Col_GeV", &RecoilProton_Corrected_MomY_Col_GeV ); + t1->SetBranchAddress("RecoilProton_Corrected_MomZ_Col_GeV", &RecoilProton_Corrected_MomZ_Col_GeV ); + t1->SetBranchAddress("RecoilProton_Corrected_Mom_Col_GeV", &RecoilProton_Corrected_Mom_Col_GeV ); + t1->SetBranchAddress("RecoilProton_Corrected_Theta_Col", &RecoilProton_Corrected_Theta_Col ); + t1->SetBranchAddress("RecoilProton_Corrected_Phi_Col", &RecoilProton_Corrected_Phi_Col ); + + t1->SetBranchAddress("EventWeight", &EventWeight ); + t1->SetBranchAddress("WilliamsWeight", &WilliamsWeight ); + t1->SetBranchAddress("DedrickWeight", &DedrickWeight ); + t1->SetBranchAddress("CatchenWeight", &CatchenWeight ); + + double ZASig_T, ZASig_L, ZASig_LT, ZASig_TT, ZASigma_Lab, ZASigma_UU, RorySigma_UT; + double Theta, Phi, Phi_S; + + t1->SetBranchAddress("ZASig_T", &ZASig_T); + t1->SetBranchAddress("ZASig_L", &ZASig_L); + t1->SetBranchAddress("ZASig_LT", &ZASig_LT); + t1->SetBranchAddress("ZASig_TT", &ZASig_TT); + t1->SetBranchAddress("ZASigma_Lab", &ZASigma_Lab); + t1->SetBranchAddress("ZASigma_UU", &ZASigma_UU); + t1->SetBranchAddress("RorySigma_UT", &RorySigma_UT); + + t1->SetBranchAddress("AsymPhiMinusPhi_S", &AsymPhiMinusPhi_S); + t1->SetBranchAddress("AsymPhi_S", &AsymPhi_S); + t1->SetBranchAddress("Asym2PhiMinusPhi_S", &Asym2PhiMinusPhi_S); + t1->SetBranchAddress("AsymPhiPlusPhi_S", &AsymPhiPlusPhi_S); + t1->SetBranchAddress("Asym3PhiMinusPhi_S", &Asym3PhiMinusPhi_S); + t1->SetBranchAddress("Asym2PhiPlusPhi_S", &Asym2PhiPlusPhi_S); + + t1->SetBranchAddress("Phi", &Phi); + t1->SetBranchAddress("PhiS", &Phi_S); + t1->SetBranchAddress("Photon_Theta_Col", &Theta); + + double Jacobian_CM, Jacobian_CM_RF, Jacobian_CM_Col; + double Flux_Factor_RF, Flux_Factor_Col, A; + + t1->SetBranchAddress("Jacobian_CM",&Jacobian_CM); + t1->SetBranchAddress("Jacobian_CM_RF",&Jacobian_CM_RF); + t1->SetBranchAddress("Jacobian_CM_Col",&Jacobian_CM_Col); + t1->SetBranchAddress("A", &A); + + t1->SetBranchAddress("Flux_Factor_RF",&Flux_Factor_RF); + t1->SetBranchAddress("Flux_Factor_Col",&Flux_Factor_Col); + + bool ALERT = false; + for (int i=0; iGetEntry(i); + + + VertScatElec->SetThetaPhiE(ScatElec_Theta_Col/DEG, ScatElec_Phi_Col/DEG, + ScatElec_Energy_Col_GeV * 1000); + *VertTargNeut = *NeutGen->GetParticle(); + + /// Setting Photon + *Photon = *VertBeamElec - *VertScatElec; + + ProtonPionGen->Solve(Pion_Theta_Col/DEG,Pion_Phi_Col/DEG); + + + /// Setting Pion + *VertProdPion = *ProtonPionGen->ProdPion(); + /// Setting Proton + *VertProdProt = *ProtonPionGen->ProdProton(); + + VertEvent->Update(); + + *CofMEvent = *VertEvent; + CofMEvent->Boost(-VertEvent->CoM()); + CofMEvent->Update(); + + *RestEvent = *VertEvent; + RestEvent->Boost(-(VertEvent->TargNeut->Vect()*(1/VertEvent->TargNeut->E()))); + RestEvent->Update(); + + *TConEvent = *RestEvent; + TConEvent->Rotate(RestEvent->VirtPhot->Theta(),-RestEvent->ScatElec->Phi()); + TConEvent->Update(); + + double qsq_GeV = *VertEvent->qsq_GeV; + double w_GeV = *VertEvent->w_GeV; + double t_GeV = *VertEvent->t_GeV; + double t_prime_GeV = *VertEvent->t_prime_GeV; + double t_para_GeV = *VertEvent->t_para_GeV; + double phi = *TConEvent->Phi; + if (phi<0) phi+=2*TMath::Pi(); + double phi_s = *TConEvent->Phi_s; + if (phi_s<0) phi_s+=2*TMath::Pi(); + double theta = *RestEvent->Theta; + if (theta <0) theta+=2*TMath::Pi(); + + + sigma_l = Sig->sigma_l(); + sigma_t = Sig->sigma_t(); + sigma_lt = Sig->sigma_lt(); + sigma_tt = Sig->sigma_tt(); + sigma_uu = Sig->sigma_uu(); + sigma_ut = Sig->sigma_ut(); + + sigma_k0 = Sig->Sigma_k(0); + sigma_k1 = Sig->Sigma_k(1); + sigma_k2 = Sig->Sigma_k(2); + sigma_k3 = Sig->Sigma_k(3); + sigma_k4 = Sig->Sigma_k(4); + + sigma = Sig->sigma(); + + if (obj["final_state_interaction"].asBool()){ + *FSIobj->VertInPion = *VertProdPion; + FSIobj->VertOutPion -> SetPxPyPzE(Pion_Corrected_MomX_Col_GeV*1000, + Pion_Corrected_MomY_Col_GeV*1000, + Pion_Corrected_MomZ_Col_GeV*1000, + Pion_Corrected_Energy_Col_GeV*1000); + //FSIfail = FSIobj->Generate(); + //if (FSIfail == 1){ + // cout << "FSI Generation Failure!" << endl; + // continue; + //} + FSIobj->GenerateNoRandom(); + *FSIProt = *FSIobj->VertOutProt; + *LCorEvent->ProdPion = *FSIobj->VertOutPion; + FSIobj -> CalculateWeights(); + } + + int printw = 20; + + ALERT = false; + if(TMath::Abs((sigma-ZASigma_Lab)/sigma)>0.01) {ALERT = true; cout << "SIGMA:\t"<0.01) {ALERT = true; cout << "SIGMA_L:\t"<0.01) {ALERT = true; cout << "SIGMA_T:\t"<0.01) {ALERT = true; cout << "SIGMA_LT:\t"<0.01) {ALERT = true; cout << "SIGMA_TT:\t"<0.01) {ALERT = true; cout << "SIGMA_UU:\t"<0.01) {ALERT = true; cout << "SIGMA_UT:\t"<weight(N)-EventWeight)/EventWeight)>0.01) {ALERT = true; cout << "WEIGHT:\t"<weight(N)-EventWeight)/EventWeight)<E()/1000<Theta()*DEG<Phi()*DEG <E()/1000<Theta()*DEG<Phi()*DEG<E()/1000<Theta()*DEG<Phi()*DEG<epsilon()<jacobian_cm()<jacobian_cm_col()<fluxfactor_col()<jacobian_A()<weight(N)<weight(100000) << endl; + cout<Asyms->at(0)->PrintPars(); + + cout<WilliamsWeight<DedrickWeight<CatchenWeight<