diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py index ea678cea410cd5339ad3f870e92e4772ce395ff5..b210d9c17c87d1129bc151960060aace08110111 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py +++ b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py @@ -126,6 +126,13 @@ class ExtraFlowMoments(JobProperty): allowedTypes = ['bool'] StoredValue = True +class DoHIBTagging(JobProperty): + """ Perform b-tagging over HI jet collections + """ + statusOn = True + allowedTypes = ['bool'] + StoredValue = False + class HIClusterKey(JobProperty): """ Key of CaloClusterContainer containing HI clusters @@ -251,6 +258,7 @@ list_jobproperties = [UnsubtractedSuffix, ModulationScheme, Remodulate, ExtraFlowMoments, + DoHIBTagging, HIClusterKey, IteratedEventShapeKey, TruthJetPtMin, diff --git a/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py index 1f9ed0c737ab3bc68f3431639656cb6d66268f00..37dad07c2dd66693a2d51782f757fd0ac7326cbb 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py +++ b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py @@ -111,45 +111,47 @@ JetAlgFromTools(jtm.HIJetRecs,suffix="HI",persistify=True) # code cloned from BTagging_jobOptions.py # to allow b-tagging over HI jets -if not BTaggingFlags.DoNotSetupBTagging: # Temporary measure so the JetRec people can test setting this all up from their side. - # - # ========== Load and configure everything - # - - from BTagging.BTaggingConfiguration import getConfiguration - ConfInstance = getConfiguration() - - if ConfInstance.checkFlagsUsingBTaggingFlags(): - - #Jet collections - JetCollectionList = ['AntiKt4HIJets'] - from JetRec.JetRecFlags import jetFlags - - BTaggingFlags.Jets = [ name[:-4] for name in JetCollectionList] - - #BTagging list - btag = ConfInstance.getOutputFilesPrefix() #BTaggingFlags.OutputFilesBTag #"BTagging_" - - #TODO define name author (now BTagging_AntiKt4LCTopo) - AuthorSubString = [ btag+name[:-4] for name in JetCollectionList] - - NotInJetToolManager = [] # For jet collections - from JetRec.JetRecStandard import jtm - for i, jet in enumerate(JetCollectionList): - try: - btagger = ConfInstance.setupJetBTaggerTool(ToolSvc, jet) #The [:-4] is not needed here; this function automatically removes trailing 'jets' or 'Jets'. - if btagger is None: - continue - jet = jet.replace("Track", "PV0Track") - jetname = getattr(jtm, jet) - jetname.unlock() - jetname.JetModifiers += [ btagger ] - jetname.lock() - if BTaggingFlags.OutputLevel < 3: - print ConfInstance.getJetCollectionTool(jet[:-4]) - except AttributeError as error: - print '#BTAG# --> ' + str(error) - NotInJetToolManager.append(AuthorSubString[i]) - - if len(NotInJetToolManager) > 0: - AuthorSubString = list(set(AuthorSubString) - set(NotInJetToolManager)) +if HIJetFlags.DoHIBTagging(): + + if not BTaggingFlags.DoNotSetupBTagging: # Temporary measure so the JetRec people can test setting this all up from their side. + # + # ========== Load and configure everything + # + + from BTagging.BTaggingConfiguration import getConfiguration + ConfInstance = getConfiguration() + + if ConfInstance.checkFlagsUsingBTaggingFlags(): + + #Jet collections + JetCollectionList = ['AntiKt4HIJets'] + from JetRec.JetRecFlags import jetFlags + + BTaggingFlags.Jets = [ name[:-4] for name in JetCollectionList] + + #BTagging list + btag = ConfInstance.getOutputFilesPrefix() #BTaggingFlags.OutputFilesBTag #"BTagging_" + + #TODO define name author (now BTagging_AntiKt4LCTopo) + AuthorSubString = [ btag+name[:-4] for name in JetCollectionList] + + NotInJetToolManager = [] # For jet collections + from JetRec.JetRecStandard import jtm + for i, jet in enumerate(JetCollectionList): + try: + btagger = ConfInstance.setupJetBTaggerTool(ToolSvc, jet) #The [:-4] is not needed here; this function automatically removes trailing 'jets' or 'Jets'. + if btagger is None: + continue + jet = jet.replace("Track", "PV0Track") + jetname = getattr(jtm, jet) + jetname.unlock() + jetname.JetModifiers += [ btagger ] + jetname.lock() + if BTaggingFlags.OutputLevel < 3: + print ConfInstance.getJetCollectionTool(jet[:-4]) + except AttributeError as error: + print '#BTAG# --> ' + str(error) + NotInJetToolManager.append(AuthorSubString[i]) + + if len(NotInJetToolManager) > 0: + AuthorSubString = list(set(AuthorSubString) - set(NotInJetToolManager))