Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 
0004 from PhysicsTools.PatAlgos.tools.helpers import cloneProcessingSnippet
0005 
0006 process = cms.Process("MCverticesTriggerBias")
0007 
0008 #prepare options
0009 
0010 options = VarParsing.VarParsing("analysis")
0011 
0012 options.register ('globalTag',
0013                   "DONOTEXIST",
0014                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0015                   VarParsing.VarParsing.varType.string,          # string, int, or float
0016                   "GlobalTag")
0017 options.register ('HLTprocess',
0018                   "HLT",
0019                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0020                   VarParsing.VarParsing.varType.string,          # string, int, or float
0021                   "HLTProcess")
0022 options.register ('L1Collection',
0023                   "gtDigis",
0024                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0025                   VarParsing.VarParsing.varType.string,          # string, int, or float
0026                   "L1DigiCollection")
0027 options.register ('triggerPaths',
0028                   "",
0029                   VarParsing.VarParsing.multiplicity.list, # singleton or list
0030                   VarParsing.VarParsing.varType.string,          # string, int, or float
0031                   "list of HLT paths")
0032 options.register ('triggerLabels',
0033                   "",
0034                   VarParsing.VarParsing.multiplicity.list, # singleton or list
0035                   VarParsing.VarParsing.varType.string,          # string, int, or float
0036                   "list of labels")
0037 options.register ('negateFlags',
0038                   "",
0039                   VarParsing.VarParsing.multiplicity.list, # singleton or list
0040                   VarParsing.VarParsing.varType.int,          # string, int, or float
0041                   "list of flags to negate HLT selection")
0042 
0043 options.parseArguments()
0044 
0045 #
0046 process.options = cms.untracked.PSet(
0047     wantSummary = cms.untracked.bool(True),
0048     fileMode = cms.untracked.string("FULLMERGE")
0049     )
0050 
0051 process.load("FWCore.MessageService.MessageLogger_cfi")
0052 
0053 process.MessageLogger.cout.enable = cms.untracked.bool(True)
0054 process.MessageLogger.cout.threshold = cms.untracked.string("INFO")
0055 process.MessageLogger.cout.default = cms.untracked.PSet(
0056     limit = cms.untracked.int32(10000000)
0057     )
0058 process.MessageLogger.cout.FwkReport = cms.untracked.PSet(
0059     reportEvery = cms.untracked.int32(10000)
0060     )
0061 
0062 process.MessageLogger.cerr.enable = cms.untracked.bool(True)
0063 process.MessageLogger.cerr.threshold = cms.untracked.string("WARNING")
0064 process.MessageLogger.cerr.default = cms.untracked.PSet(
0065     limit = cms.untracked.int32(10000000)
0066     )
0067 process.MessageLogger.cerr.FwkReport = cms.untracked.PSet(
0068     reportEvery = cms.untracked.int32(100000)
0069     )
0070 
0071 #------------------------------------------------------------------
0072 
0073 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0074 
0075 process.source = cms.Source("PoolSource",
0076                     fileNames = cms.untracked.vstring(),
0077     
0078 #                    skipBadFiles = cms.untracked.bool(True),
0079                     inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*")
0080                     )
0081 
0082 
0083 process.source.fileNames = cms.untracked.vstring(options.inputFiles)
0084 
0085 #---------------------------------------------------------------------------------------------------
0086 # Trigger Selection
0087 
0088 from HLTrigger.HLTfilters.triggerResultsFilter_cfi import *
0089 process.hltSelection = triggerResultsFilter.clone(
0090                                                   triggerConditions = cms.vstring("HLT_*"),
0091                                                   hltResults = cms.InputTag( "TriggerResults", "", options.HLTprocess ),
0092                                                   l1tResults = cms.InputTag( options.L1Collection ),
0093                                                   throw = cms.bool(False)
0094                                                   )
0095 
0096 #---------------------------------------------------------------------------------------------------
0097 
0098 process.load("Validation.RecoVertex.mcverticesanalyzer_cfi")
0099 
0100 
0101 process.seqComplete= cms.Sequence(process.hltSelection +  process.mcverticesanalyzer) 
0102 
0103 for label, trigger,negate in zip(options.triggerLabels,options.triggerPaths,options.negateFlags):
0104    cloneProcessingSnippet(process,process.seqComplete,label)
0105    getattr(process,"hltSelection"+label).triggerConditions = cms.vstring(trigger)
0106 
0107    if negate == 1:
0108       tempmodule = getattr(process,"hltSelection"+label)
0109       getattr(process,"seqComplete"+label).replace(getattr(process,"hltSelection"+label),~tempmodule)
0110 
0111    setattr(process,"p"+label,cms.Path(getattr(process,"seqComplete"+label))) 
0112 
0113 #----GlobalTag ------------------------
0114 
0115 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0116 from Configuration.AlCa.GlobalTag import GlobalTag
0117 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0118 
0119 process.TFileService = cms.Service('TFileService',
0120                                    fileName = cms.string('mcverticestriggerbias.root')
0121                                    )
0122