Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-07 22:23:03

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun runHGCalBHValid_cfg.py geometry=D88
0004 #
0005 #   Options for geometry D77, D83, D88, D92
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import os, sys, imp, re
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 
0012 ####################################################################
0013 ### SETUP OPTIONS
0014 options = VarParsing.VarParsing('standard')
0015 options.register('geometry',
0016                  "D77",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: D77, D83, D88, D92")
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 == "D83"):
0030     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0031     process = cms.Process('HGCGeomAnalysis',Phase2C11M9)
0032     process.load('Configuration.Geometry.GeometryExtended2026D83_cff')
0033     process.load('Configuration.Geometry.GeometryExtended2026D83Reco_cff')
0034     fileName = 'hgcBHValidD83.root'
0035 elif (options.geometry == "D88"):
0036     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0037     process = cms.Process('HGCGeomAnalysis',Phase2C11M9)
0038     process.load('Configuration.Geometry.GeometryExtended2026D88_cff')
0039     process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0040     fileName = 'hgcBHValidD88.root'
0041 elif (options.geometry == "D92"):
0042     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0043     process = cms.Process('HGCGeomAnalysis',Phase2C11M9)
0044     process.load('Configuration.Geometry.GeometryExtended2026D92_cff')
0045     process.load('Configuration.Geometry.GeometryExtended2026D92Reco_cff')
0046     fileName = 'hgcBHValidD92.root'
0047 else:
0048     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0049     process = cms.Process('HGCGeomAnalysis',Phase2C11)
0050     process.load('Configuration.Geometry.GeometryExtended2026D77_cff')
0051     process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff')
0052     fileName = 'hgcBHValidD77.root'
0053 
0054 print("Output file: ", fileName)
0055 
0056 # import of standard configurations
0057 process.load('Configuration.StandardSequences.Services_cff')
0058 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0059 process.load('FWCore.MessageService.MessageLogger_cfi')
0060 process.load('Configuration.EventContent.EventContent_cff')
0061 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0062 process.load('Configuration.StandardSequences.MagneticField_cff')
0063 process.load('Configuration.StandardSequences.Generator_cff')
0064 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi')
0065 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0066 process.load('Configuration.StandardSequences.SimIdeal_cff')
0067 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0068 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0069 process.load('Configuration.StandardSequences.Digi_cff')
0070 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0071 process.load('Configuration.StandardSequences.L1TrackTrigger_cff')
0072 process.load('Configuration.StandardSequences.DigiToRaw_cff')
0073 process.load('HLTrigger.Configuration.HLT_Fake2_cff')
0074 process.load('Configuration.StandardSequences.RawToDigi_cff')
0075 process.load('Configuration.StandardSequences.L1Reco_cff')
0076 process.load('Configuration.StandardSequences.Reconstruction_cff')
0077 process.load('Configuration.StandardSequences.RecoSim_cff')
0078 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0079 
0080 process.maxEvents = cms.untracked.PSet(
0081     input = cms.untracked.int32(2000)
0082 )
0083 
0084 process.MessageLogger.cerr.FwkReport.reportEvery = 5
0085 # Input source
0086 process.source = cms.Source("EmptySource")
0087 
0088 process.options = cms.untracked.PSet(
0089     wantSummary = cms.untracked.bool(True)
0090 )
0091 
0092 # Production Info
0093 process.configurationMetadata = cms.untracked.PSet(
0094     version = cms.untracked.string(''),
0095     annotation = cms.untracked.string(''),
0096     name = cms.untracked.string('Applications')
0097 )
0098 
0099 if hasattr(process,'MessageLogger'):
0100     process.MessageLogger.ValidHGCal=dict()
0101     process.MessageLogger.HcalSim=dict()
0102 
0103 # Additional output definition
0104 process.load('Validation.HGCalValidation.hgcalBHValidation_cfi')
0105 
0106 process.TFileService = cms.Service("TFileService",
0107                                    fileName = cms.string(fileName),
0108                                    closeFileFast = cms.untracked.bool(True)
0109                                    )
0110 
0111 
0112 # Other statements
0113 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0114 from Configuration.AlCa.GlobalTag import GlobalTag
0115 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '')
0116 
0117 process.generator = cms.EDProducer("FlatRandomPtGunProducer",
0118     PGunParameters = cms.PSet(
0119         MaxPt = cms.double(35.0),
0120         MinPt = cms.double(35.0),
0121         PartID = cms.vint32(13), #--->muon
0122         MinPhi = cms.double(-3.14159265359),
0123         MaxPhi = cms.double(3.14159265359),
0124         MinEta = cms.double(1.2),
0125         MaxEta = cms.double(3.0)
0126     ),
0127     Verbosity = cms.untracked.int32(0),
0128     psethack = cms.string('single muon pt 35'),
0129     AddAntiParticle = cms.bool(True),
0130     firstRun = cms.untracked.uint32(1)
0131 )
0132 
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 
0143 # Path and EndPath definitions
0144 process.generation_step = cms.Path(process.pgen)
0145 process.simulation_step = cms.Path(process.psim)
0146 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
0147 process.digitisation_step = cms.Path(process.pdigi_valid)
0148 process.L1simulation_step = cms.Path(process.SimL1Emulator)
0149 process.L1TrackTrigger_step = cms.Path(process.L1TrackTrigger)
0150 process.digi2raw_step = cms.Path(process.DigiToRaw)
0151 process.raw2digi_step = cms.Path(process.RawToDigi)
0152 process.L1Reco_step = cms.Path(process.L1Reco)
0153 process.reconstruction_step = cms.Path(process.localreco)
0154 process.recosim_step = cms.Path(process.recosim)
0155 process.analysis_step = cms.Path(process.hgcalBHAnalysis)
0156 
0157 # Schedule definition
0158 process.schedule = cms.Schedule(process.generation_step,
0159                 process.simulation_step,
0160                 process.digitisation_step,
0161                                 process.L1simulation_step,
0162                                 process.L1TrackTrigger_step,
0163                                 process.digi2raw_step,
0164                                 process.raw2digi_step,
0165                                 process.L1Reco_step,
0166                                 process.reconstruction_step,
0167                                 process.recosim_step,
0168                                 process.analysis_step,
0169                 )
0170 
0171 # filter all path with the production filter sequence
0172 for path in process.paths:
0173         if getattr(process,path)._seq is not None: getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq