Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:23:31

0001 import FWCore.ParameterSet.Config as cms
0002 import os
0003 
0004 ##############################################################################
0005 # customisations for L1 ntuple generation
0006 #
0007 # Add new customisations to this file!
0008 #
0009 # Example usage :
0010 #   cmsDriver.py testNtuple -s NONE --customise=L1Trigger/L1TNtuples/customiseL1Ntuple.customiseL1NtupleAOD --conditions=auto:run2_mc_50ns --filein='/store/relval/CMSSW_7_5_0_pre1/RelValProdTTbar_13/AODSIM/MCRUN2_74_V7-v1/00000/48159643-5EE3-E411-818F-0025905A48F0.root' -n 100
0011 #
0012 ##############################################################################
0013 
0014 def L1NtupleTFileOut(process):
0015 
0016     process.TFileService = cms.Service(
0017         "TFileService",
0018         fileName = cms.string('L1Ntuple.root')
0019     )
0020 
0021     return process
0022 
0023 from L1Trigger.L1TNtuples.customiseL1CustomReco import *
0024         
0025 
0026 def L1NtupleAOD(process):
0027     
0028     L1NtupleTFileOut(process)
0029     L1NtupleCustomReco(process)
0030 
0031     process.load('L1Trigger.L1TNtuples.L1NtupleAOD_cff')
0032     process.l1ntupleaod = cms.Path(
0033         process.L1NtupleAOD
0034     )
0035 
0036     process.schedule.append(process.l1ntupleaod)
0037 
0038     return process
0039 
0040 def L1NtupleAODCalo(process):
0041 
0042     L1NtupleTFileOut(process)
0043     L1NtupleCustomReco(process)
0044 
0045     process.load('L1Trigger.L1TNtuples.L1NtupleAODCalo_cff')
0046     process.l1ntupleaodcalo = cms.Path(
0047         process.L1NtupleAODCalo
0048     )
0049 
0050     process.schedule.append(process.l1ntupleaodcalo)
0051 
0052     return process
0053 
0054 
0055 def L1NtupleAOD_MC(process):
0056     
0057     L1NtupleAOD(process)
0058 
0059     process.l1JetRecoTree.jecToken = cms.untracked.InputTag("ak4PFCHSL1FastL2L3Corrector")
0060 
0061     return process
0062 
0063 
0064 
0065 def L1NtupleRAW(process):
0066 
0067     L1NtupleTFileOut(process)
0068 
0069     process.load('L1Trigger.L1TNtuples.L1NtupleRAW_cff')
0070     process.l1ntupleraw = cms.Path(
0071         process.L1NtupleRAW
0072     )
0073 
0074     process.schedule.append(process.l1ntupleraw)
0075 
0076     # for 5 BX of candidates in L1Extra
0077     if "gctDigis" in process.producers:
0078         process.gctDigis.numberOfGctSamplesToUnpack = cms.uint32(5)
0079 
0080     if "l1extraParticles" in process.producers:
0081         process.l1extraParticles.centralBxOnly = cms.bool(False)
0082 
0083     return process
0084 
0085 def L1NtupleNANO(process):
0086 
0087     L1NtupleTFileOut(process)
0088 
0089     process.load('L1Trigger.L1TNtuples.L1NtupleNANO_cff')
0090     process.l1ntuplenano = cms.Path(
0091         process.L1NtupleNANO
0092     )
0093 
0094     process.schedule.append(process.l1ntuplenano)
0095 
0096     return process
0097 
0098 def L1NtupleRAWCalo(process):
0099 
0100     L1NtupleTFileOut(process)
0101 
0102     process.load('L1Trigger.L1TNtuples.L1NtupleRAWCalo_cff')
0103     process.l1ntuplerawcalo = cms.Path(
0104         process.L1NtupleRAWCalo
0105     )
0106 
0107     process.schedule.append(process.l1ntuplerawcalo)
0108 
0109     return process
0110 
0111 
0112 def L1NtupleEMU(process):
0113 
0114     L1NtupleTFileOut(process)
0115 
0116     process.load('L1Trigger.L1TNtuples.L1NtupleEMU_cff')
0117     process.l1ntupleemu = cms.Path(
0118         process.L1NtupleEMU
0119     )
0120 
0121     process.schedule.append(process.l1ntupleemu)
0122 
0123     return process
0124 
0125 def L1NtupleEMUCalo(process):
0126 
0127     L1NtupleTFileOut(process)
0128 
0129     process.load('L1Trigger.L1TNtuples.L1NtupleEMUCalo_cff')
0130     process.l1ntupleemucalo = cms.Path(
0131         process.L1NtupleEMUCalo
0132     )
0133 
0134     process.schedule.append(process.l1ntupleemucalo)
0135 
0136     return process
0137 
0138 
0139 def L1NtupleEMULegacy(process):
0140 
0141     L1NtupleTFileOut(process)
0142 
0143     process.load('L1Trigger.L1TNtuples.L1NtupleEMULegacy_cff')
0144     process.l1ntupleemulegacy = cms.Path(
0145         process.L1NtupleEMULegacy
0146     )
0147 
0148     process.schedule.append(process.l1ntupleemulegacy)
0149 
0150     return process
0151 
0152 
0153 def L1NtupleGEN(process):
0154 
0155     L1NtupleTFileOut(process)
0156 
0157     process.load('L1Trigger.L1TNtuples.L1NtupleGEN_cff')
0158     process.l1ntuplegen = cms.Path(
0159         process.L1NtupleGEN
0160     )
0161 
0162     process.schedule.append(process.l1ntuplegen)
0163 
0164     return process
0165 
0166 
0167 def L1NtupleRAWEMU(process):
0168 
0169     L1NtupleRAW(process)
0170     L1NtupleEMU(process)
0171 
0172     return process
0173 
0174 def L1NtupleRAWEMUCalo(process):
0175 
0176     L1NtupleRAWCalo(process)
0177     L1NtupleEMUCalo(process)
0178 
0179     return process
0180 
0181 def L1NtupleNANOEMU(process):
0182 
0183     L1NtupleNANO(process)
0184     process.load('L1Trigger.L1TNtuples.L1NtupleEMU_cff')
0185 
0186     process.L1NtupleGTEMU = cms.Sequence( process.l1uGTEmuTree )
0187     process.l1ntuplegtemu = cms.Path(
0188         process.L1NtupleGTEMU
0189     )
0190     process.schedule.append(process.l1ntuplegtemu)
0191 
0192     return process
0193 
0194 def L1NtupleRAWEMULegacy(process):
0195 
0196     L1NtupleRAW(process)
0197     L1NtupleEMU(process)
0198     L1NtupleEMULegacy(process)
0199 
0200     return process
0201 
0202 
0203 def L1NtupleAODRAW(process):
0204 
0205     L1NtupleRAW(process)
0206     L1NtupleAOD(process)
0207 
0208     return process
0209 
0210 def L1NtupleAODRAWCalo(process):
0211 
0212     L1NtupleRAWCalo(process)
0213     L1NtupleAODCalo(process)
0214 
0215     return process
0216 
0217 def L1NtupleAODRAWEMULegacy(process):
0218 
0219     L1NtupleRAW(process)
0220     L1NtupleEMU(process)
0221     L1NtupleEMULegacy(process)
0222     L1NtupleAOD(process)
0223 
0224     return process
0225 
0226 
0227 def L1NtupleAODRAWEMU(process):
0228 
0229     L1NtupleRAW(process)
0230     L1NtupleEMU(process)
0231     L1NtupleAOD(process)
0232 
0233     return process
0234 
0235 def L1NtupleAODRAWEMUCalo(process):
0236 
0237     L1NtupleRAWCalo(process)
0238     L1NtupleEMUCalo(process)
0239     L1NtupleAODCalo(process)
0240 
0241     return process
0242 
0243 def L1NtupleAODEMU(process):
0244 
0245     L1NtupleEMU(process)
0246     L1NtupleAOD(process)
0247 
0248     return process
0249 
0250 def L1NtupleAODEMUCalo(process):
0251 
0252     L1NtupleEMUCalo(process)
0253     L1NtupleAODCalo(process)
0254 
0255     return process
0256 
0257 
0258 def L1NtupleAODEMU_MC(process):
0259 
0260     L1NtupleEMU(process)
0261     L1NtupleAOD_MC(process)
0262 
0263     return process
0264 
0265 
0266 def L1NtupleRAWEMUGEN_MC(process):
0267 
0268     L1NtupleRAW(process)
0269     L1NtupleEMU(process)
0270     L1NtupleGEN(process)
0271 
0272     return process
0273 
0274 def L1NtupleAODEMUGEN_MC(process):
0275 
0276     L1NtupleEMU(process)
0277     L1NtupleAOD_MC(process)
0278     L1NtupleGEN(process)
0279 
0280     return process
0281 
0282 def L1NtupleAODRAWEMUGEN_MC(process):
0283 
0284     L1NtupleRAW(process)
0285     L1NtupleEMU(process)
0286     L1NtupleAOD_MC(process)
0287     L1NtupleGEN(process)
0288 
0289     return process
0290 
0291 def L1NtupleEMUNoEventTree(process):
0292 
0293     L1NtupleTFileOut(process)
0294 
0295     process.load('L1Trigger.L1TNtuples.L1NtupleEMU_cff')
0296     process.L1NtupleEMU = cms.Sequence( process.l1CaloTowerEmuTree+process.l1UpgradeEmuTree+process.l1UpgradeTfMuonEmuTree )
0297     process.l1ntuplesim = cms.Path(
0298         process.L1NtupleEMU
0299     )
0300     process.schedule.append(process.l1ntuplesim)
0301 
0302     return process
0303 
0304 def PrefireVetoFilter(process):
0305 
0306     process.load('EventFilter.L1TRawToDigi.triggerRulePrefireVetoFilter_cfi')
0307 
0308     if hasattr(process, 'l1ntupleraw'):
0309         process.l1ntupleraw.insert(0,process.triggerRulePrefireVetoFilter)
0310     if hasattr(process, 'l1ntupleemu'):
0311         process.l1ntupleemu.insert(0,process.triggerRulePrefireVetoFilter)
0312     if hasattr(process, 'l1ntupleaod'):
0313         process.l1ntupleaod.insert(0,process.triggerRulePrefireVetoFilter)
0314     if hasattr(process, 'l1ntuplerawcalo'):
0315         process.l1ntuplerawcalo.insert(0,process.triggerRulePrefireVetoFilter)
0316     if hasattr(process, 'l1ntupleemucalo'):
0317         process.l1ntupleemucalo.insert(0,process.triggerRulePrefireVetoFilter)
0318     if hasattr(process, 'l1ntupleaodcalo'):
0319         process.l1ntupleaodcalo.insert(0,process.triggerRulePrefireVetoFilter)
0320 
0321     return process