Working with SAMweb definitions - twongjirad/LArLiteSoftCookBook GitHub Wiki

The Answers

(Note, you need to setup these tools. The quickest way is to setup a uboonecode environment. SAM tools are setup.)

  • Look up date ranges

    samweb list-files "start_time> '2015-10-29T22:53:40-05:00' and start_time < '2015-10-29T22:54:40-05:00'"
    
  • Look up ran number X

    samweb list-files "run_number X"
    
  • Of course the file lists don't show up in order. If this bothers you

    samweb list-files "run_number X" | sort
    
  • partition an existing samweb definition into smaller pieces (this example is 3 parts)

    samweb create-definition ${USER}_prod_reco2_extbnb_v8_mcc8_part0 “defname: prod_reco2_extbnb_v8_mcc8 with stride 3 offset 0”
    samweb create-definition ${USER}_prod_reco2_extbnb_v8_mcc8_part0 “defname: prod_reco2_extbnb_v8_mcc8 with stride 3 offset 1”
    samweb create-definition ${USER}_prod_reco2_extbnb_v8_mcc8_part0 “defname: prod_reco2_extbnb_v8_mcc8 with stride 3 offset 2”
    
  • compose a definition from a list of file names (names are the unique filenames already stored in SAM)

     samweb create-definition ${USER}_blerg_blah "file_name file1,file2,file3,..."
    
  • pre-stage a dataset

     samweb prestage-dataset --defname=[definition name]
    

Website to create/edit data definitions

[Defintion Editor] (http://samweb.fnal.gov:8480/sam/uboone/definition_editor/)

Tips:

Pick out raw binary only:

file_format = binaryraw-uncompressed

Merged EXT+BNB events (swizzled):

ub_project.stage=mergeext_bnb

Merged BNB events (swizzeld):

ub_project.stage=mergebnb

Reco1 files:

ub_project.stage=reco1

How to make a file list with file locations (for use in project.py)

(note we will use files for run 3170 as an example)

  • First list the files: samweb list-files "run_number 3170"

  • Then pick one file at random and get it's location: samweb locate-file "PhysicsRun-2015_10_4_10_7_54-0003170-00312.ubdaq"

  • Now make a sorted file list with the folder

      samweb list-files "run_number 3170" | sort | awk '{print "/pnfs/uboone/data/uboone/raw/online/assembler/v6_00_00/00/00/31/70/"$0}' > filelist_run3170.txt
    

How to get file meta data

Example

samweb get-metadata PhysicsRun-2016_2_23_17_14_14-0005121-00004_20160224T073553_ext_bnb_20160224T215538_merged_20160411T145529_reco1_20160412T111133_reco2.root

Returns

         File Name: PhysicsRun-2016_2_23_17_14_14-0005121-00004_20160224T073553_ext_bnb_20160224T215538_merged_20160411T145529_reco1_20160412T111133_reco2.root                      
           File Id: 8723440
       Create Date: 2016-04-12T12:10:19+00:00
              User: uboonepro
         File Type: data
       File Format: artroot
         File Size: 9385593090
          Checksum: enstore:2906646635
    Content Status: good
             Group: uboone
         Data Tier: reconstructed
       Application: art dataapr2016recostage2 v05_08_00
       Event Count: 99
       First Event: 2
        Last Event: 244
        Start Time: 2016-04-12T08:43:36+00:00
          End Time: 2016-04-12T11:11:33+00:00
          fcl.name: reco_uboone_data_Feb2016_driver_stage2.fcl
       fcl.version: v05_08_00
   ub_project.name: reco_outextbnb
  ub_project.stage: reco2
ub_project.version: prod_v05_08_00
              Runs: 5121.0004 (physics)
                    5121.0003 (physics)
                    5121.0002 (physics)
                    5121.0001 (physics)
                    5121.0000 (physics)
            Parents: PhysicsRun-2016_2_23_17_14_14-0005121-00004_20160224T073553_ext_bnb_20160224T215538_merged_20160411T145529_reco1.root

Reference

https://cdcvs.fnal.gov/redmine/projects/sam/wiki/User_Guide_for_SAM