[BLAST_ANAWARE] putting user options in scripts based on init.C

From: Chris Crawford (chris2@lns.mit.edu)
Date: Mon Apr 05 2004 - 14:26:31 EDT


hi,
  here are a couple of examples of scripts with options that you can set
from the command-line. note that string arguments are automatically
quoted in init.C; however you may need quotes so that the shell parses
the string as one word/token.
--chris


// root example1.C +i -j x=2 ... y='hello world' z=alt
{
  // user option default values set before call to init.C
  bool i=false, j=true;
  int x=5;
  TString y="default";
  char* z;
  TString alt="alternative";

  gROOT->ProcessLine(".x flr.C");
  printf("i=%d, j=%d, x=%d, y=%s, z=%s\n", i,j,x,y.Data(),z);
}


// root example2.C +i -j x=2 ... y='hello world' z=alt
#include "/home/daq/blast/pro2004/analysis/utils/init.C"

// user option default values set before call to init.C
bool i=false, j=true;
int x=5;
TString y="default";
char* z;
char* alt="alternative";

void example2()
{
  gEnv->SetValue("ntuple", "flr");
  init(); // note: init("flr") can't be overriden in command-line
  printf("i=%d, j=%d, x=%d, y=%s, z=%s\n", i,j,x,y.Data(),z);
}



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:30 EST