DESY Hbb Analysis Framework
ReHLT_L1Trepack_HLTUser_DataNtuple.py
Go to the documentation of this file.
1 # Auto generated configuration file
2 # using:
3 # Revision: 1.19
4 # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
5 # with command line options: step2 --step=L1REPACK:Full,HLT:UserBTagMu20 --conditions=auto:run2_hlt_GRun --filein=/store/data/Run2016H/BTagMu/RAW/v1/000/283/408/00000/78879B75-CC94-E611-BAE6-02163E0146EA.root --custom_conditions= --number=10 --data --no_exec --datatier RAW --eventcontent=RAW --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era=Run2_2016 --customise= --scenario=pp --python_filename=ReHLT_L1Trepack_HLTUserBtagMu20_Ntuple.py --processName=HLT2 --no_output
6 import FWCore.ParameterSet.Config as cms
7 
8 from Configuration.StandardSequences.Eras import eras
9 
10 process = cms.Process('HLT2',eras.Run2_2016)
11 
12 # import of standard configurations
13 process.load('Configuration.StandardSequences.Services_cff')
14 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
15 process.load('FWCore.MessageService.MessageLogger_cfi')
16 process.load('Configuration.EventContent.EventContent_cff')
17 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
18 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
19 process.load('Configuration.StandardSequences.SimL1EmulatorRepack_Full_cff')
20 process.load('HLTrigger.Configuration.HLT_User_cff')
21 process.load('Configuration.StandardSequences.EndOfProcess_cff')
22 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
23 
24 process.maxEvents = cms.untracked.PSet(
25  input = cms.untracked.int32(100)
26 )
27 
28 # Input source
29 # Examples
30 # ('/store/data/Run2016H/BTagMu/RAW/v1/000/283/408/00000/78879B75-CC94-E611-BAE6-02163E0146EA.root'),
31 # ('/store/data/Run2016H/ZeroBiasBunchTrains0/RAW/v1/000/283/171/00000/2E41F4FF-EA91-E611-9DBB-02163E0145F1.root'),
32 # ('/store/data/Run2016H/ParkingZeroBias0/RAW/v1/000/283/885/00000/5453166E-DA9D-E611-A050-FA163EEEB45D.root'),
33 process.source = cms.Source("PoolSource",
34  fileNames = cms.untracked.vstring('/store/data/Run2016H/BTagMu/RAW/v1/000/283/408/00000/78879B75-CC94-E611-BAE6-02163E0146EA.root'),
35  secondaryFileNames = cms.untracked.vstring()
36 )
37 
38 process.options = cms.untracked.PSet(
39 
40 )
41 
42 # Production Info
43 process.configurationMetadata = cms.untracked.PSet(
44  annotation = cms.untracked.string('step2 nevts:10'),
45  name = cms.untracked.string('Applications'),
46  version = cms.untracked.string('$Revision: 1.19 $')
47 )
48 
49 # Output definition
50 
51 # Additional output definition
52 
53 # Other statements
54 from HLTrigger.Configuration.CustomConfigs import ProcessName
55 process = ProcessName(process)
56 
57 from Configuration.AlCa.GlobalTag import GlobalTag
58 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_hlt_GRun', '')
59 
60 # Path and EndPath definitions
61 process.L1RePack_step = cms.Path(process.SimL1Emulator)
62 process.endjob_step = cms.EndPath(process.endOfProcess)
63 
64 #_______________ Addition to cmsDriver - begin
65 
66 isMC = False
67 
68 ## Filter counter (maybe more useful for MC)
69 process.TotalEvents = cms.EDProducer("EventCountProducer")
70 process.FilteredEvents = cms.EDProducer("EventCountProducer")
71 
72 # pileup filter MC
73 process.RemovePileUpDominatedEventsGen = cms.EDFilter("RemovePileUpDominatedEventsGen")
74 
75 # Trigger filter (HLT config)
76 from Analysis.Ntuplizer.TriggerFilter_cfi import triggerFilter
77 
78 # =========================
79 # Trigger config modifications
80 # Example triggers
81 # 'HLT_BTagMu_DiJet20_Mu5_v*',
82 # 'HLT_ZeroBias_BunchTrains_part*',
83 # 'HLT_ZeroBias_part0_v*',
84 process.triggerFilter = triggerFilter.clone()
85 process.triggerFilter.hltResults = cms.InputTag( 'TriggerResults', '', 'HLT' )
86 process.triggerFilter.triggerConditions = cms.vstring ('HLT_BTagMu_DiJet20_Mu5_v*')
87 # =========================
88 # Filtering the trigger sequence
89 # comment or modified the lines below if no filter or other filters are required
90 if isMC:
91  process.triggerFilter.hltResults = cms.InputTag( 'TriggerResults', '', 'HLT2' )
92  process.triggerFilter.triggerConditions = cms.vstring('HLT_ZeroBias_v*')
93  process.HLTBeginSequence.insert(-1,process.RemovePileUpDominatedEventsGen) # qcd MC
94 else:
95  process.HLTBeginSequence.insert(-1,process.triggerFilter) # data
96 # =========================
97 
98 
99 # Ntuplizer
100 from Analysis.Ntuplizer.Ntuplizer_cfi import TFileService
101 process.TFileService = TFileService.clone()
102 
103 from Analysis.Ntuplizer.Ntuplizer_cfi import ntuplizer
104 process.MssmHbbTrigger = ntuplizer.clone()
105 process.MssmHbbTrigger.MonteCarlo = cms.bool(isMC)
106 process.MssmHbbTrigger.TotalEvents = cms.InputTag("TotalEvents")
107 process.MssmHbbTrigger.FilteredEvents = cms.InputTag("FilteredEvents")
108 process.MssmHbbTrigger.PrimaryVertices = cms.VInputTag(cms.InputTag('hltFastPrimaryVertex'),cms.InputTag('hltFastPVPixelVertices'))
109 process.MssmHbbTrigger.L1TJets = cms.VInputTag(cms.InputTag('hltCaloStage2Digis','Jet'))
110 process.MssmHbbTrigger.L1TMuons = cms.VInputTag(cms.InputTag('hltGmtStage2Digis','Muon'))
111 process.MssmHbbTrigger.ChargedCandidates = cms.VInputTag(cms.InputTag('hltL2MuonCandidates'),cms.InputTag('hltL3MuonCandidates') )
112 process.MssmHbbTrigger.CaloJets = cms.VInputTag(cms.InputTag('hltAK4CaloJetsCorrectedIDPassed') )
113 process.MssmHbbTrigger.JetsTags = cms.VInputTag(cms.InputTag('hltCombinedSecondaryVertexBJetTagsCalo'))
114 process.MssmHbbTrigger.PFJets = cms.VInputTag(cms.InputTag('hltAK4PFJets'),cms.InputTag('hltAK4PFJetsLooseIDCorrected'),cms.InputTag('hltAK4PFJetsTightIDCorrected'))
115 process.MssmHbbTrigger.TriggerResults = cms.VInputTag(cms.InputTag('TriggerResults','','HLT2'))
116 process.MssmHbbTrigger.TriggerPaths = cms.vstring ('HLT_ZeroBias_v','HLT_CaloJets_Muons_CaloBTagCSV_PFJets_v')
117 if isMC:
118  # MC specific
119  process.MssmHbbTrigger.PileupInfo = cms.InputTag("addPileupInfo","","HLT")
120  process.MssmHbbTrigger.GenFilterInfo = cms.InputTag("genFilterEfficiencyProducer")
121  process.MssmHbbTrigger.GenRunInfo = cms.InputTag("generator")
122 
123 process.Ntuplizer = cms.Sequence( process.TotalEvents + process.triggerFilter + process.FilteredEvents + process.MssmHbbTrigger)
124 
125 process.ntuplizer_step = cms.EndPath(process.Ntuplizer)
126 
127 #_______________ Addition to cmsDriver - end
128 
129 # Schedule definition
130 process.schedule = cms.Schedule(process.L1RePack_step)
131 process.schedule.extend(process.HLTSchedule)
132 process.schedule.extend([process.endjob_step,process.ntuplizer_step]) # Modified wrt cmsDriver
133 
134 # customisation of the process.
135 
136 # Automatic addition of the customisation function from HLTrigger.Configuration.CustomConfigs
137 from HLTrigger.Configuration.CustomConfigs import L1THLT
138 
139 #call to customisation function L1THLT imported from HLTrigger.Configuration.CustomConfigs
140 process = L1THLT(process)
141 
142 # End of customisation functions
143