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 paths=dummy()
0008 
0009 ##########################################################
0010 # Define which preselections to run                      #
0011 ##########################################################
0012 
0013 samples.names = ['Wenu',
0014                  'Zee',
0015                  'GammaJet',
0016                  'DiGamma']
0017 samples.pdgid = [ 11,
0018                   11,
0019                   22,
0020                   22]
0021 samples.num   = [1,
0022                  2,
0023                  1,
0024                  2]
0025 
0026 #which triggers for which sample
0027 
0028 paths.Wenu = [
0029               'HLT_Ele17_SW_TighterEleIdIsol_L1RDQM',
0030 
0031               'HLT_Ele10_LW_L1RDQM',
0032               'HLT_Ele15_SW_L1RDQM',
0033               'HLT_Ele10_LW_EleId_L1RDQM'
0034               ]
0035 
0036 paths.Zee = paths.Wenu + ['HLT_DoubleEle5_SW_L1RDQM']
0037 
0038 paths.GammaJet = ['HLT_Photon15_TrackIso_L1R_DQM',
0039                   'HLT_Photon10_L1R_DQM']
0040 
0041 paths.DiGamma  = paths.GammaJet 
0042 
0043 
0044 ##########################################################
0045 # loop over samples to create modules and sequence       #
0046 ##########################################################
0047 
0048 tmp = cms.SequencePlaceholder("tmp")
0049 egammaValidationSequenceReco = 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     # loop over triggers for each sample
0055     for trig in getattr(paths,samples.names[samplenum]):
0056         trigname = trig + samples.names[samplenum]
0057         #import appropriate config snippet
0058         filename = "HLTriggerOffline.Egamma."+trig+"_cfi"
0059         trigdef =__import__( filename )
0060         import sys
0061         globals()[trigname] = getattr(sys.modules[filename],trig).clone()    # clone imported config
0062         setattr(globals()[trigname],"_TypedParameterizable__type","EmDQMReco")
0063         # setattr(globals()[trigname],"cutcollection",cms.InputTag(fiducialname))       # set preselacted generator collection
0064         setattr(globals()[trigname],"cutnum",cms.int32( samples.num[samplenum]  )) # cut value for preselection
0065         setattr(globals()[trigname],"pdgGen",cms.int32( samples.pdgid[samplenum])) #correct pdgId for MC matching
0066         egammaValidationSequenceReco *= globals()[trigname]                      # add to sequence
0067 
0068 
0069 egammaValidationSequenceReco.remove(tmp)  # remove the initial dummy