Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-09 02:22:33

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from RecoBTag.FeatureTools.pfDeepBoostedJetTagInfos_cfi import pfDeepBoostedJetTagInfos
0004 from RecoBTag.ONNXRuntime.boostedJetONNXJetTagsProducer_cfi import boostedJetONNXJetTagsProducer
0005 from RecoBTag.FeatureTools.ParticleNetFeatureEvaluator_cfi import ParticleNetFeatureEvaluator
0006 from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4DiscriminatorsJetTags_cfi import *
0007 from RecoBTag.ONNXRuntime.particleNetSonicJetTagsProducer_cfi import particleNetSonicJetTagsProducer as _particleNetSonicJetTagsProducer
0008 from Configuration.ProcessModifiers.particleNetSonicTriton_cff import particleNetSonicTriton
0009 
0010 pfParticleNetFromMiniAODAK4CHSCentralTagInfos = ParticleNetFeatureEvaluator.clone(
0011     jets = "slimmedJets",
0012     jet_radius = 0.4,
0013     min_jet_pt = 15,
0014     min_jet_eta = 0.,
0015     max_jet_eta = 2.5,
0016 )
0017 
0018 pfParticleNetFromMiniAODAK4CHSForwardTagInfos = ParticleNetFeatureEvaluator.clone(
0019     jets = "slimmedJets",
0020     jet_radius = 0.4,
0021     min_jet_pt = 15,
0022     min_jet_eta = 2.5,
0023     max_jet_eta = 4.7,
0024 )
0025 
0026 pfParticleNetFromMiniAODAK4PuppiCentralTagInfos = ParticleNetFeatureEvaluator.clone(
0027     jets = "slimmedJetsPuppi",
0028     jet_radius = 0.4,
0029     min_jet_pt = 15,
0030     min_jet_eta = 0.,
0031     max_jet_eta = 2.5,
0032 )
0033 
0034 pfParticleNetFromMiniAODAK4PuppiForwardTagInfos = ParticleNetFeatureEvaluator.clone(
0035     jets = "slimmedJetsPuppi",
0036     jet_radius = 0.4,
0037     min_jet_pt = 15,
0038     min_jet_eta = 2.5,
0039     max_jet_eta = 4.7,
0040 )
0041 
0042 
0043 pfParticleNetFromMiniAODAK4CHSCentralJetTags = boostedJetONNXJetTagsProducer.clone(
0044     src = 'pfParticleNetFromMiniAODAK4CHSCentralTagInfos',
0045     preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Central/preprocess.json',
0046     model_path = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Central/modelfile/model.onnx',
0047     flav_names = ['probmu','probele','probtaup1h0p','probtaup1h1p','probtaup1h2p','probtaup3h0p','probtaup3h1p','probtaum1h0p','probtaum1h1p','probtaum1h2p','probtaum3h0p','probtaum3h1p','probb','probc','probuds','probg','ptcorr','ptreshigh','ptreslow','ptnu'],
0048 )
0049 
0050 particleNetSonicTriton.toReplaceWith(pfParticleNetFromMiniAODAK4CHSCentralJetTags, _particleNetSonicJetTagsProducer.clone(
0051     src = 'pfParticleNetFromMiniAODAK4CHSCentralTagInfos',
0052     preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Central/preprocess.json',
0053     Client = cms.PSet(
0054         timeout = cms.untracked.uint32(300),
0055         mode = cms.string("Async"),
0056         modelName = cms.string("particleNetFromMiniAODAK4CHSCentral"),
0057         modelConfigPath = cms.FileInPath("RecoBTag/Combined/data/models/particleNetFromMiniAODAK4CHSCentral/config.pbtxt"),
0058         modelVersion = cms.string(""),
0059         verbose = cms.untracked.bool(False),
0060         allowedTries = cms.untracked.uint32(0),
0061         useSharedMemory = cms.untracked.bool(True),
0062         compression = cms.untracked.string(""),
0063     ),
0064     flav_names = pfParticleNetFromMiniAODAK4CHSCentralJetTags.flav_names,
0065 ))
0066 
0067 pfParticleNetFromMiniAODAK4CHSForwardJetTags = boostedJetONNXJetTagsProducer.clone(
0068     src = 'pfParticleNetFromMiniAODAK4CHSForwardTagInfos',
0069     preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Forward/preprocess.json',
0070     model_path = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Forward/modelfile/model.onnx',
0071     flav_names = ['probq','probg','ptcorr','ptreshigh','ptreslow','ptnu'],
0072 )
0073 
0074 particleNetSonicTriton.toReplaceWith(pfParticleNetFromMiniAODAK4CHSForwardJetTags, _particleNetSonicJetTagsProducer.clone(
0075     src = 'pfParticleNetFromMiniAODAK4CHSForwardTagInfos',
0076     preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/CHS/Central/preprocess.json',
0077     Client = cms.PSet(
0078         timeout = cms.untracked.uint32(300),
0079         mode = cms.string("Async"),
0080         modelName = cms.string("particleNetFromMiniAODAK4CHSForward"),
0081         modelConfigPath = cms.FileInPath("RecoBTag/Combined/data/models/particleNetFromMiniAODAK4CHSForward/config.pbtxt"),
0082         modelVersion = cms.string(""),
0083         verbose = cms.untracked.bool(False),
0084         allowedTries = cms.untracked.uint32(0),
0085         useSharedMemory = cms.untracked.bool(True),
0086         compression = cms.untracked.string(""),
0087     ),
0088     flav_names = pfParticleNetFromMiniAODAK4CHSForwardJetTags.flav_names,
0089 ))
0090 
0091 pfParticleNetFromMiniAODAK4PuppiCentralJetTags = boostedJetONNXJetTagsProducer.clone(
0092     src = 'pfParticleNetFromMiniAODAK4PuppiCentralTagInfos',
0093     preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Central/preprocess.json',
0094     model_path = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Central/modelfile/model.onnx',
0095     flav_names = ['probmu','probele','probtaup1h0p','probtaup1h1p','probtaup1h2p','probtaup3h0p','probtaup3h1p','probtaum1h0p','probtaum1h1p','probtaum1h2p','probtaum3h0p','probtaum3h1p','probb','probc','probuds','probg','ptcorr','ptreshigh','ptreslow','ptnu'],
0096 )
0097 
0098 particleNetSonicTriton.toReplaceWith(pfParticleNetFromMiniAODAK4PuppiCentralJetTags, _particleNetSonicJetTagsProducer.clone(
0099     src = 'pfParticleNetFromMiniAODAK4PuppiCentralTagInfos',
0100     preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Central/preprocess.json',
0101     Client = cms.PSet(
0102         timeout = cms.untracked.uint32(300),
0103         mode = cms.string("Async"),
0104         modelName = cms.string("particleNetFromMiniAODAK4PuppiCentral"),
0105         modelConfigPath = cms.FileInPath("RecoBTag/Combined/data/models/particleNetFromMiniAODAK4PuppiCentral/config.pbtxt"),
0106         modelVersion = cms.string(""),
0107         verbose = cms.untracked.bool(False),
0108         allowedTries = cms.untracked.uint32(0),
0109         useSharedMemory = cms.untracked.bool(True),
0110         compression = cms.untracked.string(""),
0111     ),
0112     flav_names = pfParticleNetFromMiniAODAK4PuppiCentralJetTags.flav_names,
0113 ))
0114 
0115 pfParticleNetFromMiniAODAK4PuppiForwardJetTags = boostedJetONNXJetTagsProducer.clone(
0116     src = 'pfParticleNetFromMiniAODAK4PuppiForwardTagInfos',
0117     preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Forward/preprocess.json',
0118     model_path = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Forward/modelfile/model.onnx',
0119     flav_names = ['probq','probg','ptcorr','ptreshigh','ptreslow','ptnu'],
0120 )
0121 
0122 particleNetSonicTriton.toReplaceWith(pfParticleNetFromMiniAODAK4PuppiForwardJetTags, _particleNetSonicJetTagsProducer.clone(
0123     src = 'pfParticleNetFromMiniAODAK4PuppiForwardTagInfos',
0124     preprocess_json = 'RecoBTag/Combined/data/ParticleNetFromMiniAODAK4/PUPPI/Forward/preprocess.json',
0125     Client = cms.PSet(
0126         timeout = cms.untracked.uint32(300),
0127         mode = cms.string("Async"),
0128         modelName = cms.string("particleNetFromMiniAODAK4PuppiForward"),
0129         modelConfigPath = cms.FileInPath("RecoBTag/Combined/data/models/particleNetFromMiniAODAK4PuppiForward/config.pbtxt"),
0130         modelVersion = cms.string(""),
0131         verbose = cms.untracked.bool(False),
0132         allowedTries = cms.untracked.uint32(0),
0133         useSharedMemory = cms.untracked.bool(True),
0134         compression = cms.untracked.string(""),
0135     ),
0136     flav_names = pfParticleNetFromMiniAODAK4PuppiForwardJetTags.flav_names,
0137 ))
0138 
0139 pfParticleNetFromMiniAODAK4CHSTask = cms.Task( pfParticleNetFromMiniAODAK4CHSCentralTagInfos, pfParticleNetFromMiniAODAK4CHSForwardTagInfos, pfParticleNetFromMiniAODAK4CHSCentralJetTags, pfParticleNetFromMiniAODAK4CHSForwardJetTags)
0140 pfParticleNetFromMiniAODAK4PuppiTask = cms.Task( pfParticleNetFromMiniAODAK4PuppiCentralTagInfos, pfParticleNetFromMiniAODAK4PuppiForwardTagInfos, pfParticleNetFromMiniAODAK4PuppiCentralJetTags, pfParticleNetFromMiniAODAK4PuppiForwardJetTags)
0141 
0142 # declare all the discriminators
0143 # probs
0144 _pfParticleNetFromMiniAODAK4CHSCentralJetTagsProbs = ['pfParticleNetFromMiniAODAK4CHSCentralJetTags:' + flav_name
0145                                  for flav_name in pfParticleNetFromMiniAODAK4CHSCentralJetTags.flav_names]
0146 _pfParticleNetFromMiniAODAK4CHSForwardJetTagsProbs = ['pfParticleNetFromMiniAODAK4CHSForwardJetTags:' + flav_name
0147                                  for flav_name in pfParticleNetFromMiniAODAK4CHSForwardJetTags.flav_names]
0148 _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsProbs = ['pfParticleNetFromMiniAODAK4PuppiCentralJetTags:' + flav_name
0149                                  for flav_name in pfParticleNetFromMiniAODAK4PuppiCentralJetTags.flav_names]
0150 _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsProbs = ['pfParticleNetFromMiniAODAK4PuppiForwardJetTags:' + flav_name
0151                                  for flav_name in pfParticleNetFromMiniAODAK4PuppiForwardJetTags.flav_names]
0152 
0153 _pfParticleNetFromMiniAODAK4CHSCentralJetTagsMetaDiscr = ['pfParticleNetFromMiniAODAK4CHSCentralDiscriminatorsJetTags:' + disc.name.value()
0154                                  for disc in pfParticleNetFromMiniAODAK4CHSCentralDiscriminatorsJetTags.discriminators]
0155 _pfParticleNetFromMiniAODAK4CHSForwardJetTagsMetaDiscr = ['pfParticleNetFromMiniAODAK4CHSForwardDiscriminatorsJetTags:' + disc.name.value()
0156                                  for disc in pfParticleNetFromMiniAODAK4CHSForwardDiscriminatorsJetTags.discriminators]
0157 _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsMetaDiscr = ['pfParticleNetFromMiniAODAK4PuppiCentralDiscriminatorsJetTags:' + disc.name.value()
0158                                  for disc in pfParticleNetFromMiniAODAK4PuppiCentralDiscriminatorsJetTags.discriminators]
0159 _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsMetaDiscr = ['pfParticleNetFromMiniAODAK4PuppiForwardDiscriminatorsJetTags:' + disc.name.value()
0160                                  for disc in pfParticleNetFromMiniAODAK4PuppiForwardDiscriminatorsJetTags.discriminators]
0161 
0162 _pfParticleNetFromMiniAODAK4CHSCentralJetTagsAll = _pfParticleNetFromMiniAODAK4CHSCentralJetTagsProbs + _pfParticleNetFromMiniAODAK4CHSCentralJetTagsMetaDiscr
0163 _pfParticleNetFromMiniAODAK4CHSForwardJetTagsAll = _pfParticleNetFromMiniAODAK4CHSForwardJetTagsProbs + _pfParticleNetFromMiniAODAK4CHSForwardJetTagsMetaDiscr
0164 _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll = _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsProbs + _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsMetaDiscr
0165 _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsAll = _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsProbs + _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsMetaDiscr
0166 
0167 
0168 # === Negative tags ===
0169 pfNegativeParticleNetFromMiniAODAK4CHSCentralTagInfos = pfParticleNetFromMiniAODAK4CHSCentralTagInfos.clone(
0170     flip_ip_sign = True,
0171     max_sip3dsig_for_flip = 10,
0172     secondary_vertices = 'inclusiveCandidateNegativeSecondaryVertices',
0173 )
0174 pfNegativeParticleNetFromMiniAODAK4PuppiCentralTagInfos = pfParticleNetFromMiniAODAK4PuppiCentralTagInfos.clone(
0175     flip_ip_sign = True,
0176     max_sip3dsig_for_flip = 10,
0177     secondary_vertices = 'inclusiveCandidateNegativeSecondaryVertices',
0178 )
0179 
0180 pfNegativeParticleNetFromMiniAODAK4CHSCentralJetTags = pfParticleNetFromMiniAODAK4CHSCentralJetTags.clone(
0181     src = 'pfNegativeParticleNetFromMiniAODAK4CHSCentralTagInfos',
0182 )
0183 pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags = pfParticleNetFromMiniAODAK4PuppiCentralJetTags.clone(
0184     src = 'pfNegativeParticleNetFromMiniAODAK4PuppiCentralTagInfos',
0185 )
0186 
0187 # probs
0188 _pfNegativeParticleNetFromMiniAODAK4CHSCentralJetTagsProbs = ['pfNegativeParticleNetFromMiniAODAK4CHSCentralJetTags:' + flav_name
0189                                  for flav_name in pfParticleNetFromMiniAODAK4CHSCentralJetTags.flav_names]
0190 _pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTagsProbs = ['pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:' + flav_name
0191                                  for flav_name in pfParticleNetFromMiniAODAK4PuppiCentralJetTags.flav_names]