Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-10 02:51: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 #    ]
0061 #    )
0062 #)  # for local run only
0063 
0064 process.load('Configuration.StandardSequences.Services_cff')
0065 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0066 process.load('FWCore.MessageService.MessageLogger_cfi')
0067 process.load('Configuration.EventContent.EventContent_cff')
0068 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0069 process.load('Configuration.StandardSequences.GeometryDB_cff')
0070 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0071 process.load('Configuration.StandardSequences.RawToDigi_cff')
0072 process.load('Configuration.StandardSequences.Reconstruction_cff')
0073 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0074 process.load("Configuration.StandardSequences.EDMtoMEAtJobEnd_cff") # new 
0075 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0076 
0077 from Configuration.AlCa.autoCond import autoCond
0078 #process.GlobalTag.globaltag = os.environ['TEST_GLOBAL_TAG']#+'::All'
0079 process.GlobalTag.globaltag = '122X_mcRun4_realistic_v1'
0080 #process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v2'
0081 #process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v0'
0082 #process.GlobalTag.globaltag = '93X_mc2017_realistic_v1'
0083 
0084 # FOR DATA REDONE FROM RAW, ONE MUST HIDE IsoFromDeps
0085 # CONFIGURATION
0086 process.load("Validation.RecoEgamma.electronIsoFromDeps_cff")
0087 process.load("Validation.RecoEgamma.ElectronMcSignalValidatorPt1000_gedGsfElectrons_cfi")
0088 
0089 # load DQM
0090 process.load("DQMServices.Core.DQM_cfg")
0091 process.load("DQMServices.Components.DQMEnvironment_cfi")
0092 
0093 process.EDM = cms.OutputModule("PoolOutputModule",
0094                                 outputCommands = cms.untracked.vstring('drop *',"keep *_MEtoEDMConverter_*_*"),
0095                                 fileName = cms.untracked.string(os.environ['outputFile'])#.replace(".root", "_a.root"))
0096                                 #fileName = cms.untracked.string('electronHistos.ValFullZEEStartup_13_gedGsfE_a.root') # for local run only
0097                                 )
0098 
0099 process.electronMcSignalValidatorPt1000.InputFolderName = cms.string("EgammaV/ElectronMcSignalValidatorPt1000")
0100 process.electronMcSignalValidatorPt1000.OutputFolderName = cms.string("EgammaV/ElectronMcSignalValidatorPt1000")
0101 
0102 process.p = cms.Path(process.electronMcSignalValidatorPt1000 * process.MEtoEDMConverter * process.dqmStoreStats)
0103 
0104 process.outpath = cms.EndPath(
0105 process.EDM,
0106 )