Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-13 01:32:32

0001 from __future__ import print_function
0002 
0003 import sys
0004 import os
0005 import FWCore.ParameterSet.Config as cms
0006 
0007 print('Number of arguments:', len(sys.argv), 'arguments.')
0008 print('Argument List:', str(sys.argv))
0009 # first arg : cmsRun
0010 # second arg : name of the _cfg file
0011 # third arg : sample name (ex. ZEE_14)
0012 
0013 from electronValidationCheck_Env import env
0014 
0015 cmsEnv = env()  # be careful, cmsEnv != cmsenv. cmsEnv is local
0016 
0017 cmsEnv.checkSample()  # check the sample value
0018 cmsEnv.checkValues()
0019 
0020 import DQMOffline.EGamma.electronDataDiscovery as dd
0021 
0022 if cmsEnv.beginTag() == 'Run2_2017':
0023     from Configuration.Eras.Era_Run2_2017_cff import Run2_2017
0024     process = cms.Process("electronValidation", Run2_2017)
0025 elif cmsEnv.beginTag() == 'Run3':
0026     from Configuration.Eras.Era_Run3_cff import Run3
0027     process = cms.Process('electronValidation', Run3) 
0028 else:
0029     from Configuration.Eras.Era_Phase2_cff import Phase2
0030     process = cms.Process('electronValidation', Phase2)
0031 
0032 process.DQMStore = cms.Service("DQMStore")
0033 process.load("DQMServices.Components.DQMStoreStats_cfi")
0034 from DQMServices.Components.DQMStoreStats_cfi import *
0035 
0036 dqmStoreStats.runOnEndJob = cms.untracked.bool(True)
0037 
0038 # max_skipped = 165
0039 max_number = -1  # 10 # number of events
0040 process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(max_number))
0041 # process.source = cms.Source ("PoolSource",skipEvents = cms.untracked.uint32(max_skipped), fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring())
0042 
0043 data = os.environ['data']
0044 flist = dd.getCMSdata(data)
0045 print(flist)
0046 process.source = cms.Source("PoolSource", fileNames=cms.untracked.vstring(*flist))
0047 
0048 # process.source = cms.Source ("PoolSource", fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring()) # std value
0049 # process.source.fileNames.extend(dd.search())  # to be commented for local run only
0050 
0051 # process.source = cms.Source ("PoolSource",
0052 #    fileNames = cms.untracked.vstring(
0053 #    [
0054 # 'file:/eos/user/a/archiron/HGCal_Shares/step3_A8F750A4-6D87-E711-A476-0CC47A4D7600.root',
0055 # 'file:/eos/user/a/archiron/HGCal_Shares/step3_AE79E794-7287-E711-9D2A-0CC47A78A3EE.root',
0056 # 'file:/eos/user/a/archiron/HGCal_Shares/step3_D801BDAF-7087-E711-AEF8-0CC47A7C354A.root',
0057 
0058 # 'file:/eos/user/r/rovere/www/shared/step3.root',
0059 
0060 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_9_3_2/RelValQCD_Pt-15To7000_Flat_14TeV/GEN-SIM-RECO/93X_upgrade2023_realistic_v2_2023D17noPU-v1/10000/00FF6760-F8A6-E711-AA68-0025905A60D6.root',
0061 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_11_3_0_pre4/RelValZEE_14/GEN-SIM-RECO/113X_mcRun4_realistic_v4_2026D76noPU-v1/00000/0d87e1b9-1398-4a32-9775-e2d170c00df3.root',
0062 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_11_3_0_pre4/RelValZEE_14/GEN-SIM-RECO/113X_mcRun4_realistic_v4_2026D76noPU-v1/00000/22bff740-c71a-4527-a6ac-58360438960b.root',
0063 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_11_3_0_pre4/RelValZEE_14/GEN-SIM-RECO/113X_mcRun4_realistic_v4_2026D76noPU-v1/00000/268ccf98-9216-493b-a1ff-403db31fbfd2.root',
0064 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_11_3_0_pre4/RelValZEE_14/GEN-SIM-RECO/113X_mcRun4_realistic_v4_2026D76noPU-v1/00000/515c0b30-2803-490e-a1bf-06722f934a2f.root',
0065 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_11_3_0_pre4/RelValZEE_14/GEN-SIM-RECO/113X_mcRun4_realistic_v4_2026D76noPU-v1/00000/7f266520-2cf7-4245-859c-3cb82b4e4cea.root',
0066 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_11_3_0_pre4/RelValZEE_14/GEN-SIM-RECO/113X_mcRun4_realistic_v4_2026D76noPU-v1/00000/9c7caca7-9179-4d91-a4fa-2cc37cef73a1.root',
0067 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_11_3_0_pre4/RelValZEE_14/GEN-SIM-RECO/113X_mcRun4_realistic_v4_2026D76noPU-v1/00000/a75081f2-16e5-499e-ac41-6b98afddbf28.root',
0068 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_11_3_0_pre4/RelValZEE_14/GEN-SIM-RECO/113X_mcRun4_realistic_v4_2026D76noPU-v1/00000/b714a540-be23-423c-9b71-b92b07235dde.root',
0069 # 'root://cms-xrd-global.cern.ch//store/relval/CMSSW_11_3_0_pre4/RelValZEE_14/GEN-SIM-RECO/113X_mcRun4_realistic_v4_2026D76noPU-v1/00000/cf9fb9fc-8450-4d7f-a285-41007aed4158.root',
0070 
0071 # ]
0072 # )
0073 # )  # for local run only
0074 
0075 process.load('Configuration.StandardSequences.Services_cff')
0076 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0077 process.load('FWCore.MessageService.MessageLogger_cfi')
0078 process.load('Configuration.EventContent.EventContent_cff')
0079 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0080 process.load('Configuration.StandardSequences.GeometryDB_cff')
0081 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0082 process.load('Configuration.StandardSequences.RawToDigi_cff')
0083 process.load('Configuration.StandardSequences.Reconstruction_cff')
0084 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0085 process.load("Configuration.StandardSequences.EDMtoMEAtJobEnd_cff")  # new
0086 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0087 
0088 from Configuration.AlCa.autoCond import autoCond
0089 
0090 # process.GlobalTag.globaltag = os.environ['TEST_GLOBAL_TAG'] + '::All'
0091 #process.GlobalTag.globaltag = '120X_mcRun3_2021_realistic_v1'
0092 process.GlobalTag.globaltag = '123X_mcRun3_2021_realistic_v14'
0093 # process.GlobalTag.globaltag = '113X_mcRun3_2021_realistic_v4'
0094 # process.GlobalTag.globaltag = '93X_mc2017_realistic_v1'
0095 # process.GlobalTag.globaltag = '92X_upgrade2017_realistic_v10'
0096 
0097 # FOR DATA REDONE FROM RAW, ONE MUST HIDE IsoFromDeps
0098 # CONFIGURATION
0099 process.load("Validation.RecoEgamma.electronIsoFromDeps_cff")
0100 process.load("Validation.RecoEgamma.ElectronMcSignalValidator_gedGsfElectrons_cfi")
0101 
0102 # load DQM
0103 process.load("DQMServices.Core.DQM_cfg")
0104 process.load("DQMServices.Components.DQMEnvironment_cfi")
0105 
0106 process.EDM = cms.OutputModule("PoolOutputModule",
0107                                outputCommands=cms.untracked.vstring('drop *', "keep *_MEtoEDMConverter_*_*"),
0108                                fileName=cms.untracked.string(os.environ['outputFile'])#.replace("_a.root", ".root"))
0109                                # fileName = cms.untracked.string('electronHistos.ValFullZEEStartup_13_gedGsfE_a.root') # for local run only
0110                                )
0111 
0112 process.electronMcSignalValidator.InputFolderName = cms.string("EgammaV/ElectronMcSignalValidator")
0113 process.electronMcSignalValidator.OutputFolderName = cms.string("EgammaV/ElectronMcSignalValidator")
0114 
0115 # process.p = cms.Path(process.electronIsoFromDeps * process.electronMcSignalValidator * process.MEtoEDMConverter * process.dqmStoreStats)
0116 process.p = cms.Path(process.electronMcSignalValidator * process.MEtoEDMConverter * process.dqmStoreStats)
0117 
0118 process.outpath = cms.EndPath(
0119     process.EDM,
0120 )