CMS 3D CMS Logo

dqmAnalyzer_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from RecoBTag.Combined.pfDeepCSVDiscriminatorsJetTags_cfi import pfDeepCSVDiscriminatorsJetTags
4 
5 
7 bTagAnalysis.ptRanges = cms.vdouble(0.0)
8 bTagAnalysis.doJetID = True
9 bTagAnalysis.doJEC = True
10 #Residual correction will be added inside the c++ code only for data (checking the presence of genParticles collection), not explicit here as this sequence also ran on MC FullSim
11 bTagPlotsDATA = cms.Sequence(pfDeepCSVDiscriminatorsJetTags * bTagAnalysis)
12 
13 
14 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
15 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
16 (pp_on_XeXe_2017 | pp_on_AA).toModify(bTagAnalysis,
17  doJEC=False
18 )
19 
20 
21 
23 from PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi import selectedHadronsAndPartons
24 from PhysicsTools.JetMCAlgos.AK4PFJetsMCFlavourInfos_cfi import ak4JetFlavourInfos
25 myak4JetFlavourInfos = ak4JetFlavourInfos.clone(
26  jets = cms.InputTag("ak4PFJetsCHS"),
27  partons = cms.InputTag("selectedHadronsAndPartons","algorithmicPartons"),
28  hadronFlavourHasPriority = cms.bool(True)
29  )
30 
31 #Get gen jet collection for real jets
32 ak4GenJetsForPUid = cms.EDFilter("GenJetSelector",
33  src = cms.InputTag("ak4GenJets"),
34  cut = cms.string('pt > 8.'),
35  filter = cms.bool(False)
36  )
37 #do reco gen - reco matching
38 from PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi import patJetGenJetMatch
39 newpatJetGenJetMatch = patJetGenJetMatch.clone(
40  src = cms.InputTag("ak4PFJetsCHS"),
41  matched = cms.InputTag("ak4GenJetsForPUid"),
42  maxDeltaR = cms.double(0.25),
43  resolveAmbiguities = cms.bool(True)
44 )
45 
46 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
47 pp_on_AA.toModify(newpatJetGenJetMatch, src = "akCs4PFJets")
48 
49 # Module execution for MC
51 bTagValidation.jetMCSrc = 'myak4JetFlavourInfos'
52 bTagValidation.ptRanges = cms.vdouble(0.0)
53 bTagValidation.etaRanges = cms.vdouble(0.0)
54 bTagValidation.doJetID = True
55 bTagValidation.doJEC = True
56 bTagValidation.genJetsMatched = cms.InputTag("newpatJetGenJetMatch")
57 #to run on fastsim
58 prebTagSequenceMC = cms.Sequence(ak4GenJetsForPUid*newpatJetGenJetMatch*selectedHadronsAndPartons*myak4JetFlavourInfos*pfDeepCSVDiscriminatorsJetTags)
59 bTagPlotsMC = cms.Sequence(bTagValidation)
60 
61 
62 (pp_on_XeXe_2017 | pp_on_AA).toModify(bTagValidation,
63  doJEC=False
64 )
65 
66 #to run on fullsim in the validation sequence, all histograms produced in the dqmoffline sequence
67 bTagValidationNoall = bTagValidation.clone(flavPlots="bcl")
68 bTagPlotsMCbcl = cms.Sequence(bTagValidationNoall)
bTagAnalysisData_cfi
DATA ############.
jetMatch_cfi
bTagAnalysis_cfi