Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 08:39:16

0001 #!/usr/bin/env python
0002 # Licensed under the Apache License, Version 2.0 (the "License");
0003 # you may not use this file except in compliance with the License.
0004 # You may obtain a copy of the License at
0005 # http://www.apache.org/licenses/LICENSE-2.0
0006 #
0007 # Authors:
0008 # - Paul Nilsson, paul.nilsson@cern.ch, 2018
0009 
0010 # This script shows how to use the Data API stage-in client to download a file from storage
0011 
0012 from pilot.api import data
0013 from pilot.info import InfoService, FileSpec, infosys
0014 
0015 # Without infosys initialization:
0016 
0017 client = data.StageInClient()
0018 files = [{'scope': 'mc16_13TeV', 'lfn': 'EVNT.11320990._003958.pool.root.1', 'workdir': '.',
0019           'ddmendpoint': 'RRC-KI-T1_DATADISK'}]
0020 xfiles = [FileSpec(type='input', **f) for f in files]
0021 r = client.transfer(xfiles)
0022 
0023 # With infosys initialization:
0024 
0025 infoservice = InfoService()
0026 infoservice.init('ANALY_CERN', infosys.confinfo, infosys.extinfo)
0027 
0028 client = data.StageInClient(infoservice)
0029 files = [{'scope': 'mc16_13TeV', 'lfn': 'EVNT.11320990._003958.pool.root.1', 'workdir': '.'}]
0030 xfiles = [FileSpec(type='input', **f) for f in files]
0031 r = client.transfer(xfiles)