Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:20:53

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 class dummy:
0004     pass
0005 
0006 samples=dummy()
0007 
0008 ##########################################################
0009 # Define which preselections to run                      #
0010 ##########################################################
0011 
0012 samples.names = ['Wenu',
0013                  'Zee',
0014                  'TripleEle',
0015                  'GammaJet',
0016                  'DiGamma']
0017 samples.pdgid = [ 11,
0018                   11,
0019                   11,
0020                   22,
0021                   22]
0022 samples.num   = [1,
0023                  2,
0024                  3,
0025                  1,
0026                  2]
0027 
0028 ##########################################################
0029 # produce generated paricles in acceptance               #
0030 ##########################################################
0031 
0032 genp = cms.EDFilter("CandViewSelector",
0033     src = cms.InputTag("genParticles"),
0034     cut = cms.string("isPromptFinalState() & abs(pdgId) = 11")  # replaced in loop
0035 )
0036 
0037 fiducial = cms.EDFilter("EtaPtMinCandViewSelector",
0038     src = cms.InputTag("genp"),
0039     etaMin = cms.double(-2.5),  # to be replaced in loop ?
0040     etaMax = cms.double(2.5),   # to be replaced in loop ?
0041     ptMin = cms.double(2.0)     # to be replaced in loop ?
0042 )
0043 
0044 ##########################################################
0045 # loop over samples to create modules and sequence       #
0046 ##########################################################
0047 
0048 tmp = cms.SequencePlaceholder("tmp")
0049 egammaSelectors = cms.Sequence(tmp) # no empty sequences allowed, start with dummy
0050 
0051 #loop over samples
0052 for samplenum in range(len(samples.names)):
0053 
0054     # clone genparticles and select correct type
0055     genpartname = "genpart"+samples.names[samplenum]
0056     globals()[genpartname] = genp.clone()
0057     setattr(globals()[genpartname],"cut",cms.string("isPromptFinalState() & abs(pdgId) = "+str(samples.pdgid[samplenum])) ) # set pdgId
0058     egammaSelectors *= globals()[genpartname]                            # add to sequence
0059 
0060     # clone generator fiducial region
0061     fiducialname = "fiducial"+samples.names[samplenum]
0062     globals()[fiducialname] = fiducial.clone()
0063     setattr(globals()[fiducialname],"src",cms.InputTag(genpartname) ) # set input collection
0064     egammaSelectors *= globals()[fiducialname]               # add to sequence
0065 
0066 egammaSelectors.remove(tmp)  # remove the initial dummy
0067 
0068 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0069 emdqm = DQMEDAnalyzer('EmDQM',
0070                            #processname = cms.string("HLT"), # can be obtained from triggerobject
0071                            autoConfMode = cms.untracked.bool(True),
0072                            triggerobject = cms.InputTag("hltTriggerSummaryRAW","","HLT"),
0073                            genEtaAcc = cms.double(2.5),
0074                            genEtAcc = cms.double(2.0),
0075                            PtMax = cms.untracked.double(100.0),
0076                            isData = cms.bool(False),
0077                            verbosity = cms.untracked.uint32(0),
0078                            mcMatchedOnly = cms.untracked.bool(True),
0079                            noPhiPlots = cms.untracked.bool(True),
0080                            noIsolationPlots = cms.untracked.bool(True)
0081                           )
0082 
0083 # selectors go into separate "prevalidation" sequence
0084 egammaValidationSequence   = cms.Sequence(emdqm)