lcsim/src/org/lcsim/util/aida
diff -u -r1.4 -r1.5
--- AIDA.java 26 Aug 2005 08:23:26 -0000 1.4
+++ AIDA.java 20 Feb 2006 22:02:04 -0000 1.5
@@ -42,13 +42,13 @@
private IHistogramFactory hf;
private File tempFile;
private static AIDA defaultInstance;
-
+
public static AIDA defaultInstance()
{
if (defaultInstance == null) defaultInstance = new AIDA();
return defaultInstance;
}
-
+
private AIDA()
{
try
@@ -58,7 +58,7 @@
af = IAnalysisFactory.create();
tree = af.createTreeFactory().create(tempFile.getAbsolutePath(),"xml",false,true);
hf = af.createHistogramFactory(tree);
-
+
Application app = Application.getApplication();
if (app instanceof Studio)
{
@@ -76,12 +76,12 @@
int pos = path.lastIndexOf('/');
if (pos > 0) tree.mkdirs(path.substring(0, pos));
}
-
+
public ICloud1D cloud1D(String path)
{
return cloud1D(path, defMax);
}
-
+
public ICloud1D cloud1D(String path, int nMax)
{
try
@@ -96,12 +96,12 @@
return hf.createCloud1D(path, path, nMax);
}
}
-
+
public ICloud2D cloud2D(String path)
{
return cloud2D(path, defMax);
}
-
+
public ICloud2D cloud2D(String path, int nMax)
{
try
@@ -116,12 +116,12 @@
return hf.createCloud2D(path, path, nMax);
}
}
-
+
public ICloud3D cloud3D(String path)
{
return cloud3D(path, defMax);
}
-
+
public ICloud3D cloud3D(String path, int nMax)
{
try
@@ -136,14 +136,14 @@
return hf.createCloud3D(path, path, nMax);
}
}
-
+
public IHistogram1D histogram1D(String path)
{
IManagedObject obj = tree.find(path);
if (obj instanceof IHistogram1D) return (IHistogram1D) obj;
throw new RuntimeException(path +" is not a IHistogram1D");
}
-
+
public IHistogram1D histogram1D(String path, int bins, double lowerEdge, double upperEdge)
{
try
@@ -158,14 +158,14 @@
return hf.createHistogram1D(path, bins, lowerEdge, upperEdge);
}
}
-
+
public IHistogram2D histogram2D(String path)
{
IManagedObject obj = tree.find(path);
if (obj instanceof IHistogram2D) return (IHistogram2D) obj;
throw new RuntimeException(path +" is not a IHistogram2D");
}
-
+
public IHistogram2D histogram2D(String path, int nBinsX, double lowerEdgeX, double upperEdgeX, int nBinsY, double lowerEdgeY, double upperEdgeY)
{
try
@@ -180,14 +180,14 @@
return hf.createHistogram2D(path, nBinsX, lowerEdgeX, upperEdgeX, nBinsY, lowerEdgeY, upperEdgeY);
}
}
-
+
public IHistogram3D histogram3D(String path)
{
IManagedObject obj = tree.find(path);
if (obj instanceof IHistogram3D) return (IHistogram3D) obj;
throw new RuntimeException(path +" is not a IHistogram3D");
}
-
+
public IHistogram3D histogram3D(String path, int nBinsX, double lowerEdgeX, double upperEdgeX, int nBinsY, double lowerEdgeY, double upperEdgeY, int nBinsZ, double lowerEdgeZ, double upperEdgeZ)
{
try
@@ -201,21 +201,21 @@
checkPath(path);
return hf.createHistogram3D(path, nBinsX, lowerEdgeX, upperEdgeX, nBinsY, lowerEdgeY, upperEdgeY, nBinsZ, lowerEdgeZ, upperEdgeZ);
}
-
+
}
-
+
public IHistogramFactory histogramFactory()
{
return hf;
}
-
+
public IProfile1D profile1D(String path)
{
IManagedObject obj = tree.find(path);
if (obj instanceof IProfile1D) return (IProfile1D) obj;
throw new RuntimeException(path +" is not a IProfile1D");
}
-
+
public IProfile1D profile1D(String path, int nBins, double lowerEdge, double upperEdge)
{
try
@@ -230,14 +230,14 @@
return hf.createProfile1D(path, nBins, lowerEdge, upperEdge);
}
}
-
+
public IProfile2D profile2D(String path)
{
IManagedObject obj = tree.find(path);
if (obj instanceof IProfile2D) return (IProfile2D) obj;
throw new RuntimeException(path +" is not a IProfile2D");
}
-
+
public IProfile2D profile2D(String path, int nBinsX, double lowerEdgeX, double upperEdgeX, int nBinsY, double lowerEdgeY, double upperEdgeY)
{
try
@@ -252,17 +252,17 @@
return hf.createProfile2D(path, nBinsX, lowerEdgeX, upperEdgeX, nBinsY, lowerEdgeY, upperEdgeY);
}
}
-
+
public IAnalysisFactory analysisFactory()
{
return af;
}
-
+
public ITree tree()
{
return tree;
}
-
+
public void saveAs(String name) throws IOException
{
tree.commit();
@@ -298,7 +298,7 @@
super(message,cause);
}
}
- void clearAll()
+ public void clearAll()
{
String[] type = tree.listObjectNames("/",true);
for (int i=0; i<type.length; i++)
@@ -329,4 +329,4 @@
}
}
}
-}
\ No newline at end of file
+}