Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:11:37

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 import glob
0004 import os
0005 import os,sys,getopt,glob,cx_Oracle,subprocess
0006 
0007 cmsswbase = os.path.expandvars("$CMSSW_BASE/")
0008 inputPath = '/raid/fff'
0009 
0010 conn_str = os.path.expandvars("$CONFDB")
0011 conn     = cx_Oracle.connect(conn_str)
0012 e        = conn.cursor()
0013 e.execute('select RUNMODE from run where runnumber = RUNNUMBER')
0014 runmode = e.fetchall()
0015 runtype = -1;
0016 for result in runmode:
0017     runtype = int(result[0]);
0018 conn.close()
0019 
0020 process = cms.Process("SRCEDM")
0021 
0022 process.load("DQM.SiStripCommon.MessageLogger_cfi")
0023 process.load("DQM.SiStripCommon.DaqMonitorROOTBackEnd_cfi")
0024 
0025 process.load("OnlineDB.SiStripConfigDb.SiStripConfigDb_cfi")
0026 process.SiStripConfigDb.UsingDb = True                    
0027 process.SiStripConfigDb.ConfDb = 'user/password@account'
0028 process.SiStripConfigDb.Partitions.PrimaryPartition.PartitionName = 'DBPART'
0029 process.SiStripConfigDb.Partitions.PrimaryPartition.RunNumber     = RUNNUMBER
0030 process.SiStripConfigDb.TNS_ADMIN = '/etc'
0031 
0032 process.SiStripCondObjBuilderFromDb = cms.Service("SiStripCondObjBuilderFromDb")
0033 process.SiStripCondObjBuilderFromDb.SiStripDetInfoFile = cms.FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat")
0034 process.SiStripCondObjBuilderFromDb.UseFEC = cms.untracked.bool(True)
0035 process.SiStripCondObjBuilderFromDb.UseFED = cms.untracked.bool(True)
0036 
0037 process.FedCablingFromConfigDb = cms.ESSource("SiStripFedCablingBuilderFromDb",
0038     CablingSource = cms.untracked.string('UNDEFINED')  
0039 )
0040 
0041 process.PedestalsFromConfigDb = cms.ESSource("SiStripPedestalsBuilderFromDb")
0042 process.NoiseFromConfigDb = cms.ESSource("SiStripNoiseBuilderFromDb")
0043 process.sistripconn = cms.ESProducer("SiStripConnectivity")
0044 
0045 process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
0046 process.load("Geometry.TrackerNumberingBuilder.trackerTopology_cfi")
0047 process.load("Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
0048 
0049 process.FastMonitoringService = cms.Service("FastMonitoringService",
0050         sleepTime = cms.untracked.int32(1),
0051         microstateDefPath = cms.untracked.string( cmsswbase+'/src/EventFilter/Utilities/plugins/microstatedef.jsd'),
0052         fastMicrostateDefPath = cms.untracked.string( cmsswbase+'/src/EventFilter/Utilities/plugins/microstatedeffast.jsd'),
0053         fastName = cms.untracked.string( 'fastmoni' ),
0054         slowName = cms.untracked.string( 'slowmoni' )
0055 )
0056 
0057 process.EvFDaqDirector = cms.Service("EvFDaqDirector",
0058         runNumber = cms.untracked.uint32(RUNNUMBER),
0059         buBaseDir = cms.untracked.string(inputPath),
0060         directorIsBu = cms.untracked.bool(False),
0061         testModeNoBuilderUnit = cms.untracked.bool(False)
0062 )
0063 
0064 infilename = "file:"+inputPath+"/runRUNNUMBER/runRUNNUMBER.root"
0065 process.source = cms.Source("PoolSource",
0066         fileNames = cms.untracked.vstring(infilename)
0067 )
0068 
0069 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0070 
0071 ### for run types != from DAQ SCOPE Modes                                                                                                                                                              
0072 if runtype != 15:
0073     process.load("EventFilter.SiStripRawToDigi.FedChannelDigis_cfi")
0074     process.FedChannelDigis.UnpackBadChannels = cms.bool(True)
0075     process.FedChannelDigis.DoAPVEmulatorCheck = cms.bool(True)
0076     process.FedChannelDigis.LegacyUnpacker = cms.bool(False)
0077     process.FedChannelDigis.ProductLabel = cms.InputTag("rawDataCollector")
0078 else:
0079     process.load('DQM.SiStripMonitorHardware.SiStripSpyUnpacker_cfi')
0080     process.load('DQM.SiStripMonitorHardware.SiStripSpyDigiConverter_cfi')
0081     process.load('DQM.SiStripMonitorHardware.SiStripSpyEventSummaryProducer_cfi')
0082     ## * Scope digi settings                                                                                                                                                                          
0083     process.SiStripSpyUnpacker.FEDIDs = cms.vuint32()                   #use a subset of FEDs or leave empty for all.                                                                                  
0084     process.SiStripSpyUnpacker.InputProductLabel = cms.InputTag('rawDataCollector')
0085     process.SiStripSpyUnpacker.AllowIncompleteEvents = True
0086     process.SiStripSpyUnpacker.StoreCounters = True
0087     process.SiStripSpyUnpacker.StoreScopeRawDigis = cms.bool(True)      # Note - needs to be True for use in other modules.                                                                            
0088     ## * Module digi settings                                                                                                                                                                         
0089     process.SiStripSpyDigiConverter.InputProductLabel = cms.InputTag('SiStripSpyUnpacker','ScopeRawDigis')
0090     process.SiStripSpyDigiConverter.StorePayloadDigis = True
0091     process.SiStripSpyDigiConverter.StoreReorderedDigis = True
0092     process.SiStripSpyDigiConverter.StoreModuleDigis = True
0093     process.SiStripSpyDigiConverter.StoreAPVAddress = True
0094     process.SiStripSpyDigiConverter.MinDigiRange = 100
0095     process.SiStripSpyDigiConverter.MaxDigiRange = 1024
0096     process.SiStripSpyDigiConverter.MinZeroLight = 0
0097     process.SiStripSpyDigiConverter.MaxZeroLight = 1024
0098     process.SiStripSpyDigiConverter.MinTickHeight = 0
0099     process.SiStripSpyDigiConverter.MaxTickHeight = 1024
0100     process.SiStripSpyDigiConverter.ExpectedPositionOfFirstHeaderBit = 0
0101     process.SiStripSpyDigiConverter.DiscardDigisWithWrongAPVAddress = False
0102     process.SiStripSpyEventSummary.RawDataTag = cms.InputTag('rawDataCollector')
0103 
0104 
0105 process.load("DQM.SiStripCommissioningSources.CommissioningHistos_cfi")
0106 process.CommissioningHistos.CommissioningTask = 'UNDEFINED'
0107 process.CommissioningHistos.PedsFullNoiseParameters.NrEvToSkipAtStart = 100
0108 process.CommissioningHistos.PedsFullNoiseParameters.NrEvForPeds       = 3000
0109 process.CommissioningHistos.PedsFullNoiseParameters.FillNoiseProfile  = True
0110 
0111 if runtype != 15:
0112     process.p = cms.Path(process.FedChannelDigis*process.CommissioningHistos)
0113 else:
0114 
0115     process.SiStripSpyEventSummary.RunType = cms.uint32(runtype)
0116     process.CommissioningHistos.InputModuleLabel = 'SiStripSpyDigiConverter'  # output label from spy converter                                                                                        
0117     process.CommissioningHistos.InputModuleLabelAlt = cms.string('SiStripSpyUnpacker')
0118     process.CommissioningHistos.SummaryInputModuleLabel = 'SiStripSpyEventSummary'
0119     process.CommissioningHistos.isSpy = cms.bool(True)
0120     process.CommissioningHistos.PartitionName = cms.string('DBPART')
0121 
0122     process.p = cms.Path(process.SiStripSpyUnpacker*process.SiStripSpyDigiConverter*process.SiStripSpyEventSummary*process.CommissioningHistos)
0123