How to Access Files in SAM

To setup SAM:
> kinit
> kx509
> setup sam_web_client

To setup IFDH commands:
> setup ifdhc v1_6_2

To fetch one file from SAM using the file name:
> ifdh_fetch -e lbne filename

 For example:
<> ifdh_fetch -e lbne v35t_r0000101_s0001_test_raw.root
found file on enstore, using dcache gridftp
doing: ifdh cp gsi ./v35t_r0000101_s0001_test_raw.root

<> ls *.root

To get all files from a dataset definition:
(you can use my script /lbne/app/users/qzli/dhtools/
> /lbne/app/users/qzli/dhtools/ definition-name destination-location

I strongly suggest you first check how many files are in this dataset definition to
make sure you have enough disk space in your destination area before you get these files.

  For example:
<> samweb -e lbne count-files "defname:singleparticle-test" 
<> /lbne/app/users/qzli/dhtools/ singleparticle-test /scratch/lbne/qzli/files/
Project name is qzli_singleparticle-test_20141203120539
Project URL is
<> ls /scratch/lbne/qzli/files/
35T_singleparticle_piplus_01.root  35T_singleparticle_proton_01.root