void particle() { String outpar; outpar = "x=" + Output.f(p.p.x) + " " + "y=" + Output.f(p.p.y) + " " + "z=" + Output.f(p.p.z) + "\n"; outpar += "t=" + Output.f(p.p.t) + " r=" + Output.f(p.p.r) + "\n"; outpar += "theta=" + Output.f(p.p.theta) + " phi=" + Output.f(p.p.phi) + "\n"; outpar += "energy=" + Output.f(p.p.e) + " momentum=" + Output.f(p.p.p); par.append(outpar + "\n"); }
public void actionPerformed(ActionEvent event) { double e = 10, x = 10, result; String line; double vcut, ecut; String med, type; boolean lpm, cont, scat, time, intr; int bs, ph, sh, bb; boolean flag, iflag; if (event.getSource() == panel2.button) { type = panel3.type.getSelectedItem(); if (type.equals("mpl")) type = "monopole"; if (type.equals("all")) { Output.DEBUG = false; panel5.debug.setState(false); almc lmc = new almc( panel4.text1.getText() + " -tdir=" + getCodeBase() + " -user -raw " + panel4.text2.getText()); reset = true; return; } else stdReset(); e = (new Double(panel4.text1.getText())).doubleValue(); x = (new Double(panel4.text2.getText())).doubleValue(); out.append("x=" + Output.f(x) + " e=" + Output.f(e) + " "); par.append("\nplease wait ...\n"); lpm = panel5.lpm.getState(); cont = panel5.cont.getState(); scat = panel5.scat.getState(); time = panel5.time.getState(); debug = panel5.debug.getState(); intr = panel5.inter.getState(); switch (panel5.cuts.getSelectedIndex()) { case 0: vcut = 1; ecut = -1; break; case 1: vcut = 0.05; ecut = -1; break; case 2: vcut = 0.01; ecut = -1; break; case 3: vcut = 1.e-3; ecut = -1; break; default: case 4: vcut = -1; ecut = 500; break; } switch (panel5.brem.getSelectedIndex()) { case 0: bs = 1; break; case 1: bs = 2; break; case 2: bs = 3; break; default: case 3: bs = 4; break; } switch (panel5.phnu.getSelectedIndex()) { case 0: ph = 1; sh = 1; bb = 3; break; case 1: ph = 1; sh = 1; bb = 4; break; case 2: ph = 2; sh = 1; bb = 3; break; case 3: ph = 3; sh = 1; bb = 1; break; case 4: ph = 3; sh = 1; bb = 2; break; default: case 5: ph = 4; sh = 2; bb = 1; break; } med = panel3.medi.getSelectedItem(); switch (panel3.romb.getSelectedIndex()) { case 0: romb = 3; break; case 1: romb = 4; break; default: case 2: romb = 5; break; } flag = ini; ini = true; iflag = this.intr; if (this.vcut != vcut) { this.vcut = vcut; flag = false; } if (this.ecut != ecut) { this.ecut = ecut; flag = false; } if (!this.med.equals(med)) { this.med = med; flag = false; } if (!this.type.equals(type)) { this.type = type; flag = false; } if (!flag) p = new Propagate(med, ecut, vcut, type); Output.DEBUG = debug; if (!flag) iflag = false; if (this.lpm != lpm) { this.lpm = lpm; flag = false; } if (this.cont != cont) { this.cont = cont; flag = false; } if (this.scat != scat) { this.scat = scat; flag = false; } if (this.time != time) { this.time = time; flag = false; } if (this.intr != intr) { this.intr = intr; flag = false; } if (this.bs != bs) { this.bs = bs; flag = false; } if (this.ph != ph) { this.ph = ph; flag = false; } if (this.sh != sh) { this.sh = sh; flag = false; } if (this.bb != bb) { this.bb = bb; flag = false; } p.sdec = true; p.recc = true; p.contiCorr = cont; p.exactTime = time; p.s.lpm = lpm; p.s.b.form = bs; p.s.n.form = ph; p.s.n.shadow = sh; p.s.n.bb = bb; p.molieScat = scat; Propagate.g = 5; if (!flag) { if (intr) { err.append("\n"); p.interpolate("all"); } else if (iflag) { err.append("\nSwitching off parameterizations:\n"); p.interpolate("none"); } } Propagate.g = romb; result = p.propagateTo(x * 1.e2, e * 1.e3); line = "ef=" + Output.f(result > 0 ? result * 1.e-3 : result * 1.e-2); if (time) line += " tf=" + Output.f(p.p.t); out.append(line + "\n"); particle(); } }