Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:22

0001 #!/bin/csh
0002 #
0003 set goon = 1
0004 set period = 1800
0005 #
0006 while ($goon == 1)
0007 cat >! inspectRunInfo.py << %
0008 import os,sys, DLFCN
0009 sys.setdlopenflags(DLFCN.RTLD_GLOBAL+DLFCN.RTLD_LAZY)
0010 
0011 from pluginCondDBPyInterface import *
0012 a = FWIncantation()
0013 rdbms = RDBMS("/afs/cern.ch/cms/DB/conddb")
0014 #rdbms = RDBMS("/nfshome0/xiezhen/conddb")
0015 
0016 dbName =  "oracle://cms_orcoff_prod/CMS_COND_21X_RUN_INFO"
0017 logName = "oracle://cms_orcoff_prod/CMS_COND_21X_POPCONLOG"
0018 #dbName =  "oracle://cms_orcon_prod/CMS_COND_21X_RUN_INFO"
0019 #logName = "oracle://cms_orcon_prod/CMS_COND_21X_POPCONLOG"
0020 
0021 rdbms.setLogger(logName)
0022 from CondCore.Utilities import iovInspector as inspect
0023 
0024 db = rdbms.getDB(dbName)
0025 tags = db.allTags()
0026 
0027 # for inspecting last run after run has started  
0028 tag = 'runinfostart_test'
0029 
0030 # for inspecting last run after run has stopped  
0031 #tag = 'runinfo_test'
0032 
0033 try :
0034     log = db.lastLogEntry(tag)
0035     iov = inspect.Iov(db,tag,0,0,0,1)
0036     for x in  iov.summaries():
0037         print x[1]
0038 except RuntimeError :
0039     print "0"
0040 %
0041 #
0042 set lastrun = `python inspectRunInfo.py`
0043 #
0044 cat >! writeL1RPCHwConfig2DB.cfg << %%
0045 process Write2DB = {
0046 
0047   service = MessageLogger {
0048      untracked vstring destinations = {"cout"}
0049      untracked PSet cout = 
0050      {
0051        untracked  PSet default = { untracked int32 limit = 0 }
0052      }
0053   }
0054 
0055   source = EmptyIOVSource {
0056     string timetype = "runnumber"
0057     uint64 firstValue = $lastrun
0058     uint64 lastValue = $lastrun
0059     uint64 interval = 1
0060   }
0061 
0062   include "CondCore/DBCommon/data/CondDBCommon.cfi"
0063 
0064 # Select output destination:
0065 ## to write into sqlite file
0066   replace CondDBCommon.connect = "sqlite_file:L1RPCHwConfig.db"
0067 #  replace CondDBCommon.DBParameters.authenticationPath="."
0068 #
0069 ## to write into int2r_orcoff
0070 #  replace CondDBCommon.connect = "oracle://cms_orcoff_int2r/CMS_COND_RPC"
0071 #  replace CondDBCommon.DBParameters.authenticationPath="."    
0072 #
0073 ## to write into orcon
0074 #  replace CondDBCommon.connect = "oracle://cms_orcon_prod/CMS_COND_21X_RPC"
0075 #  replace CondDBCommon.DBParameters.authenticationPath="/afs/cern.ch/cms/DB/conddb"
0076 
0077   service = PoolDBOutputService {
0078     using CondDBCommon
0079     VPSet toPut = {
0080       { string record = "L1RPCHwConfigRcd" string tag = "L1RPCHwConfig_v1"}
0081     }
0082     untracked string logconnect = "sqlite_file:L1RPCHwConfig_log.db"
0083   }
0084 
0085   module WriteInDB = L1RPCHwConfigDBWriter {
0086     string record = "L1RPCHwConfigRcd"
0087     untracked bool loggingOn = true
0088     bool SinceAppendMode = true
0089     PSet Source = {
0090       untracked int32 WriteDummy = 0
0091       untracked int32 Validate = 1
0092       untracked int32 FirstBX = 0
0093       untracked int32 LastBX = 0
0094       untracked string OnlineConn = "oracle://CMS_OMDS_LB/CMS_RPC_CONF"
0095       untracked string OnlineAuthPath = "."
0096     }
0097   }
0098 
0099   path p = {WriteInDB}
0100 }
0101 %%
0102 #
0103 cmsRun -p writeL1RPCHwConfig2DB.cfg
0104 #
0105 if ( -f writeL1RPCHwConfig2DB.inp )then
0106  set goon = `cat writeL1RPCHwConfig2DB.inp`
0107 endif
0108 #
0109 sleep $period
0110 end
0111 #