CMS 3D CMS Logo

SiStripCommissioningSource_FromEDM_cfg.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import FWCore.ParameterSet.VarParsing as VarParsing
3 import glob
4 import os
5 import os,sys,getopt,glob,cx_Oracle,subprocess
6 
7 cmsswbase = os.path.expandvars("$CMSSW_BASE/")
8 inputPath = '/raid/fff'
9 
10 conn_str = os.path.expandvars("$CONFDB")
11 conn = cx_Oracle.connect(conn_str)
12 e = conn.cursor()
13 e.execute('select RUNMODE from run where runnumber = RUNNUMBER')
14 runmode = e.fetchall()
15 runtype = -1;
16 for result in runmode:
17  runtype = int(result[0]);
18 conn.close()
19 
20 process = cms.Process("SRCEDM")
21 
22 process.load("DQM.SiStripCommon.MessageLogger_cfi")
23 process.load("DQM.SiStripCommon.DaqMonitorROOTBackEnd_cfi")
24 
25 process.load("OnlineDB.SiStripConfigDb.SiStripConfigDb_cfi")
26 process.SiStripConfigDb.UsingDb = True
27 process.SiStripConfigDb.ConfDb = 'user/password@account'
28 process.SiStripConfigDb.Partitions.PrimaryPartition.PartitionName = 'DBPART'
29 process.SiStripConfigDb.Partitions.PrimaryPartition.RunNumber = RUNNUMBER
30 process.SiStripConfigDb.TNS_ADMIN = '/etc'
31 
32 process.SiStripCondObjBuilderFromDb = cms.Service("SiStripCondObjBuilderFromDb")
33 process.SiStripCondObjBuilderFromDb.SiStripDetInfoFile = cms.FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat")
34 process.SiStripCondObjBuilderFromDb.UseFEC = cms.untracked.bool(True)
35 process.SiStripCondObjBuilderFromDb.UseFED = cms.untracked.bool(True)
36 
37 process.FedCablingFromConfigDb = cms.ESSource("SiStripFedCablingBuilderFromDb",
38  CablingSource = cms.untracked.string('UNDEFINED')
39 )
40 
41 process.PedestalsFromConfigDb = cms.ESSource("SiStripPedestalsBuilderFromDb")
42 process.NoiseFromConfigDb = cms.ESSource("SiStripNoiseBuilderFromDb")
43 process.sistripconn = cms.ESProducer("SiStripConnectivity")
44 
45 process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
46 process.load("Geometry.TrackerNumberingBuilder.trackerTopology_cfi")
47 process.load("Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
48 
49 process.FastMonitoringService = cms.Service("FastMonitoringService",
50  sleepTime = cms.untracked.int32(1),
51  microstateDefPath = cms.untracked.string( cmsswbase+'/src/EventFilter/Utilities/plugins/microstatedef.jsd'),
52  fastMicrostateDefPath = cms.untracked.string( cmsswbase+'/src/EventFilter/Utilities/plugins/microstatedeffast.jsd'),
53  fastName = cms.untracked.string( 'fastmoni' ),
54  slowName = cms.untracked.string( 'slowmoni' )
55 )
56 
57 process.EvFDaqDirector = cms.Service("EvFDaqDirector",
58  runNumber = cms.untracked.uint32(RUNNUMBER),
59  buBaseDir = cms.untracked.string(inputPath),
60  directorIsBu = cms.untracked.bool(False),
61  testModeNoBuilderUnit = cms.untracked.bool(False)
62 )
63 
64 infilename = "file:"+inputPath+"/runRUNNUMBER/runRUNNUMBER.root"
65 process.source = cms.Source("PoolSource",
66  fileNames = cms.untracked.vstring(infilename)
67 )
68 
69 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
70 
71 
72 if runtype != 15:
73  process.load("EventFilter.SiStripRawToDigi.FedChannelDigis_cfi")
74  process.FedChannelDigis.UnpackBadChannels = cms.bool(True)
75  process.FedChannelDigis.DoAPVEmulatorCheck = cms.bool(True)
76  process.FedChannelDigis.LegacyUnpacker = cms.bool(False)
77  process.FedChannelDigis.ProductLabel = cms.InputTag("rawDataCollector")
78 else:
79  process.load('DQM.SiStripMonitorHardware.SiStripSpyUnpacker_cfi')
80  process.load('DQM.SiStripMonitorHardware.SiStripSpyDigiConverter_cfi')
81  process.load('DQM.SiStripMonitorHardware.SiStripSpyEventSummaryProducer_cfi')
82 
83  process.SiStripSpyUnpacker.FEDIDs = cms.vuint32() #use a subset of FEDs or leave empty for all.
84  process.SiStripSpyUnpacker.InputProductLabel = cms.InputTag('rawDataCollector')
85  process.SiStripSpyUnpacker.AllowIncompleteEvents = True
86  process.SiStripSpyUnpacker.StoreCounters = True
87  process.SiStripSpyUnpacker.StoreScopeRawDigis = cms.bool(True) # Note - needs to be True for use in other modules.
88 
89  process.SiStripSpyDigiConverter.InputProductLabel = cms.InputTag('SiStripSpyUnpacker','ScopeRawDigis')
90  process.SiStripSpyDigiConverter.StorePayloadDigis = True
91  process.SiStripSpyDigiConverter.StoreReorderedDigis = True
92  process.SiStripSpyDigiConverter.StoreModuleDigis = True
93  process.SiStripSpyDigiConverter.StoreAPVAddress = True
94  process.SiStripSpyDigiConverter.MinDigiRange = 100
95  process.SiStripSpyDigiConverter.MaxDigiRange = 1024
96  process.SiStripSpyDigiConverter.MinZeroLight = 0
97  process.SiStripSpyDigiConverter.MaxZeroLight = 1024
98  process.SiStripSpyDigiConverter.MinTickHeight = 0
99  process.SiStripSpyDigiConverter.MaxTickHeight = 1024
100  process.SiStripSpyDigiConverter.ExpectedPositionOfFirstHeaderBit = 0
101  process.SiStripSpyDigiConverter.DiscardDigisWithWrongAPVAddress = False
102  process.SiStripSpyEventSummary.RawDataTag = cms.InputTag('rawDataCollector')
103 
104 
105 process.load("DQM.SiStripCommissioningSources.CommissioningHistos_cfi")
106 process.CommissioningHistos.CommissioningTask = 'UNDEFINED'
107 process.CommissioningHistos.PedsFullNoiseParameters.NrEvToSkipAtStart = 100
108 process.CommissioningHistos.PedsFullNoiseParameters.NrEvForPeds = 3000
109 process.CommissioningHistos.PedsFullNoiseParameters.FillNoiseProfile = True
110 
111 if runtype != 15:
112  process.p = cms.Path(process.FedChannelDigis*process.CommissioningHistos)
113 else:
114 
115  process.SiStripSpyEventSummary.RunType = cms.uint32(runtype)
116  process.CommissioningHistos.InputModuleLabel = 'SiStripSpyDigiConverter' # output label from spy converter
117  process.CommissioningHistos.InputModuleLabelAlt = cms.string('SiStripSpyUnpacker')
118  process.CommissioningHistos.SummaryInputModuleLabel = 'SiStripSpyEventSummary'
119  process.CommissioningHistos.isSpy = cms.bool(True)
120  process.CommissioningHistos.PartitionName = cms.string('DBPART')
121 
122  process.p = cms.Path(process.SiStripSpyUnpacker*process.SiStripSpyDigiConverter*process.SiStripSpyEventSummary*process.CommissioningHistos)
123