Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
import FWCore.ParameterSet.Config as cms

process = cms.Process("ProdDCCWeights")

# Calo geometry service model
process.load("Geometry.CaloEventSetup.CaloGeometry_cfi")
process.load("Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi")
process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")

# ecal mapping
process.load("Geometry.EcalMapping.EcalMapping_cfi")
process.eegeom = cms.ESSource("EmptyESSource",
    recordName = cms.string('EcalMappingRcd'),
    iovIsRunNotTime = cms.bool(True),
    firstValid = cms.vuint32(1)
)

process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cff")
process.load("Geometry.HcalCommonData.hcalDDDRecConstants_cfi")

# Conditions:
#
# a) Getting hardcoded conditions the same used for standard digitization:
#process.load("CalibCalorimetry.EcalTrivialCondModules.EcalTrivialCondRetriever_cfi")
#process.EcalTrivialConditionRetriever.producedEcalIntercalibConstants = True
# b) Getting conditions through frontier interface:
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_data', '')
# c) Getting conditions through oracle interface:
#process.load("RecoLocalCalo.EcalRecProducers.getEcalConditions_orcoffint2r_cff")

#########################
process.source = cms.Source("EmptySource")

process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(1)
)

process.dccWeightBuilder = cms.EDAnalyzer("EcalDccWeightBuilder",
  dcc1stSample = cms.int32(2),
  sampleToSkip = cms.int32(-1),
  mode = cms.string("computeWeights"),
  nDccWeights = cms.int32(6),
  inputWeights  = cms.vdouble(),
  dccWeightsWithIntercalib = cms.bool(False),
  writeToDB = cms.bool(False),
  writeToAsciiFile = cms.bool(True),
  writeToRootFile = cms.bool(True),
  dbSid = cms.string("cms_omds_lb"),
  dbUser = cms.string("cms_ecal_conf_test"),
  dbPassword = cms.untracked.string("file:conddb_passwd"),
  dbTag = cms.string("6-opt-weights"),
  dbVersion = cms.int32(0),
  sqlMode = cms.bool(True),
  asciiOutputFileName = cms.string("dccWeights.sql"),
  rootOutputFileName = cms.string("dccWeights.root"))

process.path = cms.Path(process.dccWeightBuilder)