Create data points as ntuples using Jaida
Source code name: "jaida_TupleCreate.java"
Programming language: Java
Topic: Data arrays/Tuple
DMelt Version 1. Last modified: 12/08/2015. License: Pro
https://datamelt.org/code/cache/jaida_TupleCreate_3163.java
To run this script using the DataMelt 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;

public class jaida_TupleCreate
{
   public static void main(String[] argv)
   {
      IAnalysisFactory af = IAnalysisFactory.create();
      ITree tree = af.createTreeFactory().create();
      ITupleFactory tf = af.createTupleFactory(tree);
      
      String[] columnNames  =
      { "iFlat = 0", " fGauss = 3.", " fFlat =-2." };
      Class[] columnClasses =
      { Integer.TYPE, Float.TYPE, Float.TYPE };
      ITuple tuple1 = tf.create( "tuple1", "tupleLabel1", columnNames, columnClasses, "");
      
      String columnString = "int iFlat=0, float fGauss = 3.; fFlat=-2.";
      ITuple tuple2 = tf.create( "tuple2", "tupleLabel1", columnString, "");
   }
}

Ads help maintain this website.