Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:38

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