def setModules(process, options): #process.sampleInfo = cms.EDProducer("tnp::FlashggSampleInfoTree", # ) from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel process.hltFilter = hltHighLevel.clone() process.hltFilter.throw = cms.bool(False) process.hltFilter.HLTPaths = options['TnPPATHS'] from EgammaAnalysis.TnPTreeProducer.pileupConfiguration_cfi import pileupProducer process.pileupReweightingProducer = pileupProducer.clone() ################################################################### ## ELECTRON MODULES ################################################################### #produces photons for tag+probe process.photonFromDiPhotons = cms.EDProducer("FlashggPhotonFromDiPhotonProducer", src = cms.InputTag(options['DIPHOTON_COLL']), cut = cms.string(options['PHOTON_CUTS']), leadingPreselection = cms.string(options['LEADING_PRESELECTION']), subleadingPreselection = cms.string(options['SUBLEADING_PRESELECTION']), vertexSelection = cms.int32(-1), # -1 means take the chosen vertex, otherwise use the index to select 2it #diPhotonMVATag = cms.InputTag("flashggUpdatedIdMVADiPhotons"), diPhotonMVATag = cms.InputTag("flashggDiPhotonMVA"), diphotonMVAThreshold = cms.double(-0.6) ) #produces tag collection from diphotons process.goodPhotonTags = cms.EDFilter("FlashggPhotonRefSelector", src = cms.InputTag("photonFromDiPhotons"), cut = cms.string(options['PHOTON_TAG_CUTS']) ) #produces probe collection from diphotons process.goodPhotonProbes = cms.EDFilter("FlashggPhotonRefSelector", src = cms.InputTag("photonFromDiPhotons"), cut = cms.string(options['PHOTON_PROBE_CUTS']) ) ################################################################### #IDMVA for probes process.goodPhotonProbesIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap", input = cms.InputTag("goodPhotonProbes"), cut = cms.string(options['PHOTON_PROBE_CUTS']), selection = cms.InputTag("photonFromDiPhotons:idmva"), id_cut = cms.double(-0.9) ) process.goodPhotonsProbeTnPprobe = cms.EDProducer("FlashggPhotonTriggerCandProducer", filterNames = options['TnPHLTProbeFilters'], inputs = cms.InputTag("goodPhotonProbesIDMVA"), bits = cms.InputTag(options['TRIGGER_RES']), objects = cms.InputTag(options['PAT_TRIG']), dR = cms.double(0.3), isAND = cms.bool(False) ) #numerator for Preselection process.goodPhotonProbesPreselection = cms.EDProducer("FlashggPhotonSelectorByValueMap", input = cms.InputTag("goodPhotonsProbeTnPprobe"), cut = cms.string(options['PHOTON_PROBE_CUTS']), selection = cms.InputTag("photonFromDiPhotons:preselection"), id_cut = cms.bool(True) ) #probes match to l1 process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1CandProducer", #process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1Stage2CandProducer", inputs = cms.InputTag("goodPhotonProbesPreselection"), #isoObjects = cms.InputTag("l1extraParticles:Isolated"), #nonIsoObjects = cms.InputTag("l1extraParticles:NonIsolated"), #objects = cms.InputTag("hltCaloStage2Digis:EGamma"), objects = cms.InputTag("caloStage2Digis:EGamma"), #minET = cms.double(15), #lead eff only minET = cms.double(10), #sublead eff only dRmatch = cms.double(0.2), #defined to match L1 online matching to hlt (0.261) #dRmatchEE = cms.double(0.2), #defined to match L1 online matching to hlt (should probably be tightened for stage2) isolatedOnly = cms.bool(False) ) #numerator passing HLT requiring preselection and L1 process.goodPhotonsProbeHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer", filterNames = options['HLTFILTERTOMEASURE'], inputs = cms.InputTag("goodPhotonProbesPreselection"), bits = cms.InputTag(options['TRIGGER_RES']), objects = cms.InputTag(options['PAT_TRIG']), dR = cms.double(0.3), isAND = cms.bool(False) ) ################################################################### #IDMVA for tags process.goodPhotonTagsIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap", input = cms.InputTag("goodPhotonTags"), cut = cms.string(options['PHOTON_TAG_CUTS']), selection = cms.InputTag("photonFromDiPhotons:idmva"), id_cut = cms.double(-0.5) ) #preselection for tags process.goodPhotonTagsPreselection = cms.EDProducer("FlashggPhotonSelectorByValueMap", input = cms.InputTag("goodPhotonTagsIDMVA"), cut = cms.string(options['PHOTON_TAG_CUTS']), selection = cms.InputTag("photonFromDiPhotons:preselection"), id_cut = cms.bool(True) ) #good match to lead HggFilter tag photons for denominator PRESELECTED process.goodPhotonsTagLeadMatch = cms.EDProducer("FlashggPhotonTriggerCandProducer", filterNames = options['TagLeadMatchFilters'], inputs = cms.InputTag("goodPhotonTagsPreselection"), bits = cms.InputTag(options['TRIGGER_RES']), objects = cms.InputTag(options['PAT_TRIG']), dR = cms.double(0.3), isAND = cms.bool(False) ) #good preselected tag photons for denominator process.goodPhotonsTagHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer", filterNames = options['TnPHLTTagFilters'], inputs = cms.InputTag("goodPhotonsTagLeadMatch"), bits = cms.InputTag(options['TRIGGER_RES']), objects = cms.InputTag(options['PAT_TRIG']), dR = cms.double(0.3), isAND = cms.bool(False) ) ################################################################### ## PHOTON ISOLATION ################################################################### process.load("RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi") process.noL1RECO = cms.EDProducer("CandViewShallowCloneCombiner", decay = cms.string("goodPhotonsTagHLT goodPhotonProbesPreselection"), #decay = cms.string("goodPhotonsTagHLT goodPhotonsProbeHLT"), checkCharge = cms.bool(False), cut = cms.string("40<mass<180"), ) #efficiency for HLT with L1 requirement in denominator process.L1RECO = cms.EDProducer("CandViewShallowCloneCombiner", decay = cms.string("goodPhotonsTagHLT goodPhotonProbesL1"), checkCharge = cms.bool(False), cut = cms.string("40<mass<180"), )
def setModules(process, options): #process.sampleInfo = cms.EDProducer("tnp::FlashggSampleInfoTree") from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel process.hltFilter = hltHighLevel.clone() process.hltFilter.throw = cms.bool(False) process.hltFilter.HLTPaths = options['TnPPATHS'] from EgammaAnalysis.TnPTreeProducer.pileupConfiguration_cfi import pileupProducer process.pileupReweightingProducer = pileupProducer.clone() ################################################################### ## ELECTRON MODULES ################################################################### process.photonFromDiPhotons = cms.EDProducer("FlashggPhotonFromDiPhotonProducer", src = cms.InputTag(options['DIPHOTON_COLL']), cut = cms.string(options['PHOTON_CUTS']), leadingPreselection = cms.string(options['LEADING_PRESELECTION']), subleadingPreselection = cms.string(options['SUBLEADING_PRESELECTION']), vertexSelection = cms.int32(-1), # -1 means take the chosen vertex, otherwise use the index to select 2it diPhotonMVATag = cms.InputTag("flashggDiPhotonMVA"), diphotonMVAThreshold = cms.double(-0.6) #Previous value was -1.0 ) process.goodPhotonTagL1 = cms.EDProducer("FlashggPhotonL1CandProducer", inputs = cms.InputTag("goodPhotonTags"), isoObjects = cms.InputTag("goodPhotonTags"), nonIsoObjects = cms.InputTag(""), minET = cms.double(25), dRmatch = cms.double(0.2), isolatedOnly = cms.bool(False) ) process.goodPhotonTags = cms.EDFilter("FlashggPhotonRefSelector", src = cms.InputTag("photonFromDiPhotons"), cut = cms.string(options['PHOTON_TAG_CUTS']) ) process.goodPhotonProbes = cms.EDFilter("FlashggPhotonRefSelector", src = cms.InputTag("photonFromDiPhotons"), cut = cms.string(options['PHOTON_CUTS']) ) ################################################################### process.goodPhotonProbesPreselection = cms.EDProducer("FlashggPhotonSelectorByValueMap", input = cms.InputTag("goodPhotonProbes"), cut = cms.string(options['PHOTON_CUTS']), selection = cms.InputTag("photonFromDiPhotons:preselection"), id_cut = cms.bool(True) ) process.goodPhotonProbesIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap", input = cms.InputTag("goodPhotonProbes"), cut = cms.string(options['PHOTON_CUTS']), selection = cms.InputTag("photonFromDiPhotons:idmva"), id_cut = cms.double(-0.9) ) process.goodPhotonTagsIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap", input = cms.InputTag("goodPhotonTags"), cut = cms.string(options['PHOTON_CUTS']), selection = cms.InputTag("photonFromDiPhotons:idmva"), id_cut = cms.double(-0.6) ) ################################################################### process.goodPhotonsTagHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer", filterNames = options['TnPHLTTagFilters'], inputs = cms.InputTag("goodPhotonTagsIDMVA"), bits = cms.InputTag('TriggerResults::HLT'), objects = cms.InputTag('slimmedPatTrigger'), dR = cms.double(0.3), isAND = cms.bool(True) ) process.goodPhotonsProbeHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer", filterNames = options['TnPHLTProbeFilters'], inputs = cms.InputTag("goodPhotonProbes"), bits = cms.InputTag('TriggerResults::HLT'), objects = cms.InputTag('slimmedPatTrigger'), dR = cms.double(0.3), isAND = cms.bool(True) ) process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1Stage2CandProducer", inputs = cms.InputTag("goodPhotonProbes"), objects = cms.InputTag("caloStage2Digis:EGamma"), minET = cms.double(40), dRmatch = cms.double(0.2), dRmatchEE = cms.double(0.2), isolatedOnly = cms.bool(False) ) ################################################################### ## PHOTON ISOLATION ################################################################### process.load("RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi") process.tagTightRECO = cms.EDProducer("CandViewShallowCloneCombiner", decay = cms.string("goodPhotonsTagHLT goodPhotonsProbeHLT"), checkCharge = cms.bool(False), cut = cms.string("40<mass<130"), )
def setSequences(process, options): process.init_sequence = cms.Sequence() if options['UseCalibEn'] and options['useAOD']: process.enCalib_sequence = cms.Sequence( process.selectElectronsBase + process.selectPhotonsBase + process.calibratedPatElectrons + process.calibratedPatPhotons) process.init_sequence += process.enCalib_sequence process.sc_sequence = cms.Sequence() process.ele_sequence = cms.Sequence() process.pho_sequence = cms.Sequence() process.hlt_sequence = cms.Sequence(process.hltFilter) process.tag_sequence = cms.Sequence(process.goodElectrons + process.egmGsfElectronIDSequence + process.tagEleCutBasedTight + process.tagEle) if options['useAOD']: process.sc_sequence += process.sc_sequenceAOD else: process.sc_sequence += process.sc_sequenceMiniAOD process.sc_sequence += process.probeSC process.sc_sequence += process.probeSCEle process.ele_sequence = cms.Sequence( process.probeEleCutBasedVeto + process.probeEleCutBasedLoose + process.probeEleCutBasedMedium + process.probeEleCutBasedTight + process.probeEleCutBasedVeto80X + process.probeEleCutBasedLoose80X + process.probeEleCutBasedMedium80X + process.probeEleCutBasedTight80X + process.probeEleMVA80Xwp90 + process.probeEleMVA80Xwp80 + process.probeEleMiniIso + process.probeEleMiniIsoEffArea + process.probeEle) if not options['useAOD']: process.ele_sequence += process.probeEleHLTsafe process.pho_sequence = cms.Sequence( process.goodPhotons + process.egmPhotonIDSequence + process.probePhoCutBasedLoose + process.probePhoCutBasedMedium + process.probePhoCutBasedTight + process.probePhoMVA + # process.probePhoCutBasedLoose80X + # process.probePhoCutBasedMedium80X + # process.probePhoCutBasedTight80X + # process.probePhoMVA80Xwp90 + # process.probePhoMVA80Xwp80 + process.probePho) process.hlt_sequence = cms.Sequence(process.probeElePassHLT) if options['isMC']: process.tag_sequence += process.genEle + process.genTagEle process.ele_sequence += process.genProbeEle process.pho_sequence += process.genProbePho process.sc_sequence += process.genProbeSC from EgammaAnalysis.TnPTreeProducer.pileupConfiguration_cfi import pileupProducer process.pileupReweightingProducer = pileupProducer.clone() if options['useAOD']: process.pileupReweightingProducer.pileupInfoTag = "addPileupInfo" process.mc_sequence = cms.Sequence() if options['isMC']: process.mc_sequence = cms.Sequence(process.pileupReweightingProducer)
def setModules(process, options): #process.sampleInfo = cms.EDProducer("tnp::FlashggSampleInfoTree", # ) from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel process.hltFilter = hltHighLevel.clone() process.hltFilter.throw = cms.bool(False) process.hltFilter.HLTPaths = options['TnPPATHS'] from EgammaAnalysis.TnPTreeProducer.pileupConfiguration_cfi import pileupProducer process.pileupReweightingProducer = pileupProducer.clone() ################################################################### ## ELECTRON MODULES ################################################################### #produces photons for tag+probe process.photonFromDiPhotons = cms.EDProducer( "FlashggPhotonFromDiPhotonProducer", src=cms.InputTag(options['DIPHOTON_COLL']), cut=cms.string(options['PHOTON_CUTS']), leadingPreselection=cms.string(options['LEADING_PRESELECTION']), subleadingPreselection=cms.string(options['SUBLEADING_PRESELECTION']), vertexSelection=cms.int32( -1 ), # -1 means take the chosen vertex, otherwise use the index to select 2it #diPhotonMVATag = cms.InputTag("flashggUpdatedIdMVADiPhotons"), diPhotonMVATag=cms.InputTag("flashggDiPhotonMVA"), diphotonMVAThreshold=cms.double(-0.6)) #produces tag collection from diphotons process.goodPhotonTags = cms.EDFilter( "FlashggPhotonRefSelector", src=cms.InputTag("photonFromDiPhotons"), cut=cms.string(options['PHOTON_TAG_CUTS'])) #produces probe collection from diphotons process.goodPhotonProbes = cms.EDFilter( "FlashggPhotonRefSelector", src=cms.InputTag("photonFromDiPhotons"), cut=cms.string(options['PHOTON_PROBE_CUTS'])) ################################################################### #IDMVA for probes process.goodPhotonProbesIDMVA = cms.EDProducer( "FlashggPhotonSelectorByDoubleValueMap", input=cms.InputTag("goodPhotonProbes"), cut=cms.string(options['PHOTON_PROBE_CUTS']), selection=cms.InputTag("photonFromDiPhotons:idmva"), id_cut=cms.double(-0.9)) process.goodPhotonsProbeTnPprobe = cms.EDProducer( "FlashggPhotonTriggerCandProducer", filterNames=options['TnPHLTProbeFilters'], inputs=cms.InputTag("goodPhotonProbesIDMVA"), bits=cms.InputTag(options['TRIGGER_RES']), objects=cms.InputTag(options['PAT_TRIG']), dR=cms.double(0.3), isAND=cms.bool(False)) #numerator for Preselection process.goodPhotonProbesPreselection = cms.EDProducer( "FlashggPhotonSelectorByValueMap", input=cms.InputTag("goodPhotonsProbeTnPprobe"), cut=cms.string(options['PHOTON_PROBE_CUTS']), selection=cms.InputTag("photonFromDiPhotons:preselection"), id_cut=cms.bool(True)) #probes match to l1 process.goodPhotonProbesL1 = cms.EDProducer( "FlashggPhotonL1CandProducer", #process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1Stage2CandProducer", inputs=cms.InputTag("goodPhotonProbesPreselection"), #isoObjects = cms.InputTag("l1extraParticles:Isolated"), #nonIsoObjects = cms.InputTag("l1extraParticles:NonIsolated"), #objects = cms.InputTag("hltCaloStage2Digis:EGamma"), objects=cms.InputTag("caloStage2Digis:EGamma"), #minET = cms.double(15), #lead eff only minET=cms.double(10), #sublead eff only dRmatch=cms.double( 0.2), #defined to match L1 online matching to hlt (0.261) #dRmatchEE = cms.double(0.2), #defined to match L1 online matching to hlt (should probably be tightened for stage2) isolatedOnly=cms.bool(False)) #numerator passing HLT requiring preselection and L1 process.goodPhotonsProbeHLT = cms.EDProducer( "FlashggPhotonTriggerCandProducer", filterNames=options['HLTFILTERTOMEASURE'], inputs=cms.InputTag("goodPhotonProbesPreselection"), bits=cms.InputTag(options['TRIGGER_RES']), objects=cms.InputTag(options['PAT_TRIG']), dR=cms.double(0.3), isAND=cms.bool(False)) ################################################################### #IDMVA for tags process.goodPhotonTagsIDMVA = cms.EDProducer( "FlashggPhotonSelectorByDoubleValueMap", input=cms.InputTag("goodPhotonTags"), cut=cms.string(options['PHOTON_TAG_CUTS']), selection=cms.InputTag("photonFromDiPhotons:idmva"), id_cut=cms.double(-0.5)) #preselection for tags process.goodPhotonTagsPreselection = cms.EDProducer( "FlashggPhotonSelectorByValueMap", input=cms.InputTag("goodPhotonTagsIDMVA"), cut=cms.string(options['PHOTON_TAG_CUTS']), selection=cms.InputTag("photonFromDiPhotons:preselection"), id_cut=cms.bool(True)) #good match to lead HggFilter tag photons for denominator PRESELECTED process.goodPhotonsTagLeadMatch = cms.EDProducer( "FlashggPhotonTriggerCandProducer", filterNames=options['TagLeadMatchFilters'], inputs=cms.InputTag("goodPhotonTagsPreselection"), bits=cms.InputTag(options['TRIGGER_RES']), objects=cms.InputTag(options['PAT_TRIG']), dR=cms.double(0.3), isAND=cms.bool(False)) #good preselected tag photons for denominator process.goodPhotonsTagHLT = cms.EDProducer( "FlashggPhotonTriggerCandProducer", filterNames=options['TnPHLTTagFilters'], inputs=cms.InputTag("goodPhotonsTagLeadMatch"), bits=cms.InputTag(options['TRIGGER_RES']), objects=cms.InputTag(options['PAT_TRIG']), dR=cms.double(0.3), isAND=cms.bool(False)) ################################################################### ## PHOTON ISOLATION ################################################################### process.load( "RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi") process.noL1RECO = cms.EDProducer( "CandViewShallowCloneCombiner", decay=cms.string("goodPhotonsTagHLT goodPhotonProbesPreselection"), #decay = cms.string("goodPhotonsTagHLT goodPhotonsProbeHLT"), checkCharge=cms.bool(False), cut=cms.string("40<mass<180"), ) #efficiency for HLT with L1 requirement in denominator process.L1RECO = cms.EDProducer( "CandViewShallowCloneCombiner", decay=cms.string("goodPhotonsTagHLT goodPhotonProbesL1"), checkCharge=cms.bool(False), cut=cms.string("40<mass<180"), )
def setSequences(process, options): process.init_sequence = cms.Sequence() if options['UseCalibEn'] and options['useAOD']: process.enCalib_sequence = cms.Sequence( process.selectElectronsBase + process.selectPhotonsBase + process.calibratedPatElectrons + process.calibratedPatPhotons ) process.init_sequence += process.enCalib_sequence process.sc_sequence = cms.Sequence( ) process.ele_sequence = cms.Sequence( ) process.pho_sequence = cms.Sequence( ) process.hlt_sequence = cms.Sequence( process.hltFilter ) process.tag_sequence = cms.Sequence( process.goodElectrons + process.egmGsfElectronIDSequence + process.tagEleCutBasedTight + process.tagEle ) if options['useAOD'] : process.sc_sequence += process.sc_sequenceAOD else : process.sc_sequence += process.sc_sequenceMiniAOD process.sc_sequence += process.probeSC process.sc_sequence += process.probeSCEle process.ele_sequence = cms.Sequence( process.probeEleCutBasedVeto + process.probeEleCutBasedLoose + process.probeEleCutBasedMedium + process.probeEleCutBasedTight + process.probeEleCutBasedVeto80X + process.probeEleCutBasedLoose80X + process.probeEleCutBasedMedium80X + process.probeEleCutBasedTight80X + process.probeEleMVA80Xwp90 + process.probeEleMVA80Xwp80 + process.probeEleCutBasedVeto94X + process.probeEleCutBasedLoose94X + process.probeEleCutBasedMedium94X + process.probeEleCutBasedTight94X + process.probeEle ) if not options['useAOD'] : process.ele_sequence += process.probeEleHLTsafe process.pho_sequence = cms.Sequence( process.goodPhotons + process.egmPhotonIDSequence + process.probePhoCutBasedLoose + process.probePhoCutBasedMedium + process.probePhoCutBasedTight + process.probePhoMVA + # process.probePhoCutBasedLoose80X + # process.probePhoCutBasedMedium80X + # process.probePhoCutBasedTight80X + # process.probePhoMVA80Xwp90 + # process.probePhoMVA80Xwp80 + process.probePho ) process.hlt_sequence = cms.Sequence( process.probeElePassL1T + process.probeElePassEtLeg1 + process.probeElePassClusterShapeLeg1 + process.probeElePassHELeg1 + process.probeElePassEcalIsoLeg1 + process.probeElePassHcalIsoLeg1 + process.probeElePassPixelMatchLeg1 + process.probeElePassOneOEMinusOneOPLeg1 + process.probeElePassDetaLeg1 + process.probeElePassDphiLeg1 + process.probeElePassTrackIsoLeg1 + process.probeElePassEtLeg2 + process.probeElePassClusterShapeLeg2 + process.probeElePassHELeg2 + process.probeElePassEcalIsoLeg2 + process.probeElePassHcalIsoLeg2 + process.probeElePassPixelMatchLeg2 + process.probeElePassOneOEMinusOneOPLeg2 + process.probeElePassDetaLeg2 + process.probeElePassDphiLeg2 + process.probeElePassTrackIsoLeg2 + process.probeElePassPMS2SeededFilterDouble33 + process.probeElePassPMS2UnseededFilterDouble33 #process.probeElePassL1TEle32WPTight #+process.probeElePassL1TEtEle32WPTight #+process.probeElePassHcalIsoEle32WPTight #+process.probeElePassPixelMatchEle32WPTight #+process.probeElePassPMS2Ele32WPTight #+process.probeElePassGsfTrackIsoEle32WPTight ) if options['isMC'] : process.tag_sequence += process.genEle + process.genTagEle process.ele_sequence += process.genProbeEle process.pho_sequence += process.genProbePho process.sc_sequence += process.genProbeSC from EgammaAnalysis.TnPTreeProducer.pileupConfiguration_cfi import pileupProducer process.pileupReweightingProducer = pileupProducer.clone() if options['useAOD']: process.pileupReweightingProducer.pileupInfoTag = "addPileupInfo" process.mc_sequence = cms.Sequence() if options['isMC'] : process.mc_sequence = cms.Sequence( process.pileupReweightingProducer )