Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-20 22:40:15

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun protoSimValid_cfg.py geometry=D99 type=hgcalBHValidation
0004 #
0005 #   Options for geometry D98, D99, D108, D94, D103, D104, D106, D107, D108,
0006 #                        D109, D110, D111, D112, D113
0007 #               type hgcalBHValidation, hgcalSiliconValidation
0008 #
0009 ###############################################################################
0010 import FWCore.ParameterSet.Config as cms
0011 import os, sys, importlib, re
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013 
0014 ############################################################
0015 ### SETUP OPTIONS
0016 options = VarParsing.VarParsing('standard')
0017 options.register('geometry',
0018                  "D99",
0019                   VarParsing.VarParsing.multiplicity.singleton,
0020                   VarParsing.VarParsing.varType.string,
0021                   "geometry of operations: D98, D99, D108, D94, D103, D104, D106, D107, D108, D109, D110, D111, D112, D113")
0022 options.register ('type',
0023                   "hgcalBHValidation",
0024                   VarParsing.VarParsing.multiplicity.singleton,
0025                   VarParsing.VarParsing.varType.string,
0026                   "type of operations: hgcalBHValidation, hgcalSiliconValidation")
0027 
0028 ### get and parse the command line arguments
0029 options.parseArguments()
0030 
0031 print(options)
0032 
0033 ############################################################
0034 # Use the options
0035 
0036 if (options.geometry == "D94"):
0037     from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9
0038     process = cms.Process('PROD',Phase2C20I13M9)
0039 elif (options.geometry == "D104"):
0040     from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0041     process = cms.Process('PROD',PhaseC22I13M9)
0042 elif (options.geometry == "D106"):
0043     from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0044     process = cms.Process('PROD',PhaseC22I13M9)
0045 elif (options.geometry == "D109"):
0046     from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0047     process = cms.Process('PROD',PhaseC22I13M9)
0048 else:
0049     from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0050     process = cms.Process('PROD',Phase2C17I13M9)
0051 
0052 geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
0053 if (options.type == "hgcalSiliconValidation"):
0054     fileName = "hgcSilValid" + options.geometry + ".root"
0055 else:
0056     fileName = "hgcBHValid" + options.geometry + ".root"
0057 
0058 print("Geometry file: ", geomFile)
0059 print("Output file:   ", fileName)
0060 
0061 # import of standard configurations
0062 process.load(geomFile)
0063 process.load('Configuration.StandardSequences.Services_cff')
0064 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0065 process.load('FWCore.MessageService.MessageLogger_cfi')
0066 process.load('Configuration.EventContent.EventContent_cff')
0067 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0068 process.load('Configuration.StandardSequences.MagneticField_cff')
0069 process.load('Configuration.StandardSequences.Generator_cff')
0070 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi')
0071 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0072 process.load('Configuration.StandardSequences.SimIdeal_cff')
0073 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0074 process.load('Configuration.StandardSequences.Digi_cff')
0075 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0076 process.load('Configuration.StandardSequences.L1TrackTrigger_cff')
0077 process.load('Configuration.StandardSequences.DigiToRaw_cff')
0078 process.load('HLTrigger.Configuration.HLT_Fake2_cff')
0079 process.load('Configuration.StandardSequences.RawToDigi_cff')
0080 process.load('Configuration.StandardSequences.L1Reco_cff')
0081 process.load('Configuration.StandardSequences.Reconstruction_cff')
0082 process.load('Configuration.StandardSequences.RecoSim_cff')
0083 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0084 
0085 process.maxEvents = cms.untracked.PSet(
0086     input = cms.untracked.int32(2000)
0087 )
0088 
0089 process.MessageLogger.cerr.FwkReport.reportEvery = 5
0090 if hasattr(process,'MessageLogger'):
0091     process.MessageLogger.HGCalGeom=dict()
0092 
0093 # Input source
0094 process.source = cms.Source("EmptySource")
0095 
0096 process.generator = cms.EDProducer("FlatRandomPtGunProducer",
0097     PGunParameters = cms.PSet(
0098         MaxPt = cms.double(35.0),
0099         MinPt = cms.double(35.0),
0100         PartID = cms.vint32(13), #--->muon
0101         MinPhi = cms.double(-3.14159265359),
0102         MaxPhi = cms.double(3.14159265359),
0103         MinEta = cms.double(1.2),
0104         MaxEta = cms.double(3.0)
0105     ),
0106     Verbosity = cms.untracked.int32(0),
0107     psethack = cms.string('single muon pt 35'),
0108     AddAntiParticle = cms.bool(True),
0109     firstRun = cms.untracked.uint32(1)
0110 )
0111 
0112 process.options = cms.untracked.PSet(
0113     wantSummary = cms.untracked.bool(True)
0114 )
0115 
0116 # Production Info
0117 process.configurationMetadata = cms.untracked.PSet(
0118     version = cms.untracked.string(''),
0119     annotation = cms.untracked.string(''),
0120     name = cms.untracked.string('Applications')
0121 )
0122 
0123 # Other statements
0124 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0125 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0126 from Configuration.AlCa.GlobalTag import GlobalTag
0127 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '')
0128 
0129 # Additional output definition
0130 process.TFileService = cms.Service("TFileService",
0131                                    fileName = cms.string(fileName),
0132                                    closeFileFast = cms.untracked.bool(True) )
0133 
0134 #Modified to produce hgceedigis
0135 process.mix.digitizers = cms.PSet(process.theDigitizersValid)
0136 process.ProductionFilterSequence = cms.Sequence(process.generator)
0137 
0138 #Following Removes Mag Field
0139 process.g4SimHits.UseMagneticField = False
0140 process.g4SimHits.Physics.bField = cms.double(0.0)
0141 
0142 # Path and EndPath definitions
0143 process.generation_step = cms.Path(process.pgen)
0144 process.simulation_step = cms.Path(process.psim)
0145 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
0146 process.digitisation_step = cms.Path(process.pdigi_valid)
0147 process.L1simulation_step = cms.Path(process.SimL1Emulator)
0148 process.L1TrackTrigger_step = cms.Path(process.L1TrackTrigger)
0149 process.digi2raw_step = cms.Path(process.DigiToRaw)
0150 process.raw2digi_step = cms.Path(process.RawToDigi)
0151 process.L1Reco_step = cms.Path(process.L1Reco)
0152 process.reconstruction_step = cms.Path(process.localreco)
0153 process.recosim_step = cms.Path(process.recosim)
0154 
0155 if (options.type == "hgcalSiliconValidation"):
0156     process.load('Validation.HGCalValidation.hgcalSiliconValidation_cfi')
0157     process.analysis_step = cms.Path(process.hgcalSiliconAnalysisEE+process.hgcalSiliconAnalysisHEF)
0158 else:
0159     process.load('Validation.HGCalValidation.hgcalBHValidation_cfi')
0160     process.analysis_step = cms.Path(process.hgcalBHAnalysis)
0161 
0162 # Schedule definition
0163 process.schedule = cms.Schedule(process.generation_step,
0164                 process.simulation_step,
0165                 process.digitisation_step,
0166                                 process.L1simulation_step,
0167                                 process.L1TrackTrigger_step,
0168                                 process.digi2raw_step,
0169                                 process.raw2digi_step,
0170                                 process.L1Reco_step,
0171                                 process.reconstruction_step,
0172                                 process.recosim_step,
0173                                 process.analysis_step,
0174                 )
0175 
0176 # filter all path with the production filter sequence
0177 for path in process.paths:
0178         if getattr(process,path)._seq is not None: getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq