CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SiStripCommissioningClient_cfg.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import os,sys,getopt,glob,cx_Oracle,subprocess
3 
4 conn_str = os.path.expandvars("$CONFDB")
5 conn = cx_Oracle.connect(conn_str)
6 e = conn.cursor()
7 e.execute('select RUNMODE from run where runnumber = RUNNUMBER')
8 runmode = e.fetchall()
9 runtype = -1;
10 for result in runmode:
11  runtype = int(result[0]);
12 conn.close()
13 
14 process = cms.Process("SiStripCommissioningOfflineDbClient")
15 
16 process.load("DQM.SiStripCommon.MessageLogger_cfi")
17 
18 process.load("DQM.SiStripCommon.DaqMonitorROOTBackEnd_cfi")
19 
20 process.load("OnlineDB.SiStripConfigDb.SiStripConfigDb_cfi")
21 process.SiStripConfigDb.UsingDb = True # true means use database (not xml files)
22 process.SiStripConfigDb.ConfDb = 'overwritten/by@confdb' # database connection account ( or use CONFDB env. var.)
23 process.SiStripConfigDb.Partitions.PrimaryPartition.PartitionName = 'DBPART' # database partition (or use ENV_CMS_TK_PARTITION env. var.)
24 process.SiStripConfigDb.Partitions.PrimaryPartition.RunNumber = RUNNUMBER # specify run number ("0" means use major/minor versions, which are by default set to "current state")
25 process.SiStripConfigDb.TNS_ADMIN = '/etc' # location of tnsnames.ora, needed at P5, not in TAC
26 #process.SiStripConfigDb.Partitions.PrimaryPartition.ForceCurrentState = cms.untracked.bool(True)
27 
28 process.source = cms.Source("EmptySource")
29 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(2) )
30 
31 process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
32 process.load("Geometry.TrackerNumberingBuilder.trackerTopology_cfi")
33 process.load("Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
34 
35 process.load("DQM.SiStripCommissioningDbClients.OfflineDbClient_cff")
36 process.db_client.FilePath = cms.untracked.string('DATALOCATION')
37 process.db_client.RunNumber = cms.untracked.uint32(RUNNUMBER)
38 process.db_client.UseClientFile = cms.untracked.bool(CLIENTFLAG)
39 process.db_client.UploadHwConfig = cms.untracked.bool(DBUPDATE)
40 process.db_client.UploadAnalyses = cms.untracked.bool(ANALUPDATE)
41 process.db_client.DisableDevices = cms.untracked.bool(DISABLEDEVICES)
42 process.db_client.DisableBadStrips = cms.untracked.bool(DISABLEBADSTRIPS)
43 process.db_client.SaveClientFile = cms.untracked.bool(SAVECLIENTFILE)
44 
45 if runtype == 15: ## only needed for spy-channel
46  process.db_client.PartitionName = cms.string("DBPART")
47 
48 process.db_client.ApvTimingParameters.SkipFecUpdate = cms.bool(True)
49 process.db_client.ApvTimingParameters.SkipFedUpdate = cms.bool(False)
50 #process.db_client.ApvTimingParameters.TargetDelay = cms.int32(725)
51 process.db_client.ApvTimingParameters.TargetDelay = cms.int32(-1)
52 
53 process.db_client.OptoScanParameters.SkipGainUpdate = cms.bool(False)
54 
55 process.db_client.PedestalsParameters.KeepStripsDisabled = cms.bool(True)
56 
57 process.db_client.DaqScopeModeParameters.DisableBadStrips = cms.bool(False)
58 process.db_client.DaqScopeModeParameters.KeepStripsDisabled = cms.bool(True)
59 process.db_client.DaqScopeModeParameters.SkipPedestalUpdate = cms.bool(False)
60 process.db_client.DaqScopeModeParameters.SkipTickUpdate = cms.bool(False)
61 
62 ### Bad strip analysis options
63 process.db_client.PedsFullNoiseParameters.DisableBadStrips = cms.bool(True) ## if True the code loops over the dead and bad strips identified and will disable them
64 process.db_client.PedsFullNoiseParameters.KeepStripsDisabled = cms.bool(True) ## if True, strips that have been already disabled will be kept disabled
65 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
66 process.db_client.PedsFullNoiseParameters.SkipEmptyStrips = cms.bool(True) ## if True, empty strips (dead) are skipped --> to avoid to flag bad stuff not powered ON
67 process.db_client.PedsFullNoiseParameters.UploadPedsFullNoiseDBTable = cms.bool(False) ## if True, also the pedsfullnoise analysis tables is uploaded
68 
69 process.p = cms.Path(process.db_client)