From 18cb077fe2a483e3303524c5a0f3601f439f73d9 Mon Sep 17 00:00:00 2001 From: james szalkie Date: Mon, 10 Aug 2026 10:52:20 -0400 Subject: [PATCH] Randomized energy fix --- Armory/anasenMS.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Armory/anasenMS.cpp b/Armory/anasenMS.cpp index e3c4a60..406c2a0 100644 --- a/Armory/anasenMS.cpp +++ b/Armory/anasenMS.cpp @@ -99,13 +99,13 @@ int main(int argc, char **argv){ //To set beam energy loss, use energy loss app, and create table with target isotope, set Initial beam energy as max energy transfer.SetA(18, 9, 0); // 18Ne projectile - TGraph* elossBeam = LoadELoss("../ELoss/HeLoss/E_vs_x_Na-21.dat"); + //TGraph* elossBeam = LoadELoss("../ELoss/HeLoss/E_vs_x_Na-21.dat"); transfer.Seta(4, 2); // 4He target transfer.Setb(1, 1); // outgoing proton from the primary transfer transfer.SetB(21, 11); // 21Na* heavy product const ReactionConfig reactionConfig = transfer.GetRectionConfig(); const double beamA = reactionConfig.beamA; // mass number of 14N beam - const double beamE = 42.82 / beamA; // beam energy in MeV + const double beamE = 3; // maximum beam energy in MeV/u const int kMBeam = reactionConfig.beamA; // mass number of beam const int kMTarget = reactionConfig.targetA; // mass number of target @@ -388,10 +388,12 @@ int main(int argc, char **argv){ // compute beam energy at the event vertex from the gas path length beamPath_cm = TVector3(vertexZ - beamEntranceZ, vertexX, vertexY).Mag() * 0.1; if( beamPath_cm < 0 ) beamPath_cm = 0; - beamEnergy = elossBeam->Eval(beamPath_cm); // MeV - beamEnergyLoss = elossBeam->Eval(0.0) - beamEnergy; - KEA = beamEnergy / beamA; - //KEA = gRandom->Uniform(0, beamE); + //beamEnergy = elossBeam->Eval(beamPath_cm); // MeV + //beamEnergyLoss = elossBeam->Eval(0.0) - beamEnergy; + //KEA = beamEnergy / beamA; + KEA = gRandom->Uniform(0, beamE); + beamEnergy = KEA * beamA; + beamEnergyLoss = 0; transfer.SetIncidentEnergyAngle(KEA, 0, 0); transfer.CalReactionConstant();