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 protoValid_cfg.py geometry=D77 type=hgcalSimHitStudy defaultInput=1
0004 #
0005 #   Options for geometry D49, D68, D77, D83, D84, D88, D92
0006 #               type hgcalGeomCheck, hgcalSimHitStudy, hgcalDigiStudy,
0007 #                    hgcalRecHitStudy, hgcalSiliconValidation
0008 #               defaultInput 1, 0
0009 #
0010 ###############################################################################
0011 import FWCore.ParameterSet.Config as cms
0012 import os, sys, imp, re
0013 import FWCore.ParameterSet.VarParsing as VarParsing
0014 
0015 ############################################################
0016 ### SETUP OPTIONS
0017 options = VarParsing.VarParsing('standard')
0018 options.register('geometry',
0019                  "D88",
0020                   VarParsing.VarParsing.multiplicity.singleton,
0021                   VarParsing.VarParsing.varType.string,
0022                   "geometry of operations: D49, D68, D77, D83, D84, D88, D92")
0023 options.register('type',
0024                  "hgcalGeomCheck",
0025                  VarParsing.VarParsing.multiplicity.singleton,
0026                  VarParsing.VarParsing.varType.string,
0027                  "type of operations: hgcalGeomCheck, hgcalSimHitStudy, hgcalDigiStudy, hgcalRecHitStudy, hgcalSiliconValidation")
0028 options.register('defaultInput',
0029                  1, # default Value = true
0030                  VarParsing.VarParsing.multiplicity.singleton,
0031                  VarParsing.VarParsing.varType.int,
0032                  "change files path in case of defaultInput=0 for using DIGI o/p")
0033 
0034 ### get and parse the command line arguments
0035 options.parseArguments()
0036 
0037 print(options)
0038 
0039 ############################################################
0040 # Use the options
0041 
0042 if (options.geometry == "D49"):
0043     from Configuration.Eras.Era_Phase2C9_cff import Phase2C9
0044     process = cms.Process('PROD',Phase2C9)
0045     process.load('Configuration.Geometry.GeometryExtended2026D49_cff')
0046     process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
0047     fileCheck = 'testHGCalSimWatcherV11.root'
0048     if (options.type == "hgcalSimHitStudy"):
0049         fileName = 'hgcSimHitD49.root'
0050     elif (options.type == "hgcalDigiStudy"):
0051         fileName = 'hgcDigiD49.root'
0052     elif (options.type == "hgcalRecHitStudy"):
0053         fileName = 'hgcRecHitD49.root'
0054     elif (options.type == "hgcalSiliconValidation"):
0055         if (options.defaultInput == 0):
0056             fileName = 'hgcDigValidD49.root'
0057         else:
0058             fileName = 'hgcSilValidD49.root'
0059     else:
0060         fileName = 'hgcGeomCheckD49.root'
0061 elif (options.geometry == "D68"):
0062     from Configuration.Eras.Era_Phase2C12_cff import Phase2C12
0063     process = cms.Process('PROD',Phase2C12)
0064     process.load('Configuration.Geometry.GeometryExtended2026D68_cff')
0065     process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff')
0066     fileCheck = 'testHGCalSimWatcherV12.root'
0067     if (options.type == "hgcalSimHitStudy"):
0068         fileName = 'hgcSimHitD68.root'
0069     elif (options.type == "hgcalDigiStudy"):
0070         fileName = 'hgcDigiD68.root'
0071     elif (options.type == "hgcalRecHitStudy"):
0072         fileName = 'hgcRecHitD68.root'
0073     elif (options.type == "hgcalSiliconValidation"):
0074         if (options.defaultInput == 0):
0075             fileName = 'hgcDigValidD68.root'
0076         else:
0077             fileName = 'hgcSilValidD68.root'
0078     else:
0079         fileName = 'hgcGeomCheckD68.root'
0080 elif (options.geometry == "D83"):
0081     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0082     process = cms.Process('PROD',Phase2C11M9)
0083     process.load('Configuration.Geometry.GeometryExtended2026D83_cff')
0084     process.load('Configuration.Geometry.GeometryExtended2026D83Reco_cff')
0085     fileCheck = 'testHGCalSimWatcherV15.root'
0086     if (options.type == "hgcalSimHitStudy"):
0087         fileName = 'hgcSimHitD83.root'
0088     elif (options.type == "hgcalDigiStudy"):
0089         fileName = 'hgcDigiD83.root'
0090     elif (options.type == "hgcalRecHitStudy"):
0091         fileName = 'hgcRecHitD83.root'
0092     elif (options.type == "hgcalSiliconValidation"):
0093         if (options.defaultInput == 0):
0094             fileName = 'hgcDigValidD83.root'
0095         else:
0096             fileName = 'hgcSilValidD83.root'
0097     else:
0098         fileName = 'hgcGeomCheckD83.root'
0099 elif (options.geometry == "D84"):
0100     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0101     process = cms.Process('PROD',Phase2C11)
0102     process.load('Configuration.Geometry.GeometryExtended2026D84_cff')
0103     process.load('Configuration.Geometry.GeometryExtended2026D84Reco_cff')
0104     fileCheck = 'testHGCalSimWatcherV13.root'
0105     if (options.type == "hgcalSimHitStudy"):
0106         fileName = 'hgcSimHitD84.root'
0107     elif (options.type == "hgcalDigiStudy"):
0108         fileName = 'hgcDigiD84.root'
0109     elif (options.type == "hgcalRecHitStudy"):
0110         fileName = 'hgcRecHitD84.root'
0111     elif (options.type == "hgcalSiliconValidation"):
0112         if (options.defaultInput == 0):
0113             fileName = 'hgcDigValidD84.root'
0114         else:
0115             fileName = 'hgcSilValidD84.root'
0116     else:
0117         fileName = 'hgcGeomCheckD84.root'
0118 elif (options.geometry == "D88"):
0119     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0120     process = cms.Process('PROD',Phase2C11)
0121     process.load('Configuration.Geometry.GeometryExtended2026D88_cff')
0122     process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0123     fileCheck = 'testHGCalSimWatcherV16.root'
0124     if (options.type == "hgcalSimHitStudy"):
0125         fileName = 'hgcSimHitD88.root'
0126     elif (options.type == "hgcalDigiStudy"):
0127         fileName = 'hgcDigiD88.root'
0128     elif (options.type == "hgcalRecHitStudy"):
0129         fileName = 'hgcRecHitD88.root'
0130     elif (options.type == "hgcalSiliconValidation"):
0131         if (options.defaultInput == 0):
0132             fileName = 'hgcDigValidD88.root'
0133         else:
0134             fileName = 'hgcSilValidD88.root'
0135     else:
0136         fileName = 'hgcGeomCheckD88.root'
0137 elif (options.geometry == "D92"):
0138     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0139     process = cms.Process('PROD',Phase2C11)
0140     process.load('Configuration.Geometry.GeometryExtended2026D92_cff')
0141     process.load('Configuration.Geometry.GeometryExtended2026D92Reco_cff')
0142     fileCheck = 'testHGCalSimWatcherV17.root'
0143     if (options.type == "hgcalSimHitStudy"):
0144         fileName = 'hgcSimHitD92.root'
0145     elif (options.type == "hgcalDigiStudy"):
0146         fileName = 'hgcDigiD92.root'
0147     elif (options.type == "hgcalRecHitStudy"):
0148         fileName = 'hgcRecHitD92.root'
0149     elif (options.type == "hgcalSiliconValidation"):
0150         if (options.defaultInput == 0):
0151             fileName = 'hgcDigValidD92.root'
0152         else:
0153             fileName = 'hgcSilValidD92.root'
0154     else:
0155         fileName = 'hgcGeomCheckD92.root'
0156 else:
0157     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0158     process = cms.Process('PROD',Phase2C11M9)
0159     process.load('Configuration.Geometry.GeometryExtended2026D77_cff')
0160     process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff')
0161     fileCheck = 'testHGCalSimWatcherV14.root'
0162     if (options.type == "hgcalSimHitStudy"):
0163         fileName = 'hgcSimHitD77.root'
0164     elif (options.type == "hgcalDigiStudy"):
0165         fileName = 'hgcDigiD77.root'
0166     elif (options.type == "hgcalRecHitStudy"):
0167         fileName = 'hgcRecHitD77.root'
0168     elif (options.type == "hgcalSiliconValidation"):
0169         if (options.defaultInput == 0):
0170             fileName = 'hgcDigValidD77.root'
0171         else:
0172             fileName = 'hgcSilValidD77.root'
0173     else:
0174         fileName = 'hgcGeomCheckD77.root'
0175 
0176 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0177 process.load("Configuration.StandardSequences.MagneticField_cff")
0178 process.load('Configuration.StandardSequences.Services_cff')
0179 process.load("Configuration.EventContent.EventContent_cff")
0180 process.load('FWCore.MessageService.MessageLogger_cfi')
0181 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0182 from Configuration.AlCa.autoCond import autoCond
0183 process.GlobalTag.globaltag = autoCond['phase2_realistic']
0184 
0185 process.MessageLogger.cerr.FwkReport.reportEvery = 5
0186 if hasattr(process,'MessageLogger'):
0187     process.MessageLogger.HGCalGeom=dict()
0188 
0189 if (options.type == "hgcalSimHitStudy"):
0190     process.load('Validation.HGCalValidation.hgcSimHitStudy_cfi')
0191     process.source = cms.Source("PoolSource",
0192                                 fileNames = cms.untracked.vstring('file:step1.root') )
0193     process.analysis_step = cms.Path(process.hgcalSimHitStudy)
0194 elif (options.type == "hgcalDigiStudy"):
0195     process.load('Configuration.StandardSequences.RawToDigi_cff')
0196     process.load('Validation.HGCalValidation.hgcDigiStudy_cfi')
0197     process.source = cms.Source("PoolSource",
0198                                 fileNames = cms.untracked.vstring('file:step2.root') )
0199     process.analysis_step = cms.Path(process.RawToDigi+process.hgcalDigiStudyEE+process.hgcalDigiStudyHEF+process.hgcalDigiStudyHEB)
0200 elif (options.type == "hgcalRecHitStudy"):
0201     process.load('Validation.HGCalValidation.hgcalRecHitStudy_cff')
0202     process.source = cms.Source("PoolSource",
0203                                 fileNames = cms.untracked.vstring('file:step3.root') )
0204     process.analysis_step = cms.Path(process.hgcalRecHitStudyEE+process.hgcalRecHitStudyFH+process.hgcalRecHitStudyBH)
0205 elif (options.type == "hgcalSiliconValidation"):
0206     if (options.defaultInput == 0):
0207         fileIn = "file:step2.root"
0208     else:
0209         fileIn = "file:step1.root"
0210     process.load('Validation.HGCalValidation.hgcalSiliconValidation_cfi')
0211     process.source = cms.Source("PoolSource",
0212                                 fileNames = cms.untracked.vstring(fileIn) )
0213     process.analysis_step = cms.Path(process.hgcalSiliconAnalysisEE+process.hgcalSiliconAnalysisHEF)
0214 else:
0215     process.load('Validation.HGCalValidation.hgcGeomCheck_cff')
0216     process.source = cms.Source("PoolSource",
0217                                 fileNames = cms.untracked.vstring(fileCheck)
0218     )
0219     process.analysis_step = cms.Path(process.hgcGeomCheck)
0220 
0221 
0222 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
0223 process.TFileService = cms.Service("TFileService",
0224                                    fileName = cms.string(fileName),
0225                                    closeFileFast = cms.untracked.bool(True) )
0226 process.options = cms.untracked.PSet(
0227     wantSummary = cms.untracked.bool(True)
0228 )
0229 
0230 # Schedule definition
0231 process.schedule = cms.Schedule(process.analysis_step)