def setData ( files , catalogs = [] ) : """ Define the input data for the job: >>> files = [ 'file1.dst' , 'file2.dst' ] >>> catalogs = .... >>> import USERSCRIPT >>> USERSCRIPT.setData ( files , catalogs ) """ from GaudiPython.Bindings import _gaudi if type ( files ) is str : files = [ files ] elif type ( files ) is tuple : files = list ( files ) if type ( catalogs ) is str : catalogs = [ catalogs ] elif type ( catalogs ) is tuple : catalogs = list ( catalogs ) if not issubclass ( type ( files ) , list ) : files = [ f for f in files ] if not issubclass ( type ( catalogs ) , list ) : catalogs = [ c for c in catalogs ] if not _gaudi : ## here we deal with configurables! if files : files = [ extendfile ( f ) for f in files ] from Gaudi.Configuration import EventSelector EventSelector ( Input = files ) if catalogs : from Gaudi.Configuration import Gaudi__MultiFileCatalog as FileCatalog FileCatalog ( Catalogs = catalogs ) from Gaudi.Configuration import FileCatalog FileCatalog ( Catalogs = catalogs ) else : ## here we deal with the actual components if files : _e = _gaudi.evtSel() _e.open ( files ) if catalogs : _f = _gaudi.service ( 'FileCatalog' ) _f.Catalogs = catalogs
'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0024/00051872_00249151_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0024/00051872_00249152_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00251186_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00251235_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00251236_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00251334_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00251335_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00251941_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00251942_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00253726_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00254458_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00254800_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00254801_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00254802_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00255482_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0025/00051872_00258747_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0026/00051872_00261982_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0026/00051872_00262415_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0026/00051872_00263615_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0029/00051872_00297315_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0031/00051872_00310060_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0031/00051872_00315597_1.rdst', 'LFN:/lhcb/LHCb/Collision16/RDST/00051872/0031/00051872_00318985_1.rdst', ], clear=True) from Gaudi.Configuration import FileCatalog FileCatalog().Catalogs += [ 'xmlcatalog_file:$STRIPPINGSELECTIONSROOT/tests/data/Reco16_Run179101.xml' ]
from GaudiKernel.ProcessJobOptions import importOptions #importOptions("$APPCONFIGOPTS/Brunel/earlyData.py") from Configurables import (Escher, LHCbApp, ApplicationMgr, NTupleSvc, ATrackSelector) from Gaudi.Configuration import FileCatalog, EventSelector #-- File catalogs. First one is read-write FileCatalog().Catalogs = ["xmlcatalog_file:MyCatalog.xml"] Escher().DataType = "2011" Escher().Simulation = False Escher().InputType = "MDF" #Escher().InputType = "DST" #-- Use latest 2009 database tags for real data #LHCbApp().DDDBtag = "head-20090330" #LHCbApp().CondDBtag = "head-20090402" LHCbApp().DDDBtag = "default" LHCbApp().CondDBtag = "default" #LHCbApp().DDDBtag = "HEAD" #LHCbApp().CondDBtag = "HEAD" LHCbApp().DDDBtag = 'head-20110823' LHCbApp().CondDBtag = 'head-20110901' from Configurables import (CondDB, CondDBAccessSvc) cdb = CondDB() #cdb.PartitionConnectionString["ONLINE"] = "sqlite_file:/afs/cern.ch/user/w/wouter/public/AlignDB/ONLINE-201103.db/ONLINE" #cdb.Tags["ONLINE"] = "fake"
from Gaudi.Configuration import FileCatalog FileCatalog().Catalogs += [ 'xmlcatalog_file:/home/ppe/m/malexander/projects/hhpi0/DaVinciDev_v45r3/AGammaD0Tohhpi0/options/data/mc/pipipi0_DecProdCut_Dalitz_2016_MC_2016_Beam6500GeV-2016-MagUp-Nu1.6-25ns-Pythia8_Sim09c_Trig0x6138160F_Reco16_Turbo03_Stripping28r1NoPrescalingFlagged_27163404_ALLSTREAMS.DST_catalog.xml' ]
from Gaudi.Configuration import FileCatalog FileCatalog().Catalogs += [ 'xmlcatalog_file:/home/ppe/m/malexander/projects/hhpi0/DaVinciDev_v45r3/AGammaD0Tohhpi0/options/data/mc/pipipi0_DecProdCut_PHSP_2012_MC_2012_Beam4000GeV-2012-MagUp-Nu2.5-Pythia8_Sim08e_Digi13_Trig0x409f0045_Reco14a_Stripping20r0p2NoPrescalingFlagged_27163403_ALLSTREAMS.DST_catalog.xml' ]
def setData(files, catalogs=[], castor=False, grid=None): """ Define the input data for Bender job: >>> files = [ 'file1.dst' , 'file2.dst' ] >>> catalogs = .... >>> import USERSCRIPT >>> USERSCRIPT.setData ( files , catalogs ) """ if type(files) is str: files = [files] elif type(files) is tuple: files = list(files) if type(catalogs) is str: catalogs = [catalogs] elif type(catalogs) is tuple: catalogs = list(catalogs) if not issubclass(type(files), list): files = [f for f in files] if not issubclass(type(catalogs), list): catalogs = [c for c in catalogs] from GaudiPython.Bindings import _gaudi if not _gaudi: ## here we deal with configurables! from Configurables import Gaudi__RootCnvSvc rcnv = Gaudi__RootCnvSvc('RootCnvSvc') rcnv.CacheBranches = [] rcnv.VetoBranches = ['*'] if files: from Bender.DataUtils import extendfile2 files = [extendfile2(f, castor, grid) for f in files] from Gaudi.Configuration import EventSelector inpts = EventSelector().Input inpts += files EventSelector(Input=inpts) if catalogs: from Gaudi.Configuration import Gaudi__MultiFileCatalog as FileCatalog ctlgs = FileCatalog().Catalogs cc = [] for c in catalogs: if c in cc: continue if 1 <= c.find('.xml'): import os if os.path.exists(c) or 0 != c.find('xmlcatalog_file:'): logger.debug('Prepend catalog with protocol: %s' % c) c = 'xmlcatalog_file:' + c if c in cc: continue cc.append(c) logger.debug('The catalogs: %s' % cc) ctlgs += cc FileCatalog(Catalogs=ctlgs) logger.debug('FileCatalog:\n %s' % FileCatalog()) ## from Gaudi.Configuration import FileCatalog else: ## here we deal with the actual components rcnv = _gaudi.service('Gaudi::RootCnvSvc/RootCnvSvc') rcnv.CacheBranches = [] rcnv.VetoBranches = ['*'] if files: from Bender.DataUtils import extendfile1 files = [extendfile1(f, castor) for f in files] _e = _gaudi.evtSel() _e.open(files) if catalogs: _f = _gaudi.service('FileCatalog') _f.Catalogs = catalogs
# Create an ntuple to capture D*+ decays from the StrippingLine line dtt = DecayTreeTuple('TupleDstToD0pi_D0ToKK') dtt.Inputs = ['/Event/{0}/Phys/{1}/Particles'.format(stream, line)] dtt.Decay = '[D*(2010)+ -> (D0 -> K- K+) pi+]CC' # Configure DaVinci DaVinci().UserAlgorithms += [dtt] DaVinci().InputType = 'DST' DaVinci().TupleFile = 'DVntuple.root' DaVinci().PrintFreq = 1000 DaVinci().DataType = '2016' DaVinci().Simulation = True # Only ask for luminosity information when not using simulated data DaVinci().Lumi = not DaVinci().Simulation DaVinci().EvtMax = -1 DaVinci().CondDBtag = 'sim-20161124-2-vc-md100' DaVinci().DDDBtag = 'dddb-20150724' # Use input data from the bookkeeping query with XML catalog importOptions("MC_2016_27163002_" "Beam6500GeV2016MagDownNu1.625nsPythia8_Sim09b_" "Trig0x6138160F_Reco16_Turbo03_" "Stripping28NoPrescalingFlagged_ALLSTREAMS.DST.py") FileCatalog().Catalogs = [ "xmlcatalog_file:MC_2016_27163002_" "Beam6500GeV2016MagDownNu1.625nsPythia8_Sim09b_" "Trig0x6138160F_Reco16_Turbo03_" "Stripping28NoPrescalingFlagged_ALLSTREAMS.DST.xml" ]
from Gaudi.Configuration import FileCatalog FileCatalog().Catalogs += [ 'xmlcatalog_file:/home/ppe/m/malexander/projects/hhpi0/DaVinciDev_v45r3/AGammaD0Tohhpi0/options/data/mc/pipipi0_DecProdCut_PHSP_2016_MC_2016_Beam6500GeV-2016-MagDown-Nu1.6-25ns-Pythia8_Sim09c_Trig0x6138160F_Reco16_Turbo03_Stripping28r1NoPrescalingFlagged_27163403_ALLSTREAMS.DST_catalog.xml' ]
from Gaudi.Configuration import FileCatalog from Configurables import LoKi__Hybrid__TupleTool FileCatalog().Catalogs = ["xmlcatalog_file:/afs/cern.ch/work/m/malexand//charm/2011/data/mc/pool_xml_catalog.xml"] dv.EvtMax = 1000 ttmc = dtt.addTupleTool('TupleToolMCTruth') ttmc.ToolList += ['MCTupleToolPrompt'] ttmc.ToolList += ['MCTupleToolHierarchy'] dtt.ToolList += ['TupleToolMCTruth', #'TupleToolGeneration' 'TupleToolMCBackgroundInfo' ] dtfVars = { # Index 0 for CHILDFUN meas the particle itself, so 1 is the D0. "DTF_M_D0_BPVIPCHI2" : "DTF_FUN(CHILDFUN(BPVIPCHI2(), 1), False, 'D0')" } decayDesc = dtt.Decay.replace('^', '') dtt.addBranches({'Dst' : decayDesc}) dstLoKiTuple = LoKi__Hybrid__TupleTool('DstLoKiTuple') dstLoKiTuple.Variables = dtfVars dtt.Dst.ToolList += [ "LoKi::Hybrid::TupleTool/DstLoKiTuple" ] dtt.Dst.addTool(dstLoKiTuple) dtt.Dst.InheritTools = True
from Gaudi.Configuration import FileCatalog FileCatalog().Catalogs += [ 'xmlcatalog_file:$AGAMMAD0TOHHPI0ROOT/options/data/real/RealData_2018_Charm_MagDown_catalog.xml' ]
#following lines necessary for local running! need to be omitted for batch mode from GaudiConf import IOExtension from Gaudi.Configuration import FileCatalog IOExtension().inputFiles(['13102601-HLT2.digi'],clear=True) FileCatalog().Catalogs = [ "xmlcatalog_file:NewCatalog.xml" ] # local test