diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingFlags.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingFlags.py index 7fcf67e798b1ec81fed1907c69dc7225453ef981..3be6ed858c0f1de0f4c604ed36319f5107eca43a 100755 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingFlags.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingFlags.py @@ -329,7 +329,7 @@ class _BTaggingFlags: setattr(self, attr, ['IP1D','SV2','SV2Flip','TrackCounting','TrackCountingFlip']) for attr in self._TriggerTaggers: - setattr(self, attr, ['IP2D','IP3D','SV1','MV2c00','MV2c10','MV2c20', 'MV2c10hp']) + setattr(self, attr, ['IP2D','IP3D','SV1','MV2c10'])#,'MV2c00','MV2c20', 'MV2c10hp']) for attr in self._jetFinderBasedOn: setattr(self, attr, 'Cells') diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h index 44c8880f261c492ca463a3be893abc3529392d7b..ccf92cd0029776621721e3649284d3a1ce035712 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h @@ -29,36 +29,18 @@ #include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h" #include "VxSecVertex/VxSecVertexInfo.h" - +#include "BTagging/IBTagTool.h" +#include "BTagging/IBTagTrackAssociation.h" +#include "BTagging/IBTagSecVertexing.h" class MsgStream; -//class TrigEFBjetContainer; -//class TriggerElement; - -//class TrigInDetTrackCollection; -//class TrackParticleContainer; -//class TrigVertexCollection; -//class VxContainer; -//class TrigBjetTagger; -//class TrigRoiDescriptor; - -//class TaggerHelper; -//class TrigBjetTrackInfo; -//class TrigBjetPrmVtxInfo; -//class TrigBjetSecVtxInfo; -//class TrigBjetJetInfo; - -namespace Rec { - //class TrackParticleContainer; - //class TrackParticle; -} - +/* namespace Analysis { class IBTagTool; class IBTagTrackAssociation; class IBTagSecVertexing; } - +*/ /** * @brief FEX class for the b-jet weight construction using offline tools * diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetEtHypoTool.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetEtHypoTool.py new file mode 100644 index 0000000000000000000000000000000000000000..0daf3797fe1d5729e7a7c1b63763d1fb187ecdcc --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetEtHypoTool.py @@ -0,0 +1,68 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +import re +re_Bjet = re.compile(r'^HLT_(?P<multiplicity>\d+)?j(?P<threshold>\d+)(?:_gsc(?P<gscThreshold>\d+))?(?:_b(?P<bTag>[^_]+)(?:_(?P<bConfig>split))?)?$') + +from AthenaCommon.Logging import logging +from AthenaCommon.SystemOfUnits import GeV +from AthenaCommon.Constants import VERBOSE,DEBUG + +#################################################################################################### + +def TrigBjetEtHypoToolFromName( name, conf ): + from AthenaCommon.Constants import DEBUG + """ set the name of the EtHypoTool (name=chain) and figure out the threshold and selection from conf """ + + default_conf = { 'threshold' : '0', + 'multiplicity' : '1', + 'gscThreshold' : '0', + 'bTag' : 'offperf', + 'bConfig' : 'split' } + + chain = conf + match = re_Bjet.match( chain ) + conf_dict = match.groupdict() + + for k, v in default_conf.items(): + if k not in conf_dict: conf_dict[k] = v + if conf_dict[k] == None: conf_dict[k] = v + + tool = getBjetEtHypoConfiguration( name,conf_dict ) + print "TrigBjetEtHypoToolFromName: name = %s, cut_j = %s, cut_gsc = %s "%(name,tool.EtThreshold,tool.GscThreshold ) + return tool + +#################################################################################################### + +def getBjetEtHypoConfiguration( name,conf_dict ): + # Common for both gsc and non-gsc configurations + from TrigBjetHypo.TrigBjetHypoConf import TrigBjetEtHypoTool + + tool = TrigBjetEtHypoTool( name ) + tool.OutputLevel = DEBUG + tool.AcceptAll = False + # Set Cut Thresholds + tool.EtThreshold = float(conf_dict['threshold']) * GeV + tool.GscThreshold = float(conf_dict['gscThreshold']) * GeV + + return tool + +#################################################################################################### + +if __name__ == "__main__": + from TriggerJobOpts.TriggerFlags import TriggerFlags + TriggerFlags.enableMonitoring=['Validation'] + + t = TrigBjetEtHypoToolFromName( "HLT_j35_gsc45_boffperf_split","HLT_j35_gsc45_boffperf_split" ) + assert t, "can't configure gsc boffperf split" + + t = TrigBjetEtHypoToolFromName( "HLT_j35_gsc45_boffperf","HLT_j35_gsc45_boffperf" ) + assert t, "can't configure gsc boffperf" + + t = TrigBjetEtHypoToolFromName( "HLT_j35_boffperf_split","HLT_j35_boffperf_split" ) + assert t, "can't configure boffperf split" + + t = TrigBjetEtHypoToolFromName( "HLT_j35_boffperf","HLT_j35_boffperf" ) + assert t, "can't configure boffperf" + + print ( "\n\n TrigBjetEtHypoToolFromName ALL OK\n\n" ) + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetHypoTool.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetHypoTool.py index d89ef71307322593ab7e888de9e4e6be5f9ea2d5..a4f0eaa93f8b2d39af35cedf672a8f805df55b99 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetHypoTool.py +++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetHypoTool.py @@ -1,166 +1,150 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -from TrigBjetHypo.TrigBjetHypoConf import TrigBjetHypoTool +import re +re_Bjet = re.compile(r'^HLT_(?P<multiplicity>\d+)?j(?P<threshold>\d+)(?:_gsc(?P<gscThreshold>\d+))?(?:_b(?P<bTag>[^_]+)(?:_(?P<bConfig>split))?)?$') from AthenaCommon.Logging import logging from AthenaCommon.SystemOfUnits import GeV +from AthenaCommon.Constants import VERBOSE,DEBUG -#### Not sure how to deal with instances here, I left only "split" since these are used now, and for simplicity -def getBjetHypoSplitNoCutInstance( instance): - return BjetHypoSplitNoCut( instance=instance, name=instance+"BjetHypoSplitNoCut" ) +#################################################################################################### -def getBjetHypoSplitInstance( instance, version, cut ): - return BjetHypoSplit( instance=instance, cut=cut, version=version, name=instance+"BjetHypoSplit"+"_"+cut+"_"+version ) +def TrigBjetHypoToolFromName( name, conf ): + from AthenaCommon.Constants import DEBUG + """ Configure a b-jet hypo tool from chain name. """ + default_conf = { 'threshold' : '0', + 'multiplicity' : '1', + 'gscThreshold' : '0', + 'bTag' : 'offperf', + 'bConfig' : 'split' } + chain = conf + match = re_Bjet.match( chain ) + conf_dict = match.groupdict() + for k, v in default_conf.items(): + if k not in conf_dict: conf_dict[k] = v + if conf_dict[k] == None: conf_dict[k] = v -### Split instances - -class BjetHypoSplitNoCut (TrigBjetHypo): - __slots__ = [] - - def __init__(self, instance, name): - super( BjetHypoSplitNoCut, self ).__init__( name ) - - mlog = logging.getLogger('BjetHypoConfig.py') - - AllowedInstances = ["EF", "MuJetChain"] - -## self.JetKey = "SplitJet" - - if instance in AllowedInstances : - -## Let's leave mu-jet chains for later if needed -## if instance=="MuJetChain" : -## self.JetKey = "FarawayJet" -## instance = "EF" - - if instance=="EF" : - self.AcceptAll = True - self.Instance = "EF" - self.UseBeamSpotFlag = False - self.OverrideBeamSpotValid = True - from TrigBjetHypo.TrigBjetHypoMonitoring import TrigEFBjetHypoValidationMonitoring, TrigEFBjetHypoOnlineMonitoring - validation = TrigEFBjetHypoValidationMonitoring() - online = TrigEFBjetHypoOnlineMonitoring() - - from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig - time = TrigTimeHistToolConfig("TimeHistogramForTrigBjetHypo") - time.TimerHistLimits = [0,0.4] - - self.AthenaMonTools = [ time, validation, online ] - - else : - mlog.error("Instance "+instance+" is not supported!") - return None - - - -class BjetHypoSplit (TrigBjetHypo): - __slots__ = [] + tool = getBjetHypoConfiguration( name,conf_dict ) - def __init__(self, instance, version, cut, name): - super( BjetHypoSplit, self ).__init__( name ) - - mlog = logging.getLogger('BjetHypoConfig.py') - - AllowedCuts = ["loose","medium","tight","offloose","offmedium","offtight", - "mv2c2040","mv2c2050","mv2c2060","mv2c2070","mv2c2077","mv2c2085", - "mv2c1040","mv2c1050","mv2c1060","mv2c1070","mv2c1077","mv2c1085" ] - AllowedVersions = ["2012","2015","2017"] - AllowedInstances = ["EF", "MuJetChain"] - - if instance not in AllowedInstances : - mlog.error("Instance "+instance+" is not supported!") - return None - - if version not in AllowedVersions : - mlog.error("Version "+version+" is not supported!") - return None - - if cut not in AllowedCuts : - mlog.error("Cut "+cut+" is not supported!") - return None - - self.JetKey = "SplitJet" - if instance=="MuJetChain" : - self.JetKey = "FarawayJet" - instance = "EF" - - if instance=="EF" : - self.AcceptAll = False - self.Instance = "EF" - self.UseBeamSpotFlag = False - - if instance=="EF" : - from TrigBjetHypo.TrigBjetHypoMonitoring import TrigEFBjetHypoValidationMonitoring, TrigEFBjetHypoOnlineMonitoring - validation = TrigEFBjetHypoValidationMonitoring() - online = TrigEFBjetHypoOnlineMonitoring() - - from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig - time = TrigTimeHistToolConfig("TimeHistogramForTrigBjetHypo") - time.TimerHistLimits = [0,0.4] - - self.AthenaMonTools = [ time, validation, online ] - - if instance=="EF" : - if version=="2012" : - self.MethodTag = "COMB" - if cut=="loose": - self.CutXCOMB = 0.25 - elif cut=="medium": - self.CutXCOMB = 1.25 - elif cut=="tight": - self.CutXCOMB = 2.65 - - if version=="2015" : - self.MethodTag = "MV2c20" - # These are the offline working points - if cut=="mv2c2040": - # Actually XX% efficient - self.CutMV2c20 = 0.75 - elif cut=="mv2c2050": - # Actually XX% efficient - self.CutMV2c20 = 0.5 - elif cut=="mv2c2060": - # Actually 62% efficient - self.CutMV2c20 = -0.0224729 - elif cut=="mv2c2070": - # Actually 72% efficient - self.CutMV2c20 = -0.509032 - elif cut=="mv2c2077": - # Actually 79% efficient - self.CutMV2c20 = -0.764668 - elif cut=="mv2c2085": - # Actually 87% efficient - self.CutMV2c20 = -0.938441 - - if version=="2017" : - self.MethodTag = "MV2c10" - # These are the offline working points - if cut=="mv2c1040": - # Actually ~45% efficient - self.CutMV2c10 = 0.978 - elif cut=="mv2c1050": - # Actually ~55% efficient - self.CutMV2c10 = 0.948 - elif cut=="mv2c1060": - # Actually ~65% efficient - self.CutMV2c10 = 0.847 - elif cut=="mv2c1070": - # Actually ~75% efficient - self.CutMV2c10 = 0.580 - elif cut=="mv2c1077": - # Actually ~80% efficient - self.CutMV2c10 = 0.162 - elif cut=="mv2c1085": - # Actually ~90% efficient - self.CutMV2c10 = -0.494 - - - - - - + print "TrigBjetHypoToolFromName: name = %s, tagger = %s "%(name,tool.MethodTag) + print "TrigBjetHypoToolFromName: tagger %s and threshold %s "%(tool.MethodTag,tool.BTaggingCut) + + return tool + +#################################################################################################### +# Utilities + +def retrieveBtaggingCut( tagger ): + # MV2c20 + if tagger == "mv2c2040" : + return 0.75 + if tagger == "mv2c2050" : + return 0.5 + if tagger == "mv2c2060" : + return -0.0224729 + if tagger == "mv2c2070" : + return -0.509032 + if tagger == "mv2c2077" : + return -0.764668 + if tagger == "mv2c2085" : + return -0.938441 + # MV2c10 + if tagger == "mv2c1040" : + return 0.978 + if tagger == "mv2c1050" : + return 0.948 + if tagger == "mv2c1060" : + return 0.846 + if tagger == "mv2c1070" : + return 0.580 + if tagger == "mv2c1077" : + return 0.162 + if tagger == "mv2c1085" : + return -0.494 + # MV2c00 (Hybrid MV2c10) + if tagger == "hmv2c1040" : + return 0.973 + if tagger == "hmv2c1050" : + return 0.939 + if tagger == "hmv2c1060" : + return 0.835 + if tagger == "hmv2c1070" : + return 0.588 + if tagger == "hmv2c1077" : + return 0.192 + if tagger == "hmv2c1085" : + return -0.402 + # If not found + return -20 + +def decodeThreshold( threshold_btag ): + """ decodes the b-tagging thresholds """ + print "TrigBjetHypoToolFromName: decoding threshold b" + threshold_btag + + tagger = "MV2c10" + if "mv2c20" in threshold_btag : + tagger = "MV2c20" + elif "hmv2c10" in threshold_btag : + tagger = "MV2c00" + + cut = retrieveBtaggingCut( threshold_btag ) + return [tagger,cut] + +#################################################################################################### + +def getBjetHypoConfiguration( name,conf_dict ): + # Common for both split and non-split configurations + from TrigBjetHypo.TrigBjetHypoConf import TrigBjetHypoTool + + tool = TrigBjetHypoTool( name ) + tool.OutputLevel = DEBUG + tool.AcceptAll = False + tool.UseBeamSpotFlag = False + + # b-tagging + [tagger,tb] = decodeThreshold( conf_dict['bTag'] ) + + if conf_dict['bTag'] == "offperf" : + tool.AcceptAll = True + tool.OverrideBeamSpotValid = True + + tool.MethodTag = tagger + tool.BTaggingCut = tb + + # Monitoring + tool.MonTool = "" + from TriggerJobOpts.TriggerFlags import TriggerFlags + if 'Validation' in TriggerFlags.enableMonitoring() or 'Online' in TriggerFlags.enableMonitoring(): + from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram + monTool = GenericMonitoringTool("MonTool"+name) + monTool.Histograms = [] + + monTool.HistPath = 'BjetHypo/'+tool.name() + tool.MonTool = monTool + tool += monTool + + return tool + +#################################################################################################### + +if __name__ == "__main__": + from TriggerJobOpts.TriggerFlags import TriggerFlags + TriggerFlags.enableMonitoring=['Validation'] + + t = TrigBjetHypoToolFromName( "HLT_j35_gsc45_boffperf_split","HLT_j35_gsc45_boffperf_split" ) + assert t, "can't configure gsc boffperf split" + + t = TrigBjetHypoToolFromName( "HLT_j35_gsc45_boffperf","HLT_j35_gsc45_boffperf" ) + assert t, "can't configure gsc boffperf" + + t = TrigBjetHypoToolFromName( "HLT_j35_boffperf_split","HLT_j35_boffperf_split" ) + assert t, "can't configure boffperf split" + + t = TrigBjetHypoToolFromName( "HLT_j35_boffperf","HLT_j35_boffperf" ) + assert t, "can't configure boffperf" + + print ( "\n\n TrigBjetHypoToolFromName ALL OK\n\n" ) diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBtagFexMTConfig.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBtagFexMTConfig.py new file mode 100755 index 0000000000000000000000000000000000000000..e505f22758052fc7e72fd2d2da1c7019242748c3 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBtagFexMTConfig.py @@ -0,0 +1,109 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigBjetHypo.TrigBjetHypoConf import TrigBtagFexMT +#from TrigBjetHypo.TrigBtagFexTuning import * + +from AthenaCommon.Logging import logging +from AthenaCommon.SystemOfUnits import mm, GeV + +from AthenaCommon.AppMgr import ToolSvc +from BTagging.BTaggingFlags import BTaggingFlags +from BTagging.BTaggingConfiguration import getConfiguration +BTagConfig = getConfiguration("Trig") +BTagConfig.PrefixxAODBaseName(False) +BTagConfig.PrefixVertexFinderxAODBaseName(False) +BTagConfigSetupStatus = BTagConfig.setupJetBTaggerTool(ToolSvc, "AntiKt4EMTopo", SetupScheme="Trig", TaggerList=BTaggingFlags.TriggerTaggers) + + +def getBtagFexInstance( instance, version, algo ): + if instance=="EF" : + return BtagFex( instance=instance, version=version, algo=algo, name="EFBtagFex_"+algo ) + +def getBtagFexSplitInstance( instance, version, algo): + return BtagFexSplit( instance=instance, version=version, algo=algo, name=instance+"BtagFexSplit_"+algo ) + + + + +class BtagFex (TrigBtagFexMT): + __slots__ = [] + + def __init__(self, instance, version, algo, name): + super( BtagFex, self ).__init__( name ) + + mlog = logging.getLogger('BtagHypoConfig.py') + + AllowedInstances = ["EF"] + AllowedVersions = ["2012"] + AllowedAlgos = ["EFID"] + + if instance not in AllowedInstances : + mlog.error("Instance "+instance+" is not supported!") + return None + + if version not in AllowedVersions : + mlog.error("Version "+version+" is not supported!") + return None + + self.JetKey = "EFJet" + self.PriVtxKey = "EFHistoPrmVtx" + self.TrackKey = "InDetTrigTrackingxAODCnv_Bjet_EFID" + + # IMPORT OFFLINE TOOLS + self.setupOfflineTools = True + if self.setupOfflineTools : + if BTagConfigSetupStatus == None : + self.setupOfflineTools = False + else : + self.BTagTrackAssocTool = BTagConfig.getJetCollectionMainAssociatorTool("AntiKt4EMTopo") + self.BTagTool = BTagConfig.getJetCollectionTool("AntiKt4EMTopo") + self.BTagSecVertexing = BTagConfig.getJetCollectionSecVertexingTool("AntiKt4EMTopo") + self.TaggerBaseNames = BTagConfig.getJetCollectionSecVertexingToolAttribute("SecVtxFinderxAODBaseNameList", "AntiKt4EMTopo") + + +########################################### +# For split configuration +########################################### + +class BtagFexSplit (TrigBtagFexMT): + __slots__ = [] + + def __init__(self, instance, version, algo, name): + super( BtagFexSplit, self ).__init__( name ) + + mlog = logging.getLogger('BtagHypoConfig.py') + + AllowedInstances = ["EF", "MuJetChain"] + AllowedVersions = ["2012"] + AllowedAlgos = ["EFID"] + + if instance not in AllowedInstances : + mlog.error("Instance "+instance+" is not supported!") + return None + + if version not in AllowedVersions : + mlog.error("Version "+version+" is not supported!") + return None + + self.JetKey = "SplitJet" + if instance=="MuJetChain" : + self.JetKey = "FarawayJet" + instance = "EF" + + self.PriVtxKey = "xPrimVx" + self.UsePriVtxKeyBackup = True + self.PriVtxKeyBackup = "EFHistoPrmVtx" + self.TrackKey = "InDetTrigTrackingxAODCnv_Bjet_IDTrig" + + # IMPORT OFFLINE TOOLS + self.setupOfflineTools = True + if self.setupOfflineTools : + if BTagConfigSetupStatus == None : + self.setupOfflineTools = False + else : + self.BTagTrackAssocTool = BTagConfig.getJetCollectionMainAssociatorTool("AntiKt4EMTopo") + self.BTagTool = BTagConfig.getJetCollectionTool("AntiKt4EMTopo") + self.BTagSecVertexing = BTagConfig.getJetCollectionSecVertexingTool("AntiKt4EMTopo") + self.TaggerBaseNames = BTagConfig.getJetCollectionSecVertexingToolAttribute("SecVtxFinderxAODBaseNameList", "AntiKt4EMTopo") + + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMTConfig.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMTConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..e6e9ecc70cf0188505458a38c126feb5ccc0fb78 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMTConfig.py @@ -0,0 +1,122 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigBjetHypo.TrigBjetHypoConf import TrigGSCFexMT +#from TrigBjetHypo.TrigGSCFexTuning import * + +from AthenaCommon.Logging import logging +#from AthenaCommon.SystemOfUnits import mm, GeV + +from AthenaCommon.AppMgr import ToolSvc +#from BTagging.BTaggingFlags import BTaggingFlags +#from BTagging.BTaggingConfiguration import getConfiguration +#BTagConfig = getConfiguration("Trig") +#BTagConfig.PrefixxAODBaseName(False) +#BTagConfig.PrefixVertexFinderxAODBaseName(False) +#BTagConfigSetupStatus = BTagConfig.setupJetBTaggerTool(ToolSvc, "AntiKt4EMTopo", SetupScheme="Trig", TaggerList=BTaggingFlags.TriggerTaggers) +from JetRec.JetRecCalibrationFinder import jrcf +JetConfigSetupStatus = True + +# johns hack +from JetCalibTools.JetCalibToolsConf import JetCalibrationTool + +def getGSCFexInstance( instance, version, algo ): + if instance=="EF" : + return GSCFex( instance=instance, version=version, algo=algo, name="EFGSCFex_"+algo ) + +def getGSCFexSplitInstance( instance, version, algo): + return GSCFexSplit( instance=instance, version=version, algo=algo, name=instance+"GSCFexSplit_"+algo ) + + +class GSCFex (TrigGSCFexMT): + __slots__ = [] + + def __init__(self, instance, version, algo, name): + super( GSCFex, self ).__init__( name ) + + mlog = logging.getLogger('BtagHypoConfig.py') + + AllowedInstances = ["EF"] + AllowedVersions = ["2012"] + AllowedAlgos = ["EFID"] + + if instance not in AllowedInstances : + mlog.error("Instance "+instance+" is not supported!") + return None + + if version not in AllowedVersions : + mlog.error("Version "+version+" is not supported!") + return None + + self.JetKey = "EFJet" + self.PriVtxKey = "EFHistoPrmVtx" + self.TrackKey = "InDetTrigTrackingxAODCnv_Bjet_EFID" + + # IMPORT OFFLINE TOOLS + self.setupOfflineTools = True + if self.setupOfflineTools : + if JetConfigSetupStatus == None : + self.setupOfflineTools = False + else : + self.JetGSCCalibrationTool = jrcf.find("AntiKt", 0.4, "EMTopo", "ajg", "reco", "Kt4") + print self.JetGSCCalibrationTool + + +########################################### +# For split configuration +########################################### + +class GSCFexSplit (TrigGSCFexMT): + __slots__ = [] + + def __init__(self, instance, version, algo, name): + super( GSCFexSplit, self ).__init__( name ) + + mlog = logging.getLogger('BtagHypoConfig.py') + + AllowedInstances = ["EF", "MuJetChain"] + AllowedVersions = ["2012"] + AllowedAlgos = ["EFID"] + + if instance not in AllowedInstances : + mlog.error("Instance "+instance+" is not supported!") + return None + + if version not in AllowedVersions : + mlog.error("Version "+version+" is not supported!") + return None + + self.JetKey = "SplitJet" + if instance=="MuJetChain" : + self.JetKey = "FarawayJet" + instance = "EF" + + self.PriVtxKey = "xPrimVx" #"EFHistoPrmVtx" + self.TrackKey = "InDetTrigTrackingxAODCnv_Bjet_IDTrig" + + # IMPORT OFFLINE TOOLS + self.setupOfflineTools = True + if self.setupOfflineTools : + if JetConfigSetupStatus == None : + self.setupOfflineTools = False + else : + #self.GSCCalibrationTool = jrcf.find("AntiKt", 0.4, "EMTopo", "ajg", "reco", "Kt4") + #print self.GSCCalibrationTool + myGSCTool = JetCalibrationTool("myJCTool_trigger", + JetCollection="AntiKt4EMTopo", + ConfigFile="JES_data2016_data2015_Recommendation_Dec2016_rel21.config", + CalibSequence="JetArea_EtaJES_GSC_Insitu", + RhoKey="HLTKt4EMTopoEventShape", + IsData=True, + #DoTrigger = True + ) + from AthenaCommon.AppMgr import ToolSvc + ToolSvc += myGSCTool + self.JetGSCCalibrationTool = myGSCTool + print "Printing GSCCalibrationTool" + print self.JetGSCCalibrationTool + #JetCalibrationTool("myJCTool_trigger", + # IsData=True, + # ConfigFile="JES_2015dataset_recommendation_Feb2016.config", + # CalibSequence="JetArea_EtaJES_GSC", + # JetCollection="AntiKt4EMTopo") + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0deea27a2d93cc409fdf80b6497f6bf45f9eef24 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.cxx @@ -0,0 +1,96 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "GaudiKernel/Property.h" +#include "TrigBjetEtHypoAlg.h" + +using namespace TrigCompositeUtils; + +TrigBjetEtHypoAlg::TrigBjetEtHypoAlg( const std::string& name, + ISvcLocator* pSvcLocator ) : + ::HypoBase( name, pSvcLocator ) {} + +TrigBjetEtHypoAlg::~TrigBjetEtHypoAlg() +{} + +StatusCode TrigBjetEtHypoAlg::initialize() +{ + ATH_MSG_INFO ( "Initializing " << name() << "..." ); + + ATH_MSG_DEBUG( "Initializing Tools" ); + ATH_CHECK( m_hypoTools.retrieve() ); + // ATH_CHECK( m_etHypoTools.retrieve() ); + + ATH_MSG_DEBUG( "Initializing HandleKeys" ); + CHECK( m_bTagKey.initialize() ); + CHECK( m_roisKey.initialize() ); + + CHECK( m_decisionsKey.initialize() ); + + ATH_MSG_INFO("Initializing TrigBjetEtHypoAlg"); + + ATH_MSG_DEBUG( "declareProperty review:" ); + ATH_MSG_DEBUG( " " << m_roisKey ); + ATH_MSG_DEBUG( " " << m_bTagKey ); + + return StatusCode::SUCCESS; +} + +StatusCode TrigBjetEtHypoAlg::finalize() { + return StatusCode::SUCCESS; +} + +StatusCode TrigBjetEtHypoAlg::execute_r( const EventContext& context ) const { + ATH_MSG_DEBUG ( "Executing " << name() << "..." ); + SG::ReadHandle< xAOD::BTaggingContainer > bTagHandle = SG::makeHandle( m_bTagKey, context ); + SG::ReadHandle< TrigRoiDescriptorCollection > roisHandle = SG::makeHandle( m_roisKey, context ); + + std::unique_ptr< DecisionContainer > decisions = std::make_unique< DecisionContainer >(); + std::unique_ptr< DecisionAuxContainer > aux = std::make_unique< DecisionAuxContainer >(); + decisions->setStore( aux.get() ); + + // prepare decision storage ( we could simplify it ) + // Lidija: should be checked once more + size_t counter = 0; + // ---->>>>>> + xAOD::BTaggingContainer::const_iterator bTagIter = bTagHandle->begin(); + for ( ; bTagIter != bTagHandle->end(); ++bTagIter, ++counter ) { + TrigCompositeUtils::Decision *d = newDecisionIn( decisions.get() ); + d->setObjectLink( "feature", ElementLink<xAOD::BTaggingContainer>( m_bTagKey.key(), counter ) ); + d->setObjectLink( "roi", ElementLink<TrigRoiDescriptorCollection>( m_roisKey.key(), counter ) ); + } + + + size_t index = 0; + for ( ; index < decisions->size(); ++index ) { + + const xAOD::BTagging *bTag = bTagHandle->at( index ); + const TrigRoiDescriptor *roiDescriptor = roisHandle->at( index ); + TrigCompositeUtils::Decision *decision = decisions->at( index ); + + /* // TO BE CHANGED + for ( const ToolHandle< TrigBjetEtHypoTool >& tool : m_hypoTools ) { + // interface of the tool needs to be suitable for current system, so no TrigComposite + // also no support for the multi-electrons yet ( will be additional method ) + if ( tool->decide( bTag, roiDescriptor ) ) { + addDecisionID( tool->decisionId(), decision ); + ATH_MSG_DEBUG( " + " << tool->name() ); + } else { + ATH_MSG_DEBUG( " - " << tool->name() ); + } + } + */ + } + + { + SG::WriteHandle< TrigCompositeUtils::DecisionContainer > handle = SG::makeHandle( m_decisionsKey, context ); + CHECK( handle.record( std::move( decisions ), std::move( aux ) ) ); + } + + return StatusCode::SUCCESS; +} + + + + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..3cbcf5e456016a53d522c3aaa6dd5bded35c7f7f --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlg.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef TRIGBJETHYPO_TRIGBJETETHYPOALG_H +#define TRIGBJETHYPO_TRIGBJETETHYPOALG_H 1 + +#include <string> + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" +#include "DecisionHandling/TrigCompositeUtils.h" + +#include "xAODBTagging/BTaggingAuxContainer.h" +#include "xAODBTagging/BTaggingContainer.h" +#include "xAODBTagging/BTagging.h" + + +#include "TrigBjetEtHypoTool.h" +#include "DecisionHandling/HypoBase.h" + +/** + * @class Implements b-jet selection for the new HLT framework + * @brief + **/ + +class TrigBjetEtHypoAlg + : public ::HypoBase +{ + public: + + TrigBjetEtHypoAlg( const std::string& name, ISvcLocator* pSvcLocator ); + + virtual ~TrigBjetEtHypoAlg(); + + virtual StatusCode initialize() override; + virtual StatusCode execute_r( const EventContext& context ) const override; + virtual StatusCode finalize() override; + + private: + TrigBjetEtHypoAlg(); + ToolHandleArray< TrigBjetEtHypoTool > m_hypoTools {this,"HypoTools",{},"Hypo Tools"}; + + private: + SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roisKey {this,"RoIsKey","RoIs","Key for RoIs"}; + SG::ReadHandleKey< xAOD::BTaggingContainer> m_bTagKey {this,"BTaggingKey","BTagging","Key for BTagging"}; + + SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_decisionsKey {this,"DecisionsKey","BjetHypoDecisions","Output key for Btag Kypo Decisions"}; +}; + +#endif //> !TRIGBJETHYPO_TRIGBJETETHYPOALG_H diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.cxx new file mode 100755 index 0000000000000000000000000000000000000000..737a53be92c65f70495fbe8d29bc342194531a72 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.cxx @@ -0,0 +1,98 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// ************************************************ +// +// NAME: TrigBjetEtHypo.cxx +// PACKAGE: Trigger/TrigHypothesis/TrigBjetEtHypo +// +// AUTHOR: Carlo Varni +// EMAIL: carlo.varni@ge.infn.it +// +// ************************************************ + +#include "src/TrigBjetEtHypoTool.h" + +TrigBjetEtHypoTool::TrigBjetEtHypoTool( const std::string& type, + const std::string& name, + const IInterface* parent ) : + AthAlgTool( type, name, parent ), + m_id( HLT::Identifier::fromToolName( name ) ) {} + +// ----------------------------------------------------------------------------------------------------------------- + +TrigBjetEtHypoTool::~TrigBjetEtHypoTool() {} + +// ----------------------------------------------------------------------------------------------------------------- + +StatusCode TrigBjetEtHypoTool::initialize() { + ATH_MSG_INFO("Initializing TrigBjetEtHypoTool"); + + ATH_MSG_DEBUG( "declareProperty review:" ); + ATH_MSG_DEBUG( " " << m_acceptAll ); + ATH_MSG_DEBUG( " " << m_etCalibration ); + ATH_MSG_DEBUG( " " << m_etThreshold ); + ATH_MSG_DEBUG( " " << m_gscThreshold ); + + ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_id ); + return StatusCode::SUCCESS; +} + + +// ----------------------------------------------------------------------------------------------------------------- + +bool TrigBjetEtHypoTool::decide( const xAOD::Jet* jet ) const { + ATH_MSG_DEBUG( "Executing TrigBjetEtHypoTool " ); + return true; + /* + bool pass = false; + + // AcceptAll declare property setting - no need to save it in TrigPassBit, but instead it will go into decission, where we can save also properties and attach them to objects + if ( m_acceptAll ) + ATH_MSG_DEBUG( "REGTEST: AcceptAll property is set: taking all events" ); + else + ATH_MSG_DEBUG( "REGTEST: AcceptAll property not set: applying the selection" ); + + ATH_MSG_DEBUG( "EtHypo on Jet " << jet->p4().Et() ); + ATH_MSG_DEBUG( " Threshold " << m_etThreshold ); + + float et = jet->p4().Et(); + + if ( m_acceptAll ) { + ATH_MSG_DEBUG( "REGTEST: AcceptAll property is set: taking all events" ); + ATH_MSG_DEBUG( "REGTEST: Trigger decision is 1" ); + pass = true; + } else { + ATH_MSG_DEBUG( "REGTEST: EF jet with et = " << et ); + ATH_MSG_DEBUG( "REGTEST: Requiring EF jets to satisfy Et > " << m_etThreshold ); + + if (et >= m_etThreshold) + pass = true; + + ATH_MSG_DEBUG( "REGTEST: Pass " << pass ); + } + + if (pass) { + ATH_MSG_DEBUG( "Selection cut satisfied, accepting the event" ); + } + else { + ATH_MSG_DEBUG( "Selection cut not satisfied, rejecting the event" ); + } + + ATH_MSG_DEBUG( "REGTEST: Trigger decision is " << pass ); + + + return pass; + */ +} + + +// ----------------------------------------------------------------------------------------------------------------- + + +StatusCode TrigBjetEtHypoTool::finalize() { + ATH_MSG_INFO( "Finalizing TrigBjetEtHypoTool" ); + return StatusCode::SUCCESS; +} + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.h new file mode 100755 index 0000000000000000000000000000000000000000..886abee1dde978c46f8abc3a3a09b14007f88b93 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoTool.h @@ -0,0 +1,72 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// ************************************************ +// +// NAME: TrigBjetEtHypoTool.h +// PACKAGE: Trigger/TrigHypothesis/TrigBjetEtHypo +// +// AUTHOR: Carlo Varni +// EMAIL: Carlo.Varni@ge.infn.it +// +// ************************************************ + +#ifndef TRIGBJETHYPO_TRIGBJETETHYPOTOOL_H +#define TRIGBJETHYPO_TRIGBJETETHYPOTOOL_H 1 + +#include "DecisionHandling/HLTIdentifier.h" +#include "DecisionHandling/TrigCompositeUtils.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "TrigSteeringEvent/TrigRoiDescriptor.h" + +#include "xAODJet/Jet.h" +#include "xAODJet/JetContainer.h" + +static const InterfaceID IID_TrigBjetEtHypoTool("TrigBjetEtHypoTool",1,0); + + +class TrigBjetEtHypoTool : virtual public ::AthAlgTool { + + public: + + /** @brief Constructor. */ + TrigBjetEtHypoTool (const std::string& type, + const std::string& name, + const IInterface* parent ); + /** @brief Destructor. */ + virtual ~TrigBjetEtHypoTool (); + + StatusCode initialize() override; + StatusCode finalize() override; + + static const InterfaceID& interfaceID(); + + TrigCompositeUtils::DecisionID decisionId() const { + return m_id.numeric(); + } + + bool decide( const xAOD::Jet* ) const; + + private: + HLT::Identifier m_id; + + /** @brief DeclareProperty: if acceptAll flag is set to true, every event is taken. */ + Gaudi::Property< bool > m_acceptAll {this,"AcceptAll",false,"if acceptAll flag is set to true, every event is taken"}; + /** @brief DeclareProperty: Et calibration on which to apply cut */ + Gaudi::Property< std::string > m_etCalibration {this,"EtCalibration","Split","Et calibration [Split or Gsc] on which to apply cut"}; + /** @brief DeclareProperty: Et threshold cut. */ + Gaudi::Property< float > m_etThreshold {this,"EtThreshold",0.0,"Et threshold cut"}; + /** @brief DeclareProperty: Gsc threshold cut. */ + Gaudi::Property< float > m_gscThreshold {this,"GscThreshold",0.0,"Gsc threshold cut"}; + +}; + +inline const InterfaceID& TrigBjetEtHypoTool::interfaceID() +{ + return IID_TrigBjetEtHypoTool; +} + + +#endif // !TRIGBJETHYPO_TRIGBJETETHYPOTOOL_H + diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.cxx index a49b5b907ca64cc9f9bd8a8ecd6d0a8346d272cc..cac4d7a2cc2fa2577a92956a8e4401f4ae06333f 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlg.cxx @@ -20,6 +20,7 @@ StatusCode TrigBjetHypoAlg::initialize() ATH_MSG_DEBUG( "Initializing Tools" ); ATH_CHECK( m_hypoTools.retrieve() ); + // ATH_CHECK( m_etHypoTools.retrieve() ); ATH_MSG_DEBUG( "Initializing HandleKeys" ); CHECK( m_bTagKey.initialize() ); @@ -27,6 +28,12 @@ StatusCode TrigBjetHypoAlg::initialize() CHECK( m_decisionsKey.initialize() ); + ATH_MSG_INFO("Initializing TrigBjetHypoAlg"); + + ATH_MSG_DEBUG( "declareProperty review:" ); + ATH_MSG_DEBUG( " " << m_roisKey ); + ATH_MSG_DEBUG( " " << m_bTagKey ); + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.cxx index 8833595b787f5058066d149136606de7e14a0509..7d662f4998372776b4d3d34f52ac8c64095c872d 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.cxx @@ -23,7 +23,7 @@ TrigBjetHypoTool::TrigBjetHypoTool( const std::string& type, const std::string& name, const IInterface* parent ) : AthAlgTool( type, name, parent ), - m_id( name ) {} + m_id( HLT::Identifier::fromToolName( name ) ) {} // ----------------------------------------------------------------------------------------------------------------- @@ -37,13 +37,11 @@ StatusCode TrigBjetHypoTool::initialize() { ATH_MSG_INFO("Initializing TrigBjetHypoTool"); - ATH_MSG_DEBUG( "declareProperty review:" ); - ATH_MSG_DEBUG( " AcceptAll = " << m_acceptAll ); - ATH_MSG_DEBUG( " MethodTag = " << m_methodTag ); - ATH_MSG_DEBUG( " UseBeamSpotFlag = " << m_useBeamSpotFlag ); - - if (m_xcutMV2c20 != -20) ATH_MSG_DEBUG( " CutMV2c20 = " << m_xcutMV2c20 ); - if (m_xcutMV2c10 != -20) ATH_MSG_DEBUG( " CutMV2c10 = " << m_xcutMV2c10 ); + ATH_MSG_DEBUG( "declareProperty review:" ); + ATH_MSG_DEBUG( " " << m_acceptAll ); + ATH_MSG_DEBUG( " " << m_methodTag ); + ATH_MSG_DEBUG( " " << m_useBeamSpotFlag ); + ATH_MSG_DEBUG( " " << m_bTaggingCut ); // Retrieve Tools // ===================================== @@ -134,7 +132,7 @@ bool TrigBjetHypoTool::decide( const xAOD::BTagging* bTag, const TrigRoiDescrip double x = bTag->auxdata<double>("MV2c20_discriminant"); ATH_MSG_DEBUG(" MV2c20 x = " << x); - if(x>m_xcutMV2c20) { + if(x>m_bTaggingCut) { //HLT::markPassing(bitsEF, (*trigBTagging), trigBTaggingContainer); // xBits->markPassing((*trigBTagging),trigBTaggingContainer,true); ATH_MSG_DEBUG(" ==> Passed "); @@ -153,14 +151,14 @@ bool TrigBjetHypoTool::decide( const xAOD::BTagging* bTag, const TrigRoiDescrip double x = bTag->auxdata<double>("MV2c10_discriminant"); ATH_MSG_DEBUG(" MV2c10 x = " << x); - if(x>m_xcutMV2c10) { - //HLT::markPassing(bitsEF, (*trigBTagging), trigBTaggingContainer); - // xBits->markPassing((*trigBTagging),trigBTaggingContainer,true); - ATH_MSG_DEBUG(" ==> Passed "); - result = true; - } - else { - ATH_MSG_DEBUG(" ==> Failed "); + if(x>m_bTaggingCut) { + //HLT::markPassing(bitsEF, (*trigBTagging), trigBTaggingContainer); + // xBits->markPassing((*trigBTagging),trigBTaggingContainer,true); + ATH_MSG_DEBUG(" ==> Passed "); + result = true; + } + else { + ATH_MSG_DEBUG(" ==> Failed "); } } // } diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.h index 433d780ff51df63deb235b91e2be3329834e3066..fdae3d1101f96f51fe4ba6b09641c906e5880390 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoTool.h @@ -102,8 +102,7 @@ class TrigBjetHypoTool : virtual public ::AthAlgTool { /** @brief DeclareProperty: list of likelihood methods to be effectively used to perform the selection. */ Gaudi::Property< std::string > m_methodTag {this,"MethodTag","","list of likelihood methods to be effectively used to perform the selection"}; /** @brief DeclareProperty: lower bound of the discriminant variable to be selected (if flag acceptAll is set to false) for MV2 tagger. */ - Gaudi::Property< float > m_xcutMV2c20 {this,"CutMV2c20",-20,"lower bound of the discriminant variable to be selected for MV2 tagger"}; - Gaudi::Property< float > m_xcutMV2c10 {this,"CutMV2c10",-20,"lower bound of the discriminant variable to be selected for MV2 tagger"}; + Gaudi::Property< float > m_bTaggingCut {this,"BTaggingCut",-20,"lower bound of the discriminant variable to be selected for b-tagging"}; // Not sure if needed /** @brief to check the beam spot flag status. */ diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx index cf0f96ff07af1efa674cde7b83dde264724e4ab8..996892ce8d9d505014f718066cbb880c49ec8de7 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx @@ -61,9 +61,16 @@ StatusCode TrigBtagFexMT::initialize() { ATH_MSG_INFO( "Initializing TrigBtagFexMT, version " << PACKAGE_VERSION ); // declareProperty overview - ATH_MSG_DEBUG( "declareProperty review:" ); - ATH_MSG_DEBUG( " UseBeamSpotFlag = " << m_useBeamSpotFlag ); - ATH_MSG_DEBUG( " Offline Taggers = " << m_TaggerBaseNames ); + ATH_MSG_DEBUG( "declareProperty review:" ); + ATH_MSG_DEBUG( " " << m_useBeamSpotFlag ); + ATH_MSG_DEBUG( " " << m_TaggerBaseNames ); + ATH_MSG_DEBUG( " " << m_JetContainerKey ); + ATH_MSG_DEBUG( " " << m_VertexContainerKey ); + ATH_MSG_DEBUG( " " << m_BackUpVertexContainerKey ); + ATH_MSG_DEBUG( " " << m_TrackParticleContainerKey ); + ATH_MSG_DEBUG( " " << m_outputBTaggingContainerKey ); + ATH_MSG_DEBUG( " " << m_outputVertexContainerKey ); + ATH_MSG_DEBUG( " " << m_outputBtagVertexContainerKey ); ATH_MSG_DEBUG( "Initialising ReadHandleKeys" ); ATH_CHECK( m_JetContainerKey.initialize() ); diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFexMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFexMT.cxx index ff4be9a641af40d36e4a4fc8e7050630ca3f351b..156923459f178acac74c5b9c993bb25bcdc7665b 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFexMT.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigGSCFexMT.cxx @@ -50,6 +50,12 @@ StatusCode TrigGSCFexMT::initialize() { ATH_MSG_INFO( "Initializing TrigGSCFexMT, version " << PACKAGE_VERSION ); // declareProperty overview + ATH_MSG_DEBUG( "declareProperty review:" ); + ATH_MSG_DEBUG( " " << m_JetContainerKey ); + ATH_MSG_DEBUG( " " << m_VertexContainerKey ); + ATH_MSG_DEBUG( " " << m_TrackParticleContainerKey ); + ATH_MSG_DEBUG( " " << m_jetOutputKey ); + ATH_MSG_DEBUG( "Initializing ReadHandleKeys" ); ATH_CHECK( m_JetContainerKey.initialize() ); ATH_CHECK( m_VertexContainerKey.initialize() ); diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx index e8a2b70ea502c658fe2f25ba8b065089e4dcf181..adbdde59cbfa747b8d178fd8ba4445a2059e5a98 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx @@ -9,9 +9,13 @@ #include "TrigBjetHypo/TrigSuperRoiBuilderAllTE.h" #include "TrigBjetHypo/TrigBjetEtHypo.h" #include "TrigBjetHypo/TrigFarawayJetFinderAllTE.h" + #include "../TrigBjetHypoAlg.h" #include "../TrigBjetHypoTool.h" - +#include "../TrigBjetEtHypoAlg.h" +#include "../TrigBjetEtHypoTool.h" +#include "..//TrigGSCFexMT.h" +#include "../TrigBtagFexMT.h" DECLARE_COMPONENT( TrigBjetHypo ) DECLARE_COMPONENT( TrigBjetFex ) @@ -24,6 +28,10 @@ DECLARE_COMPONENT( TrigJetSplitterAllTE ) DECLARE_COMPONENT( TrigSuperRoiBuilderAllTE ) DECLARE_COMPONENT( TrigBjetEtHypo ) DECLARE_COMPONENT( TrigFarawayJetFinderAllTE ) + DECLARE_COMPONENT( TrigBjetHypoAlg ) DECLARE_COMPONENT( TrigBjetHypoTool ) - +DECLARE_COMPONENT( TrigBjetEtHypoAlg ) +DECLARE_COMPONENT( TrigBjetEtHypoTool ) +DECLARE_COMPONENT( TrigGSCFexMT ) +DECLARE_COMPONENT( TrigBtagFexMT ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt index 0e45b08800605b7b193847c20150f74657df2178..094202cef784b55c2b0f0535de4784e3a8b8d13b 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt +++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt @@ -144,6 +144,13 @@ atlas_add_test( l1sim PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_l1sim ) +file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_bJetMenu ) +atlas_add_test( bJetMenu + SCRIPT test/test_bjet_menu.sh + PROPERTIES TIMEOUT 500 + EXTRA_PATTERNS "-s TriggerSummaryStep.*HLT_.*|TriggerMonitorFinal.*HLT_.*" + PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_bJetMenu ) + atlas_install_joboptions( share/*.py ) atlas_install_data( share/*.ref ) atlas_install_python_modules( python/*.py ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/bjetMenuDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/bjetMenuDefs.py new file mode 100644 index 0000000000000000000000000000000000000000..65558e55834e6ce0af7edf927c8cd49f59be78c3 --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/bjetMenuDefs.py @@ -0,0 +1,94 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# + +from AthenaCommon.Constants import VERBOSE,DEBUG,INFO + +# My idea would be to create three steps, thus three different hypoTools +# 1 TFT + Jet Reco + j cut +# 2 Precision Tracking + GSC + gsc cut +# 3 BTagging + +def getBJetSequence( step ): + if step == "j": + return bJetStep1Sequence() + if step == "gsc": + return bJetSequence() + if step == "bTag": + return bJetSequence() + return None + +# ==================================================================================================== +# step 1: jet reco and cut on 'j' threshold +# ==================================================================================================== + +def bJetStep1Sequence(): + # menu components + from AthenaCommon.CFElements import parOR, seqAND, seqOR, stepSeq + from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence + + # input maker + from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestInputMaker + InputMakerAlg = HLTTest__TestInputMaker("BJetInputMaker") + InputMakerAlg.OutputLevel = DEBUG + InputMakerAlg.LinkName = "initialRoI" + InputMakerAlg.Output = 'FSJETRoIs' + + # Construct jets ( how do I impose split or non-split configuration ? ) + from TrigUpgradeTest.jetDefs import jetRecoSequence + (recoSequence, sequenceOut) = jetRecoSequence( InputMakerAlg.Output ) + + # hypo + from TrigBjetHypo.TrigBjetHypoConf import TrigBjetEtHypoAlg + from TrigBjetHypo.TrigBjetEtHypoTool import TrigBjetEtHypoToolFromName + hypo = TrigBjetEtHypoAlg("TrigBjetEtHypoAlg") + hypo.OutputLevel = DEBUG +# hypo.RoIsKey = sequenceOut + + # Sequence + BjetAthSequence = seqAND("BjetAthSequence",[InputMakerAlg,recoSequence]) + + return MenuSequence( Sequence = BjetAthSequence, + Maker = InputMakerAlg, + Hypo = hypo, + HypoToolGen = TrigBjetEtHypoToolFromName ) + + +# ==================================================================================================== +# step 2: precision tracking, gsc calibration and cut on gsc-corrected threshold +# ==================================================================================================== + +# ==================================================================================================== +# step 3: secondary vertex and b-tagging +# ==================================================================================================== + +def bJetSequence(): + # menu components + from AthenaCommon.CFElements import parOR, seqAND, seqOR, stepSeq + from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence + + # input maker + from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestInputMaker + InputMakerAlg = HLTTest__TestInputMaker("BJetInputMaker") + InputMakerAlg.OutputLevel = DEBUG + InputMakerAlg.LinkName = "initialRoI" + InputMakerAlg.Output = 'FSJETRoIs' + + # Construct jets ( how do I impose split or non-split configuration ? ) + from TrigUpgradeTest.jetDefs import jetRecoSequence + (recoSequence, sequenceOut) = jetRecoSequence( InputMakerAlg.Output ) + + # Hypo + from TrigBjetHypo.TrigBjetHypoConf import TrigBjetHypoAlg + from TrigBjetHypo.TrigBjetHypoTool import TrigBjetHypoToolFromName + hypo = TrigBjetHypoAlg("TrigBjetHypoAlg") + hypo.OutputLevel = DEBUG + hypo.RoIsKey = sequenceOut + + # Sequence + BjetAthSequence = seqAND("BjetAthSequence",[InputMakerAlg,recoSequence]) + + return MenuSequence( Sequence = BjetAthSequence, + Maker = InputMakerAlg, + Hypo = hypo, + HypoToolGen = TrigBjetHypoToolFromName ) + diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/bjet.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/bjet.menu.py new file mode 100644 index 0000000000000000000000000000000000000000..ae2d77bb247e94543419f70b0b61ac967bdbb3de --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/bjet.menu.py @@ -0,0 +1,52 @@ +# +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# + +# import flags +include("TrigUpgradeTest/testHLT_MT.py") + +########################################## +# menu +########################################## +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep + +# We should retrieve all the steps here +#from TrigUpgradeTest.bjetMenuDefs import BjetGscSequence,BjetNoGscSequence +#from TrigUpgradeTest.bjetMenuDefs import BjetSequence, BjetSplitSequence + +from TrigUpgradeTest.bjetMenuDefs import getBJetSequence +step1 = ChainStep("Step1", [getBJetSequence('j')]) +step3 = ChainStep("Step3", [getBJetSequence('bTag')]) + +testChains = [ + Chain(name='HLT_j35_gsc45_boffperf_split' , Seed="L1_J20", ChainSteps=[step1,step3] ), + Chain(name='HLT_j35_gsc45_bmv2c1070_split', Seed="L1_J20", ChainSteps=[step1,step3] ), + Chain(name='HLT_j35_gsc45_bmv2c1070' , Seed="L1_J20", ChainSteps=[step1,step3] ) + ] + +################################# + +topSequence.L1DecoderTest.prescaler.Prescales = ["HLT_j35_gsc45_boffperf_split:1", + "HLT_j35_gsc45_bmv2c1070_split:1", + "HLT_j35_gsc45_bmv2c1070:1"] + + + +########################################## +# CF construction +########################################## + +##### Make all HLT ####### +from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree +makeHLTTree(testChains) + + + +########################################## +# Some debug +########################################## +from AthenaCommon.AlgSequence import dumpSequence +dumpSequence(topSequence) + + + diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_bjet_menu.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_bjet_menu.sh new file mode 100755 index 0000000000000000000000000000000000000000..b97b8b8224fcb1ae9abfedca76d54d61dc679b4d --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_bjet_menu.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# art-type: build +# art-ci: master + +athena --threads=1 --skipEvents=10 --evtMax=20 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/bjet.menu.py diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuChains.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuChains.py index ce91c61aeb781d628ce88e450c6e0c2b7cddeecf..4f832fa2b3d4cb54fd697bd8cb461f4c6ab952db 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuChains.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuChains.py @@ -17,7 +17,10 @@ ChainDictionary ={ 'HLT_e8' : ['HLT_e8'], 'HLT_e7_etcut': ['HLT_e7_etcut'], 'HLT_mu6_e3_etcut': ['HLT_mu6', 'HLT_e3_etcut'], 'HLT_e3_etcut_mu6': ['HLT_e3_etcut', 'HLT_mu6'], - 'HLT_g5_etcut' : ['HLT_g5_etcut'] + 'HLT_g5_etcut' : ['HLT_g5_etcut'], + 'HLT_j35_gsc45_boffperf_split' : ['HLT_j35_gsc45_boffperf_split'], + 'HLT_j35_gsc45_bmv2c1070_split' : ['HLT_j35_gsc45_bmv2c1070_split'], + 'HLT_j35_gsc45_bmv2c1070' : ['HLT_j35_gsc45_bmv2c1070'] }