Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:38

0001 import FWCore.ParameterSet.Config as cms
0002 import sys
0003 
0004 process = cms.Process("TestPhotons")
0005 
0006 process.load("FWCore.MessageService.MessageLogger_cfi")
0007 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0008 
0009 process.load("Configuration.StandardSequences.GeometryDB_cff")
0010 
0011 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0012 # NOTE: the pick the right global tag!
0013 #    for PHYS14 scenario PU4bx50 : global tag is ???
0014 #    for PHYS14 scenario PU20bx25: global tag is PHYS14_25_V1
0015 #  as a rule, find the global tag in the DAS under the Configs for given dataset
0016 #process.GlobalTag.globaltag = 'PHYS14_25_V1::All'
0017 from Configuration.AlCa.GlobalTag import GlobalTag
0018 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
0019 
0020 #
0021 # Define input data to read
0022 #
0023 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) )
0024 
0025 inputFilesAOD = cms.untracked.vstring(
0026     # AOD test files from /store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1
0027     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/0E37A324-714F-E511-B658-003048FFD770.root',
0028     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/18C42D26-714F-E511-90A9-0025905B855C.root',
0029     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/2448F11B-734F-E511-99C8-0025905A608E.root',
0030     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/3A648F28-E64F-E511-9291-0026189438E1.root',
0031     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/5211471B-724F-E511-9B00-0025905A613C.root',
0032     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/8C6C961C-734F-E511-92F5-003048FF9AC6.root',
0033     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/BC2BE168-E74F-E511-B126-0025905A60B0.root',
0034     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/BEA93A19-724F-E511-B0C0-0025905A60F4.root'
0035     )    
0036 
0037 inputFilesMiniAOD = cms.untracked.vstring(
0038     # MiniAOD test files from /store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/GEN-SIM-RECO/PU25ns_76X_mcRun2_asymptotic_v1-v1
0039     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/MINIAODSIM/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/14954967-E74F-E511-BEF2-0026189438EF.root',
0040     '/store/relval/CMSSW_7_6_0_pre4/RelValH130GGgluonfusion_13/MINIAODSIM/PU25ns_76X_mcRun2_asymptotic_v1-v1/00000/2061DB66-E74F-E511-9531-0026189438DB.root'
0041     )
0042 
0043 # Set up input/output depending on the format
0044 # You can list here either AOD or miniAOD files, but not both types mixed
0045 #
0046 
0047 print(sys.argv[2])
0048 useAOD = bool(int(sys.argv[2]))
0049 
0050 if useAOD == True :
0051     inputFiles = inputFilesAOD
0052     outputFile = "photon_ntuple.root"
0053     print("AOD input files are used")
0054 else :
0055     inputFiles = inputFilesMiniAOD
0056     outputFile = "photon_ntuple_mini.root"
0057     print("MiniAOD input files are used")
0058 process.source = cms.Source ("PoolSource", fileNames = inputFiles )
0059 
0060 #
0061 # Set up electron ID (VID framework)
0062 #
0063 
0064 from PhysicsTools.SelectorUtils.tools.vid_id_tools import *
0065 # turn on VID producer, indicate data format  to be
0066 # DataFormat.AOD or DataFormat.MiniAOD, as appropriate 
0067 if useAOD == True :
0068     dataFormat = DataFormat.AOD
0069 else :
0070     dataFormat = DataFormat.MiniAOD
0071 
0072 switchOnVIDPhotonIdProducer(process, dataFormat)
0073 
0074 # define which IDs we want to produce
0075 my_id_modules = [sys.argv[3]]
0076 
0077 #add them to the VID producer
0078 for idmod in my_id_modules:
0079     setupAllVIDIdsInModule(process,idmod,setupVIDPhotonSelection)
0080 
0081 # Make sure to add the ID sequence upstream from the user analysis module
0082 process.p = cms.Path(process.egmPhotonIDSequence)