From b9cf71087cd2297e1d90c8f3c2439d28fd4e7aee Mon Sep 17 00:00:00 2001 From: dglazier Date: Mon, 31 May 2021 10:11:35 +0100 Subject: [PATCH] fix _maxPossiblexRange to be independent of given theta and Q2 ranges for correct sampling behaviour --- core/DistVirtPhotFlux_xy.cpp | 7 +++++-- core/Interface.h | 10 ++++++++++ jpacPhoto | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/core/DistVirtPhotFlux_xy.cpp b/core/DistVirtPhotFlux_xy.cpp index 0a84458..7b1cc4c 100644 --- a/core/DistVirtPhotFlux_xy.cpp +++ b/core/DistVirtPhotFlux_xy.cpp @@ -81,8 +81,11 @@ namespace elSpectro{ ymin = TMath::Exp(_lnymin); double ymax = TMath::Exp(_lnymax); for(int i=0;i<1E5;i++){ - double avail_xmin = XMin(static_cast(i*(ymax-ymin) + ymin)/1E5); - if(avail_xmin<_maxPossiblexRange) + // double avail_xmin = XMin(static_cast(i*(ymax-ymin) + ymin)/1E5); + //Need xmin with no experiment based limits on Q2 or theta + double yformin=static_cast(i*(ymax-ymin) + ymin)/1E5; + double avail_xmin =escat::M2_el()*yformin/(2*_mTar*_ebeam)/(1-yformin); + if(avail_xmin<_maxPossiblexRange) _maxPossiblexRange=avail_xmin; } diff --git a/core/Interface.h b/core/Interface.h index 65a6b8d..de9b558 100644 --- a/core/Interface.h +++ b/core/Interface.h @@ -129,5 +129,15 @@ namespace elSpectro{ return generator().Reaction(); } + inline ProductionProcess* eic(CollidingParticle* el,CollidingParticle* pr,DecayModelQ2W *totalXsec=nullptr){ + + if(totalXsec!=nullptr){ + generator().Reaction(new ElectronScattering(el,pr, totalXsec )); + } + else + generator().Reaction(new ElectronScattering(el,pr,totalXsec)); + + return generator().Reaction(); + } }//namespace elSpectro diff --git a/jpacPhoto b/jpacPhoto index c67402b..8ea3993 160000 --- a/jpacPhoto +++ b/jpacPhoto @@ -1 +1 @@ -Subproject commit c67402be5965456b6c34117324aafda54da33001 +Subproject commit 8ea3993d145fd0130cdb95a08a7dc2657f0ea8ac