def run(input_files, output_file): ## Bit of extra configuration from GaudiConf import IOHelper IOHelper().inputFiles(input_files) HistogramPersistencySvc().OutputFile = output_file.replace('.root', '_histos.root') ## GaudiPython import GaudiPython import cppyy cppyy.load_reflection_info('libLinkerEvent') cppyy.load_reflection_info('libLinkerInstancesDict') from GaudiPython.Bindings import AppMgr appMgr = AppMgr(outputlevel = 3) appMgr.config() appMgr.HistogramPersistency = 'ROOT' ntSvc = GaudiPython.iService('NTupleSvc') ntSvc.Output = ["MATCHZERRLUN DATAFILE='{0}' OPT='NEW'".format(output_file)] from Hlt1Muons.MatchAlgo import MatchResidualAlgo match_algo = MatchResidualAlgo("MatchResidualAlgo", MatchVeloMuon = mvm.getFullName()) match_algo.NTupleLUN = 'MATCHZERRLUN' appMgr.addAlgorithm(match_algo) from Hlt1Muons.MatchAlgo import MatchChi2Algo chi2_algo = MatchChi2Algo("MatchChi2Algo", MatchVeloMuon = mvm_chi2.getFullName()) chi2_algo.NTupleLUN = 'MATCHZERRLUN' appMgr.addAlgorithm(chi2_algo) if mvm_old: chi2_algo_old = MatchChi2Algo("MatchChi2AlgoOld", MatchVeloMuon = mvm_old.getFullName()) chi2_algo_old.NTupleLUN = 'MATCHZERRLUN' appMgr.addAlgorithm(chi2_algo_old) appMgr.initialize() appMgr.run(options.nevents) appMgr.stop() appMgr.finalize() appMgr.exit()
def run(self): if lambdas == 'None': kali = firstPass( ##-- cuts and filters PtGamma=250 * MeV, ## selection cuts ## event multiplicity filter Filter= "(650. > CONTAINS('Raw/Spd/Digits')) & ( CONTAINS('Rec/Vertex/Primary') > 0.) & ( CONTAINS('Rec/Vertex/Primary') < 5.)", ##-- output NTupleProduce=True, # produce NTuples NTuple=self.__dsname + '.root', # NTuple name Histograms=False, # do not produce Histograms FemtoDST=self.__dsname + '.fmDST', # output fmDST name ##-- general (configuring DaVinci) DataType='2015', # data type EvtMax=self.__nevt, # number of events to run OutputLevel=ERROR) else: kali = secondPass( ## DestroyTES=False, ## ``Physics'' PtGamma=250 * MeV, Pi0Cut="PT > 550 * MeV", ## IO NTupleProduce=True, # produce NTuples NTuple=self.__dsname + '.root', # NTuple name Histograms=False, # do not produce Histograms FemtoDST="", ## Calibration KaliDB={ 'name': lambdas, 'ecal': 'ecal' }, ## general DataType='2015', EvtMax=self.__nevt, OutputLevel=ERROR) from Configurables import CondDB CondDB().Simulation = False CondDB().UseDBSnapshot = True CondDB().DBSnapshotDirectory = "/group/online/hlt/conditions" CondDB().EnableRunChangeHandler = True CondDB().Tags["ONLINE"] = 'fake' CondDB().setProp("IgnoreHeartBeat", True) CondDB().Online = True try: import AllHlt1 except ImportError: rd = '/group/online/hlt/conditions/RunChangeHandler' sys.path.append(rd) import AllHlt1 import AllHlt1 CondDB().RunChangeHandlerConditions = AllHlt1.ConditionMap Online = importOnline() ## ======== input data type - 'SDST' ============ from Configurables import DaVinci DaVinci().InputType = 'DST' # use SDSTs as an input DaVinci().CondDBtag = Online.CondDBTag DaVinci().DDDBtag = Online.DDDBTag from GaudiConf import IOHelper IOHelper('ROOT').inputFiles(self.__inputs) from GaudiPython.Bindings import AppMgr gaudi = AppMgr() gaudi.initialize() gaudi.run(self.__nevt) gaudi.stop() gaudi.finalize() gaudi.exit()
#MessageSvc(OutputLevel=1) EventDataSvc(ForceLeaves = True) from GaudiPython.Bindings import AppMgr Gaudi=AppMgr() print "===================== Initializing the XML conversion ========================" stat = Gaudi.initialize() print "===================== Running the XML conversion ========================" stat = Gaudi.run(1) print "============= Status :",stat if stat.isFailure(): sys.exit(44) print "============= Gaudi.ReturnCode :",Gaudi.ReturnCode if Gaudi.ReturnCode != 0: sys.exit(44) print "===================== Stopping the XML conversion ========================" stat = Gaudi.stop() print "============= Status :",stat if stat.isFailure(): sys.exit(44) print "===================== Finalizing the XML conversion ========================" stat = Gaudi.finalize() print "============= Status :",stat if stat.isFailure(): sys.exit(44) print "===================== Exiting the XML conversion ========================" stat = Gaudi.exit() print "============= Status :",stat if stat.isFailure(): sys.exit(44) print "===================== Updating the Database ========================" import CondDBUI
def run(self): from Configurables import Brunel ## Brunel parameters Brunel().Detectors = ['Spd', 'Prs', 'Ecal', 'Hcal' ] Brunel().DataType = "2015" Brunel().InputType = "MDF" Brunel().OutputType = "DST" Brunel().EvtMax = self.__nevt Brunel().WriteFSR = False Brunel().Histograms = "Online" Brunel().OnlineMode = True Brunel().PrintFreq = 1000 Brunel().DatasetName = self.__dsname ## use the conditions database ## configuration for online from Configurables import CondDB CondDB().Simulation = False CondDB().UseDBSnapshot = True CondDB().DBSnapshotDirectory = "/group/online/hlt/conditions" CondDB().EnableRunChangeHandler = True CondDB().Tags["ONLINE"] = 'fake' CondDB().setProp("IgnoreHeartBeat", True) CondDB().Online = True try: import AllHlt1 except ImportError: rd = '/group/online/hlt/conditions/RunChangeHandler' sys.path.append(rd) import AllHlt1 import AllHlt1 CondDB().RunChangeHandlerConditions = AllHlt1.ConditionMap Online = importOnline() Brunel().CondDBtag = Online.CondDBTag Brunel().DDDBtag = Online.DDDBTag """ Messages in the online get redirected. Setup here the FMC message service @author M.Frank """ app=Gaudi.ApplicationMgr() #Configs.AuditorSvc().Auditors = [] app.MessageSvcType = 'LHCb::FmcMessageSvc' if Gaudi.allConfigurables.has_key('MessageSvc'): del Gaudi.allConfigurables['MessageSvc'] msg = Configs.LHCb__FmcMessageSvc('MessageSvc') msg.fifoPath = os.environ['LOGFIFO'] msg.LoggerOnly = True msg.doPrintAlways = False msg.OutputLevel = MSG_INFO # Online.OutputLevel from GaudiConf import IOHelper IOHelper('MDF').inputFiles(self.__inputs) from GaudiPython.Bindings import AppMgr gaudi = AppMgr() gaudi.initialize() gaudi.run(self.__nevt) gaudi.stop() gaudi.finalize() gaudi.exit()