CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
jetTools.AddJetCollection Class Reference
Inheritance diagram for jetTools.AddJetCollection:

Public Member Functions

def __call__ (self, process, labelName=None, postfix=None, btagPrefix=None, jetSource=None, pfCandidates=None, explicitJTA=None, pvSource=None, svSource=None, elSource=None, muSource=None, runIVF=None, tightBTagNTkHits=None, loadStdRecoBTag=None, svClustering=None, fatJets=None, groomedFatJets=None, algo=None, rParam=None, getJetMCFlavour=None, genJetCollection=None, genParticles=None, jetCorrections=None, btagDiscriminators=None, btagInfos=None, jetTrackAssociation=None, outputModules=None)
 
def __init__ (self)
 
def getDefaultParameters (self)
 
def toolCode (self, process)
 

Private Attributes

 _comment
 add comments More...
 
 _parameters
 initialization of the base class More...
 

Static Private Attributes

 _defaultParameters
 
 _label
 

Detailed Description

Tool to add a new jet collection to your PAT Tuple or to modify an existing one.

Definition at line 856 of file jetTools.py.

Constructor & Destructor Documentation

◆ __init__()

def jetTools.AddJetCollection.__init__ (   self)
Initialize elements of the class. Note that the tool needs to be derived from ConfigToolBase to be usable in the configEditor.

Definition at line 863 of file jetTools.py.

863  def __init__(self):
864  """
865  Initialize elements of the class. Note that the tool needs to be derived from ConfigToolBase to be usable in the configEditor.
866  """
867 
868  ConfigToolBase.__init__(self)
869 
870  self.addParameter(self._defaultParameters,'labelName', 'UNDEFINED', "Label name of the new patJet collection.", str)
871  self.addParameter(self._defaultParameters,'postfix','', "Postfix from usePF2PAT.", str)
872  self.addParameter(self._defaultParameters,'btagPrefix','', "Prefix to be added to b-tag discriminator and TagInfo names", str)
873  self.addParameter(self._defaultParameters,'jetSource','', "Label of the input collection from which the new patJet collection should be created", cms.InputTag)
874  self.addParameter(self._defaultParameters,'pfCandidates',cms.InputTag('particleFlow'), "Label of the input collection for candidatecandidatese used in b-tagging", cms.InputTag)
875  self.addParameter(self._defaultParameters,'explicitJTA', False, "Use explicit jet-track association")
876  self.addParameter(self._defaultParameters,'pvSource',cms.InputTag('offlinePrimaryVertices'), "Label of the input collection for primary vertices used in b-tagging", cms.InputTag)
877  self.addParameter(self._defaultParameters,'svSource',cms.InputTag('inclusiveCandidateSecondaryVertices'), "Label of the input collection for IVF vertices used in b-tagging", cms.InputTag)
878  self.addParameter(self._defaultParameters,'elSource',cms.InputTag('gedGsfElectrons'), "Label of the input collection for electrons used in b-tagging", cms.InputTag)
879  self.addParameter(self._defaultParameters,'muSource',cms.InputTag('muons'), "Label of the input collection for muons used in b-tagging", cms.InputTag)
880  self.addParameter(self._defaultParameters,'runIVF', False, "Re-run IVF secondary vertex reconstruction")
881  self.addParameter(self._defaultParameters,'tightBTagNTkHits', False, "Enable legacy tight b-tag track selection")
882  self.addParameter(self._defaultParameters,'loadStdRecoBTag', False, "Load the standard reconstruction b-tagging modules")
883  self.addParameter(self._defaultParameters,'svClustering', False, "Secondary vertices ghost-associated to jets using jet clustering (mostly intended for subjets)")
884  self.addParameter(self._defaultParameters,'fatJets', cms.InputTag(''), "Fat jet collection used for secondary vertex clustering", cms.InputTag)
885  self.addParameter(self._defaultParameters,'groomedFatJets', cms.InputTag(''), "Groomed fat jet collection used for secondary vertex clustering", cms.InputTag)
886  self.addParameter(self._defaultParameters,'algo', 'AK', "Jet algorithm of the input collection from which the new patJet collection should be created")
887  self.addParameter(self._defaultParameters,'rParam', 0.4, "Jet size (distance parameter R used in jet clustering)")
888  self.addParameter(self._defaultParameters,'getJetMCFlavour', True, "Get jet MC truth flavour")
889  self.addParameter(self._defaultParameters,'genJetCollection', cms.InputTag("ak4GenJets"), "GenJet collection to match to", cms.InputTag)
890  self.addParameter(self._defaultParameters,'genParticles', cms.InputTag("genParticles"), "GenParticle collection to be used", cms.InputTag)
891  self.addParameter(self._defaultParameters,'jetCorrections',None, "Add all relevant information about jet energy corrections that you want to be added to your new patJet \
892  collection. The format has to be given in a python tuple of type: (\'AK4Calo\',[\'L2Relative\', \'L3Absolute\'], patMet). Here the first argument corresponds to the payload \
893  in the CMS Conditions database for the given jet collection; the second argument corresponds to the jet energy correction levels that you want to be embedded into your \
894  new patJet collection. This should be given as a list of strings. Available values are L1Offset, L1FastJet, L1JPTOffset, L2Relative, L3Absolute, L5Falvour, L7Parton; the \
895  third argument indicates whether MET(Type1/2) corrections should be applied corresponding to the new patJetCollection. If so a new patMet collection will be added to your PAT \
896  Tuple in addition to the raw patMet. This new patMet collection will have the MET(Type1/2) corrections applied. The argument can have the following types: \'type-1\' for \
897  type-1 corrected MET; \'type-2\' for type-1 plus type-2 corrected MET; \'\' or \'none\' if no further MET corrections should be applied to your MET. The arguments \'type-1\' \
898  and \'type-2\' are not case sensitive.", tuple, acceptNoneValue=True)
899  self.addParameter(self._defaultParameters,'btagDiscriminators',['None'], "If you are interested in btagging, in most cases just the labels of the btag discriminators that \
900  you are interested in is all relevant information that you need for a high level analysis. Add here all btag discriminators, that you are interested in as a list of strings. \
901  If this list is empty no btag discriminator information will be added to your new patJet collection.", allowedValues=(list(set().union(supportedBtagDiscr.keys(),supportedMetaDiscr.keys()))),Type=list)
902  self.addParameter(self._defaultParameters,'btagInfos',['None'], "The btagInfos objects contain all relevant information from which all discriminators of a certain \
903  type have been calculated. You might be interested in keeping this information for low level tests or to re-calculate some discriminators from hand. Note that this information \
904  on the one hand can be very space consuming and that it is not necessary to access the pre-calculated btag discriminator information that has been derived from it. Only in very \
905  special cases the btagInfos might really be needed in your analysis. Add here all btagInfos, that you are interested in as a list of strings. If this list is empty no btagInfos \
906  will be added to your new patJet collection.", allowedValues=supportedBtagInfos,Type=list)
907  self.addParameter(self._defaultParameters,'jetTrackAssociation',False, "Add JetTrackAssociation and JetCharge from reconstructed tracks to your new patJet collection. This \
908  switch is only of relevance if you don\'t add any btag information to your new patJet collection (btagDiscriminators or btagInfos) and still want this information added to \
909  your new patJetCollection. If btag information of any form is added to the new patJet collection this information will be added automatically.")
910  self.addParameter(self._defaultParameters,'outputModules',['out'],"Add a list of all output modules to which you would like the new jet collection to be added. Usually this is \
911  just one single output module with name \'out\', which corresponds also the default configuration of the tool. There is cases though where you might want to add this collection \
912  to more than one output module.")
913 
914  self._parameters=copy.deepcopy(self._defaultParameters)
915 
916  self._comment = "This is a tool to add more patJet collectinos to your PAT Tuple or to re-configure the default collection. You can add and embed additional information like jet\
917  energy correction factors, btag information and generator match information to the new patJet collection depending on the parameters that you pass on to this function. Consult \
918  the descriptions of each parameter for more information."
919 

References heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.AddJetCollection._defaultParameters, root::helper::RootFunctionAdapter< F, args >.addParameter(), root::helper::RootFunctionHelper< F, args, Tag >.addParameter(), ParameterMgr.addParameter(), fit::RootMinuit< Function >.addParameter(), DropBoxMetadata::Parameters.addParameter(), Python11ParameterSet.addParameter(), cmspython3::Python11ParameterSet.addParameter(), l1t::TriggerSystem.addParameter(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), edm::ParameterSet.addParameter(), and list().

Member Function Documentation

◆ __call__()

