Commit c2ba0cff authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'xAODPrimitivesPythonHelper-master-20200527' into 'master'

xAODPrimitives Python Helper, master branch (2020.05.27.)

See merge request atlas/athena!33202
parents ce976319 dc33e688
......@@ -18,3 +18,6 @@ atlas_add_dictionary( xAODPrimitivesDict
atlas_add_test( ut_xAOD_primitives_enums_test
SOURCES test/ut_xAOD_primitives_enums_test.cxx
LINK_LIBRARIES xAODPrimitives )
# Install files from the package.
atlas_install_python_modules( python/*.py )
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Make sure that the dictionary is loaded.
import ROOT
ROOT.xAOD.Iso.ROOT6_NamespaceAutoloadHook()
# Declare the xAODIso type.
xAODIso = ROOT.xAOD.Iso
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// $Id: IsolationType.h 718726 2016-01-20 12:10:22Z dzhang $
#ifndef XAODPRIMITIVES_ISOLATIONTYPE_H
#define XAODPRIMITIVES_ISOLATIONTYPE_H
......@@ -100,8 +97,6 @@ namespace xAOD {
default: return "[Unknown IsolationType]";
}
}
struct ROOT6_NamespaceAutoloadHook{};
} // namespace Iso
......
<!-- $Id: selection.xml 615648 2014-09-08 16:35:14Z schaffer $ -->
<!-- Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -->
<lcgdict>
<!-- Enums -->
<enum pattern="xAOD::Iso::*" />
<class name="xAOD::Iso::ROOT6_NamespaceAutoloadHook" />
<struct name="xAOD::Iso::ROOT6_NamespaceAutoloadHook" />
</lcgdict>
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODPrimitivesDict.h 636772 2014-12-18 15:33:07Z mnowak $
#ifndef XAODPRIMITIVES_XAODPRIMITIVESDICT_H
#define XAODPRIMITIVES_XAODPRIMITIVESDICT_H
// Local include(s).
#include "xAODPrimitives/IsolationType.h"
#include "xAODPrimitives/IsolationCorrection.h"
#include "xAODPrimitives/IsolationFlavour.h"
#include "xAODPrimitives/IsolationConeSize.h"
#endif // XAODPRIMITIVES_XAODPRIMITIVESDICT_H
namespace xAOD {
namespace Iso {
/// Struct helping with auto-loading this dictionary
struct ROOT6_NamespaceAutoloadHook {};
} // namespace Iso
} // namespace xAOD
#endif // XAODPRIMITIVES_XAODPRIMITIVESDICT_H
......@@ -198,13 +198,10 @@ def ConstituentPileupIso(privateSeq):
UseEMScale = True,
addCaloExtensionDecoration = False)
ToolSvc += TimePFCSSKCaloIsolationTool
import ROOT, cppyy
# Need to be sure base dict is loaded first.
cppyy.loadDictionary('xAODCoreRflxDict')
cppyy.loadDictionary('xAODPrimitivesDict')
isoPar = ROOT.xAOD.Iso
# Import the xAOD isolation parameters.
from xAODPrimitives.xAODIso import xAODIso as isoPar
from IsolationAlgs.IsolationAlgsConf import IsolationBuilder
isoBuilderLC = IsolationBuilder(
name = "isoBuilderLC",
......
......@@ -42,10 +42,8 @@ print (CaloIsoTool)
ToolSvc += CaloIsoTool
import ROOT, cppyy
cppyy.loadDictionary('xAODCoreRflxDict')
cppyy.loadDictionary('xAODPrimitivesDict')
isoPar = ROOT.xAOD.Iso
# Import the xAOD isolation parameters.
from xAODPrimitives.xAODIso import xAODIso as isoPar
deco_ptcones = [isoPar.ptcone40, isoPar.ptcone30]
deco_topoetcones = [isoPar.topoetcone40, isoPar.topoetcone20]
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#********************************************************************
# SUSY4.py
# reductionConf flag SUSY4 in Reco_tf.py
......@@ -199,10 +200,7 @@ TrackIsoTool500.TrackSelectionTool.CutLevel= "Loose"
ToolSvc += TrackIsoTool500
from DerivationFrameworkSUSY.DerivationFrameworkSUSYConf import DerivationFramework__trackIsolationDecorator
import ROOT, cppyy
cppyy.loadDictionary('xAODCoreRflxDict')
cppyy.loadDictionary('xAODPrimitivesDict')
isoPar = ROOT.xAOD.Iso
from xAODPrimitives.xAODIso import xAODIso as isoPar
Pt1000IsoTrackDecorator = DerivationFramework__trackIsolationDecorator(name = "Pt1000IsoTrackDecorator",
TrackIsolationTool = TrackIsoTool,
TargetContainer = "InDetTrackParticles",
......
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
##=============================================================================
## Name: HNLFlags.py
......@@ -18,10 +18,10 @@ from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
from AthenaCommon.JobProperties import jobproperties
import AthenaCommon.SystemOfUnits as Units
import ROOT, cppyy
cppyy.loadDictionary('xAODCoreRflxDict')
cppyy.loadDictionary('xAODPrimitivesDict')
from xAODPrimitives.xAODIso import xAODIso
import ROOT
from LongLivedParticleDPDMaker.PrimaryDPDFlags_RPVLLStream import jobproperties
primRPVLLDESDM=jobproperties.PrimaryDPDFlags_RPVLLStream
class doHnlElMu(JobProperty):
......@@ -116,7 +116,7 @@ class promptElectronIsoTypeHnl(JobProperty):
# isolation type for prompt electrons
statusOn = True
allowedTypes = ["int"]
StoredValue = ROOT.xAOD.Iso.ptcone30
StoredValue = xAODIso.ptcone30
pass
primRPVLLDESDM.add_JobProperty(promptElectronIsoTypeHnl)
......@@ -124,7 +124,7 @@ class displacedElectronIsoTypeHnl(JobProperty):
# isolation type for displaced electrons
statusOn = True
allowedTypes = ["int"]
StoredValue = ROOT.xAOD.Iso.ptcone30
StoredValue = xAODIso.ptcone30
pass
primRPVLLDESDM.add_JobProperty(displacedElectronIsoTypeHnl)
......@@ -132,7 +132,7 @@ class promptMuonTypesHnl(JobProperty):
# allowed types of prompt muons
statusOn = True
allowedTypes = ["list"]
StoredValue = [ROOT.xAOD.Muon_v1.Combined]
StoredValue = [ROOT.xAOD.Muon.Combined]
pass
primRPVLLDESDM.add_JobProperty(promptMuonTypesHnl)
......@@ -140,8 +140,8 @@ class displacedMuonTypesHnl(JobProperty):
# allowed types of displaced muons
statusOn = True
allowedTypes = ["list"]
StoredValue = [ROOT.xAOD.Muon_v1.Combined,
ROOT.xAOD.Muon_v1.MuonStandAlone]
StoredValue = [ROOT.xAOD.Muon.Combined,
ROOT.xAOD.Muon.MuonStandAlone]
pass
primRPVLLDESDM.add_JobProperty(displacedMuonTypesHnl)
......
......@@ -207,11 +207,8 @@ tit.TrackSelectionTool.CutLevel = "Loose"
if not useVertices:
tit.VertexLocation = ''
import ROOT, cppyy
# Need to be sure base dict is loaded first.
cppyy.loadDictionary('xAODCoreRflxDict')
cppyy.loadDictionary('xAODPrimitivesDict')
isoPar = ROOT.xAOD.Iso
# Import the xAOD isolation parameters.
from xAODPrimitives.xAODIso import xAODIso as isoPar
# In fact the default isolations are the same for eg and muons : prepare the list here
IsoTypes = [
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaCommon.AppMgr import ToolSvc
from AthenaCommon.AlgSequence import AlgSequence
from RecExConfig.RecFlags import rec
import ROOT, cppyy
cppyy.loadDictionary('xAODCoreRflxDict')
cppyy.loadDictionary('xAODPrimitivesDict')
isoPar = ROOT.xAOD.Iso
# Import the xAOD isolation parameters.
from xAODPrimitives.xAODIso import xAODIso as isoPar
ptconeList = [[isoPar.ptcone40,isoPar.ptcone30,isoPar.ptcone20]]
## Put the new algs before egamma locker... (so right after default IsolationBuilder)
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# inputFile = '/net/s3_datac/dzhang/SAMPLES/R20/MC15/mc15_13TeV.402211.MGPy8EG_A14N_C1C1_800_10_LLE12k.merge.AOD.e4097_a766_a768_r6282/AOD.05819610._000001.pool.root.1'
#
# Input file
......@@ -34,10 +36,8 @@ CaloIsoTool.saveOnlyRequestedCorrections = True
# CaloIsoTool.OutputLevel = 2
ToolSvc += CaloIsoTool
import ROOT, cppyy
cppyy.loadDictionary('xAODCoreRflxDict')
cppyy.loadDictionary('xAODPrimitivesDict')
isoPar = ROOT.xAOD.Iso
# Import the xAOD isolation parameters.
from xAODPrimitives.xAODIso import xAODIso as isoPar
deco_ptcones = [isoPar.ptcone40, isoPar.ptcone30]
deco_topoetcones = [isoPar.topoetcone40, isoPar.topoetcone20]
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
__doc__ = "ToolFactory to instantiate all EMShowerBuilder with default configuration"
__author__ = "Bruno Lenzi"
......@@ -10,12 +10,6 @@ from egammaRec import egammaKeys
from egammaCaloTools.egammaCaloToolsFactories import egammaShowerShape, \
egammaIso
import ROOT, cppyy
# Need to be sure base dict is loaded first.
cppyy.loadDictionary('xAODCoreRflxDict')
cppyy.loadDictionary('xAODPrimitivesDict')
EgammaParameters = ROOT.xAOD.Iso
from CaloIdentifier import SUBCALO
from RecExConfig.RecFlags import rec
......@@ -29,4 +23,3 @@ EMShowerBuilder = ToolFactory( egammaToolsConf.EMShowerBuilder,
ShowerShapeTool = egammaShowerShape,
HadronicLeakageTool = egammaIso,
Print = False)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# configurables for TrigEgammaRec fexes
from AthenaCommon.Logging import logging
......@@ -12,13 +12,9 @@ from egammaRec.Factories import Factory, ToolFactory, FcnWrapper, getPropertyVal
# The following tools use the offline configuration
from egammaTools.egammaToolsFactories import EMConversionBuilder, EGammaAmbiguityTool,EMFourMomBuilder
# Import the xAOD isolation parameters.
from xAODPrimitives.xAODIso import xAODIso as isoPar
# Define the isolation types
import ROOT, cppyy
# Need to be sure base dict is loaded first.
cppyy.loadDictionary('xAODCoreRflxDict')
cppyy.loadDictionary('xAODPrimitivesDict')
isoPar = ROOT.xAOD.Iso
## Be carefull : store them in decreasing dR
TrigEgammaIsoTypes = [ [ int(isoPar.ptcone40), int(isoPar.ptcone30), int(isoPar.ptcone20)],
[ int(isoPar.etcone40), int(isoPar.etcone30), int(isoPar.etcone20)],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment