Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/sh

if [ "$#" == "1" ]; then
  file=$1
else
  echo "Usage: cmsbrowse [root_file]"
  exit
fi

cat <<EOF >| /tmp/cmsbrowse_tmp.C
{
      gSystem->Load("$CMSSW_RELEASE_BASE/lib/$SCRAM_ARCH/libFWCoreFWLite.so");
      FWLiteEnabler::enable();
      hfile = new TFile("${file}","READONLY");
      new TBrowser("CMS Browser",hfile);
}
EOF

root -l /tmp/cmsbrowse_tmp.C