Skip to content

Commit

Permalink
Update of examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien committed May 4, 2015
1 parent d57352c commit b55c19a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
3 changes: 0 additions & 3 deletions DQMOffline/RecoB/python/dqmAnalyzer_cff.py
@@ -1,8 +1,5 @@
import FWCore.ParameterSet.Config as cms

#not useful anymore for b-tagging but used in some other sequences
#from JetMETCorrections.Configuration.JetCorrectionServices_cff import ak4PFL2L3,ak4PFL2Relative,ak4PFL3Absolute

#JEC for CHS
from JetMETCorrections.Configuration.JetCorrectors_cff import *

Expand Down
Expand Up @@ -5,7 +5,7 @@

whichJets = "ak4PFJetsCHS"
applyJEC = True
corrLabel = 'ak4PFCHSL1FastL2L3'
corrLabel = 'ak4PFCHS'
tag = 'MCRUN2_74_V7::All'
useTrigger = False
triggerPath = "HLT_PFJet80_v*"
Expand All @@ -26,13 +26,14 @@
process.load("DQMServices.Components.DQMEnvironment_cfi")
process.load("DQMServices.Core.DQM_cfg")

process.load("JetMETCorrections.Configuration.JetCorrectionServices_cff")
process.load("JetMETCorrections.Configuration.JetCorrectors_cff")
process.load("CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi")
process.load("RecoJets.JetAssociationProducers.ak4JTA_cff")
process.load("RecoBTag.Configuration.RecoBTag_cff")
process.load("PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi")
process.load("PhysicsTools.JetMCAlgos.AK4PFJetsMCFlavourInfos_cfi")
process.load("PhysicsTools.JetMCAlgos.CaloJetsMCFlavour_cfi")
process.JECseq = cms.Sequence(getattr(process,corrLabel+"L1FastL2L3CorrectorChain"))

newjetID=cms.InputTag(whichJets)
process.ak4JetFlavourInfos.jets = newjetID
Expand Down Expand Up @@ -64,7 +65,7 @@
process.bTagValidationFirstStep.applyPtHatWeight = False
process.bTagValidationFirstStep.doJetID = True
process.bTagValidationFirstStep.doJEC = applyJEC
process.bTagValidationFirstStep.JECsource = cms.string(corrLabel)
process.bTagValidation.JECsourceMC = cms.InputTag(corrLabel+"L1FastL2L3Corrector")
process.bTagValidationFirstStep.flavPlots = flavPlots
#process.bTagValidationFirstStep.ptRecJetMin = cms.double(20.)
process.bTagValidationFirstStep.genJetsMatched = cms.InputTag("patJetGenJetMatch")
Expand All @@ -80,7 +81,8 @@
process.patJetGenJetMatch.resolveAmbiguities = cms.bool(True)
else:
process.bTagValidationFirstStepData.doJEC = applyJEC
process.bTagValidationFirstStepData.JECsource = cms.string(corrLabel)
process.bTagAnalysis.JECsourceData = cms.InputTag(corrLabel+"L1FastL2L3ResidualCorrector")
process.JECseq *= (getattr(process,corrLabel+"ResidualCorrector") * getattr(process,corrLabel+"L1FastL2L3ResidualCorrector"))

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(10)
Expand All @@ -105,9 +107,9 @@
process.dqmSeq = cms.Sequence(process.bTagValidationFirstStepData)

if useTrigger:
process.plots = cms.Path(process.bTagHLT * process.jetSequences * process.dqmSeq)
process.plots = cms.Path(process.bTagHLT * process.JECseq * process.jetSequences * process.dqmSeq)
else:
process.plots = cms.Path(process.jetSequences * process.dqmSeq)
process.plots = cms.Path(process.JECseq * process.jetSequences * process.dqmSeq)

process.outpath = cms.EndPath(process.EDM)

Expand Down
14 changes: 8 additions & 6 deletions Validation/RecoB/test/validation_customJet_cfg.py
Expand Up @@ -16,7 +16,7 @@

whichJets = options.jets
applyJEC = True
corrLabel = 'ak4PFCHSL1FastL2L3'
corrLabel = "ak4PFCHS"
tag = 'MCRUN2_74_V7::All'
useTrigger = False
triggerPath = "HLT_PFJet80_v*"
Expand All @@ -37,14 +37,15 @@
process.load("DQMServices.Components.DQMEnvironment_cfi")
process.load("DQMServices.Core.DQM_cfg")

process.load("JetMETCorrections.Configuration.JetCorrectionServices_cff")
process.load("JetMETCorrections.Configuration.JetCorrectors_cff")
process.load("CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi")
process.load("RecoJets.JetAssociationProducers.ak4JTA_cff")
process.load("RecoBTag.Configuration.RecoBTag_cff")
process.load("PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi")
process.load("PhysicsTools.JetMCAlgos.AK4PFJetsMCFlavourInfos_cfi")
process.load("PhysicsTools.JetMCAlgos.CaloJetsMCFlavour_cfi")
process.load("PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi")
process.JECseq = cms.Sequence(getattr(process,corrLabel+"L1FastL2L3CorrectorChain"))

