) ############################### # Create some 4-vectors ############################### from AthExThinning.AthExThinningAlgsConf import AthExThinning__CreateData topSequence += AthExThinning__CreateData("CreateData", ParticlesOutput="Particles", NbrOfParticles=10, OutputLevel=DEBUG) #--------------------------------------------------------------- # Pool Persistency #--------------------------------------------------------------- import AthenaPoolCnvSvc.WriteAthenaPool as wap outStream = wap.AthenaPoolOutputStream("StreamUSR", noTag=True) outStream.ItemList = ["EventInfo#*"] outStream.ItemList += ["AthExParticles#*"] outStream.ItemList += ["AthExDecay#*"] outStream.ItemList += ["AthExElephantino#*"] if not 'OUTPUT' in dir(): OUTPUT = "my.data.pool" pass outStream.OutputFile = OUTPUT svcMgr += CfgMgr.MessageSvc(defaultLimit=4000000) #svcMgr.MessageSvc.OutputLevel = ERROR #============================================================== #
def _copy_file_impl(cfg, hints): cfg = _read_file_impl(cfg, hints=hints) # now try to configure the writing... # get the file infos import PyUtils.AthFile af = PyUtils.AthFile.fopen(cfg.input_files[0]) stream_names = af.infos['stream_names'] if stream_names is None: stream_names = [] def any_startswith(pattern, lst): return any(map(lambda x: x.startswith(pattern), lst)) dst = cfg.output_file if af.infos['file_type'] == 'pool': do_write = None if (cfg.is_rdo() or cfg.is_esd() or cfg.is_aod() or cfg.is_tag()): if cfg.is_rdo(): do_write = 'RDO' if hints.get('writeBS', False): do_write = 'BS' cfg.acf['BSRDOOutput'] = dst else: cfg.acf['PoolRDOOutput'] = dst elif cfg.is_esd(): do_write = 'ESD' cfg.acf['PoolESDOutput'] = dst elif cfg.is_aod(): do_write = 'AOD' cfg.acf['PoolAODOutput'] = dst elif cfg.is_tag(): do_write = 'TAG' cfg.acf['PoolTAGOutput'] = dst else: raise RuntimeError('logic error') else: #if cfg.is_evgen(): # FIXME - create an outputstream with the same stream name # - configure it correctly import AthenaPoolCnvSvc.WriteAthenaPool as wap outstream = wap.AthenaPoolOutputStream(af.infos['stream_names'][0], dst) outstream.ForceRead = True outstream.TakeItemsFromInput = True ## tweak the default commit interval from AthenaCommon.AppMgr import ServiceMgr as svcMgr svcMgr.AthenaPoolCnvSvc.CommitInterval = 100 pass if do_write is not None: try: cfg.rec["doWrite" + do_write] = True except AttributeError: cfg.msg.info(err) pass pass else: # a bytestream do_write = None assert cfg.is_rdo() do_write = 'RDO' if hints.get('writeBS', False): do_write = 'BS' cfg.acf['BSRDOOutput'] = dst else: cfg.acf['PoolRDOOutput'] = dst try: cfg.rec["doWrite" + do_write] = True except AttributeError: cfg.msg.info(err) pass pass return cfg
##################################################### # ReadThinnedData # --> read "swiss" DataVector ##################################################### from AthExThinning.AthExThinningAlgsConf import AthExThinning__ReadThinnedData topSequence += AthExThinning__ReadThinnedData("ReadThinnedData", Particles="Particles", Decay="TwoBodyDecay", Elephantino="PinkElephantino", OutputLevel=DEBUG) #-------------------------------------------------------------- # POOL Persistency #-------------------------------------------------------------- import AthenaPoolCnvSvc.WriteAthenaPool as wap outStream = wap.AthenaPoolOutputStream("StreamUSR") if 'OUTPUT' not in dir(): OUTPUT = "reaccessed.%s" % INPUT[0] svcMgr.PoolSvc.CheckDictionary = True # Stream's output file outStream.OutputFile = OUTPUT # Event Info outStream.ItemList = ["EventInfo#*"] outStream.ItemList += ["AthExParticles#*"] outStream.ItemList += ["AthExDecay#*"] outStream.ItemList += ["AthExElephantino#*"] svcMgr.AthenaPoolCnvSvc.CommitInterval = 10