CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions | Variables
custom_btv_cff Namespace Reference

Functions

def add_BTV (process, addAK4=False, addAK8=False, scheme="btvSF")
 
def addPFCands (process, allPF=False, addAK4=False, addAK8=False)
 
def BTVCustomNanoAOD (process)
 
def get_DDX_vars ()
 
def get_DeepCSV_vars ()
 
def get_DeepJet_outputs ()
 Store all output nodes, negative tagger for SF. More...
 
def get_ParticleNetAK4_outputs ()
 
def get_ParticleTransformerAK4_outputs ()
 
def update_jets_AK4 (process)
 Move PFNano (https://github.com/cms-jet/PFNano/) to NanoAOD. More...
 
def update_jets_AK8 (process)
 
def update_jets_AK8_subjet (process)
 

Variables

 btvNano_addAK4_switch
 
 btvNano_addAK8_switch
 
 btvNano_addallPF_switch
 
 btvNano_switch
 Switches for BTV nano Default(store SFs PFCands+TaggerInputs) for both AK4 & AK8 jets btvNano_addAK4_switch, btvNano_addAK8_switch True, btvNano_addPF_switch False, TaggerInput = "btvSF". More...
 
 TaggerInput
 

Function Documentation

◆ add_BTV()

def custom_btv_cff.add_BTV (   process,
  addAK4 = False,
  addAK8 = False,
  scheme = "btvSF" 
)

Definition at line 435 of file custom_btv_cff.py.

References get_DDX_vars(), get_DeepCSV_vars(), get_DeepJet_outputs(), get_ParticleNetAK4_outputs(), update_jets_AK4(), update_jets_AK8(), update_jets_AK8_subjet(), and common_cff.Var().

Referenced by BTVCustomNanoAOD().

435 def add_BTV(process, addAK4=False, addAK8=False, scheme="btvSF"):
436  process.customizeJetTask = cms.Task()
437  process.schedule.associate(process.customizeJetTask)
438 
439  CommonVars = cms.PSet(
440  Proba=Var("bDiscriminator('pfJetProbabilityBJetTags')",
441  float,
442  doc="Jet Probability (Usage:BTV)",
443  precision=10),
444  ProbaN=Var("bDiscriminator('pfNegativeOnlyJetProbabilityBJetTags')",
445  float,
446  doc="Negative-only Jet Probability (Usage:BTV)",
447  precision=10),
448  Bprob=Var("bDiscriminator('pfJetBProbabilityBJetTags')",
449  float,
450  doc="Jet B Probability (Usage:BTV)",
451  precision=10),
452  BprobN=Var("bDiscriminator('pfNegativeOnlyJetBProbabilityBJetTags')",
453  float,
454  doc="Negative-only Jet B Probability (Usage:BTV)",
455  precision=10),
456  )
457 
458  # decouple these from CommonVars, not relevant for data
459  HadronCountingVars = cms.PSet(
460  nBHadrons=Var("jetFlavourInfo().getbHadrons().size()",
461  int,
462  doc="number of b-hadrons"),
463  nCHadrons=Var("jetFlavourInfo().getcHadrons().size()",
464  int,
465  doc="number of c-hadrons")
466  )
467 
468  # AK4
469  if addAK4:
470  if scheme == "btvSF":
471  _n_cpf = 3
472  _n_npf = 3
473  _n_sv = 4
474  elif scheme == "DeepJet":
475  _n_cpf = 25
476  _n_npf = 25
477  _n_sv = 4
478  elif scheme == "RobustParTAK4":
479  _n_cpf = 25
480  _n_npf = 25
481  _n_sv = 12
482  process = update_jets_AK4(process)
483 
484  process.customJetExtTable = cms.EDProducer(
485  "SimplePATJetFlatTableProducer",
486  src=jetPuppiTable.src,
487  cut=jetPuppiTable.cut,
488  name=jetPuppiTable.name,
489  doc=jetPuppiTable.doc,
490  singleton=cms.bool(False), # the number of entries is variable
491  extension=cms.bool(True), # this is the extension table for Jets
492  variables=cms.PSet(
493  CommonVars,
495  get_DeepJet_outputs(), # outputs are added in any case, inputs only if requested
497  #get_ParticleTransformerAK4_outputs(),# removed in 2024
498  ))
499 
500  # disable the ParT branches in default jetPuppi table
501  from PhysicsTools.NanoAOD.nano_eras_cff import run3_nanoAOD_122, run3_nanoAOD_124
502  (run3_nanoAOD_122 | run3_nanoAOD_124).toModify(
503  process.jetPuppiTable.variables,
504  btagRobustParTAK4B = None,
505  btagRobustParTAK4CvL = None,
506  btagRobustParTAK4CvB = None,
507  btagRobustParTAK4QG = None,
508  )
509 
510 
511  # from Run3 onwards, always set storeAK4Truth to True for MC
512  process.customAK4ConstituentsForDeepJetTable = cms.EDProducer("PatJetDeepJetTableProducer",
513  jets = cms.InputTag("linkedObjects","jets"),
514  n_cpf=cms.uint32(_n_cpf),
515  n_npf=cms.uint32(_n_npf),
516  n_sv=cms.uint32(_n_sv)
517  )
518  process.customizeJetTask.add(process.customJetExtTable)
519  process.customizeJetTask.add(process.customAK4ConstituentsForDeepJetTable)
520  # AK8
521  if addAK8:
522  process = update_jets_AK8(process)
523  process = update_jets_AK8_subjet(process)
524  process.customFatJetExtTable = cms.EDProducer(
525  "SimplePATJetFlatTableProducer",
526  src=fatJetTable.src,
527  cut=fatJetTable.cut,
528  name=fatJetTable.name,
529  doc=fatJetTable.doc,
530  singleton=cms.bool(False), # the number of entries is variable
531  extension=cms.bool(True), # this is the extension table for FatJets
532  variables=cms.PSet(
533  CommonVars,
534  #HadronCountingVars if runOnMC else cms.PSet(), # only necessary before 106x
535  get_DDX_vars() ,
536  ))
537 
538 
539  # Subjets
540  process.customSubJetExtTable = cms.EDProducer(
541  "SimplePATJetFlatTableProducer",
542  src=subJetTable.src,
543  cut=subJetTable.cut,
544  name=subJetTable.name,
545  doc=subJetTable.doc,
546  singleton=cms.bool(False), # the number of entries is variable
547  extension=cms.bool(True), # this is the extension table for FatJets
548  variables=cms.PSet(
549  CommonVars,
550  #HadronCountingVars if runOnMC else cms.PSet(), # only necessary before 106x
551  ))
552 
553  process.customizeJetTask.add(process.customFatJetExtTable)
554  process.customizeJetTask.add(process.customSubJetExtTable)
555 
556 
557 
558 # From https://github.com/cms-jet/PFNano/blob/13_0_7_from124MiniAOD/python/addPFCands_cff.py
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17
def update_jets_AK4(process)
Move PFNano (https://github.com/cms-jet/PFNano/) to NanoAOD.
def add_BTV(process, addAK4=False, addAK8=False, scheme="btvSF")
def update_jets_AK8_subjet(process)
def update_jets_AK8(process)
def get_ParticleNetAK4_outputs()
def get_DeepJet_outputs()
Store all output nodes, negative tagger for SF.

◆ addPFCands()

def custom_btv_cff.addPFCands (   process,
  allPF = False,
  addAK4 = False,
  addAK8 = False 
)

Definition at line 559 of file custom_btv_cff.py.

References common_cff.Var().

Referenced by BTVCustomNanoAOD().

559 def addPFCands(process, allPF = False, addAK4=False, addAK8=False):
560  process.customizedPFCandsTask = cms.Task()
561  process.schedule.associate(process.customizedPFCandsTask)
562 
563  process.finalJetsAK8Constituents = cms.EDProducer("PatJetConstituentPtrSelector",
564  src = cms.InputTag("finalJetsAK8"),
565  cut = cms.string("")
566  )
567  process.finalJetsAK4Constituents = cms.EDProducer("PatJetConstituentPtrSelector",
568  src = cms.InputTag("finalJetsPuppi"),
569  cut = cms.string("")
570  )
571  if allPF:
572  candInput = cms.InputTag("packedPFCandidates")
573  elif not addAK8:
574  candList = cms.VInputTag(cms.InputTag("finalJetsAK4Constituents", "constituents"))
575  process.customizedPFCandsTask.add(process.finalJetsAK4Constituents)
576  process.finalJetsConstituentsTable = cms.EDProducer("PackedCandidatePtrMerger", src = candList, skipNulls = cms.bool(True), warnOnSkip = cms.bool(True))
577  candInput = cms.InputTag("finalJetsConstituentsTable")
578  elif not addAK4:
579  candList = cms.VInputTag(cms.InputTag("finalJetsAK8Constituents", "constituents"))
580  process.customizedPFCandsTask.add(process.finalJetsAK8Constituents)
581  process.finalJetsConstituentsTable = cms.EDProducer("PackedCandidatePtrMerger", src = candList, skipNulls = cms.bool(True), warnOnSkip = cms.bool(True))
582  candInput = cms.InputTag("finalJetsConstituentsTable")
583  else:
584  candList = cms.VInputTag(cms.InputTag("finalJetsAK4Constituents", "constituents"), cms.InputTag("finalJetsAK8Constituents", "constituents"))
585  process.customizedPFCandsTask.add(process.finalJetsAK4Constituents)
586  process.customizedPFCandsTask.add(process.finalJetsAK8Constituents)
587  process.finalJetsConstituentsTable = cms.EDProducer("PackedCandidatePtrMerger", src = candList, skipNulls = cms.bool(True), warnOnSkip = cms.bool(True))
588  candInput = cms.InputTag("finalJetsConstituentsTable")
589 
590  process.customConstituentsExtTable = cms.EDProducer("SimplePATCandidateFlatTableProducer",
591  src = candInput,
592  cut = cms.string(""), #we should not filter after pruning
593  name = cms.string("PFCands"),
594  doc = cms.string("interesting particles from AK4 and AK8 jets"),
595  singleton = cms.bool(False), # the number of entries is variable
596  extension = cms.bool(False), # this is the extension table for the AK8 constituents
597  variables = cms.PSet(CandVars,
598  puppiWeight = Var("puppiWeight()", float, doc="Puppi weight",precision=10),
599  puppiWeightNoLep = Var("puppiWeightNoLep()", float, doc="Puppi weight removing leptons",precision=10),
600  vtxChi2 = Var("?hasTrackDetails()?vertexChi2():-1", float, doc="vertex chi2",precision=10),
601  trkChi2 = Var("?hasTrackDetails()?pseudoTrack().normalizedChi2():-1", float, doc="normalized trk chi2", precision=10),
602  dz = Var("?hasTrackDetails()?dz():-1", float, doc="pf dz", precision=10),
603  dzErr = Var("?hasTrackDetails()?dzError():-1", float, doc="pf dz err", precision=10),
604  d0 = Var("?hasTrackDetails()?dxy():-1", float, doc="pf d0", precision=10),
605  d0Err = Var("?hasTrackDetails()?dxyError():-1", float, doc="pf d0 err", precision=10),
606  pvAssocQuality = Var("pvAssociationQuality()", int, doc="primary vertex association quality. 0: NotReconstructedPrimary, 1: OtherDeltaZ, 4: CompatibilityBTag, 5: CompatibilityDz, 6: UsedInFitLoose, 7: UsedInFitTight"),
607  lostInnerHits = Var("lostInnerHits()", int, doc="lost inner hits. -1: validHitInFirstPixelBarrelLayer, 0: noLostInnerHits, 1: oneLostInnerHit, 2: moreLostInnerHits"),
608  lostOuterHits = Var("?hasTrackDetails()?pseudoTrack().hitPattern().numberOfLostHits('MISSING_OUTER_HITS'):0", int, doc="lost outer hits"),
609  numberOfHits = Var("numberOfHits()", int, doc="number of hits"),
610  numberOfPixelHits = Var("numberOfPixelHits()", int, doc="number of pixel hits"),
611  trkQuality = Var("?hasTrackDetails()?pseudoTrack().qualityMask():0", int, doc="track quality mask"),
612  trkHighPurity = Var("?hasTrackDetails()?pseudoTrack().quality('highPurity'):0", bool, doc="track is high purity"),
613  trkAlgo = Var("?hasTrackDetails()?pseudoTrack().algo():-1", int, doc="track algorithm"),
614  trkP = Var("?hasTrackDetails()?pseudoTrack().p():-1", float, doc="track momemtum", precision=-1),
615  trkPt = Var("?hasTrackDetails()?pseudoTrack().pt():-1", float, doc="track pt", precision=-1),
616  trkEta = Var("?hasTrackDetails()?pseudoTrack().eta():-1", float, doc="track pt", precision=12),
617  trkPhi = Var("?hasTrackDetails()?pseudoTrack().phi():-1", float, doc="track phi", precision=12),
618  )
619  )
620  process.customAK8ConstituentsTable = cms.EDProducer("PatJetConstituentTableProducer",
621  candidates = candInput,
622  jets = cms.InputTag("finalJetsAK8"),
623  jet_radius = cms.double(0.8),
624  name = cms.string("FatJetPFCands"),
625  idx_name = cms.string("pFCandsIdx"),
626  nameSV = cms.string("FatJetSVs"),
627  idx_nameSV = cms.string("sVIdx"),
628  )
629  process.customAK4ConstituentsTable = cms.EDProducer("PatJetConstituentTableProducer",
630  candidates = candInput,
631  jets = cms.InputTag("finalJetsPuppi"), # was finalJets before
632  jet_radius = cms.double(0.4),
633  name = cms.string("JetPFCands"),
634  idx_name = cms.string("pFCandsIdx"),
635  nameSV = cms.string("JetSVs"),
636  idx_nameSV = cms.string("sVIdx"),
637  )
638  process.customizedPFCandsTask.add(process.customConstituentsExtTable)
639 
640  if not allPF:
641  process.customizedPFCandsTask.add(process.finalJetsConstituentsTable)
642  # linkedObjects are WIP for Run3
643  if addAK8:
644  process.customizedPFCandsTask.add(process.customAK8ConstituentsTable)
645  if addAK4:
646  process.customizedPFCandsTask.add(process.customAK4ConstituentsTable)
647 
648 
649  return process
650 
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17
def addPFCands(process, allPF=False, addAK4=False, addAK8=False)

◆ BTVCustomNanoAOD()

def custom_btv_cff.BTVCustomNanoAOD (   process)

Definition at line 662 of file custom_btv_cff.py.

References add_BTV(), and addPFCands().

662 def BTVCustomNanoAOD(process):
663  addPFCands(process,btvNano_switch.btvNano_addallPF_switch,btvNano_switch.btvNano_addAK4_switch,btvNano_switch.btvNano_addAK8_switch)
664  add_BTV(process, btvNano_switch.btvNano_addAK4_switch,btvNano_switch.btvNano_addAK8_switch,btvNano_switch.TaggerInput)
665  process.load("PhysicsTools.NanoAOD.btvMC_cff")
666 
667  if btvNano_switch.btvNano_addallPF_switch:
668  process.nanoSequenceMC+=allPFPFCandsMCSequence
669  else:
670  if btvNano_switch.btvNano_addAK4_switch and btvNano_switch.btvNano_addAK8_switch :
671  process.nanoSequenceMC+=ak4ak8PFCandsMCSequence
672  elif btvNano_switch.btvNano_addAK4_switch and not btvNano_switch.btvNano_addAK8_switch :
673  process.nanoSequenceMC+=ak4onlyPFCandsMCSequence
674  elif not btvNano_switch.btvNano_addAK4_switch and btvNano_switch.btvNano_addAK8_switch:
675  process.nanoSequenceMC+=ak8onlyPFCandsMCSequence
676 
677  return process
678 
def BTVCustomNanoAOD(process)
def add_BTV(process, addAK4=False, addAK8=False, scheme="btvSF")
def addPFCands(process, allPF=False, addAK4=False, addAK8=False)

◆ get_DDX_vars()

def custom_btv_cff.get_DDX_vars ( )

Definition at line 129 of file custom_btv_cff.py.

References common_cff.Var().

Referenced by add_BTV().

129 def get_DDX_vars():
130  # retreive 27 jet-level features used in double-b and deep double-x taggers
131  # defined in arXiv:1712.07158
132  DDXVars = cms.PSet(
133  DDX_jetNTracks = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.jetNTracks", int, doc="number of tracks associated with the jet"),
134  DDX_jetNSecondaryVertices = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.jetNSecondaryVertices", int, doc="number of SVs associated with the jet"),
135  DDX_tau1_trackEtaRel_0 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau1_trackEtaRel_0", float, doc="1st smallest track pseudorapidity, relative to the jet axis, associated to the 1st N-subjettiness axis", precision=10),
136  DDX_tau1_trackEtaRel_1 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau1_trackEtaRel_1", float, doc="2nd smallest track pseudorapidity, relative to the jet axis, associated to the 1st N-subjettiness axis", precision=10),
137  DDX_tau1_trackEtaRel_2 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau1_trackEtaRel_2", float, doc="3rd smallest track pseudorapidity, relative to the jet axis, associated to the 1st N-subjettiness axis", precision=10),
138  DDX_tau2_trackEtaRel_0 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau2_trackEtaRel_0", float, doc="1st smallest track pseudorapidity, relative to the jet axis, associated to the 2nd N-subjettiness axis", precision=10),
139  DDX_tau2_trackEtaRel_1 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau2_trackEtaRel_1", float, doc="2nd smallest track pseudorapidity, relative to the jet axis, associated to the 2nd N-subjettiness axis", precision=10),
140  DDX_tau2_trackEtaRel_3 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau2_trackEtaRel_2", float, doc="3rd smallest track pseudorapidity, relative to the jet axis, associated to the 2nd N-subjettiness axis", precision=10),
141  DDX_tau1_flightDistance2dSig = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau1_flightDistance2dSig", float, doc="transverse distance significance between primary and secondary vertex associated to the 1st N-subjettiness axis", precision=10),
142  DDX_tau2_flightDistance2dSig = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau2_flightDistance2dSig", float, doc="transverse distance significance between primary and secondary vertex associated to the 2nd N-subjettiness axis", precision=10),
143  DDX_tau1_vertexDeltaR = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau1_vertexDeltaR", float, doc="deltaR between the 1st N-subjettiness axis and secondary vertex direction", precision=10),
144  DDX_tau1_vertexEnergyRatio = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau1_vertexEnergyRatio", float, doc="ratio of energy at secondary vertex over total energy associated to the 1st N-subjettiness axis", precision=10),
145  DDX_tau2_vertexEnergyRatio = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau2_vertexEnergyRatio", float, doc="ratio of energy at secondary vertex over total energy associated to the 2nd N-subjettiness axis", precision=10),
146  DDX_tau1_vertexMass = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau1_vertexMass", float, doc="mass of track sum at secondary vertex associated to the 1st N-subjettiness axis", precision=10),
147  DDX_tau2_vertexMass = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau2_vertexMass", float, doc="mass of track sum at secondary vertex associated to the 2nd N-subjettiness axis", precision=10),
148  DDX_trackSip2dSigAboveBottom_0 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.trackSip2dSigAboveBottom_0", float, doc="track 2D signed impact parameter significance of 1st track lifting mass above bottom", precision=10),
149  DDX_trackSip2dSigAboveBottom_1 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.trackSip2dSigAboveBottom_1", float, doc="track 2D signed impact parameter significance of 2nd track lifting mass above bottom", precision=10),
150  DDX_trackSip2dSigAboveCharm = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.trackSip2dSigAboveCharm", float, doc="track 2D signed impact parameter significance of 1st track lifting mass above charm", precision=10),
151  DDX_trackSip3dSig_0 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.trackSip3dSig_0", float, doc="1st largest track 3D signed impact parameter significance", precision=10),
152  DDX_tau1_trackSip3dSig_0 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau1_trackSip3dSig_0", float, doc="1st largest track 3D signed impact parameter significance associated to the 1st N-subjettiness axis", precision=10),
153  DDX_tau1_trackSip3dSig_1 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau1_trackSip3dSig_1", float, doc="2nd largest track 3D signed impact parameter significance associated to the 1st N-subjettiness axis", precision=10),
154  DDX_trackSip3dSig_1 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.trackSip3dSig_1", float, doc="2nd largest track 3D signed impact parameter significance", precision=10),
155  DDX_tau2_trackSip3dSig_0 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau2_trackSip3dSig_0", float, doc="1st largest track 3D signed impact parameter significance associated to the 2nd N-subjettiness axis", precision=10),
156  DDX_tau2_trackSip3dSig_1 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.tau2_trackSip3dSig_1", float, doc="2nd largest track 3D signed impact parameter significance associated to the 2nd N-subjettiness axis", precision=10),
157  DDX_trackSip3dSig_2 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.trackSip3dSig_2", float, doc="3rd largest track 3D signed impact parameter significance", precision=10),
158  DDX_trackSip3dSig_3 = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.trackSip3dSig_3", float, doc="4th largest track 3D signed impact parameter significance", precision=10),
159  DDX_z_ratio = Var("tagInfo(\'pfDeepDoubleX\').features().tag_info_features.z_ratio", float, doc="z = deltaR(SV0,SV1)*pT(SV1)/m(SV0,SV1), defined in Eq. 7 of arXiv:1712.07158", precision=10)
160  )
161  return DDXVars
162 
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17

◆ get_DeepCSV_vars()

def custom_btv_cff.get_DeepCSV_vars ( )

Definition at line 163 of file custom_btv_cff.py.

References common_cff.Var().

Referenced by add_BTV().

163 def get_DeepCSV_vars():
164  DeepCSVVars = cms.PSet(
165  # Tagger inputs also include jet pt and eta
166  # Track based (keep only jet-based features for DeepCSV from Run 3 commissioning)
167  # DeepCSV_trackPtRel_0 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRel\')[0]:-999", float, doc="track transverse momentum, relative to the jet axis", precision=10),
168  # DeepCSV_trackPtRel_1 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRel\')[1]:-999", float, doc="track transverse momentum, relative to the jet axis", precision=10),
169  # DeepCSV_trackPtRel_2 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRel\')[2]:-999", float, doc="track transverse momentum, relative to the jet axis", precision=10),
170  # DeepCSV_trackPtRel_3 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRel\')[3]:-999", float, doc="track transverse momentum, relative to the jet axis", precision=10),
171  # DeepCSV_trackPtRel_4 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRel\')[4]:-999", float, doc="track transverse momentum, relative to the jet axis", precision=10),
172  # DeepCSV_trackPtRel_5 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRel\')[5]:-999", float, doc="track transverse momentum, relative to the jet axis", precision=10),
173  # DeepCSV_trackJetDistVal_0 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackJetDistVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackJetDistVal\')[0]:-999", float, doc="minimum track approach distance to jet axis", precision=10),
174  # DeepCSV_trackJetDistVal_1 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackJetDistVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackJetDistVal\')[1]:-999", float, doc="minimum track approach distance to jet axis", precision=10),
175  # DeepCSV_trackJetDistVal_2 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackJetDistVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackJetDistVal\')[2]:-999", float, doc="minimum track approach distance to jet axis", precision=10),
176  # DeepCSV_trackJetDistVal_3 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackJetDistVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackJetDistVal\')[3]:-999", float, doc="minimum track approach distance to jet axis", precision=10),
177  # DeepCSV_trackJetDistVal_4 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackJetDistVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackJetDistVal\')[4]:-999", float, doc="minimum track approach distance to jet axis", precision=10),
178  # DeepCSV_trackJetDistVal_5 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackJetDistVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackJetDistVal\')[5]:-999", float, doc="minimum track approach distance to jet axis", precision=10),
179  # DeepCSV_trackDeltaR_0 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDeltaR\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDeltaR\')[0]:-999", float, doc="track pseudoangular distance from the jet axis", precision=10),
180  # DeepCSV_trackDeltaR_1 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDeltaR\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDeltaR\')[1]:-999", float, doc="track pseudoangular distance from the jet axis", precision=10),
181  # DeepCSV_trackDeltaR_2 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDeltaR\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDeltaR\')[2]:-999", float, doc="track pseudoangular distance from the jet axis", precision=10),
182  # DeepCSV_trackDeltaR_3 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDeltaR\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDeltaR\')[3]:-999", float, doc="track pseudoangular distance from the jet axis", precision=10),
183  # DeepCSV_trackDeltaR_4 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDeltaR\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDeltaR\')[4]:-999", float, doc="track pseudoangular distance from the jet axis", precision=10),
184  # DeepCSV_trackDeltaR_5 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDeltaR\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDeltaR\')[5]:-999", float, doc="track pseudoangular distance from the jet axis", precision=10),
185  # DeepCSV_trackPtRatio_0 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRatio\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRatio\')[0]:-999", float, doc="track transverse momentum, relative to the jet axis, normalized to its energy", precision=10),
186  # DeepCSV_trackPtRatio_1 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRatio\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRatio\')[1]:-999", float, doc="track transverse momentum, relative to the jet axis, normalized to its energy", precision=10),
187  # DeepCSV_trackPtRatio_2 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRatio\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRatio\')[2]:-999", float, doc="track transverse momentum, relative to the jet axis, normalized to its energy", precision=10),
188  # DeepCSV_trackPtRatio_3 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRatio\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRatio\')[3]:-999", float, doc="track transverse momentum, relative to the jet axis, normalized to its energy", precision=10),
189  # DeepCSV_trackPtRatio_4 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRatio\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRatio\')[4]:-999", float, doc="track transverse momentum, relative to the jet axis, normalized to its energy", precision=10),
190  # DeepCSV_trackPtRatio_5 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackPtRatio\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackPtRatio\')[5]:-999", float, doc="track transverse momentum, relative to the jet axis, normalized to its energy", precision=10),
191  # DeepCSV_trackSip3dSig_0 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip3dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip3dSig\')[0]:-999", float, doc="track 3D signed impact parameter significance", precision=10),
192  # DeepCSV_trackSip3dSig_1 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip3dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip3dSig\')[1]:-999", float, doc="track 3D signed impact parameter significance", precision=10),
193  # DeepCSV_trackSip3dSig_2 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip3dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip3dSig\')[2]:-999", float, doc="track 3D signed impact parameter significance", precision=10),
194  # DeepCSV_trackSip3dSig_3 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip3dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip3dSig\')[3]:-999", float, doc="track 3D signed impact parameter significance", precision=10),
195  # DeepCSV_trackSip3dSig_4 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip3dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip3dSig\')[4]:-999", float, doc="track 3D signed impact parameter significance", precision=10),
196  # DeepCSV_trackSip3dSig_5 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip3dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip3dSig\')[5]:-999", float, doc="track 3D signed impact parameter significance", precision=10),
197  # DeepCSV_trackSip2dSig_0 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip2dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip2dSig\')[0]:-999", float, doc="track 2D signed impact parameter significance", precision=10),
198  # DeepCSV_trackSip2dSig_1 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip2dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip2dSig\')[1]:-999", float, doc="track 2D signed impact parameter significance", precision=10),
199  # DeepCSV_trackSip2dSig_2 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip2dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip2dSig\')[2]:-999", float, doc="track 2D signed impact parameter significance", precision=10),
200  # DeepCSV_trackSip2dSig_3 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip2dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip2dSig\')[3]:-999", float, doc="track 2D signed impact parameter significance", precision=10),
201  # DeepCSV_trackSip2dSig_4 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip2dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip2dSig\')[4]:-999", float, doc="track 2D signed impact parameter significance", precision=10),
202  # DeepCSV_trackSip2dSig_5 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackSip2dSig\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackSip2dSig\')[5]:-999", float, doc="track 2D signed impact parameter significance", precision=10),
203  # DeepCSV_trackDecayLenVal_0 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDecayLenVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDecayLenVal\')[0]:-999", float, doc="track decay length", precision=10),
204  # DeepCSV_trackDecayLenVal_1 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDecayLenVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDecayLenVal\')[1]:-999", float, doc="track decay length", precision=10),
205  # DeepCSV_trackDecayLenVal_2 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDecayLenVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDecayLenVal\')[2]:-999", float, doc="track decay length", precision=10),
206  # DeepCSV_trackDecayLenVal_3 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDecayLenVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDecayLenVal\')[3]:-999", float, doc="track decay length", precision=10),
207  # DeepCSV_trackDecayLenVal_4 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDecayLenVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDecayLenVal\')[4]:-999", float, doc="track decay length", precision=10),
208  # DeepCSV_trackDecayLenVal_5 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackDecayLenVal\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackDecayLenVal\')[5]:-999", float, doc="track decay length", precision=10),
209  # DeepCSV_trackEtaRel_0 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackEtaRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackEtaRel\')[0]:-999", float, doc="track pseudorapidity, relative to the jet axis", precision=10),
210  # DeepCSV_trackEtaRel_1 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackEtaRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackEtaRel\')[1]:-999", float, doc="track pseudorapidity, relative to the jet axis", precision=10),
211  # DeepCSV_trackEtaRel_2 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackEtaRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackEtaRel\')[2]:-999", float, doc="track pseudorapidity, relative to the jet axis", precision=10),
212  # DeepCSV_trackEtaRel_3 = Var("?tagInfo(\'pfDeepCSV\').taggingVariables.checkTag(\'trackEtaRel\')?tagInfo(\'pfDeepCSV\').taggingVariables.getList(\'trackEtaRel\')[3]:-999", float, doc="track pseudorapidity, relative to the jet axis", precision=10),
213  # Jet based
214  DeepCSV_trackJetPt = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'trackJetPt\', -999)", float, doc="track-based jet transverse momentum", precision=10),
215  DeepCSV_vertexCategory = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'vertexCategory\', -999)", float, doc="category of secondary vertex (Reco, Pseudo, No)", precision=10),
216  DeepCSV_jetNSecondaryVertices = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'jetNSecondaryVertices\', -999)", int, doc="number of reconstructed possible secondary vertices in jet"),
217  DeepCSV_jetNSelectedTracks = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'jetNSelectedTracks\', -999)", int, doc="selected tracks in the jet"),
218  DeepCSV_jetNTracksEtaRel = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'jetNTracksEtaRel\', -999)", int, doc="number of tracks for which etaRel is computed"),
219  DeepCSV_trackSumJetEtRatio = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'trackSumJetEtRatio\', -999)", float, doc="ratio of track sum transverse energy over jet energy", precision=10),
220  DeepCSV_trackSumJetDeltaR = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'trackSumJetDeltaR\', -999)", float, doc="pseudoangular distance between jet axis and track fourvector sum", precision=10),
221  DeepCSV_trackSip2dValAboveCharm = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'trackSip2dValAboveCharm\', -999)", float, doc="track 2D signed impact parameter of first track lifting mass above charm", precision=10),
222  DeepCSV_trackSip2dSigAboveCharm = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'trackSip2dSigAboveCharm\', -999)", float, doc="track 2D signed impact parameter significance of first track lifting mass above charm", precision=10),
223  DeepCSV_trackSip3dValAboveCharm = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'trackSip3dValAboveCharm\', -999)", float, doc="track 3D signed impact parameter of first track lifting mass above charm", precision=10),
224  DeepCSV_trackSip3dSigAboveCharm = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'trackSip3dSigAboveCharm\', -999)", float, doc="track 3D signed impact parameter significance of first track lifting mass above charm", precision=10),
225  DeepCSV_vertexMass = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'vertexMass\', -999)", float, doc="mass of track sum at secondary vertex", precision=10),
226  DeepCSV_vertexNTracks = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'vertexNTracks\', -999)", int, doc="number of tracks at secondary vertex"),
227  DeepCSV_vertexEnergyRatio = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'vertexEnergyRatio\', -999)", float, doc="ratio of energy at secondary vertex over total energy", precision=10),
228  DeepCSV_vertexJetDeltaR = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'vertexJetDeltaR\', -999)", float, doc="pseudoangular distance between jet axis and secondary vertex direction", precision=10),
229  DeepCSV_flightDistance2dVal = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'flightDistance2dVal\', -999)", float, doc="transverse distance between primary and secondary vertex", precision=10),
230  DeepCSV_flightDistance2dSig = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'flightDistance2dSig\', -999)", float, doc="transverse distance significance between primary and secondary vertex", precision=10),
231  DeepCSV_flightDistance3dVal = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'flightDistance3dVal\', -999)", float, doc="distance between primary and secondary vertex", precision=10),
232  DeepCSV_flightDistance3dSig = Var("tagInfo(\'pfDeepCSV\').taggingVariables.get(\'flightDistance3dSig\', -999)", float, doc="distance significance between primary and secondary vertex", precision=10),
233  )
234  return DeepCSVVars
235 
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17

◆ get_DeepJet_outputs()

def custom_btv_cff.get_DeepJet_outputs ( )

Store all output nodes, negative tagger for SF.

Definition at line 237 of file custom_btv_cff.py.

References common_cff.Var().

Referenced by add_BTV().

237 def get_DeepJet_outputs():
238  DeepJetOutputVars = cms.PSet(
239  btagDeepFlavB_b=Var("bDiscriminator('pfDeepFlavourJetTags:probb')",
240  float,
241  doc="DeepJet b tag probability",
242  precision=10),
243  btagDeepFlavB_bb=Var("bDiscriminator('pfDeepFlavourJetTags:probbb')",
244  float,
245  doc="DeepJet bb tag probability",
246  precision=10),
247  btagDeepFlavB_lepb=Var("bDiscriminator('pfDeepFlavourJetTags:problepb')",
248  float,
249  doc="DeepJet lepb tag probability",
250  precision=10),
251  btagDeepFlavC=Var("bDiscriminator('pfDeepFlavourJetTags:probc')",
252  float,
253  doc="DeepJet c tag probability",
254  precision=10),
255  btagDeepFlavUDS=Var("bDiscriminator('pfDeepFlavourJetTags:probuds')",
256  float,
257  doc="DeepJet uds tag probability",
258  precision=10),
259  btagDeepFlavG=Var("bDiscriminator('pfDeepFlavourJetTags:probg')",
260  float,
261  doc="DeepJet gluon tag probability",
262  precision=10),
263  # discriminators are already part of jets_cff.py from NanoAOD and therefore not added here
264 
265  # negative taggers
266  btagNegDeepFlavB = Var("bDiscriminator('pfNegativeDeepFlavourJetTags:probb')+bDiscriminator('pfNegativeDeepFlavourJetTags:probbb')+bDiscriminator('pfNegativeDeepFlavourJetTags:problepb')",
267  float,
268  doc="Negative DeepJet b+bb+lepb tag discriminator",
269  precision=10),
270  btagNegDeepFlavCvL = Var("?(bDiscriminator('pfNegativeDeepFlavourJetTags:probc')+bDiscriminator('pfNegativeDeepFlavourJetTags:probuds')+bDiscriminator('pfNegativeDeepFlavourJetTags:probg'))>0?bDiscriminator('pfNegativeDeepFlavourJetTags:probc')/(bDiscriminator('pfNegativeDeepFlavourJetTags:probc')+bDiscriminator('pfNegativeDeepFlavourJetTags:probuds')+bDiscriminator('pfNegativeDeepFlavourJetTags:probg')):-1",
271  float,
272  doc="Negative DeepJet c vs uds+g discriminator",
273  precision=10),
274  btagNegDeepFlavCvB = Var("?(bDiscriminator('pfNegativeDeepFlavourJetTags:probc')+bDiscriminator('pfNegativeDeepFlavourJetTags:probb')+bDiscriminator('pfNegativeDeepFlavourJetTags:probbb')+bDiscriminator('pfNegativeDeepFlavourJetTags:problepb'))>0?bDiscriminator('pfNegativeDeepFlavourJetTags:probc')/(bDiscriminator('pfNegativeDeepFlavourJetTags:probc')+bDiscriminator('pfNegativeDeepFlavourJetTags:probb')+bDiscriminator('pfNegativeDeepFlavourJetTags:probbb')+bDiscriminator('pfNegativeDeepFlavourJetTags:problepb')):-1",
275  float,
276  doc="Negative DeepJet c vs b+bb+lepb discriminator",
277  precision=10),
278  btagNegDeepFlavQG = Var("?(bDiscriminator('pfNegativeDeepFlavourJetTags:probg')+bDiscriminator('pfNegativeDeepFlavourJetTags:probuds'))>0?bDiscriminator('pfNegativeDeepFlavourJetTags:probg')/(bDiscriminator('pfNegativeDeepFlavourJetTags:probg')+bDiscriminator('pfNegativeDeepFlavourJetTags:probuds')):-1",
279  float,
280  doc="Negative DeepJet g vs uds discriminator",
281  precision=10),
282  btagNegDeepFlavB_b = Var("bDiscriminator('pfNegativeDeepFlavourJetTags:probb')",
283  float,
284  doc="Negative DeepJet b tag probability",
285  precision=10),
286  btagNegDeepFlavB_bb = Var("bDiscriminator('pfNegativeDeepFlavourJetTags:probbb')",
287  float,
288  doc="Negative DeepJet bb tag probability",
289  precision=10),
290  btagNegDeepFlavB_lepb = Var("bDiscriminator('pfNegativeDeepFlavourJetTags:problepb')",
291  float,
292  doc="Negative DeepJet lepb tag probability",
293  precision=10),
294  btagNegDeepFlavC = Var("bDiscriminator('pfNegativeDeepFlavourJetTags:probc')",
295  float,
296  doc="Negative DeepJet c tag probability",
297  precision=10),
298  btagNegDeepFlavUDS = Var("bDiscriminator('pfNegativeDeepFlavourJetTags:probuds')",
299  float,
300  doc="Negative DeepJet uds tag probability",
301  precision=10),
302  btagNegDeepFlavG = Var("bDiscriminator('pfNegativeDeepFlavourJetTags:probg')",
303  float,
304  doc="Negative DeepJet gluon tag probability",
305  precision=10),
306  )
307  return DeepJetOutputVars
308 
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17
def get_DeepJet_outputs()
Store all output nodes, negative tagger for SF.

◆ get_ParticleNetAK4_outputs()

def custom_btv_cff.get_ParticleNetAK4_outputs ( )

Definition at line 309 of file custom_btv_cff.py.

References common_cff.Var().

Referenced by add_BTV().

310 
311  ParticleNetAK4OutputVars = cms.PSet(
312  # raw scores
313  btagPNetProbB = Var("?bDiscriminator('pfParticleNetFromMiniAODAK4PuppiCentralJetTags:probb')>0?bDiscriminator('pfParticleNetFromMiniAODAK4PuppiCentralJetTags:probb'):-1",
314  float,
315  doc="ParticleNet b tag probability",
316  precision=10),
317  btagPNetProbC = Var("?bDiscriminator('pfParticleNetFromMiniAODAK4PuppiCentralJetTags:probc')>0?bDiscriminator('pfParticleNetFromMiniAODAK4PuppiCentralJetTags:probc'):-1",
318  float,
319  doc="ParticleNet c tag probability",
320  precision=10),
321  btagPNetProbUDS = Var("?bDiscriminator('pfParticleNetFromMiniAODAK4PuppiCentralJetTags:probuds')>0?bDiscriminator('pfParticleNetFromMiniAODAK4PuppiCentralJetTags:probuds'):-1",
322  float,
323  doc="ParticleNet uds tag probability",
324  precision=10),
325  btagPNetProbG = Var("?bDiscriminator('pfParticleNetFromMiniAODAK4PuppiCentralJetTags:probg')>0?bDiscriminator('pfParticleNetFromMiniAODAK4PuppiCentralJetTags:probg'):-1",
326  float,
327  doc="ParticleNet gluon tag probability",
328  precision=10),
329 
330  # negative taggers
331  btagNegPNetB = Var("?(bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probb')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probuds')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probg'))>0?(bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probb'))/(bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probb')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probuds')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probg')):-1",
332  float,
333  doc="Negative ParticleNet b vs. udscg",
334  precision=10),
335  btagNegPNetCvL = Var("?(bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probuds')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probg'))>0?(bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc'))/(bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probuds')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probg')):-1",
336  float,
337  doc="Negative ParticleNet c vs. udsg",
338  precision=10),
339  btagNegPNetCvB = Var("?(bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probb'))>0?(bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc'))/(bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc')+bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probb')):-1",
340  float,
341  doc="Negative ParticleNet c vs. b",
342  precision=10),
343  btagNegPNetProbB = Var("?bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probb')>0?bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probb'):-1",
344  float,
345  doc="Negative ParticleNet b tag probability",
346  precision=10),
347  btagNegPNetProbC = Var("?bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc')>0?bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probc'):-1",
348  float,
349  doc="Negative ParticleNet c tag probability",
350  precision=10),
351  btagNegPNetProbUDS = Var("?bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probuds')>0?bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probuds'):-1",
352  float,
353  doc="Negative ParticleNet uds tag probability",
354  precision=10),
355  btagNegPNetProbG = Var("?bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probg')>0?bDiscriminator('pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTags:probg'):-1",
356  float,
357  doc="Negative ParticleNet gluon tag probability",
358  precision=10),
359  )
360 
361  return ParticleNetAK4OutputVars
362 
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17
def get_ParticleNetAK4_outputs()

◆ get_ParticleTransformerAK4_outputs()

def custom_btv_cff.get_ParticleTransformerAK4_outputs ( )

Definition at line 363 of file custom_btv_cff.py.

References common_cff.Var().

364  ParticleTransformerAK4OutputVars = cms.PSet(
365  btagRobustParTAK4B_b=Var("bDiscriminator('pfParticleTransformerAK4JetTags:probb')",
366  float,
367  doc="RobustParTAK4 b tag probability",
368  precision=10),
369  btagRobustParTAK4B_bb=Var("bDiscriminator('pfParticleTransformerAK4JetTags:probbb')",
370  float,
371  doc="RobustParTAK4 bb tag probability",
372  precision=10),
373  btagRobustParTAK4B_lepb=Var("bDiscriminator('pfParticleTransformerAK4JetTags:problepb')",
374  float,
375  doc="RobustParTAK4 lepb tag probability",
376  precision=10),
377  btagRobustParTAK4C=Var("bDiscriminator('pfParticleTransformerAK4JetTags:probc')",
378  float,
379  doc="RobustParTAK4 c tag probability",
380  precision=10),
381  btagRobustParTAK4UDS=Var("bDiscriminator('pfParticleTransformerAK4JetTags:probuds')",
382  float,
383  doc="RobustParTAK4 uds tag probability",
384  precision=10),
385  btagRobustParTAK4G=Var("bDiscriminator('pfParticleTransformerAK4JetTags:probg')",
386  float,
387  doc="RobustParTAK4 gluon tag probability",
388  precision=10),
389 
390  # negative taggers
391  btagNegRobustParTAK4B = Var("bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probb')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probbb')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:problepb')",
392  float,
393  doc="Negative RobustParTAK4 b+bb+lepb tag discriminator",
394  precision=10),
395  btagNegRobustParTAK4CvL = Var("?(bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probc')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probuds')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probg'))>0?bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probc')/(bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probc')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probuds')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probg')):-1",
396  float,
397  doc="Negative RobustParTAK4 c vs uds+g discriminator",
398  precision=10),
399  btagNegRobustParTAK4CvB = Var("?(bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probc')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probb')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probbb')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:problepb'))>0?bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probc')/(bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probc')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probb')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probbb')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:problepb')):-1",
400  float,
401  doc="Negative RobustParTAK4 c vs b+bb+lepb discriminator",
402  precision=10),
403  btagNegRobustParTAK4QG = Var("?(bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probg')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probuds'))>0?bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probg')/(bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probg')+bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probuds')):-1",
404  float,
405  doc="Negative RobustParTAK4 g vs uds discriminator",
406  precision=10),
407  btagNegRobustParTAK4B_b = Var("bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probb')",
408  float,
409  doc="Negative RobustParTAK4 b tag probability",
410  precision=10),
411  btagNegRobustParTAK4B_bb = Var("bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probbb')",
412  float,
413  doc="Negative RobustParTAK4 bb tag probability",
414  precision=10),
415  btagNegRobustParTAK4B_lepb = Var("bDiscriminator('pfNegativeParticleTransformerAK4JetTags:problepb')",
416  float,
417  doc="Negative RobustParTAK4 lepb tag probability",
418  precision=10),
419  btagNegRobustParTAK4C = Var("bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probc')",
420  float,
421  doc="Negative RobustParTAK4 c tag probability",
422  precision=10),
423  btagNegRobustParTAK4UDS = Var("bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probuds')",
424  float,
425  doc="Negative RobustParTAK4 uds tag probability",
426  precision=10),
427  btagNegRobustParTAK4G = Var("bDiscriminator('pfNegativeParticleTransformerAK4JetTags:probg')",
428  float,
429  doc="Negative RobustParTAK4 gluon tag probability",
430  precision=10),
431  )
432 
433  return ParticleTransformerAK4OutputVars
434 
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17
def get_ParticleTransformerAK4_outputs()

◆ update_jets_AK4()

def custom_btv_cff.update_jets_AK4 (   process)

Move PFNano (https://github.com/cms-jet/PFNano/) to NanoAOD.

From: https://github.com/cms-jet/PFNano/blob/13_0_7_from124MiniAOD/python/addBTV.py

Definition at line 13 of file custom_btv_cff.py.

Referenced by add_BTV().

13 def update_jets_AK4(process):
14  # Based on ``nanoAOD_addDeepInfo``
15  # in https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/python/nano_cff.py
16  # DeepJet flav_names as found in
17  # https://github.com/cms-sw/cmssw/blob/master/RecoBTag/ONNXRuntime/plugins/DeepFlavourONNXJetTagsProducer.cc#L86
18  # and https://twiki.cern.ch/twiki/bin/view/CMS/DeepJet
19  from RecoBTag.ONNXRuntime.pfParticleTransformerAK4_cff import _pfParticleTransformerAK4JetTagsAll as pfParticleTransformerAK4JetTagsAll
20  from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4_cff import _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll as pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll
21  from RecoBTag.ONNXRuntime.pfParticleTransformerAK4_cff import _pfNegativeParticleTransformerAK4JetTagsProbs as pfNegativeParticleTransformerAK4JetTagsProbs
22  from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4_cff import _pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTagsProbs as pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTagsProbs
23 
24  _btagDiscriminators = [
25  'pfJetProbabilityBJetTags',
26  'pfJetBProbabilityBJetTags',
27  'pfNegativeOnlyJetProbabilityBJetTags',
28  'pfNegativeOnlyJetBProbabilityBJetTags',
29  'pfDeepFlavourJetTags:probb',
30  'pfDeepFlavourJetTags:probbb',
31  'pfDeepFlavourJetTags:problepb',
32  'pfDeepFlavourJetTags:probc',
33  'pfDeepFlavourJetTags:probuds',
34  'pfDeepFlavourJetTags:probg',
35  'pfNegativeDeepFlavourJetTags:probb',
36  'pfNegativeDeepFlavourJetTags:probbb',
37  'pfNegativeDeepFlavourJetTags:problepb',
38  'pfNegativeDeepFlavourJetTags:probc',
39  'pfNegativeDeepFlavourJetTags:probuds',
40  'pfNegativeDeepFlavourJetTags:probg',
41  ] + pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll + pfNegativeParticleNetFromMiniAODAK4PuppiCentralJetTagsProbs
42  # \ #+ pfParticleTransformerAK4JetTagsAll + pfNegativeParticleTransformerAK4JetTagsProbs \
43  updateJetCollection(
44  process,
45  jetSource=cms.InputTag('slimmedJetsPuppi'),
46  jetCorrections=('AK4PFPuppi',
47  cms.vstring(
48  ['L1FastJet', 'L2Relative', 'L3Absolute',
49  'L2L3Residual']), 'None'),
50  btagDiscriminators=_btagDiscriminators,
51  postfix='PuppiWithDeepInfo',
52  )
53  process.load("Configuration.StandardSequences.MagneticField_cff")
54  process.jetPuppiCorrFactorsNano.src = "selectedUpdatedPatJetsPuppiWithDeepInfo"
55  process.updatedJetsPuppi.jetSource = "selectedUpdatedPatJetsPuppiWithDeepInfo"
56 
57 
58  process.updatedPatJetsTransientCorrectedPuppiWithDeepInfo.tagInfoSources.append(cms.InputTag("pfDeepFlavourTagInfosPuppiWithDeepInfo"))
59  process.updatedPatJetsTransientCorrectedPuppiWithDeepInfo.addTagInfos = cms.bool(True)
60 
61 
62 
63  return process
64 
def update_jets_AK4(process)
Move PFNano (https://github.com/cms-jet/PFNano/) to NanoAOD.

◆ update_jets_AK8()

def custom_btv_cff.update_jets_AK8 (   process)

Definition at line 65 of file custom_btv_cff.py.

Referenced by add_BTV().

65 def update_jets_AK8(process):
66  # Based on ``nanoAOD_addDeepInfoAK8``
67  # in https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/python/nano_cff.py
68  # Care needs to be taken to make sure no discriminators from stock Nano are excluded -> would results in unfilled vars
69  _btagDiscriminators = [
70  'pfMassIndependentDeepDoubleBvLV2JetTags:probHbb',
71  'pfMassIndependentDeepDoubleCvLV2JetTags:probHcc',
72  'pfMassIndependentDeepDoubleCvBV2JetTags:probHcc',
73  ]
74  from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetJetTagsAll as pfParticleNetJetTagsAll
75  _btagDiscriminators += pfParticleNetJetTagsAll
76  updateJetCollection(
77  process,
78  jetSource=cms.InputTag('slimmedJetsAK8'),
79  pvSource=cms.InputTag('offlineSlimmedPrimaryVertices'),
80  svSource=cms.InputTag('slimmedSecondaryVertices'),
81  rParam=0.8,
82  jetCorrections=('AK8PFPuppi',
83  cms.vstring([
84  'L1FastJet', 'L2Relative', 'L3Absolute',
85  'L2L3Residual'
86  ]), 'None'),
87  btagDiscriminators=_btagDiscriminators,
88  postfix='AK8WithDeepInfo',
89  # this should work but doesn't seem to enable the tag info with addTagInfos
90  # btagInfos=['pfDeepDoubleXTagInfos'],
91  printWarning=False)
92  process.jetCorrFactorsAK8.src = "selectedUpdatedPatJetsAK8WithDeepInfo"
93  process.updatedJetsAK8.jetSource = "selectedUpdatedPatJetsAK8WithDeepInfo"
94  # add DeepDoubleX taginfos
95  process.updatedPatJetsTransientCorrectedAK8WithDeepInfo.tagInfoSources.append(cms.InputTag("pfDeepDoubleXTagInfosAK8WithDeepInfo"))
96  process.updatedPatJetsTransientCorrectedAK8WithDeepInfo.addTagInfos = cms.bool(True)
97  return process
98 
def update_jets_AK8(process)

◆ update_jets_AK8_subjet()

def custom_btv_cff.update_jets_AK8_subjet (   process)

Definition at line 99 of file custom_btv_cff.py.

Referenced by add_BTV().

99 def update_jets_AK8_subjet(process):
100  # Based on ``nanoAOD_addDeepInfoAK8``
101  # in https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/python/nano_cff.py
102  # and https://github.com/alefisico/RecoBTag-PerformanceMeasurements/blob/10_2_X_boostedCommissioning/test/runBTagAnalyzer_cfg.py
103  _btagDiscriminators = [
104  'pfJetProbabilityBJetTags',
105  'pfDeepCSVJetTags:probb',
106  'pfDeepCSVJetTags:probc',
107  'pfDeepCSVJetTags:probbb',
108  'pfDeepCSVJetTags:probudsg',
109  ]
110  updateJetCollection(
111  process,
112  labelName='SoftDropSubjetsPF',
113  jetSource=cms.InputTag("slimmedJetsAK8PFPuppiSoftDropPacked", "SubJets"),
114  jetCorrections=('AK4PFPuppi',
115  ['L2Relative', 'L3Absolute'], 'None'),
116  btagDiscriminators=list(_btagDiscriminators),
117  explicitJTA=True, # needed for subjet b tagging
118  svClustering=False, # needed for subjet b tagging (IMPORTANT: Needs to be set to False to disable ghost-association which does not work with slimmed jets)
119  fatJets=cms.InputTag('slimmedJetsAK8'), # needed for subjet b tagging
120  rParam=0.8, # needed for subjet b tagging
121  sortByPt=False, # Don't change order (would mess with subJetIdx for FatJets)
122  postfix='AK8SubjetsWithDeepInfo')
123 
124  process.subJetTable.src = 'selectedUpdatedPatJetsSoftDropSubjetsPFAK8SubjetsWithDeepInfo'
125 
126 
127  return process
128 
def update_jets_AK8_subjet(process)

Variable Documentation

◆ btvNano_addAK4_switch

custom_btv_cff.btvNano_addAK4_switch

Definition at line 656 of file custom_btv_cff.py.

◆ btvNano_addAK8_switch

custom_btv_cff.btvNano_addAK8_switch

Definition at line 657 of file custom_btv_cff.py.

◆ btvNano_addallPF_switch

custom_btv_cff.btvNano_addallPF_switch

Definition at line 658 of file custom_btv_cff.py.

◆ btvNano_switch

custom_btv_cff.btvNano_switch

Switches for BTV nano Default(store SFs PFCands+TaggerInputs) for both AK4 & AK8 jets btvNano_addAK4_switch, btvNano_addAK8_switch True, btvNano_addPF_switch False, TaggerInput = "btvSF".

Definition at line 655 of file custom_btv_cff.py.

◆ TaggerInput

custom_btv_cff.TaggerInput

Definition at line 659 of file custom_btv_cff.py.