def jetTools.AddJetCollection.__call__ (   self,
  process,
  labelName = None,
  postfix = None,
  btagPrefix = None,
  jetSource = None,
  pfCandidates = None,
  explicitJTA = None,
  pvSource = None,
  svSource = None,
  elSource = None,
  muSource = None,
  runIVF = None,
  tightBTagNTkHits = None,
  loadStdRecoBTag = None,
  svClustering = None,
  fatJets = None,
  groomedFatJets = None,
  algo = None,
  rParam = None,
  getJetMCFlavour = None,
  genJetCollection = None,
  genParticles = None,
  jetCorrections = None,
  btagDiscriminators = None,
  btagInfos = None,
  jetTrackAssociation = None,
  outputModules = None 
)
Function call wrapper. This will check the parameters and call the actual implementation that
can be found in toolCode via the base class function apply.

Definition at line 926 of file jetTools.py.

926  def __call__(self,process,labelName=None,postfix=None,btagPrefix=None,jetSource=None,pfCandidates=None,explicitJTA=None,pvSource=None,svSource=None,elSource=None,muSource=None,runIVF=None,tightBTagNTkHits=None,loadStdRecoBTag=None,svClustering=None,fatJets=None,groomedFatJets=None,algo=None,rParam=None,getJetMCFlavour=None,genJetCollection=None,genParticles=None,jetCorrections=None,btagDiscriminators=None,btagInfos=None,jetTrackAssociation=None,outputModules=None):
927  """
928  Function call wrapper. This will check the parameters and call the actual implementation that
929  can be found in toolCode via the base class function apply.
930  """
931  if labelName is None:
932  labelName=self._defaultParameters['labelName'].value
933  self.setParameter('labelName', labelName)
934  if postfix is None:
935  postfix=self._defaultParameters['postfix'].value
936  self.setParameter('postfix', postfix)
937  if btagPrefix is None:
938  btagPrefix=self._defaultParameters['btagPrefix'].value
939  self.setParameter('btagPrefix', btagPrefix)
940  if jetSource is None:
941  jetSource=self._defaultParameters['jetSource'].value
942  self.setParameter('jetSource', jetSource)
943  if pfCandidates is None:
944  pfCandidates=self._defaultParameters['pfCandidates'].value
945  self.setParameter('pfCandidates', pfCandidates)
946  if explicitJTA is None:
947  explicitJTA=self._defaultParameters['explicitJTA'].value
948  self.setParameter('explicitJTA', explicitJTA)
949  if pvSource is None:
950  pvSource=self._defaultParameters['pvSource'].value
951  self.setParameter('pvSource', pvSource)
952  if svSource is None:
953  svSource=self._defaultParameters['svSource'].value
954  self.setParameter('svSource', svSource)
955  if elSource is None:
956  elSource=self._defaultParameters['elSource'].value
957  self.setParameter('elSource', elSource)
958  if muSource is None:
959  muSource=self._defaultParameters['muSource'].value
960  self.setParameter('muSource', muSource)
961  if runIVF is None:
962  runIVF=self._defaultParameters['runIVF'].value
963  self.setParameter('runIVF', runIVF)
964  if tightBTagNTkHits is None:
965  tightBTagNTkHits=self._defaultParameters['tightBTagNTkHits'].value
966  self.setParameter('tightBTagNTkHits', tightBTagNTkHits)
967  if loadStdRecoBTag is None:
968  loadStdRecoBTag=self._defaultParameters['loadStdRecoBTag'].value
969  self.setParameter('loadStdRecoBTag', loadStdRecoBTag)
970  if svClustering is None:
971  svClustering=self._defaultParameters['svClustering'].value
972  self.setParameter('svClustering', svClustering)
973  if fatJets is None:
974  fatJets=self._defaultParameters['fatJets'].value
975  self.setParameter('fatJets', fatJets)
976  if groomedFatJets is None:
977  groomedFatJets=self._defaultParameters['groomedFatJets'].value
978  self.setParameter('groomedFatJets', groomedFatJets)
979  if algo is None:
980  algo=self._defaultParameters['algo'].value
981  self.setParameter('algo', algo)
982  if rParam is None:
983  rParam=self._defaultParameters['rParam'].value
984  self.setParameter('rParam', rParam)
985  if getJetMCFlavour is None:
986  getJetMCFlavour=self._defaultParameters['getJetMCFlavour'].value
987  self.setParameter('getJetMCFlavour', getJetMCFlavour)
988  if genJetCollection is None:
989  genJetCollection=self._defaultParameters['genJetCollection'].value
990  self.setParameter('genJetCollection', genJetCollection)
991  if genParticles is None:
992  genParticles=self._defaultParameters['genParticles'].value
993  self.setParameter('genParticles', genParticles)
994  if jetCorrections is None:
995  jetCorrections=self._defaultParameters['jetCorrections'].value
996  self.setParameter('jetCorrections', jetCorrections)
997  if btagDiscriminators is None:
998  btagDiscriminators=self._defaultParameters['btagDiscriminators'].value
999  self.setParameter('btagDiscriminators', btagDiscriminators)
1000  if btagInfos is None:
1001  btagInfos=self._defaultParameters['btagInfos'].value
1002  self.setParameter('btagInfos', btagInfos)
1003  if jetTrackAssociation is None:
1004  jetTrackAssociation=self._defaultParameters['jetTrackAssociation'].value
1005  self.setParameter('jetTrackAssociation', jetTrackAssociation)
1006  if outputModules is None:
1007  outputModules=self._defaultParameters['outputModules'].value
1008  self.setParameter('outputModules', outputModules)
1009  self.apply(process)
1010 

References heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RunOnData._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.AddJetCollection._defaultParameters, SignedImpactParameter3D.apply(), SignedDecayLength3D.apply(), SignedTransverseImpactParameter.apply(), gen::PhotosInterfaceBase.apply(), SurveyParameters.apply(), DummyOOTPileupCorrection.apply(), MatrixReader.MatrixReader.apply, gen::PhotosppInterface.apply(), gen::PhotosInterface.apply(), FWPSetCellEditor.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), DeviationsFromFileSensor2D.apply(), FWGUIEventFilter.apply(), AlignmentParameters.apply(), ConfigToolBase.ConfigToolBase.apply(), BowedSurfaceAlignmentParameters.apply(), OOTPileupCorrData.apply(), AbsOOTPileupCorrection.apply(), TwoBowedSurfacesAlignmentParameters.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), models.RegExp.apply(), npstat::ArrayND< Numeric, StackLen, StackDim >.apply(), npstat::ArrayND< Numeric >.apply(), npstat::ArrayND< Num1, Len1, Dim1 >.apply(), Config.ProcessModifier.apply(), PedeReader.setParameter(), QIE8Simulator.setParameter(), AbsElectronicODERHS.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

◆ getDefaultParameters()

def jetTools.AddJetCollection.getDefaultParameters (   self)

◆ toolCode()

def jetTools.AddJetCollection.toolCode (   self,
  process 
)
Tool code implementation

Definition at line 1011 of file jetTools.py.

1011  def toolCode(self, process):
1012  """
1013  Tool code implementation
1014  """
1015  task = getPatAlgosToolsTask(process)
1016 
1017 
1018  labelName=self._parameters['labelName'].value
1019  postfix=self._parameters['postfix'].value
1020  btagPrefix=self._parameters['btagPrefix'].value
1021  jetSource=self._parameters['jetSource'].value
1022  pfCandidates=self._parameters['pfCandidates'].value
1023  explicitJTA=self._parameters['explicitJTA'].value
1024  pvSource=self._parameters['pvSource'].value
1025  svSource=self._parameters['svSource'].value
1026  elSource=self._parameters['elSource'].value
1027  muSource=self._parameters['muSource'].value
1028  runIVF=self._parameters['runIVF'].value
1029  tightBTagNTkHits=self._parameters['tightBTagNTkHits'].value
1030  loadStdRecoBTag=self._parameters['loadStdRecoBTag'].value
1031  svClustering=self._parameters['svClustering'].value
1032  fatJets=self._parameters['fatJets'].value
1033  groomedFatJets=self._parameters['groomedFatJets'].value
1034  algo=self._parameters['algo'].value
1035  rParam=self._parameters['rParam'].value
1036  getJetMCFlavour=self._parameters['getJetMCFlavour'].value
1037  genJetCollection=self._parameters['genJetCollection'].value
1038  genParticles=self._parameters['genParticles'].value
1039  jetCorrections=self._parameters['jetCorrections'].value
1040  btagDiscriminators=list(self._parameters['btagDiscriminators'].value)
1041  btagInfos=list(self._parameters['btagInfos'].value)
1042  jetTrackAssociation=self._parameters['jetTrackAssociation'].value
1043  outputModules=list(self._parameters['outputModules'].value)
1044 
1045 
1046  if labelName=='UNDEFINED':
1047  undefinedLabelName(self)
1048 
1049 
1050  knownModules = process.producerNames().split()
1051 
1052  if btagDiscriminators.count('None')>0:
1053  btagDiscriminators.remove('None')
1054  if btagInfos.count('None')>0:
1055  btagInfos.remove('None')
1056  bTagging=(len(btagDiscriminators)>0 or len(btagInfos)>0)
1057 
1058  infos = 0
1059  for info in btagInfos:
1060  if info.startswith('pf'): infos = infos + 1
1061  if 'softpf' in info.lower(): infos = infos + 1
1062  tags = 0
1063  for tag in btagDiscriminators:
1064  if tag.startswith('pf'): tags = tags + 1
1065  if 'softpf' in tag.lower(): tags = tags + 1
1066  bTaggingLegacy=(len(btagDiscriminators)>tags or len(btagInfos)>infos)
1067 
1070  _labelName=labelName[:1].upper()+labelName[1:]
1071 
1072 
1073  _algo=''
1074  for x in ["ak", "ca", "kt"]:
1075  if x in algo.lower():
1076  _algo=supportedJetAlgos[x]
1077  break
1078  if _algo=='':
1080 
1081  from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cfi import _patJets as patJets
1082  if 'patJets'+_labelName+postfix in knownModules :
1083  _newPatJets=getattr(process, 'patJets'+_labelName+postfix)
1084  _newPatJets.jetSource=jetSource
1085  else :
1086  addToProcessAndTask('patJets'+_labelName+postfix, patJets.clone(jetSource=jetSource), process, task)
1087  _newPatJets=getattr(process, 'patJets'+_labelName+postfix)
1088  knownModules.append('patJets'+_labelName+postfix)
1089 
1090  from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets
1091  if 'selectedPatJets'+_labelName+postfix in knownModules :
1092  _newSelectedPatJets=getattr(process, 'selectedPatJets'+_labelName+postfix)
1093  _newSelectedPatJets.src='patJets'+_labelName+postfix
1094  else :
1095  addToProcessAndTask('selectedPatJets'+_labelName+postfix,
1096  selectedPatJets.clone(src='patJets'+_labelName+postfix),
1097  process, task)
1098  knownModules.append('selectedPatJets'+_labelName+postfix)
1099 
1100 
1101  from PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi import patJetPartonMatch
1102  if 'patJetPartonMatch'+_labelName+postfix in knownModules :
1103  _newPatJetPartonMatch=getattr(process, 'patJetPartonMatch'+_labelName+postfix)
1104  _newPatJetPartonMatch.src=jetSource
1105  _newPatJetPartonMatch.matched=genParticles
1106  else :
1107  addToProcessAndTask('patJetPartonMatch'+_labelName+postfix,
1108  patJetPartonMatch.clone(src=jetSource, matched=genParticles),
1109  process, task)
1110  knownModules.append('patJetPartonMatch'+_labelName+postfix)
1111 
1112  from PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi import patJetGenJetMatch
1113  if 'patJetGenJetMatch'+_labelName+postfix in knownModules :
1114  _newPatJetGenJetMatch=getattr(process, 'patJetGenJetMatch'+_labelName+postfix)
1115  _newPatJetGenJetMatch.src=jetSource
1116  _newPatJetGenJetMatch.maxDeltaR=rParam
1117  _newPatJetGenJetMatch.matched=genJetCollection
1118  else :
1119  addToProcessAndTask('patJetGenJetMatch'+_labelName+postfix,
1120  patJetGenJetMatch.clone(src=jetSource, maxDeltaR=rParam, matched=genJetCollection),
1121  process, task)
1122  knownModules.append('patJetGenJetMatch'+_labelName+postfix)
1123 
1124  _newPatJets.genJetMatch.setModuleLabel('patJetGenJetMatch'+_labelName+postfix)
1125  _newPatJets.genPartonMatch.setModuleLabel('patJetPartonMatch'+_labelName+postfix)
1126 
1127  if (getJetMCFlavour):
1128 
1130  from PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff import patJetPartonsLegacy
1131  if 'patJetPartonsLegacy'+postfix not in knownModules :
1132  addToProcessAndTask('patJetPartonsLegacy'+postfix, patJetPartonsLegacy.clone(src=genParticles),
1133  process, task)
1134  knownModules.append('patJetPartonsLegacy'+postfix)
1135  else:
1136  getattr(process, 'patJetPartonsLegacy'+postfix).src=genParticles
1137 
1138  from PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff import patJetPartonAssociationLegacy
1139  if 'patJetPartonAssociationLegacy'+_labelName+postfix in knownModules :
1140  _newPatJetPartonAssociation=getattr(process, 'patJetPartonAssociationLegacy'+_labelName+postfix)
1141  _newPatJetPartonAssociation.jets=jetSource
1142  else :
1143  addToProcessAndTask('patJetPartonAssociationLegacy'+_labelName+postfix,
1144  patJetPartonAssociationLegacy.clone(jets=jetSource), process, task)
1145  knownModules.append('patJetPartonAssociationLegacy'+_labelName+postfix)
1146 
1147  from PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff import patJetFlavourAssociationLegacy
1148  if 'patJetFlavourAssociationLegacy'+_labelName+postfix in knownModules :
1149  _newPatJetFlavourAssociation=getattr(process, 'patJetFlavourAssociationLegacy'+_labelName+postfix)
1150  _newPatJetFlavourAssociation.srcByReference='patJetPartonAssociationLegacy'+_labelName+postfix
1151  else:
1152  addToProcessAndTask('patJetFlavourAssociationLegacy'+_labelName+postfix,
1153  patJetFlavourAssociationLegacy.clone(
1154  srcByReference='patJetPartonAssociationLegacy'+_labelName+postfix),
1155  process, task)
1156  knownModules.append('patJetFlavourAssociationLegacy'+_labelName+postfix)
1157 
1158  _newPatJets.JetPartonMapSource.setModuleLabel('patJetFlavourAssociationLegacy'+_labelName+postfix)
1159 
1162  if 'patJetPartons'+postfix not in knownModules :
1163  addToProcessAndTask('patJetPartons'+postfix, patJetPartons.clone(particles=genParticles), process, task)
1164  knownModules.append('patJetPartons'+postfix)
1165  else:
1166  getattr(process, 'patJetPartons'+postfix).particles=genParticles
1167 
1168  from PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff import patJetFlavourAssociation
1169  if 'patJetFlavourAssociation'+_labelName+postfix in knownModules :
1170  _newPatJetFlavourAssociation=getattr(process, 'patJetFlavourAssociation'+_labelName+postfix)
1171  _newPatJetFlavourAssociation.jets=jetSource
1172  _newPatJetFlavourAssociation.jetAlgorithm=_algo
1173  _newPatJetFlavourAssociation.rParam=rParam
1174  _newPatJetFlavourAssociation.bHadrons=cms.InputTag("patJetPartons"+postfix,"bHadrons")
1175  _newPatJetFlavourAssociation.cHadrons=cms.InputTag("patJetPartons"+postfix,"cHadrons")
1176  _newPatJetFlavourAssociation.partons=cms.InputTag("patJetPartons"+postfix,"physicsPartons")
1177  _newPatJetFlavourAssociation.leptons=cms.InputTag("patJetPartons"+postfix,"leptons")
1178  else :
1179  addToProcessAndTask('patJetFlavourAssociation'+_labelName+postfix,
1180  patJetFlavourAssociation.clone(
1181  jets=jetSource,
1182  jetAlgorithm=_algo,
1183  rParam=rParam,
1184  bHadrons = cms.InputTag("patJetPartons"+postfix,"bHadrons"),
1185  cHadrons = cms.InputTag("patJetPartons"+postfix,"cHadrons"),
1186  partons = cms.InputTag("patJetPartons"+postfix,"physicsPartons"),
1187  leptons = cms.InputTag("patJetPartons"+postfix,"leptons")),
1188  process, task)
1189 
1190  knownModules.append('patJetFlavourAssociation'+_labelName+postfix)
1191  if 'Puppi' in jetSource.value() and pfCandidates.value() == 'particleFlow':
1192  _newPatJetFlavourAssociation=getattr(process, 'patJetFlavourAssociation'+_labelName+postfix)
1193  _newPatJetFlavourAssociation.weights = cms.InputTag("puppi")
1194 
1195  _newPatJets.JetFlavourInfoSource.setModuleLabel('patJetFlavourAssociation'+_labelName+postfix)
1196 
1197  if fatJets != cms.InputTag('') and groomedFatJets != cms.InputTag(''):
1198  _newPatJetFlavourAssociation=getattr(process, 'patJetFlavourAssociation'+_labelName+postfix)
1199  _newPatJetFlavourAssociation.jets=fatJets
1200  _newPatJetFlavourAssociation.groomedJets=groomedFatJets
1201  _newPatJetFlavourAssociation.subjets=jetSource
1202  _newPatJets.JetFlavourInfoSource=cms.InputTag('patJetFlavourAssociation'+_labelName+postfix,'SubJets')
1203  else:
1204  _newPatJets.getJetMCFlavour = False
1205  _newPatJets.addJetFlavourInfo = False
1206 
1207 
1208  if (jetTrackAssociation or bTaggingLegacy):
1209 
1210  from RecoJets.JetAssociationProducers.ak4JTA_cff import ak4JetTracksAssociatorAtVertex, ak4JetTracksAssociatorExplicit
1211  if 'jetTracksAssociationAtVertex'+_labelName+postfix in knownModules :
1212  _newJetTracksAssociationAtVertex=getattr(process, 'jetTracksAssociatorAtVertex'+_labelName+postfix)
1213  _newJetTracksAssociationAtVertex.jets=jetSource
1214  _newJetTracksAssociationAtVertex.pvSrc=pvSource
1215  else:
1216  jetTracksAssociator=ak4JetTracksAssociatorAtVertex
1217  if explicitJTA:
1218  jetTracksAssociator=ak4JetTracksAssociatorExplicit
1219  addToProcessAndTask('jetTracksAssociatorAtVertex'+_labelName+postfix,
1220  jetTracksAssociator.clone(jets=jetSource,pvSrc=pvSource),
1221  process, task)
1222  knownModules.append('jetTracksAssociationAtVertex'+_labelName+postfix)
1223 
1225  if 'patJetCharge'+_labelName+postfix in knownModules :
1226  _newPatJetCharge=getattr(process, 'patJetCharge'+_labelName+postfix)
1227  _newPatJetCharge.src='jetTracksAssociatorAtVertex'+_labelName+postfix
1228  else:
1229  addToProcessAndTask('patJetCharge'+_labelName+postfix,
1230  patJetCharge.clone(src = 'jetTracksAssociatorAtVertex'+_labelName+postfix),
1231  process, task)
1232  knownModules.append('patJetCharge'+_labelName+postfix)
1233 
1234  _newPatJets.addAssociatedTracks=True
1235  _newPatJets.trackAssociationSource=cms.InputTag('jetTracksAssociatorAtVertex'+_labelName+postfix)
1236  _newPatJets.addJetCharge=True
1237  _newPatJets.jetChargeSource=cms.InputTag('patJetCharge'+_labelName+postfix)
1238  else:
1239 
1240  _newPatJets.addAssociatedTracks=False
1241  _newPatJets.trackAssociationSource=''
1242  _newPatJets.addJetCharge=False
1243  _newPatJets.jetChargeSource=''
1244 
1245  if (bTagging):
1246  setupBTagging(process, jetSource, pfCandidates, explicitJTA, pvSource, svSource, elSource, muSource, runIVF, tightBTagNTkHits, loadStdRecoBTag, svClustering, fatJets, groomedFatJets,
1247  _algo, rParam, btagDiscriminators, btagInfos, _newPatJets, _labelName, btagPrefix, postfix)
1248  else:
1249  _newPatJets.addBTagInfo = False
1250  _newPatJets.addTagInfos = False
1251 
1252  for outputModule in outputModules:
1253  if hasattr(process,outputModule):
1254  getattr(process,outputModule).outputCommands.append("drop *_"+'selected'+_labelName+postfix+"_tagInfos_*")
1255 
1256 
1257  if (jetCorrections != None):
1258 
1259  checkJetCorrectionsFormat(jetCorrections)
1260 
1261  setupJetCorrections(process, knownModules, jetCorrections, jetSource, pvSource, _newPatJets, _labelName, postfix)
1262  else:
1263 
1264  _newPatJets.addJetCorrFactors=False
1265 
1266 addJetCollection=AddJetCollection()
1267 

References heavyIonTools.ConfigureHeavyIons._parameters, coreTools.RunOnData._parameters, heavyIonTools.ProductionDefaults._parameters, ConfigToolBase.ConfigToolBase._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, jetTools.AddJetCollection._parameters, helpers.addToProcessAndTask(), jetTools.checkJetCorrectionsFormat(), helpers.getPatAlgosToolsTask(), list(), jetTools.setupBTagging(), jetTools.setupJetCorrections(), cms::dd.split(), jetTools.undefinedLabelName(), jetTools.unsupportedJetAlgorithm(), and pileupCalc.upper.

Member Data Documentation

◆ _comment

jetTools.AddJetCollection._comment
private

add comments

Definition at line 916 of file jetTools.py.

◆ _defaultParameters

jetTools.AddJetCollection._defaultParameters
staticprivate

Definition at line 861 of file jetTools.py.

Referenced by trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), tauTools.AddTauCollection.__call__(), trackTools.MakeTrackCandidates.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetCollection.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.UpdateJetCollection.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), metTools.AddMETCollection.__init__(), trackTools.MakeAODTrackCandidates.__init__(), runJetUncertainties.RunJetUncertainties.__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), tauTools.AddTauCollection.__init__(), trackTools.MakeTrackCandidates.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), jetTools.AddJetCollection.__init__(), jetTools.SwitchJetCollection.__init__(), jetTools.UpdateJetCollection.__init__(), jetTools.AddJetID.__init__(), jetTools.SetTagInfos.__init__(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), metTools.AddMETCollection.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), tauTools.AddTauCollection.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), jetTools.AddJetCollection.getDefaultParameters(), jetTools.SwitchJetCollection.getDefaultParameters(), jetTools.UpdateJetCollection.getDefaultParameters(), jetTools.AddJetID.getDefaultParameters(), jetTools.SetTagInfos.getDefaultParameters(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.initializeInputTag(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

◆ _label

jetTools.AddJetCollection._label
staticprivate

◆ _parameters

jetTools.AddJetCollection._parameters
private

initialization of the base class

add all parameters that should be known to the class set defaults

Definition at line 914 of file jetTools.py.

Referenced by runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.ak4JetReclustering(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createMVAMETModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.createSmearedJetModule(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.extractMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getCorrectedMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getMETUncertainties(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getUnclusteredVariationsForMVAMET(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.getVariations(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetCleaning(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.jetConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfiguration(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.miniAODConfigurationPost(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.recomputeRawMetFromPfcs(), trackTools.MakeAODTrackCandidates.toolCode(), metTools.AddMETCollection.toolCode(), runJetUncertainties.RunJetUncertainties.toolCode(), trigTools.SwitchOnTrigger.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.toolCode(), tauTools.AddTauCollection.toolCode(), trackTools.MakeTrackCandidates.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), jetTools.AddJetCollection.toolCode(), jetTools.SwitchJetCollection.toolCode(), jetTools.UpdateJetCollection.toolCode(), jetTools.AddJetID.toolCode(), jetTools.SetTagInfos.toolCode(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.updateJECs().

helpers.getPatAlgosToolsTask
def getPatAlgosToolsTask(process)
Definition: helpers.py:14
jetTools.checkJetCorrectionsFormat
def checkJetCorrectionsFormat(jetCorrections)
Definition: jetTools.py:18
jetMatch_cfi
ak4JTA_cff
jetSelector_cfi
cms::dd::split
std::vector< std::string_view > split(std::string_view, const char *)
jetFlavourId_cff
jetTools.undefinedLabelName
def undefinedLabelName(obj)
Definition: jetTools.py:1870
jetTools.setupJetCorrections
def setupJetCorrections(process, knownModules, jetCorrections, jetSource, pvSource, patJets, labelName, postfix)
Definition: jetTools.py:26
jetProducer_cfi
jetTools.unsupportedJetAlgorithm
def unsupportedJetAlgorithm(obj)
Definition: jetTools.py:1877
jetTools.setupBTagging
def setupBTagging(process, jetSource, pfCandidates, explicitJTA, pvSource, svSource, elSource, muSource, runIVF, tightBTagNTkHits, loadStdRecoBTag, svClustering, fatJets, groomedFatJets, algo, rParam, btagDiscriminators, btagInfos, patJets, labelName, btagPrefix, postfix)
Definition: jetTools.py:238
jetTracksCharge_cff
pileupCalc.upper
upper
Definition: pileupCalc.py:214
list
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
helpers.addToProcessAndTask
def addToProcessAndTask(label, module, process, task)
Definition: helpers.py:29