def configOnline(app, alg, name): from Configurables import ApplicationMgr, UpdateAndReset appMgr = ApplicationMgr() ## Configure saving of histograms ur = UpdateAndReset() ur.saveHistograms = 1 appMgr.TopAlg.insert(0, ur) from Configurables import LoKiSvc LoKiSvc().Welcome = False import OnlineEnv app.DDDBtag = OnlineEnv.DDDBTag app.CondDBtag = OnlineEnv.CondDBTag from Configurables import CondDB conddb = CondDB() conddb.IgnoreHeartBeat = True conddb.UseDBSnapshot = True conddb.EnableRunChangeHandler = True conddb.EnableRunStampCheck = False conddb.Tags['ONLINE'] = 'fake' import ConditionsMap conddb.RunChangeHandlerConditions = ConditionsMap.RunChangeHandlerConditions from Gaudi.Configuration import EventLoopMgr EventLoopMgr().Warnings = False from Configurables import MonitorSvc MonitorSvc().disableDimPropServer = 1 MonitorSvc().disableDimCmdServer = 1 MonitorSvc().ExpandCounterServices = 0; MonitorSvc().ExpandNameInfix = "<part>_x_<program>/"; MonitorSvc().PartitionName = OnlineEnv.PartitionName; MonitorSvc().ProgramName = name + "_00"; # setup the histograms and the monitoring service appMgr.ExtSvc.append( 'MonitorSvc' ) from Configurables import RootHistCnv__PersSvc RootHistCnv__PersSvc().OutputEnabled = False from Gaudi.Configuration import allConfigurables # set up the event selector if 'EventSelector' in allConfigurables : del allConfigurables['EventSelector'] input = 'Events' mepMgr = OnlineEnv.mepManager(OnlineEnv.PartitionID,OnlineEnv.PartitionName,[input],True) mepMgr.ConnectWhen = "start"; appMgr.Runable = OnlineEnv.evtRunable(mepMgr) appMgr.SvcOptMapping.append('LHCb::OnlineEvtSelector/EventSelector') appMgr.SvcOptMapping.append('LHCb::FmcMessageSvc/MessageSvc') appMgr.ExtSvc.append(mepMgr) eventSelector = OnlineEnv.mbmSelector(input = input, type = 'ONE', decode = False, event_type = 2) appMgr.ExtSvc.append(eventSelector) appMgr.ExtSvc.append(mepMgr) appMgr.OutputLevel = 3 OnlineEnv.evtDataSvc() eventSelector.REQ1 = 'EvType=2;TriggerMask=0x0,0x4,0x0,0x0;VetoMask=0,0,0,0x300;MaskType=ANY;UserType=USER;Frequency=PERC;Perc=100.0' appMgr.EvtSel = eventSelector from Configurables import AuditorSvc AuditorSvc().Auditors = [] configMsgSvc( appMgr ) OnlineEnv.end_config(False)
print "Moving to Offline DB the following detector Data ",dets ecs = EventClockSvc() ecs.InitialTime = RunOption.RunStartTime*1000000000 ecs.addTool(FakeEventTime,"EventTimeDecoder") ecs.EventTimeDecoder.StartTime = ecs.InitialTime ecs.EventTimeDecoder.TimeStep = 10 #xmlCnvSvc = XmlCnvSvc(AllowGenericConversion = True) DDDBConf() #detDataSvc = DetectorDataSvc() #DetectorPersistencySvc( CnvServices = [ xmlCnvSvc ] ) cdb = CondDB() cdb.RunChangeHandlerConditions=CondMap.ConditionMap cdb.EnableRunChangeHandler = True cdb.EnableRunStampCheck=False cdb.UseDBSnapshot = True cdb.Tags = { "DDDB" : RunOption.DDDBTag, "LHCBCOND" : RunOption.CondDbTag, "ONLINE" : 'fake'} cdb.IgnoreHeartBeat = True dbxalg = DBXferAlg() dbxalg.RunNumber = RunOption.RunNumber dbxalg.RunStartTime = RunOption.RunStartTime*1000000000 dbxalg.OnlineXmlDir = RunOption.OutputDirectory wrconf = WriterConf("wconf",dets)#["Velo","IT","TT","OT"]) wrconf.CondFilePrefix = RunOption.OutputDirectory+"/offl/Conditions/Online" from Configurables import WriteMultiAlignmentConditionsTool xmlwriter = WriteMultiAlignmentConditionsTool()#"AlignWriterTool") wrconf.addXmlWriters(xmlwriter) app = ApplicationMgr() app.TopAlg = [ dbxalg ]
def setup(): initialTime = long(time.time() * 1e9) OTGaudiSeq = GaudiSequencer("OTt0OnlineClbrSeq") OTt0OnlineClbrAlg = OTt0OnlineClbr("OTt0OnlineClbrAlg") #OTt0OnlineClbrAlg.InputFiles = [ "/hist/Savesets/2013/LHCb/Brunel/01/20/Brunel-135576-20130120T161302-EOR.root"] # OT T0 calibration algorithm OTt0OnlineClbrAlg.InputTasks = ["Brunel"] OTt0OnlineClbrAlg.Partition = partition OTt0OnlineClbrAlg.ReadInitialT0FromDB = False OTt0OnlineClbrAlg.SaveFits = False OTt0OnlineClbrAlg.RunOnline = True OTt0OnlineClbrAlg.CheckDataT0 = True OTt0OnlineClbrAlg.PublishedName = "OT/Calib" OTt0OnlineClbrAlg.XMLFilePath = "/group/online/alignment/OT/Calib" OTt0OnlineClbrAlg.OutputLevel = MSG_INFO OTt0OnlineClbrAlg.UseClockPhase = (partition != "FEST") OTt0OnlineClbrAlg.InitialTime = initialTime OTt0OnlineClbrAlg.Threshold = 0.1 OTt0OnlineClbrAlg.MaxDifference = 2 # Keep analysis task going. OTt0OnlineClbrAlg.StopAlgSequence = False OTGaudiSeq.Members += [OTt0OnlineClbrAlg] OTGaudiSeq.IgnoreFilterPassed = True ## Configure saving of histograms from Configurables import UpdateAndReset ur = UpdateAndReset() ur.saveHistograms = 1 ApplicationMgr().TopAlg.insert(0, ur) from Configurables import MonitorSvc MonitorSvc().disableDimPropServer = 1 MonitorSvc().disableDimCmdServer = 1 #import OnlineEnv MonitorSvc().ExpandCounterServices = 0 MonitorSvc().ExpandNameInfix = "<part>_x_<program>/" #MonitorSvc().PartitionName = OnlineEnv.PartitionName; MonitorSvc().PartitionName = partition MonitorSvc().ProgramName = "OTOnlineCalib_0" #setup the histograms and the monitoring service #ApplicationMgr().ExtSvc.append( 'MonitorSvc' ) from Configurables import RootHistCnv__PersSvc RootHistCnv__PersSvc().OutputEnabled = False ApplicationMgr().TopAlg += [OTGaudiSeq] ApplicationMgr().EvtSel = "NONE" ApplicationMgr().ExtSvc += [ "LHCb::PublishSvc", "MonitorSvc", "IncidentSvc" ] ApplicationMgr().Runable = "LHCb::OnlineRunable/Runable" from Configurables import CondDB conddb = CondDB() conddb.Tags["ONLINE"] = 'fake' conddb.IgnoreHeartBeat = True conddb.UseDBSnapshot = True conddb.DBSnapshotDirectory = "/group/online/hlt/conditions" from Configurables import EventClockSvc, FakeEventTime, EventDataSvc ecs = EventClockSvc() ecs.InitialTime = initialTime ecs.addTool(FakeEventTime, "EventTimeDecoder") ecs.EventTimeDecoder.StartTime = initialTime ecs.EventTimeDecoder.TimeStep = 10 EventDataSvc().ForceLeaves = True # Configure DB tags and per-run conditions to be used to be the same as what # the HLT1 reconstruction farm uses. This is done by directly importing the # python file to ensure the script can also start when LHCb is running # passthrough. conddb.EnableRunChangeHandler = True conddb.RunChangeHandlerConditions = { 'LHCb/2015/%d/ot.xml': ["Conditions/Calibration/OT/CalibrationGlobal"] } from Configurables import LHCbApp import ConditionsMap LHCbApp().CondDBtag = ConditionsMap.CondDBTag LHCbApp().DDDBtag = ConditionsMap.DDDBTag # LHCbApp().CondDBtag = 'cond-20150409-2' # LHCbApp().DDDBtag = 'dddb-20150119-3' LHCbApp().DataType = '2015'