Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun protoSimValid_cfg.py geometry=D77 type=hgcalBHValidation
0004 #
0005 #   Options for geometry D49, D68, D77, D83, D84, D88, D92
0006 #               type hgcalBHValidation, hgcalSiliconValidation
0007 #
0008 ###############################################################################
0009 import FWCore.ParameterSet.Config as cms
0010 import os, sys, imp, re
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012 
0013 ############################################################
0014 ### SETUP OPTIONS
0015 options = VarParsing.VarParsing('standard')
0016 options.register('geometry',
0017                  "D88",
0018                   VarParsing.VarParsing.multiplicity.singleton,
0019                   VarParsing.VarParsing.varType.string,
0020                   "geometry of operations: D49, D68, D77, D83, D84, D88, D92")
0021 options.register ('type',
0022                   "hgcalBHValidation",
0023                   VarParsing.VarParsing.multiplicity.singleton,
0024                   VarParsing.VarParsing.varType.string,
0025                   "type of operations: hgcalBHValidation, hgcalSiliconValidation")
0026 
0027 ### get and parse the command line arguments
0028 options.parseArguments()
0029 
0030 print(options)
0031 
0032 ############################################################
0033 # Use the options
0034 
0035 if (options.geometry == "D49"):
0036     from Configuration.Eras.Era_Phase2C9_cff import Phase2C9
0037     process = cms.Process('PROD',Phase2C9)
0038     process.load('Configuration.Geometry.GeometryExtended2026D49_cff')
0039     process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
0040     if (options.type == "hgcalSiliconValidation"):
0041         fileName = 'hgcSilValidD49.root'
0042     else:
0043         fileName = 'hgcBHValidD49.root'
0044 elif (options.geometry == "D68"):
0045     from Configuration.Eras.Era_Phase2C12_cff import Phase2C12
0046     process = cms.Process('PROD',Phase2C12)
0047     process.load('Configuration.Geometry.GeometryExtended2026D68_cff')
0048     process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff')
0049     if (options.type == "hgcalSiliconValidation"):
0050         fileName = 'hgcSilValidD68.root'
0051     else:
0052         fileName = 'hgcBHValidD68.root'
0053 elif (options.geometry == "D83"):
0054     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0055     process = cms.Process('PROD',Phase2C11M9)
0056     process.load('Configuration.Geometry.GeometryExtended2026D83_cff')
0057     process.load('Configuration.Geometry.GeometryExtended2026D83Reco_cff')
0058     if (options.type == "hgcalSiliconValidation"):
0059         fileName = 'hgcSilValidD83.root'
0060     else:
0061         fileName = 'hgcBHValidD83.root'
0062 elif (options.geometry == "D84"):
0063     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0064     process = cms.Process('PROD',Phase2C11)
0065     process.load('Configuration.Geometry.GeometryExtended2026D84_cff')
0066     process.load('Configuration.Geometry.GeometryExtended2026D84Reco_cff')
0067     if (options.type == "hgcalSiliconValidation"):
0068         fileName = 'hgcSilValidD84.root'
0069     else:
0070         fileName = 'hgcBHValidD84.root'
0071 elif (options.geometry == "D88"):
0072     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0073     process = cms.Process('PROD',Phase2C11)
0074     process.load('Configuration.Geometry.GeometryExtended2026D88_cff')
0075     process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0076     if (options.type == "hgcalSiliconValidation"):
0077         fileName = 'hgcSilValidD88.root'
0078     else:
0079         fileName = 'hgcBHValidD88.root'
0080 elif (options.geometry == "D92"):
0081     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0082     process = cms.Process('PROD',Phase2C11)
0083     process.load('Configuration.Geometry.GeometryExtended2026D92_cff')
0084     process.load('Configuration.Geometry.GeometryExtended2026D92Reco_cff')
0085     if (options.type == "hgcalSiliconValidation"):
0086         fileName = 'hgcSilValidD92.root'
0087     else:
0088         fileName = 'hgcBHValidD92.root'
0089 else:
0090     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0091     process = cms.Process('PROD',Phase2C11M9)
0092     process.load('Configuration.Geometry.GeometryExtended2026D77_cff')
0093     process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff')
0094     if (options.type == "hgcalSiliconValidation"):
0095         fileName = 'hgcSilValidD77.root'
0096     else:
0097         fileName = 'hgcBHValidD77.root'
0098 
0099 # import of standard configurations
0100 process.load('Configuration.StandardSequences.Services_cff')
0101 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0102 process.load('FWCore.MessageService.MessageLogger_cfi')
0103 process.load('Configuration.EventContent.EventContent_cff')
0104 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0105 process.load('Configuration.StandardSequences.MagneticField_cff')
0106 process.load('Configuration.StandardSequences.Generator_cff')
0107 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi')
0108 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0109 process.load('Configuration.StandardSequences.SimIdeal_cff')
0110 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0111 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0112 process.load('Configuration.StandardSequences.Digi_cff')
0113 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0114 process.load('Configuration.StandardSequences.L1TrackTrigger_cff')
0115 process.load('Configuration.StandardSequences.DigiToRaw_cff')
0116 process.load('HLTrigger.Configuration.HLT_Fake2_cff')
0117 process.load('Configuration.StandardSequences.RawToDigi_cff')
0118 process.load('Configuration.StandardSequences.L1Reco_cff')
0119 process.load('Configuration.StandardSequences.Reconstruction_cff')
0120 process.load('Configuration.StandardSequences.RecoSim_cff')
0121 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0122 
0123 process.maxEvents = cms.untracked.PSet(
0124     input = cms.untracked.int32(2000)
0125 )
0126 
0127 process.MessageLogger.cerr.FwkReport.reportEvery = 5
0128 if hasattr(process,'MessageLogger'):
0129     process.MessageLogger.HGCalGeom=dict()
0130 
0131 # Input source
0132 process.source = cms.Source("EmptySource")
0133 
0134 process.generator = cms.EDProducer("FlatRandomPtGunProducer",
0135     PGunParameters = cms.PSet(
0136         MaxPt = cms.double(35.0),
0137         MinPt = cms.double(35.0),
0138         PartID = cms.vint32(13), #--->muon
0139         MinPhi = cms.double(-3.14159265359),
0140         MaxPhi = cms.double(3.14159265359),
0141         MinEta = cms.double(1.2),
0142         MaxEta = cms.double(3.0)
0143     ),
0144     Verbosity = cms.untracked.int32(0),
0145     psethack = cms.string('single muon pt 35'),
0146     AddAntiParticle = cms.bool(True),
0147     firstRun = cms.untracked.uint32(1)
0148 )
0149 
0150 process.options = cms.untracked.PSet(
0151     wantSummary = cms.untracked.bool(True)
0152 )
0153 
0154 # Production Info
0155 process.configurationMetadata = cms.untracked.PSet(
0156     version = cms.untracked.string(''),
0157     annotation = cms.untracked.string(''),
0158     name = cms.untracked.string('Applications')
0159 )
0160 
0161 # Other statements
0162 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0163 from Configuration.AlCa.GlobalTag import GlobalTag
0164 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0165 
0166 # Additional output definition
0167 process.TFileService = cms.Service("TFileService",
0168                                    fileName = cms.string(fileName),
0169                                    closeFileFast = cms.untracked.bool(True) )
0170 
0171 #Modified to produce hgceedigis
0172 process.mix.digitizers = cms.PSet(process.theDigitizersValid)
0173 process.ProductionFilterSequence = cms.Sequence(process.generator)
0174 
0175 #Following Removes Mag Field
0176 process.g4SimHits.UseMagneticField = False
0177 process.g4SimHits.Physics.bField = cms.double(0.0)
0178 
0179 # Path and EndPath definitions
0180 process.generation_step = cms.Path(process.pgen)
0181 process.simulation_step = cms.Path(process.psim)
0182 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
0183 process.digitisation_step = cms.Path(process.pdigi_valid)
0184 process.L1simulation_step = cms.Path(process.SimL1Emulator)
0185 process.L1TrackTrigger_step = cms.Path(process.L1TrackTrigger)
0186 process.digi2raw_step = cms.Path(process.DigiToRaw)
0187 process.raw2digi_step = cms.Path(process.RawToDigi)
0188 process.L1Reco_step = cms.Path(process.L1Reco)
0189 process.reconstruction_step = cms.Path(process.localreco)
0190 process.recosim_step = cms.Path(process.recosim)
0191 
0192 if (options.type == "hgcalSiliconValidation"):
0193     process.load('Validation.HGCalValidation.hgcalSiliconValidation_cfi')
0194     process.analysis_step = cms.Path(process.hgcalSiliconAnalysisEE+process.hgcalSiliconAnalysisHEF)
0195 else:
0196     process.load('Validation.HGCalValidation.hgcalBHValidation_cfi')
0197     process.analysis_step = cms.Path(process.hgcalBHAnalysis)
0198 
0199 # Schedule definition
0200 process.schedule = cms.Schedule(process.generation_step,
0201                 process.simulation_step,
0202                 process.digitisation_step,
0203                                 process.L1simulation_step,
0204                                 process.L1TrackTrigger_step,
0205                                 process.digi2raw_step,
0206                                 process.raw2digi_step,
0207                                 process.L1Reco_step,
0208                                 process.reconstruction_step,
0209                                 process.recosim_step,
0210                                 process.analysis_step,
0211                 )
0212 
0213 # filter all path with the production filter sequence
0214 for path in process.paths:
0215         if getattr(process,path)._seq is not None: getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq