Project

General

Profile

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:
<lbnegpvm02.fnal.gov> ifdh_fetch -e lbne v35t_r0000101_s0001_test_raw.root
found file on enstore, using dcache gridftp
doing: ifdh cp gsiftp://fndca1.fnal.gov:2811/test-data/lbne/raw/00/00/69/00/v35t_r0000101_s0001_test_raw.root ./v35t_r0000101_s0001_test_raw.root

<lbnegpvm02.fnal.gov> ls *.root
v35t_r0000101_s0001_test_raw.root
<lbnegpvm02.fnal.gov>

To get all files from a dataset definition:
(you can use my script /lbne/app/users/qzli/dhtools/get_files.py)
> /lbne/app/users/qzli/dhtools/get_files.py 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:
<lbnegpvm02.fnal.gov> samweb -e lbne count-files "defname:singleparticle-test" 
2
<lbnegpvm02.fnal.gov> /lbne/app/users/qzli/dhtools/get_files.py singleparticle-test /scratch/lbne/qzli/files/
Project name is qzli_singleparticle-test_20141203120539
Project URL is http://samweb.fnal.gov:8480/sam/lbne/api/running/projects/lbne/qzli_singleparticle-test_20141203120539
...
<lbnegpvm02.fnal.gov> ls /scratch/lbne/qzli/files/
35T_singleparticle_piplus_01.root  35T_singleparticle_proton_01.root
<lbnegpvm02.fnal.gov>