newjetID=cms.InputTag(whichJets)
process.ak4JetFlavourInfos.jets = newjetID
Expand Down Expand Up @@ -84,7 +85,7 @@
process.bTagValidation.applyPtHatWeight = False
process.bTagValidation.doJetID = True
process.bTagValidation.doJEC = applyJEC
process.bTagValidation.JECsource = cms.string(corrLabel)
process.bTagValidation.JECsourceMC = cms.InputTag(corrLabel+"L1FastL2L3Corrector")
process.bTagValidation.flavPlots = flavPlots
process.bTagHarvestMC.flavPlots = flavPlots
#process.bTagValidation.ptRecJetMin = cms.double(20.)
Expand All @@ -101,7 +102,8 @@
else:
process.load("DQMOffline.RecoB.bTagAnalysisData_cfi")
process.bTagAnalysis.doJEC = applyJEC
process.bTagAnalysis.JECsource = cms.string(corrLabel)
process.bTagAnalysis.JECsourceData = cms.InputTag(corrLabel+"L1FastL2L3ResidualCorrector")
process.JECseq *= (getattr(process,corrLabel+"ResidualCorrector") * getattr(process,corrLabel+"L1FastL2L3ResidualCorrector"))

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(-1)
Expand All @@ -121,9 +123,9 @@
process.dqmSeq = cms.Sequence(process.bTagAnalysis * process.bTagHarvest * process.dqmSaver)

if useTrigger:
process.plots = cms.Path(process.bTagHLT * process.jetSequences * process.dqmSeq)
process.plots = cms.Path(process.bTagHLT * process.JECseq * process.jetSequences * process.dqmSeq)
else:
process.plots = cms.Path(process.jetSequences * process.dqmSeq)
process.plots = cms.Path(process.JECseq * process.jetSequences * process.dqmSeq)

process.dqmEnv.subSystemFolder = 'BTAG'
process.dqmSaver.producer = 'DQM'
Expand Down
11 changes: 6 additions & 5 deletions Validation/RecoB/test/validation_fromRECO_cfg.py
Expand Up @@ -10,7 +10,6 @@
tag = 'POSTLS172_V3::All'
#Do you want to apply JEC? For data, no need to add 'Residual', the code is checking if events are Data or MC and add 'Residual' for Data.
applyJEC = True
corrLabel = 'ak4PFCHSL1FastL2L3'
#Data or MC?
runOnMC = True
#Flavour plots for MC: "all" = plots for all jets ; "dusg" = plots for d, u, s, dus, g independently ; not mandatory and any combinations are possible
Expand Down Expand Up @@ -39,10 +38,11 @@

process.load("DQMServices.Components.DQMEnvironment_cfi")
process.load("DQMServices.Core.DQM_cfg")
process.load("JetMETCorrections.Configuration.JetCorrectionServices_cff")
process.load("JetMETCorrections.Configuration.JetCorrectors_cff")
#keep the logging output to a nice level
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 100
process.JECseq = cms.Sequence(process.ak4PFCHSL1FastL2L3CorrectorChain)

if runOnMC:
#for MC jet flavour
Expand All @@ -62,7 +62,7 @@
process.bTagHarvestMC.flavPlots = flavPlots
process.bTagValidation.doPUid = cms.bool(PUid)
process.bTagValidation.doJEC = applyJEC
process.bTagValidation.JECsource = cms.string(corrLabel)
process.bTagValidation.JECsourceMC = cms.InputTag("ak4PFCHSL1FastL2L3Corrector")
process.ak4GenJetsForPUid = cms.EDFilter("GenJetSelector",
src = cms.InputTag("ak4GenJets"),
cut = cms.string('pt > 8.'),
Expand All @@ -77,7 +77,8 @@
process.bTagAnalysis.tagConfig = tagConfig
process.bTagHarvest.tagConfig = tagConfig
process.bTagAnalysis.doJEC = applyJEC
process.bTagAnalysis.JECsource = cms.string(corrLabel)
process.bTagAnalysis.JECsourceData = cms.InputTag("ak4PFCHSL1FastL2L3ResidualCorrector")
process.JECseq *= (process.ak4PFCHSResidualCorrector * process.ak4PFCHSL1FastL2L3ResidualCorrector)

# load the full reconstraction configuration, to make sure we're getting all needed dependencies
process.load("Configuration.StandardSequences.MagneticField_cff")
Expand All @@ -99,7 +100,7 @@
else:
process.dqmSeq = cms.Sequence(process.bTagAnalysis * process.bTagHarvest * process.dqmSaver)

process.plots = cms.Path(process.dqmSeq)
process.plots = cms.Path(process.JECseq*process.dqmSeq)

process.dqmEnv.subSystemFolder = 'BTAG'
process.dqmSaver.producer = 'DQM'
Expand Down

0 comments on commit b55c19a

Please sign in to comment.