Package gov.nist.microanalysis.NISTMonte

Examples of gov.nist.microanalysis.NISTMonte.MonteCarloSS


        OptionsExtractor extractor = new OptionsExtractor();
        extractor.extract(rootElement);

        // Create simulation
        String name = extractor.getName();
        MonteCarloSS mcss = extractor.getMonteCarloSS();
        Map<String, Detector> detectors = extractor.getDetectors();
        Set<Limit> limits = extractor.getLimits();
        Strategy strategy = extractor.getStrategy();

        // Setup detectors
        report(0.0, "Setup detectors");
        setupDetectors(mcss, detectors.values(), strategy);

        // Register limits and get the number of showers
        report(0.0, "Setup limits");
        int showers = setupLimits(mcss, limits);

        // Apply models' strategy
        report(0.0, "Setup models");
        AlgorithmUser.applyGlobalOverride(strategy);

        // Run
        report(0.0, "Running showers");

        for (Detector det : detectors.values())
            det.reset();

        for (int n = 0; n < showers; n++) {
            report((double) n / showers, "Running showers");
            mcss.runTrajectory();
        }

        // Save results
        report(1.0, "Saving results");
        HDF5Group rootGroup =
View Full Code Here


    @Before
    public void setUp() throws Exception {
        det = new TrajectoryDetector(false);
        resultsFile = createTempFile("h5");

        MonteCarloSS mcss = getMonteCarloSS();
        det.setup(mcss);

        mcss.runTrajectory();
    }
View Full Code Here

    @Before
    public void setUp() throws Exception {
        det = new PhiZDetector(getDetectorPosition(), 100);
        resultsFile = createTempFile("h5");

        MonteCarloSS mcss = getMonteCarloSS();
        XRayTransport3 charac = getCharacteristicTransport(mcss);
        XRayTransport3 bremss = getBremmstrahlungTransport(mcss);
        XRayTransport3 characFluo =
                getCharacteristicFluoTransport(mcss, charac);
        XRayTransport3 bremssFluo =
                getBremmstrahlungFluoTransport(mcss, bremss);
        det.setup(mcss, charac, bremss, characFluo, bremssFluo);

        mcss.runTrajectory();
    }
View Full Code Here


    @Override
    public void actionPerformed(ActionEvent e) {
        super.actionPerformed(e);
        final MonteCarloSS mcss = (MonteCarloSS) e.getSource();

        Trajectory trajectory;
        switch (e.getID()) {
        case MonteCarloSS.TrajectoryStartEvent:
            trajectory = new Trajectory(true, -1);
            saveTrajectoryInteraction(trajectory, mcss.getElectron());
            cachedTrajectories.push(trajectory);
            break;
        case MonteCarloSS.StartSecondaryEvent:
            trajectory = new Trajectory(false, 3); // Hard inelastic
            saveTrajectoryInteraction(trajectory, mcss.getElectron());
            cachedTrajectories.push(trajectory);
            break;
        case MonteCarloSS.EndSecondaryEvent:
        case MonteCarloSS.TrajectoryEndEvent:
            trajectory = cachedTrajectories.pop();
            if (!trajectory.primary && !secondary) // Do not record secondary
                break;

            if (trajectory.exitState < 0)
                trajectory.exitState = 3; // Absorbed

            trajectories.add(trajectory);
            break;
        case MonteCarloSS.ScatterEvent:
            trajectory = cachedTrajectories.peek();
            saveTrajectoryInteraction(trajectory, mcss.getElectron());
            break;
        case MonteCarloSS.BackscatterEvent:
            trajectory = cachedTrajectories.peek();
            trajectory.exitState = 2; // Backscattered
            // TODO: Should also check for transmitted
View Full Code Here

    @Before
    public void setUp() throws Exception {
        det = new TimeDetector();
        resultsFile = createTempFile("h5");

        MonteCarloSS mcss = getMonteCarloSS();
        det.setup(mcss);

        mcss.runTrajectory();
    }
View Full Code Here

    @Before
    public void setUp() throws Exception {
        det = new PhotonIntensityDetector(getDetectorPosition());
        resultsFile = createTempFile("zip");

        MonteCarloSS mcss = getMonteCarloSS();
        XRayTransport3 charac = getCharacteristicTransport(mcss);
        XRayTransport3 bremss = getBremmstrahlungTransport(mcss);
        XRayTransport3 characFluo =
                getCharacteristicFluoTransport(mcss, charac);
        XRayTransport3 bremssFluo =
                getBremmstrahlungFluoTransport(mcss, bremss);
        det.setup(mcss, charac, bremss, characFluo, bremssFluo);

        mcss.runTrajectory();
    }
View Full Code Here



    @Test
    public void testFindAllXRayTransitions() throws Exception {
        MonteCarloSS mcss = getMonteCarloSS();
        new Region(mcss.getChamber(),
                new BasicMaterialModel(
                        MaterialFactory.createPureElement(Element.Au)),
                MultiPlaneShape.createSubstrate(Math2.Z_AXIS,
                        Math2.ORIGIN_3D));
View Full Code Here

    }



    public MonteCarloSS getMonteCarloSS() throws EPQException {
        MonteCarloSS mcss = createMonteCarloSS();

        ElectronGun beam = createElectronGun();
        mcss.setBeamEnergy(beam.getBeamEnergy());
        mcss.setElectronGun(beam);

        createGeometry(mcss.getChamber());

        return mcss;
    }
View Full Code Here

    }



    protected MonteCarloSS createMonteCarloSS() {
        return new MonteCarloSS();
    }
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());
        RegionBase region = chamber.getSubRegions().get(0);

        IMaterialScatterModel model = region.getScatterModel();
View Full Code Here

TOP

Related Classes of gov.nist.microanalysis.NISTMonte.MonteCarloSS

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.