getfile.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 from __future__ import print_function
4 import sys
5 import samweb_cli
6 
7 samweb = samweb_cli.SAMWebClient(experiment='dune')
8 
9 files = samweb.listFiles("run_number %s " % (sys.argv[1]) + "and run_type protodune-sp and data_tier raw")
10 
11 #print files
12 for file in files:
13  #print file
14  events = samweb.getURL('/files/metadata/event_numbers', {'file_name': file}).json()
15  if int(sys.argv[2]) in events :
16  print (file, '--nskip',events.index(int(sys.argv[2])))
17