Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:32

0001 import FWCore.ParameterSet.Config as cms
0002 import os,sys,getopt,glob,cx_Oracle,subprocess
0003 
0004 conn_str = os.path.expandvars("$CONFDB")
0005 conn     = cx_Oracle.connect(conn_str)
0006 e        = conn.cursor()
0007 e.execute('select RUNMODE from run where runnumber = RUNNUMBER')
0008 runmode = e.fetchall()
0009 runtype = -1;
0010 for result in runmode:
0011     runtype = int(result[0]);
0012 conn.close()
0013 
0014 process = cms.Process("SiStripCommissioningOfflineDbClient")
0015 
0016 process.load("DQM.SiStripCommon.MessageLogger_cfi")
0017 
0018 process.load("DQM.SiStripCommon.DaqMonitorROOTBackEnd_cfi")
0019 
0020 process.load("OnlineDB.SiStripConfigDb.SiStripConfigDb_cfi")
0021 process.SiStripConfigDb.UsingDb = True                                            # true means use database (not xml files)
0022 process.SiStripConfigDb.ConfDb  = 'overwritten/by@confdb'                         # database connection account ( or use CONFDB env. var.)
0023 process.SiStripConfigDb.Partitions.PrimaryPartition.PartitionName = 'DBPART'      # database partition (or use ENV_CMS_TK_PARTITION env. var.)
0024 process.SiStripConfigDb.Partitions.PrimaryPartition.RunNumber     = RUNNUMBER     # specify run number ("0" means use major/minor versions, which are by default set to "current state")
0025 process.SiStripConfigDb.TNS_ADMIN = '/etc'                                        # location of tnsnames.ora, needed at P5, not in TAC
0026 #process.SiStripConfigDb.Partitions.PrimaryPartition.ForceCurrentState = cms.untracked.bool(True)
0027 
0028 process.source = cms.Source("EmptySource") 
0029 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(2) ) 
0030 
0031 process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
0032 process.load("Geometry.TrackerNumberingBuilder.trackerTopology_cfi")
0033 process.load("Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
0034 
0035 process.load("DQM.SiStripCommissioningDbClients.OfflineDbClient_cff")
0036 process.db_client.FilePath         = cms.untracked.string('DATALOCATION')
0037 process.db_client.RunNumber        = cms.untracked.uint32(RUNNUMBER)
0038 process.db_client.UseClientFile    = cms.untracked.bool(CLIENTFLAG)
0039 process.db_client.UploadHwConfig   = cms.untracked.bool(DBUPDATE)
0040 process.db_client.UploadAnalyses   = cms.untracked.bool(ANALUPDATE)
0041 process.db_client.DisableDevices   = cms.untracked.bool(DISABLEDEVICES)
0042 process.db_client.DisableBadStrips = cms.untracked.bool(DISABLEBADSTRIPS)
0043 process.db_client.SaveClientFile   = cms.untracked.bool(SAVECLIENTFILE)
0044 
0045 if runtype == 15: ## only needed for spy-channel
0046     process.db_client.PartitionName    = cms.string("DBPART")
0047 
0048 process.db_client.ApvTimingParameters.SkipFecUpdate = cms.bool(True)
0049 process.db_client.ApvTimingParameters.SkipFedUpdate = cms.bool(False)
0050 #process.db_client.ApvTimingParameters.TargetDelay = cms.int32(725)
0051 process.db_client.ApvTimingParameters.TargetDelay = cms.int32(-1)
0052 
0053 process.db_client.OptoScanParameters.SkipGainUpdate = cms.bool(False)
0054 
0055 process.db_client.PedestalsParameters.KeepStripsDisabled = cms.bool(True)
0056 
0057 process.db_client.DaqScopeModeParameters.DisableBadStrips =  cms.bool(False)
0058 process.db_client.DaqScopeModeParameters.KeepStripsDisabled = cms.bool(True)
0059 process.db_client.DaqScopeModeParameters.SkipPedestalUpdate = cms.bool(False)
0060 process.db_client.DaqScopeModeParameters.SkipTickUpdate = cms.bool(False)
0061 
0062 ### Bad strip analysis options                                                                                                                                                                         
0063 process.db_client.PedsFullNoiseParameters.DisableBadStrips   = cms.bool(True) ## if True the code loops over the dead and bad strips identified and will disable them                                  
0064 process.db_client.PedsFullNoiseParameters.KeepStripsDisabled = cms.bool(True) ## if True, strips that have been already disabled will be kept disabled                                                 
0065 process.db_client.PedsFullNoiseParameters.UploadOnlyStripBadChannelBit = cms.bool(True) ## if True, only the disable flag will be changed, peds and noise cloned from the previous FED version         
0066 process.db_client.PedsFullNoiseParameters.SkipEmptyStrips    =  cms.bool(True) ## if True, empty strips (dead) are skipped --> to avoid to flag bad stuff not powered ON                               
0067 process.db_client.PedsFullNoiseParameters.UploadPedsFullNoiseDBTable  =  cms.bool(False) ## if True, also the pedsfullnoise analysis tables is uploaded                                                
0068 
0069 process.p = cms.Path(process.db_client)