Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-10 05:44:15

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from RecoTauTag.HLTProducers.l2TauNNProducer_cfi import *
0004 from RecoTauTag.HLTProducers.l2TauTagFilter_cfi import *
0005 
0006 def insertL2TauSequence(process, path, ref_module):
0007     ref_idx = path.index(ref_module)
0008     path.insert(ref_idx + 1, process.hltL2TauTagNNSequence)
0009     path.insert(ref_idx + 2, process.hltL2DoubleTauTagNNFilter)
0010     path.insert(ref_idx + 3, process.HLTGlobalPFTauHPSSequence)
0011 
0012 
0013 def update(process):
0014     thWp = {
0015             'Tight': 0.180858813224404,
0016             'Medium': 0.12267940863785043,
0017             'Loose': 0.08411243185219064,
0018     }
0019 
0020     working_point = "Tight"
0021     graphPath = 'RecoTauTag/TrainingFiles/data/L2TauNNTag/L2TauTag_Run3v1.pb'
0022 
0023     normalizationDict = 'RecoTauTag/TrainingFiles/data/L2TauNNTag/NormalizationDict.json'
0024 
0025     process.hltL2TauTagNNProducer = l2TauNNProducer.clone(
0026         debugLevel = 0,
0027         L1Taus = [
0028             cms.PSet(
0029                 L1CollectionName = cms.string('DoubleTau'),
0030                 L1TauTrigger = cms.InputTag('hltL1sDoubleTauBigOR'),
0031             ),
0032         ],
0033         hbheInput = "hltHbhereco",
0034         hoInput = "hltHoreco",
0035         ebInput = "hltEcalRecHit:EcalRecHitsEB",
0036         eeInput = "hltEcalRecHit:EcalRecHitsEE",
0037         pataVertices = "hltPixelVerticesSoA",
0038         pataTracks = "hltPixelTracksSoA",
0039         BeamSpot = "hltOnlineBeamSpot",
0040         maxVtx = 100,
0041         fractionSumPt2 = 0.3,
0042         minSumPt2 = 0.,
0043         track_pt_min = 1.,
0044         track_pt_max = 20.,
0045         track_chi2_max = 20.,
0046         graphPath = graphPath,
0047         normalizationDict = normalizationDict
0048     )
0049     process.hltL2DoubleTauTagNNFilter = l2TauTagFilter.clone(
0050         nExpected = 2,
0051         L1TauSrc = 'hltL1sDoubleTauBigOR',
0052         L2Outcomes = 'hltL2TauTagNNProducer:DoubleTau',
0053         DiscrWP = thWp[working_point],
0054         l1TauPtThreshold = 250,
0055     )
0056     # L2 updated Sequence
0057     process.hltL2TauTagNNSequence = cms.Sequence(process.HLTDoCaloSequence + process.hltL1sDoubleTauBigOR + process.hltL2TauTagNNProducer)
0058 
0059 
0060     # Regional -> Global customization
0061     process.hltHpsPFTauTrackPt1DiscriminatorReg.PFTauProducer = "hltHpsPFTauProducer"
0062     process.hltHpsDoublePFTau35Reg.inputTag = "hltHpsPFTauProducer"
0063     process.hltHpsSelectedPFTausTrackPt1Reg.src = "hltHpsPFTauProducer"
0064     process.hltHpsPFTauMediumAbsoluteChargedIsolationDiscriminatorReg.PFTauProducer = "hltHpsPFTauProducer"
0065     process.hltHpsPFTauMediumAbsoluteChargedIsolationDiscriminatorReg.particleFlowSrc = "hltParticleFlow"
0066     process.hltHpsPFTauMediumRelativeChargedIsolationDiscriminatorReg.PFTauProducer = "hltHpsPFTauProducer"
0067     process.hltHpsPFTauMediumRelativeChargedIsolationDiscriminatorReg.particleFlowSrc = "hltParticleFlow"
0068     process.hltHpsPFTauMediumAbsOrRelChargedIsolationDiscriminatorReg.PFTauProducer = "hltHpsPFTauProducer"
0069     process.hltHpsSelectedPFTausTrackPt1MediumChargedIsolationReg.src = "hltHpsPFTauProducer"
0070 
0071     process.HLT_DoubleMediumChargedIsoPFTauHPS35_Trk1_eta2p1_Reg_v4.remove(process.HLTL2TauJetsL1TauSeededSequence)
0072     process.HLT_DoubleMediumChargedIsoPFTauHPS35_Trk1_eta2p1_Reg_v4.remove(process.hltDoubleL2Tau26eta2p2)
0073     process.HLT_DoubleMediumChargedIsoPFTauHPS35_Trk1_eta2p1_Reg_v4.remove(process.HLTL2p5IsoTauL1TauSeededSequence)
0074     process.HLT_DoubleMediumChargedIsoPFTauHPS35_Trk1_eta2p1_Reg_v4.remove(process.hltDoubleL2IsoTau26eta2p2 )
0075     process.HLT_DoubleMediumChargedIsoPFTauHPS35_Trk1_eta2p1_Reg_v4.remove(process.HLTRegionalPFTauHPSSequence )
0076 
0077     insertL2TauSequence(process, process.HLT_DoubleMediumChargedIsoPFTauHPS35_Trk1_eta2p1_Reg_v4, process.hltPreDoubleMediumChargedIsoPFTauHPS35Trk1eta2p1Reg)
0078 
0079 
0080     old_diTau_paths = ['HLT_IsoMu24_eta2p1_TightChargedIsoPFTauHPS35_Trk1_eta2p1_Reg_CrossL1_v1', 'HLT_IsoMu24_eta2p1_MediumChargedIsoPFTauHPS35_Trk1_TightID_eta2p1_Reg_CrossL1_v1','HLT_IsoMu24_eta2p1_TightChargedIsoPFTauHPS35_Trk1_TightID_eta2p1_Reg_CrossL1_v1','HLT_IsoMu24_eta2p1_MediumChargedIsoPFTauHPS35_Trk1_eta2p1_Reg_CrossL1_v4','HLT_IsoMu24_eta2p1_MediumChargedIsoPFTauHPS30_Trk1_eta2p1_Reg_CrossL1_v1','HLT_DoubleMediumChargedIsoPFTauHPS30_L1MaxMass_Trk1_eta2p1_Reg_v1','HLT_DoubleTightChargedIsoPFTauHPS35_Trk1_eta2p1_Reg_v1','HLT_DoubleMediumChargedIsoPFTauHPS35_Trk1_TightID_eta2p1_Reg_v1','HLT_DoubleTightChargedIsoPFTauHPS35_Trk1_TightID_eta2p1_Reg_v1','HLT_DoubleMediumChargedIsoPFTauHPS40_Trk1_eta2p1_Reg_v1','HLT_DoubleTightChargedIsoPFTauHPS40_Trk1_eta2p1_Reg_v1','HLT_DoubleMediumChargedIsoPFTauHPS40_Trk1_TightID_eta2p1_Reg_v1','HLT_DoubleTightChargedIsoPFTauHPS40_Trk1_TightID_eta2p1_Reg_v1']
0081     for path in old_diTau_paths:
0082         if path in process.__dict__:
0083             process.schedule.remove(getattr(process, path))
0084 
0085 
0086     return process