Skip to content

Commit

Permalink
Split configuration into combined and extended
Browse files Browse the repository at this point in the history
Combined uses selections designed for the combined Electron-Muon
results. Extended uses selections designed for the extended Eta coverage
possible with electrons.
  • Loading branch information
Alexander Gude committed May 21, 2014
1 parent e27e17c commit 62f9e4c
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 16 deletions.
30 changes: 20 additions & 10 deletions ZFinder/Event/python/zdefinitions_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,35 @@
cuts1 = cms.untracked.vstring("acc(ALL)", "acc(HF)", "pt>20", "hf_2dloose"),
)

# The ZDefinition for data
zdefs = cms.untracked.VPSet(
# The ZDefinition for use on data for the extended electron result
zdefs_extended_data = cms.untracked.VPSet(
all_electrons,
combined_reco_cuts,
combined_double,
combined_single,
ecal_ecal,
ecal_nt,
ecal_hf,
)

# The ZDefinition for MC
zdefs_mc = cms.untracked.VPSet(
# The ZDefinition for use on MC for the extended electron result
zdefs_extended_mc = cms.untracked.VPSet(
all_electrons,
ecal_ecal_no_trigger,
ecal_nt_no_trigger,
ecal_hf_no_trigger,
)

# The ZDefinition for use on data for the combined result
zdefs_combined_data = cms.untracked.VPSet(
all_electrons,
combined_reco_cuts,
combined_double,
combined_single,
)

# The ZDefinition for use on MC for the combined result
zdefs_combined_mc = cms.untracked.VPSet(
all_electrons,
combined_gen_cuts,
combined_reco_cuts,
combined_double_no_trigger,
combined_single_no_trigger,
ecal_ecal_no_trigger,
ecal_nt_no_trigger,
ecal_hf_no_trigger,
)
4 changes: 2 additions & 2 deletions ZFinder/Event/python/zfinder_cfi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

# Import ZDefinitions
from ZFinder.Event.zdefinitions_cfi import zdefs
from ZFinder.Event.zdefinitions_cfi import zdefs_extended_data

# ZFinder
ZFinder = cms.EDAnalyzer('ZFinder',
Expand All @@ -23,7 +23,7 @@
pileupInputTag = cms.InputTag("addPileupInfo"),
generatorInputTag = cms.InputTag("genParticles"),
# ZDefinitions from ZFinder.ZFinder.zdefinitions_cfi
ZDefinitions = zdefs,
ZDefinitions = zdefs_extended_data,
# Run on MC or not. If true, every ZDefinition is included twice: once
# plotting reco quantities, and once plotting generator quantities. If
# false, only the reco quantities are plotted.
Expand Down
59 changes: 59 additions & 0 deletions ZFinder/Event/zfinder_combined_data_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("ZFinderData")

# Set up message output and logging
from FWCore.MessageService.MessageLogger_cfi import MessageLogger
process.MessageLogger = MessageLogger
process.MessageLogger.cerr.FwkReport.reportEvery = 100 # Report status ever 100 events

# Number of events from each file to process. It should be -1 (all) when
# running for an analysis
N_EVENTS_TO_PROCESS = -1
if N_EVENTS_TO_PROCESS != -1:
print "NOT RUNNING ON ALL EVENTS IN THE FILE!"
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(N_EVENTS_TO_PROCESS)
)

# Input file
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring('file:/local/cms/phedex/store/data/Run2012A/DoubleElectron/AOD/22Jan2013-v1/20000/003EC246-5E67-E211-B103-00259059642E.root')
)

# Output file
process.TFileService = cms.Service("TFileService",
fileName = cms.string("test_combined_data.root")
)

# Run only on lumis specified in the lumi file
# Recipe from:
# https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuidePythonTips#Use_a_JSON_file_of_good_lumi_sec
from FWCore.ParameterSet.Types import untracked, VLuminosityBlockRange
from FWCore.PythonUtilities.LumiList import LumiList
json_file = "../../Metadata/lumi_json/Run2012ABCD.json" # File location
run_2012abcd_lumis = LumiList(filename = json_file).getCMSSWString().split(',')
process.source.lumisToProcess = untracked(VLuminosityBlockRange(run_2012abcd_lumis))

# Import rho value for isolation correction
from ZFinder.Event.kt6_pfjets_cfi import kt6PFJetsForIsolation
process.kt6PFJetsForIsolation = kt6PFJetsForIsolation.clone()

# Particle flow isolation
from CommonTools.ParticleFlow.Tools.pfIsolation import setupPFElectronIso
process.eleIsoSequence = setupPFElectronIso(process, 'gsfElectrons')
process.pfiso = cms.Sequence(process.pfParticleSelectionSequence + process.eleIsoSequence)

# ZFinder
from ZFinder.Event.zdefinitions_cfi import zdefs_combined_data
from ZFinder.Event.zfinder_cfi import ZFinder
process.ZFinder = ZFinder.clone(
ZDefinitions = zdefs_combined_data,
)

# RUN
process.p = cms.Path(
process.kt6PFJetsForIsolation
* process.pfiso
* process.ZFinder
)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# Output file
process.TFileService = cms.Service("TFileService",
fileName = cms.string("test_mc.root")
fileName = cms.string("test_combined_mc.root")
)

# Import rho value for isolation correction
Expand All @@ -36,10 +36,10 @@
process.pfiso = cms.Sequence(process.pfParticleSelectionSequence + process.eleIsoSequence)

# ZFinder
from ZFinder.Event.zdefinitions_cfi import zdefs_mc
from ZFinder.Event.zdefinitions_cfi import zdefs_combined_mc
from ZFinder.Event.zfinder_cfi import ZFinder
process.ZFinder = ZFinder.clone(
ZDefinitions = zdefs_mc,
ZDefinitions = zdefs_combined_mc,
is_mc = cms.bool(True),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# Output file
process.TFileService = cms.Service("TFileService",
fileName = cms.string("test_data.root")
fileName = cms.string("test_extended_data.root")
)

# Run only on lumis specified in the lumi file
Expand Down
51 changes: 51 additions & 0 deletions ZFinder/Event/zfinder_extended_mc_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("ZFinderMC")

# Set up message output and logging
from FWCore.MessageService.MessageLogger_cfi import MessageLogger
process.MessageLogger = MessageLogger
process.MessageLogger.cerr.FwkReport.reportEvery = 100 # Report status ever 100 events

# Number of events from each file to process. It should be -1 (all) when
# running for an analysis
N_EVENTS_TO_PROCESS = -1
if N_EVENTS_TO_PROCESS != -1:
print "NOT RUNNING ON ALL EVENTS IN THE FILE!"
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(N_EVENTS_TO_PROCESS)
)

# Input file
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring('file:/local/cms/phedex/store/mc/Summer12_DR53X/DYToEE_M-20_CT10_TuneZ2star_8TeV-powheg-pythia6/AODSIM/PU_S10_START53_V7A-v1/0000/AC6646E7-36F0-E111-B2F8-00259073E3FC.root')
)

# Output file
process.TFileService = cms.Service("TFileService",
fileName = cms.string("test_extended_mc.root")
)

# Import rho value for isolation correction
from ZFinder.Event.kt6_pfjets_cfi import kt6PFJetsForIsolation
process.kt6PFJetsForIsolation = kt6PFJetsForIsolation.clone()

# Particle flow isolation
from CommonTools.ParticleFlow.Tools.pfIsolation import setupPFElectronIso
process.eleIsoSequence = setupPFElectronIso(process, 'gsfElectrons')
process.pfiso = cms.Sequence(process.pfParticleSelectionSequence + process.eleIsoSequence)

# ZFinder
from ZFinder.Event.zdefinitions_cfi import zdefs_extended_mc
from ZFinder.Event.zfinder_cfi import ZFinder
process.ZFinder = ZFinder.clone(
ZDefinitions = zdefs_extended_mc,
is_mc = cms.bool(True),
)

# RUN
process.p = cms.Path(
process.kt6PFJetsForIsolation
* process.pfiso
* process.ZFinder
)

0 comments on commit 62f9e4c

Please sign in to comment.