Adapting IDL For HEP Analysis

Jeff Kallenbach

Irwin Gaines

April 13, 1999

IDL

Adapting IDL For HEP Analysis

IDL access to external data

IDL external data access - Callable IDL

IDL external data access - LINKIMAGE

IDL external data access - DLMís

General approach to HBOOK/IDL

Writing a ht2IDL function - headers

#include <stdio.h>

#include "export.h"

#include "HepTuple/HepHBookNtuple.h"

#include "HepTuple/HepNtuple.h"

ZM_USING_NAMESPACE( zmht )

#include "ZMutility/iostream"

#include <cmath>

#include "ZMutility/fstream"

USING( namespace std );

/*

* Here's the code to fix the name mangling by KCC

*/

// First are the name twists of the original functions

IDL_VPTR htDir_( int argc, IDL_VPTR argv[] );

// Shells declared with "external C"

extern "C" {

IDL_VPTR htDir(int argc, IDL_VPTR argv[]);

}

Writing a ht2IDL function - interface

IDL_VPTR htDir_( int argc, IDL_VPTR argv[] ) {

//

// DLM processing

//

IDL_VPTR dst, src;

IDL_LONG outDim[IDL_MAX_ARRAY_DIM];

char *fileName;

src = argv[0];

fileName = src->value.str.s;

char *varName;

IDL_STRING *dst_d;

//

// Heptuple initialization

//

HepFileManager* manager = new HepHBookFileManager(fileName);

HepFileManager::ItemList myItemList = manager->list("","N");

HepFileManager::ItemList::iterator myIter = myItemList.begin();

Writing a ht2IDL function - processing

HepNtuple& hep = manager->retrieveNtuple(((*myIter).title).c_str(),0);

int nCols = hep.nColumns();

outDim[0] = nCols;

dst_d = (IDL_STRING *) IDL_MakeTempArray

(IDL_TYP_STRING,1,outDim,IDL_BARR_INI_NOP,&dst);

for (int k=0; k<nCols; k++) {

strcpy(varName,(hep.nametag(k)).c_str());

IDL_StrStore(dst_d,varName);

dst_d++;

}

hep.release();

delete manager;

return (dst);

}

ht2IDL.dlm - module description file

MODULE ht2IDL

DESCRIPTION Get Data from Heptuple to IDL

VERSION 1.0

SOURCE Research Systems, Inc.

BUILD_DATE APR 8 1998

FUNCTION HTGETVAR 2 2

FUNCTION HTDIR 1 1

FUNCTION HTGETFCOLS 2 2

FUNCTION HTGETICOLS 2 2

FUNCTION HTGETBLOCK 3 3

Using a ht2IDL function

fnpat1 - 21 >idl

IDL Version 5.1 (IRIX mipseb). Research Systems, Inc.

Installation number: 93168-0.

Licensed for use by: Fermilab

For basic information, enter "IDLInfo" at the IDL> prompt.

IDL> print,htDir("d3_10999.nhis")

% Loaded DLM: HT2IDL.

BLOB3::AIso1 BLOB3::AIso2 BLOB3::AIso3 BLOB3::Clbesto BLOB3::Clsec BLOB3::Dmom

BLOB3::Dstarta BLOB3::El BLOB3::Elsig BLOB3::Ievento BLOB3::Irunno

BLOB3::Ispillo BLOB3::Istacer BLOB3::Itrax BLOB3::Itri BLOB3::Laskimw

BLOB3::Micto BLOB3::Mode BLOB3::Mulprim BLOB3::PPX5 BLOB3::PPY5 BLOB3::PPZ5

BLOB3::Rmass BLOB3::Rmerr BLOB3::Wobba BLOB3::Xprim BLOB3::Xsec BLOB3::Yprim

BLOB3::Ysec BLOB3::Zout BLOB3::Zprim BLOB3::Zsec

ht2IDL results

ht2IDL Status

Observations on IDL - Good news

Observations on IDL - The problems

The many uses of IDL
IDL uses in Engineering Test & Analysis

Who Else Uses IDL?

NASA Jet Propulsion Lab. (JPL)

NOAA Lawrence Livermore National Lab.

NCAR Los Alamos National Lab.

CSIRO US Geological Survey

3M Corp. Abbott Labs

Ford Motor Comp. Hughes Aircraft

Naval Research Labs Barrick Exploration

G.E. Medical Systems Chinese Academy of Sciences

Unilever Max Planck

And thousands more!

The Near Future