Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-02-14 04:12:17

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun digiValidation_cfg.py geometry=D99
0004 #
0005 #   Options for geometry D98, D99, D108, D94, D103, D104, D106, D109
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import os, sys, importlib, re
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 
0012 ####################################################################
0013 ### SETUP OPTIONS
0014 options = VarParsing.VarParsing('standard')
0015 options.register('geometry',
0016                  "D99",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: D98, D99, D108, D94, D103, D104, D106, D109")
0020 
0021 ### get and parse the command line arguments
0022 options.parseArguments()
0023 
0024 print(options)
0025 
0026 ####################################################################
0027 # Use the options
0028 
0029 if (options.geometry == "D94"):
0030         from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9
0031         process = cms.Process('DigiValidation',Phase2C20I13M9)
0032 elif (options.geometry == "D104"):
0033         from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0034         process = cms.Process('DigiValidation',PhaseC22I13M9)
0035 elif (options.geometry == "D106"):
0036         from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0037         process = cms.Process('DigiValidation',PhaseC22I13M9)
0038 elif (options.geometry == "D109"):
0039         from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0040         process = cms.Process('DigiValidation',PhaseC22I13M9)
0041 else:
0042         from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0043         process = cms.Process('DigiValidation',Phase2C17I13M9)
0044 
0045 geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
0046 fileName = "file:DigiVal" + options.geometry + ".root"
0047 
0048 print("Geometry file: ", geomFile)
0049 print("Output file:   ", fileName)
0050 
0051 # import of standard configurations
0052 process.load(geomFile)
0053 process.load('Configuration.StandardSequences.Services_cff')
0054 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0055 process.load('FWCore.MessageService.MessageLogger_cfi')
0056 process.load('Configuration.EventContent.EventContent_cff')
0057 process.load('FWCore.MessageService.MessageLogger_cfi')
0058 process.load('Configuration.EventContent.EventContent_cff')
0059 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0060 process.load('Configuration.StandardSequences.MagneticField_cff')
0061 process.load('Configuration.StandardSequences.Generator_cff')
0062 process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi')
0063 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0064 process.load('Configuration.StandardSequences.SimIdeal_cff')
0065 process.load('Configuration.StandardSequences.Digi_cff')
0066 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0067 process.load('Configuration.StandardSequences.DigiToRaw_cff')
0068 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0069 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0070 from Configuration.AlCa.GlobalTag import GlobalTag
0071 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '')
0072 
0073 process.maxEvents = cms.untracked.PSet(
0074         input = cms.untracked.int32(10)
0075 )
0076 
0077 # Input source
0078 process.source = cms.Source("EmptySource")
0079 
0080 process.options = cms.untracked.PSet()
0081 
0082 # Production Info
0083 process.configurationMetadata = cms.untracked.PSet(
0084     version    = cms.untracked.string('$Revision: 1.20 $'),
0085     annotation = cms.untracked.string('SingleMuonPt10_cfi nevts:10'),
0086     name       = cms.untracked.string('Applications')
0087     )
0088 
0089 # Output definition
0090 
0091 process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule",
0092                           splitLevel                   = cms.untracked.int32(0),
0093                           eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0094                           outputCommands               = process.FEVTDEBUGHLTEventContent.outputCommands,
0095                           fileName                     = cms.untracked.string(fileName),
0096                           dataset                      = cms.untracked.PSet(
0097     filterName = cms.untracked.string(''),
0098     dataTier   = cms.untracked.string('GEN-SIM-DIGI-RAW')
0099     ),
0100                           SelectEvents                 = cms.untracked.PSet(SelectEvents = cms.vstring('generation_step'))
0101                           )
0102 
0103 # Additional output definition
0104 
0105 # Other statements
0106 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0107 
0108 process.generator = cms.EDProducer("FlatRandomPtGunProducer",
0109    PGunParameters = cms.PSet(
0110     MaxPt  = cms.double(10.01),
0111     MinPt  = cms.double(9.99),
0112     PartID = cms.vint32(13),
0113     MaxEta = cms.double(2.50),
0114     MaxPhi = cms.double(3.14159265359),
0115     MinEta = cms.double(1.75),
0116     MinPhi = cms.double(-3.14159265359)
0117     ),
0118    Verbosity       = cms.untracked.int32(0),
0119    psethack        = cms.string('single electron pt 10'),
0120    AddAntiParticle = cms.bool(True),
0121    firstRun        = cms.untracked.uint32(1)
0122 )
0123 
0124 process.mix.digitizers = cms.PSet(process.theDigitizersValid)
0125 
0126 # Path and EndPath definitions
0127 process.generation_step = cms.Path(process.pgen)
0128 process.simulation_step = cms.Path(process.psim)
0129 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
0130 process.digitisation_step = cms.Path(process.pdigi_valid)
0131 process.L1simulation_step = cms.Path(process.SimL1Emulator)
0132 process.digi2raw_step = cms.Path(process.DigiToRaw)
0133 process.endjob_step = cms.EndPath(process.endOfProcess)
0134 process.FEVTDEBUGHLToutput_step = cms.EndPath(process.FEVTDEBUGHLToutput)
0135 
0136 # Output definition
0137 process.ValidationOutput = cms.OutputModule("PoolOutputModule",
0138     outputCommands = cms.untracked.vstring('drop *', 'keep *_MEtoEDMConverter_*_*'),
0139     fileName = cms.untracked.string('file:output_digiVal_test.root'),
0140 )
0141 
0142 process.load("DQMServices.Core.DQM_cfg")
0143 process.load("DQMServices.Components.MEtoEDMConverter_cfi")
0144 
0145 process.load("Validation.HGCalValidation.digiValidation_cff")
0146 
0147 ## path and endpath deffinition 
0148 process.p1 = cms.Path(process.hgcalDigiValidationEE+
0149               process.hgcalDigiValidationHEF+
0150               process.hgcalDigiValidationHEB)
0151 process.p2 = cms.Path(process.MEtoEDMConverter)
0152 process.output_step = cms.EndPath(process.ValidationOutput)
0153 
0154 # Schedule definition
0155 process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,
0156                 process.simulation_step,process.digitisation_step,
0157                 process.L1simulation_step,process.digi2raw_step,
0158                 process.endjob_step,process.p1,process.p2,process.output_step)
0159 
0160 # filter all path with the production filter sequence
0161 for path in process.paths:
0162         getattr(process,path)._seq = process.generator * getattr(process,path)._seq
0163     
0164 for label, prod in process.producers_().items():
0165         if prod.type_() == "OscarMTProducer":
0166             # ugly hack
0167             prod.__dict__['_TypedParameterizable__type'] = "OscarProducer"