Package pymontecarlo.program.nistmonte.options.beam

Examples of pymontecarlo.program.nistmonte.options.beam.PencilBeam


    }



    protected ElectronGun createElectronGun() {
        PencilBeam beam = new PencilBeam();

        beam.setBeamEnergy(getBeamEnergy());
        beam.setCenter(new double[] { 0.0, 0.0,
                0.99 * MonteCarloSS.ChamberRadius });
        beam.setDirection(new double[] { 0.0, 0.0, 1.0 });

        return beam;
    }
View Full Code Here


    public void testPENCIL() throws IOException, EPQException {
        Element element = createPencilBeamElement();

        BeamExtractor extractor = BeamExtractorFactory.PENCIL;

        PencilBeam beam = (PencilBeam) extractor.extract(element);
        assertEquals(1234, FromSI.eV(beam.getBeamEnergy()), 1e-4);
        assertEquals(0.01, beam.getCenter()[0], 1e-4);
        assertEquals(0.02, beam.getCenter()[1], 1e-4);
        assertEquals(0.03, beam.getCenter()[2], 1e-4);
        assertEquals(4, beam.getDirection()[0], 1e-4);
        assertEquals(5, beam.getDirection()[1], 1e-4);
        assertEquals(6, beam.getDirection()[2], 1e-4);
    }
View Full Code Here

    protected static class PencilBeamExtractor implements BeamExtractor {

        @Override
        public ElectronGun extract(Element beamElement) throws IOException,
                EPQException {
            PencilBeam beam = new PencilBeam();

            beam.setBeamEnergy(ToSI.eV(extractBeamEnergy(beamElement)));
            beam.setCenter(extractCenter(beamElement));
            beam.setDirection(extractDirection(beamElement));

            return beam;
        }
View Full Code Here

    @Test
    public void testGetMonteCarloSS() {
        MonteCarloSS mcss = extractor.getMonteCarloSS();

        // Beam
        PencilBeam beam = (PencilBeam) mcss.getElectronGun();

        assertEquals(1234, FromSI.eV(beam.getBeamEnergy()), 1e-4);
        assertEquals(0.01, beam.getCenter()[0], 1e-4);
        assertEquals(0.02, beam.getCenter()[1], 1e-4);
        assertEquals(0.03, beam.getCenter()[2], 1e-4);
        assertEquals(4, beam.getDirection()[0], 1e-4);
        assertEquals(5, beam.getDirection()[1], 1e-4);
        assertEquals(6, beam.getDirection()[2], 1e-4);

        // Geometry
        Region chamber = mcss.getChamber();

        assertEquals(1, chamber.getSubRegions().size());
View Full Code Here

TOP

Related Classes of pymontecarlo.program.nistmonte.options.beam.PencilBeam

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.