Restore histograms from XML using Jaida
Code: "jaida_Restore.java". Programming language: Java DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/jaida_Restore_5547.java
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.



import hep.aida.*;
import java.util.Random;
import java.io.IOException;

public class jaida_Restore 
{
   public static void main(String[] argv) throws IOException
   {
      IAnalysisFactory af = IAnalysisFactory.create();
      ITree tree = af.createTreeFactory().create("myFile.aida","xml");
      
      IHistogram1D h1d = (IHistogram1D) tree.find("test 1d");
      IHistogram2D h2d = (IHistogram2D) tree.find("test 2d");
      
      IPlotter plotter = af.createPlotterFactory().create("Test");
      plotter.createRegions(2,1);
      plotter.region(0).plot(h1d);
      plotter.region(1).plot(h2d);
      plotter.show();
   }
}

You see the box below because you did not login.