1 import FWCore.ParameterSet.Config
as cms
2 import FWCore.ParameterSet.VarParsing
as VarParsing
5 import os,sys,getopt,glob,cx_Oracle,subprocess
7 cmsswbase = os.path.expandvars(
"$CMSSW_BASE/")
8 inputPath =
'/raid/fff'
11 conn_str = os.path.expandvars(
"$CONFDB")
12 conn = cx_Oracle.connect(conn_str)
14 e.execute(
'select RUNMODE from run where runnumber = RUNNUMBER')
15 runmode = e.fetchall()
17 for result
in runmode:
18 runtype = int(result[0]);
22 process = cms.Process(
"SRC")
24 process.load(
"DQM.SiStripCommon.MessageLogger_cfi")
26 process.load(
"DQM.SiStripCommon.DaqMonitorROOTBackEnd_cfi")
28 process.load(
"OnlineDB.SiStripConfigDb.SiStripConfigDb_cfi")
29 process.SiStripConfigDb.UsingDb =
True
30 process.SiStripConfigDb.ConfDb =
'user/password@account'
31 process.SiStripConfigDb.Partitions.PrimaryPartition.PartitionName =
'DBPART'
32 process.SiStripConfigDb.Partitions.PrimaryPartition.RunNumber = RUNNUMBER
33 process.SiStripConfigDb.TNS_ADMIN =
'/etc'
35 process.SiStripCondObjBuilderFromDb = cms.Service(
"SiStripCondObjBuilderFromDb")
36 process.SiStripCondObjBuilderFromDb.SiStripDetInfoFile = cms.FileInPath(
"CalibTracker/SiStripCommon/data/SiStripDetInfo.dat")
37 process.SiStripCondObjBuilderFromDb.UseFEC = cms.untracked.bool(
True)
38 process.SiStripCondObjBuilderFromDb.UseFED = cms.untracked.bool(
True)
40 process.FedCablingFromConfigDb = cms.ESSource(
"SiStripFedCablingBuilderFromDb",
41 CablingSource = cms.untracked.string(
'UNDEFINED')
44 process.PedestalsFromConfigDb = cms.ESSource(
"SiStripPedestalsBuilderFromDb")
45 process.NoiseFromConfigDb = cms.ESSource(
"SiStripNoiseBuilderFromDb")
46 process.sistripconn = cms.ESProducer(
"SiStripConnectivity")
48 process.load(
"Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
49 process.load(
"Geometry.TrackerNumberingBuilder.trackerTopology_cfi")
50 process.load(
"Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
52 process.FastMonitoringService = cms.Service(
"FastMonitoringService",
53 sleepTime = cms.untracked.int32(1),
54 microstateDefPath = cms.untracked.string( cmsswbase+
'/src/EventFilter/Utilities/plugins/microstatedef.jsd'),
55 fastMicrostateDefPath = cms.untracked.string( cmsswbase+
'/src/EventFilter/Utilities/plugins/microstatedeffast.jsd'),
56 fastName = cms.untracked.string(
'fastmoni' ),
57 slowName = cms.untracked.string(
'slowmoni' )
60 process.EvFDaqDirector = cms.Service(
"EvFDaqDirector",
61 runNumber = cms.untracked.uint32(RUNNUMBER),
62 buBaseDir = cms.untracked.string(inputPath),
63 directorIsBu = cms.untracked.bool(
False),
64 testModeNoBuilderUnit = cms.untracked.bool(
False)
67 process.source = cms.Source(
"FedRawDataInputSource",
68 runNumber = cms.untracked.uint32(RUNNUMBER),
69 getLSFromFilename = cms.untracked.bool(
True),
70 testModeNoBuilderUnit = cms.untracked.bool(
False),
71 verifyAdler32 = cms.untracked.bool(
True),
72 verifyChecksum = cms.untracked.bool(
True),
73 useL1EventID = cms.untracked.bool(
True),
74 eventChunkSize = cms.untracked.uint32(16),
75 numBuffers = cms.untracked.uint32(2),
76 eventChunkBlock = cms.untracked.uint32(1),
77 fileListMode = cms.untracked.bool(
True),
78 fileNames = cms.untracked.vstring()
81 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
85 process.load(
"EventFilter.SiStripRawToDigi.FedChannelDigis_cfi")
86 process.FedChannelDigis.UnpackBadChannels = cms.bool(
True)
87 process.FedChannelDigis.DoAPVEmulatorCheck = cms.bool(
True)
88 process.FedChannelDigis.LegacyUnpacker = cms.bool(
False)
89 process.FedChannelDigis.ProductLabel = cms.InputTag(
"rawDataCollector")
91 process.load(
'DQM.SiStripMonitorHardware.SiStripSpyUnpacker_cfi')
92 process.load(
'DQM.SiStripMonitorHardware.SiStripSpyDigiConverter_cfi')
93 process.load(
'DQM.SiStripMonitorHardware.SiStripSpyEventSummaryProducer_cfi')
95 process.SiStripSpyUnpacker.FEDIDs = cms.vuint32()
96 process.SiStripSpyUnpacker.InputProductLabel = cms.InputTag(
'rawDataCollector')
97 process.SiStripSpyUnpacker.AllowIncompleteEvents =
True
98 process.SiStripSpyUnpacker.StoreCounters =
True
99 process.SiStripSpyUnpacker.StoreScopeRawDigis = cms.bool(
True)
101 process.SiStripSpyDigiConverter.InputProductLabel = cms.InputTag(
'SiStripSpyUnpacker',
'ScopeRawDigis')
102 process.SiStripSpyDigiConverter.StorePayloadDigis =
True
103 process.SiStripSpyDigiConverter.StoreReorderedDigis =
True
104 process.SiStripSpyDigiConverter.StoreModuleDigis =
True
105 process.SiStripSpyDigiConverter.StoreAPVAddress =
True
106 process.SiStripSpyDigiConverter.MinDigiRange = 100
107 process.SiStripSpyDigiConverter.MaxDigiRange = 1024
108 process.SiStripSpyDigiConverter.MinZeroLight = 0
109 process.SiStripSpyDigiConverter.MaxZeroLight = 1024
110 process.SiStripSpyDigiConverter.MinTickHeight = 0
111 process.SiStripSpyDigiConverter.MaxTickHeight = 1024
112 process.SiStripSpyDigiConverter.ExpectedPositionOfFirstHeaderBit = 0
113 process.SiStripSpyDigiConverter.DiscardDigisWithWrongAPVAddress =
False
114 process.SiStripSpyEventSummary.RawDataTag = cms.InputTag(
'rawDataCollector')
116 process.load(
"DQM.SiStripCommissioningSources.CommissioningHistos_cfi")
117 process.CommissioningHistos.CommissioningTask =
'UNDEFINED'
118 process.CommissioningHistos.PedsFullNoiseParameters.NrEvToSkipAtStart = 100
119 process.CommissioningHistos.PedsFullNoiseParameters.NrEvForPeds = 3000
120 process.CommissioningHistos.PedsFullNoiseParameters.FillNoiseProfile =
True
122 outfilename = inputPath+
"/run"+
"RUNNUMBER"+
"/run"+
"RUNNUMBER"+
".root"
123 process.out = cms.OutputModule(
"PoolOutputModule",
124 fileName = cms.untracked.string(outfilename),
125 outputCommands = cms.untracked.vstring(
"drop *",
"keep FEDRawDataCollection_*_*_*")
129 process.p = cms.Path(process.FedChannelDigis*process.CommissioningHistos)
132 process.SiStripSpyEventSummary.RunType = cms.uint32(runtype)
133 process.CommissioningHistos.InputModuleLabel =
'SiStripSpyDigiConverter'
134 process.CommissioningHistos.InputModuleLabelAlt = cms.string(
'SiStripSpyUnpacker')
135 process.CommissioningHistos.SummaryInputModuleLabel =
'SiStripSpyEventSummary'
136 process.CommissioningHistos.isSpy = cms.bool(
True)
137 process.CommissioningHistos.PartitionName = cms.string(
'DBPART')
139 process.p = cms.Path(process.SiStripSpyUnpacker*process.SiStripSpyDigiConverter*process.SiStripSpyEventSummary*process.CommissioningHistos)
141 process.e = cms.EndPath(process.out)
143 fnames = glob.glob(inputPath+
"/run"+
"RUNNUMBER"+
"/*ls00*.raw")
145 process.source.fileNames.extend(cms.untracked.vstring(
'file:'+f))