00001 import FWCore.ParameterSet.Config as cms
00002
00003 class dummy:
00004 pass
00005
00006 samples=dummy()
00007 paths=dummy()
00008
00009
00010
00011
00012
00013 samples.names = ['Wenu',
00014 'Zee',
00015 'GammaJet',
00016 'DiGamma']
00017 samples.pdgid = [ 11,
00018 11,
00019 22,
00020 22]
00021 samples.num = [1,
00022 2,
00023 1,
00024 2]
00025
00026
00027
00028 paths.Wenu = ['HLT_Ele10_LW_L1RDQM',
00029 'HLT_Ele15_SW_L1RDQM',
00030 'HLT_Ele10_LW_EleId_L1RDQM',
00031 'HLT_Ele15_SiStrip_L1RDQM']
00032
00033 paths.Zee = paths.Wenu + ['HLT_DoubleEle5_SW_L1RDQM']
00034
00035 paths.GammaJet = ['HLT_Photon10_L1R_DQM',
00036 'HLT_Photon15_TrackIso_L1R_DQM',
00037 'HLT_Photon15_LooseEcalIso_L1R_DQM',
00038 'HLT_Photon25_LooseEcalIso_TrackIso_L1R_DQM']
00039
00040 paths.DiGamma = ['HLT_Photon10_L1R_DQM','HLT_DoublePhoton10_L1R_DQM']
00041
00042 pathlumi = { 'HLT_Ele10_LW_L1RDQM':'8e29',
00043 'HLT_Ele15_SW_L1RDQM':'1e31',
00044 'HLT_Ele10_LW_EleId_L1RDQM':'8e29',
00045 'HLT_Ele15_SiStrip_L1RDQM':'8e29',
00046 'HLT_DoubleEle5_SW_L1RDQM':'8e29',
00047 'HLT_Photon10_L1R_DQM':'8e29',
00048 'HLT_Photon15_TrackIso_L1R_DQM':'8e29',
00049 'HLT_Photon15_LooseEcalIso_L1R_DQM':'8e29',
00050 'HLT_DoublePhoton10_L1R_DQM':'8e29',
00051 'HLT_Photon25_L1R_DQM':'1e31',
00052 'HLT_Photon25_LooseEcalIso_TrackIso_L1R_DQM':'1e31'}
00053
00054 lumiprocess = { '8e29':'HLT',
00055 '1e31':'HLT'
00056 }
00057
00058
00059
00060
00061
00062
00063 genp = cms.EDFilter("PdgIdAndStatusCandViewSelector",
00064 status = cms.vint32(3),
00065 src = cms.InputTag("genParticles"),
00066 pdgId = cms.vint32(11)
00067 )
00068
00069 fiducial = cms.EDFilter("EtaPtMinCandViewSelector",
00070 src = cms.InputTag("genp"),
00071 etaMin = cms.double(-2.5),
00072 etaMax = cms.double(2.5),
00073 ptMin = cms.double(2.0)
00074 )
00075
00076
00077
00078
00079
00080 tmp = cms.SequencePlaceholder("tmp")
00081 egammaSelectors = cms.Sequence(tmp)
00082 egammaValidators= cms.Sequence(tmp)
00083
00084
00085 for samplenum in range(len(samples.names)):
00086
00087
00088 genpartname = "genpart"+samples.names[samplenum]
00089 globals()[genpartname] = genp.clone()
00090 setattr(globals()[genpartname],"pdgId",cms.vint32(samples.pdgid[samplenum]) )
00091 egammaSelectors *= globals()[genpartname]
00092
00093
00094 fiducialname = "fiducial"+samples.names[samplenum]
00095 globals()[fiducialname] = fiducial.clone()
00096 setattr(globals()[fiducialname],"src",cms.InputTag(genpartname) )
00097 egammaSelectors *= globals()[fiducialname]
00098
00099
00100 for trig in getattr(paths,samples.names[samplenum]):
00101 trigname = trig + samples.names[samplenum]
00102
00103 filename = "HLTriggerOffline.Egamma."+trig+"_cfi"
00104 trigdef =__import__( filename )
00105 import sys
00106 globals()[trigname] = getattr(sys.modules[filename],trig).clone()
00107 setattr(globals()[trigname],"cutcollection",cms.InputTag(fiducialname))
00108 setattr(globals()[trigname],"cutnum",cms.int32( samples.num[samplenum] ))
00109 setattr(globals()[trigname],"pdgGen",cms.int32( samples.pdgid[samplenum]))
00110 getattr(globals()[trigname],'triggerobject').setProcessName( lumiprocess[pathlumi[trig]] )
00111 for filterpset in getattr(globals()[trigname],'filters'):
00112 getattr(filterpset,'HLTCollectionLabels').setProcessName( lumiprocess[pathlumi[trig]] )
00113 for isocollections in getattr(filterpset,'IsoCollections'):
00114 isocollections.setProcessName( lumiprocess[pathlumi[trig]])
00115
00116 egammaValidators *= globals()[trigname]
00117
00118
00119 egammaSelectors.remove(tmp)
00120 egammaValidators.remove(tmp)
00121
00122
00123 egammaValidationSequence = cms.Sequence( egammaValidators )
00124 egammaValidationSequenceFS = cms.Sequence( egammaValidators )