Skip to content
Snippets Groups Projects
Commit 1e68415e authored by Bruno Lenzi's avatar Bruno Lenzi Committed by Graeme Stewart
Browse files

Fixing config (egammaTools-01-00-62)

parent bdf96159
No related merge requests found
Showing
with 2471 additions and 0 deletions
package egammaTools
use AtlasPolicy AtlasPolicy-*
private
use AthenaBaseComps AthenaBaseComps-* Control
use AthenaKernel AthenaKernel-* Control
use AtlasROOT AtlasROOT-* External
use GaudiInterface GaudiInterface-* External
use AtlasCLHEP AtlasCLHEP-* External
use StoreGate StoreGate-* Control
use Identifier Identifier-* DetectorDescription
use EventKernel EventKernel-* Event
use FourMom FourMom-* Event
use NavFourMom NavFourMom-* Event
use FourMomUtils FourMomUtils-* Event
use EventPrimitives EventPrimitives-* Event
use LArRecConditions LArRecConditions-* LArCalorimeter
use LArTools LArTools-* LArCalorimeter
use TrkVertexFitterInterfaces TrkVertexFitterInterfaces-* Tracking/TrkVertexFitter
use InDetConversionFinderTools InDetConversionFinderTools-* InnerDetector/InDetRecTools
use InDetRecToolInterfaces InDetRecToolInterfaces-* InnerDetector/InDetRecTools
use InDetBeamSpotService InDetBeamSpotService-* InnerDetector/InDetConditions
use CaloGeoHelpers CaloGeoHelpers-* Calorimeter
use CaloEvent CaloEvent-* Calorimeter
use CaloUtils CaloUtils-* Calorimeter
use CaloRec CaloRec-* Calorimeter
use CaloIdentifier CaloIdentifier-* Calorimeter
use CaloInterface CaloInterface-* Calorimeter
use CaloConditions CaloConditions-* Calorimeter
use Particle Particle-* Reconstruction
use IsolationTool IsolationTool-* Reconstruction/RecoTools
#use TrkParameters TrkParameters-* Tracking/TrkEvent
use TrkParticleBase TrkParticleBase-* Tracking/TrkEvent
use TrkTrack TrkTrack-* Tracking/TrkEvent
use TrkEventPrimitives TrkEventPrimitives-* Tracking/TrkEvent
use VxVertex VxVertex-* Tracking/TrkEvent
use TrkTrackLink TrkTrackLink-* Tracking/TrkEvent
#use TrkNeutralParameters TrkNeutralParameters-* Tracking/TrkEvent
use TrkVertexFitterInterfaces TrkVertexFitterInterfaces-* Tracking/TrkVertexFitter
use TrkToolInterfaces TrkToolInterfaces-* Tracking/TrkTools
use ParticleTruth ParticleTruth-* Reconstruction
use egammaInterfaces egammaInterfaces-* Reconstruction/egamma
use egammaRecEvent egammaRecEvent-* Reconstruction/egamma
use egammaUtils egammaUtils-* Reconstruction/egamma
#use egammaConditions egammaConditions-* Reconstruction/egamma
use xAODEgamma xAODEgamma-* Event/xAOD
use xAODTracking xAODTracking-* Event/xAOD
use xAODCaloEvent xAODCaloEvent-* Event/xAOD
use xAODPrimitives xAODPrimitives-* Event/xAOD
use xAODTruth xAODTruth-* Event/xAOD
use xAODEventShape xAODEventShape-* Event/xAOD
use PATCore PATCore-* PhysicsAnalysis/AnalysisCommon
#use ElectronPhotonFourMomentumCorrection ElectronPhotonFourMomentumCorrection-* PhysicsAnalysis/ElectronPhotonID
end_private
private
apply_tag ROOTMathLibs
# macro cppdebugflags '$(cppdebugflags_s)'
# macro_remove componentshr_linkopts "-Wl,-s"
end_private
library egammaTools *.cxx components/*.cxx
apply_pattern component_library
apply_pattern declare_python_modules files="*.py"
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
@mainpage egammaTools Package
This package contains electron and photon reconstruction and identification tools.
These tools are called by main algorithms located in the egammaRec package.
Following tools are used by egammaBuilder for the reconstruction of isolated high-pT electrons and photons :
egammaSwTool : creation of the cluster
EMClusterTool : define cluster size depending on type of object
EMClusterErrorsTool : associate error on cluster quantities
EMShowerBuilder : Calculation of the EM shower shapes. It calls specialized tools located in egammaCaloTools package. When called from an analysis alg or tool it applies a special treatement to retrieve the original shower object to keep the "calorimetric isolation" variables which cannot be recalculated (due to lack of cells)
EMTrackMatchBuilder : performs matching between cluster and a track
EMPIDBuilder : performs identification of the object. It calls specialized tools located in egammaPID package
EMConversionBuilder : retrieve and match conversion objects to an egamma one
EMBremsstrahlungBuilder : retrieve bremsstrahlung. It calls specialized tools BremsstrahlungHit and BremsstrahlungHelix
EMTrkRefitter : retrieve bremsstrahlung. It calls specialized tools like DNA and GSF.
EMConversionRefitter : Refits the conversion tracks with dedicated e+- track fitters (like GSF and DNA) and refits the vertex (rebuilds the vertex from the first measurement in case of single-track conversions). Does not change the original tracks/vertices, but supplies the results in an egDetail.
EMFourMomBuilder : build the 4-momentum of the candidates
Following tools are called by softebuilder for the reconstruction of low-pT and non-isoalted electrons :
EMClusterBuilderFromTrackSETool : take a track, extrapolate it to the EM and build a cluster
egammaSelectClusterSETool : selection based on cluster
egammaSelectSETool : pre and post-selection based on shower shape
EMSofteCombinedTool :calculate variables which combine cluster and track
Tools EMShowerBuilder, EMPIDBuilder, EMFourMomBuilder, EMConversionBuilder and EMBremsstrahlungBuilder are also called by softeBuilder.
@author H. Ma <hma@bnl.gov>
@author A. Poppleton <Alan.Poppleton@cern.ch>
@author S. Rajagopalan <srinir@bnl.gov>
@author M. Wielers <Monika.Wielers@cern.ch>
@author A. Khodinov <khodinov@bnl.gov>
@author F. Derue <derue@lpnhe.in2p3.fr>
@author T. Koffas <Thomas.Koffas@cern.ch>
*/
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# default configuration of the EMBremCollectionBuilder
from AthenaCommon.Logging import logging
from AthenaCommon.SystemOfUnits import *
from AthenaCommon.Constants import *
from AthenaCommon.AppMgr import ServiceMgr
from AthenaCommon.AppMgr import ToolSvc
from AthenaCommon.DetFlags import DetFlags
from RecExConfig.RecFlags import rec
import traceback
#import base class
from egammaTools import egammaToolsConf
from InDetTools import egammaExtrapolator
class egammaBremCollectionBuilder ( egammaToolsConf.EMBremCollectionBuilder ) :
__slots__ = ()
def __init__(self, name="EMBremCollectionBuilder", **kw):
mlog = logging.getLogger(name+'::__init__')
mlog.info("entering")
super(egammaBremCollectionBuilder, self).__init__(name, **kw)
# do the configuration
import egammaRec.EMCommonRefitter
GSFBuildInDetExtrapolator= egammaExtrapolator()
from egammaTrackTools.egammaTrackToolsConf import egammaTrkRefitterTool
GSFRefitterTool = egammaTrkRefitterTool(name = 'GSFRefitterTool',
FitterTool = egammaRec.EMCommonRefitter.GSFTrackFitter,
useBeamSpot = False,
ReintegrateOutliers=True,
OutputLevel =7)
from AthenaCommon.AppMgr import ToolSvc
ToolSvc += GSFRefitterTool
# ----------- load association tool from Inner Detector to handle pixel ganged ambiguities
#
from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
GSFBuildInDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(name = "GSFBuildInDetPrdAssociationTool",
PixelClusterAmbiguitiesMapName = 'PixelClusterAmbiguitiesMap')
ToolSvc += GSFBuildInDetPrdAssociationTool
#
# ----------- Load SummaryTool
#
# Loading Configurable HoleSearchTool
#
from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
GSFBuildHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "GSFBuildHoleSearchTool",
Extrapolator = GSFBuildInDetExtrapolator,
usePixel = DetFlags.haveRIO.pixel_on(),
useSCT = DetFlags.haveRIO.SCT_on(),
CountDeadModulesAfterLastHit = True)
from AthenaCommon.AppMgr import ServiceMgr
if (DetFlags.haveRIO.SCT_on()):
from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsSummarySvc
InDetSCT_ConditionsSummarySvc = SCT_ConditionsSummarySvc(name = "InDetSCT_ConditionsSummarySvc")
ServiceMgr += InDetSCT_ConditionsSummarySvc
GSFBuildHoleSearchTool.SctSummarySvc = ServiceMgr.InDetSCT_ConditionsSummarySvc
else:
GSFBuildHoleSearchTool.SctSummarySvc = None
ToolSvc += GSFBuildHoleSearchTool
print GSFBuildHoleSearchTool
#
# Load BLayer tool
#
GSFBuildTestBLayerTool = None
if DetFlags.haveRIO.pixel_on() :
from InDetTestBLayer.InDetTestBLayerConf import InDet__InDetTestBLayerTool
from PixelConditionsServices.PixelConditionsServicesConf import PixelConditionsSummarySvc
ServiceMgr += PixelConditionsSummarySvc()
GSFBuildTestBLayerTool = InDet__InDetTestBLayerTool(name = "GSFBuildTestBLayerTool",
PixelSummarySvc = ServiceMgr.PixelConditionsSummarySvc,
Extrapolator = GSFBuildInDetExtrapolator)
ToolSvc += GSFBuildTestBLayerTool
print GSFBuildTestBLayerTool
#
# Configurable version of TRT_ElectronPidTools
#
GSFBuildTRT_ElectronPidTool = None
if DetFlags.haveRIO.TRT_on():
from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidTool
GSFBuildTRT_ElectronPidTool = InDet__TRT_ElectronPidTool(name = "GSFBuildTRT_ElectronPidTool")
ToolSvc += GSFBuildTRT_ElectronPidTool
print GSFBuildTRT_ElectronPidTool
#
# Configurable version of PixelToTPIDTOol
#
GSFBuildPixelToTPIDTool = None
if DetFlags.haveRIO.pixel_on():
from PixelToTPIDTool.PixelToTPIDToolConf import InDet__PixelToTPIDTool
GSFBuildPixelToTPIDTool = InDet__PixelToTPIDTool(name = "GSFBuildPixelToTPIDTool")
GSFBuildPixelToTPIDTool.ReadFromCOOL = True
ToolSvc += GSFBuildPixelToTPIDTool
print GSFBuildPixelToTPIDTool
#
# Configrable version of loading the InDetTrackSummaryHelperTool
#
from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
GSFBuildTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(name = "GSFBuildTrackSummaryHelperTool",
AssoTool = GSFBuildInDetPrdAssociationTool,
PixelToTPIDTool = GSFBuildPixelToTPIDTool,
TestBLayerTool = GSFBuildTestBLayerTool,
DoSharedHits = False,
HoleSearch = GSFBuildHoleSearchTool,
usePixel = DetFlags.haveRIO.pixel_on(),
useSCT = DetFlags.haveRIO.SCT_on(),
useTRT = DetFlags.haveRIO.TRT_on())
ToolSvc += GSFBuildTrackSummaryHelperTool
print GSFBuildTrackSummaryHelperTool
#
# Configurable version of TrkTrackSummaryTool: no TRT_PID tool needed here (no shared hits)
#
from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
GSFBuildInDetTrackSummaryTool = Trk__TrackSummaryTool(name = "GSFBuildInDetTrackSummaryTool",
InDetSummaryHelperTool = GSFBuildTrackSummaryHelperTool,
doSharedHits = False,
InDetHoleSearchTool = GSFBuildHoleSearchTool,
TRT_ElectronPidTool = GSFBuildTRT_ElectronPidTool,
PixelToTPIDTool = GSFBuildPixelToTPIDTool)
ToolSvc += GSFBuildInDetTrackSummaryTool
print GSFBuildInDetTrackSummaryTool
#
# --- load patricle creator tool
#
from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
GSFBuildInDetParticleCreatorTool = Trk__TrackParticleCreatorTool(name = "GSFBuildInDetParticleCreatorTool",
KeepParameters = True,
Extrapolator = GSFBuildInDetExtrapolator,
TrackSummaryTool = GSFBuildInDetTrackSummaryTool,
UseTrackSummaryTool = False,
ForceTrackSummaryUpdate = False)
# Otherwise Tracks and CombinedInDetTracks will be different when slimming
ToolSvc += GSFBuildInDetParticleCreatorTool
print GSFBuildInDetParticleCreatorTool
#
# --- do track slimming
#
from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool
GSFBuildInDetTrkSlimmingTool = ConfigurableTrackSlimmingTool(name = "GSFBuildInDetTrackSlimmingTool",
KeepParameters = True,
KeepOutliers = True )
ToolSvc += GSFBuildInDetTrkSlimmingTool
print GSFBuildInDetTrkSlimmingTool
# do the configuration
self.ClusterContainerName="LArClusterEM"
from InDetRecExample.InDetKeys import InDetKeys
self.TrackParticleContainerName=InDetKeys.xAODTrackParticleContainer()
self.PrimaryVertexContainerName=InDetKeys.xAODVertexContainer()
self.TrackParticleTruthCollectionName="TrackParticleTruthCollection"
self.OutputTrkPartContainerName="GSFTrackParticles"
self.OutputTrackContainerName="GSFTracks"
self.TrackRefitTool= GSFRefitterTool
self.TrackParticleCreatorTool=GSFBuildInDetParticleCreatorTool
self.TrackSlimmingTool=GSFBuildInDetTrkSlimmingTool
self.TrackSummaryTool=GSFBuildInDetTrackSummaryTool
# do the configuration (from old EMBremCollectionBuilderBase)
self.minNoSiHits=4
self.broadDeltaEta=0.1 # this is multiplied by 2 for the Candidate Match , so +- 0.2 in eta
self.broadDeltaPhi=0.15 # this is multiplied by 2 for the Candidate Match , so +- 0.3 in phi
self.narrowDeltaEta=0.05
#These have to be relaxed enough for the conversions
self.narrowDeltaPhi=0.05
self.narrowDeltaPhiBrem=0.20 #Dominated by the needs of assymetric conversions
self.narrowDeltaPhiRescale=0.05
self.narrowDeltaPhiRescaleBrem=0.1
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# default configuration of the EMPIDBuilder
from AthenaCommon.Logging import logging
from AthenaCommon.DetFlags import DetFlags
import traceback
from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import electronPIDmenu
from ElectronPhotonSelectorTools.PhotonIsEMSelectorMapping import photonPIDmenu
#import base class
from egammaTools.egammaToolsConf import EMPIDBuilder
import PyCintex
PyCintex.loadDictionary('ElectronPhotonSelectorToolsDict')
from ROOT import egammaPID
class EMPIDBuilderElectronBase ( EMPIDBuilder ) :
__slots__ = ()
def __init__(self, name="EMPIDBuilderElectronBase", menu=electronPIDmenu.menu2012):
EMPIDBuilder.__init__(self,name)
mlog = logging.getLogger(name+'::__init__')
mlog.debug("entering")
from AthenaCommon.AppMgr import ToolSvc
# Electron Selectors
try:
from ElectronPhotonSelectorTools.ConfiguredAsgElectronIsEMSelectors import ConfiguredAsgElectronIsEMSelector
LooseElectronSelector = ConfiguredAsgElectronIsEMSelector("LooseElectronSelector", egammaPID.ElectronIDLoosePP)
ToolSvc+=LooseElectronSelector
MediumElectronSelector = ConfiguredAsgElectronIsEMSelector("MediumElectronSelector", egammaPID.ElectronIDMediumPP)
ToolSvc+=MediumElectronSelector
TightElectronSelector = ConfiguredAsgElectronIsEMSelector("TightElectronSelector", egammaPID.ElectronIDTightPP)
ToolSvc+=TightElectronSelector
except:
mlog.error("could not get configure tools")
print traceback.format_exc()
return False
electronSelectors = [LooseElectronSelector, MediumElectronSelector, TightElectronSelector]
electronSelectorNames = ["Loose", "Medium", "Tight"]
self.selectors=electronSelectors
self.selectorResultNames=electronSelectorNames
class EMPIDBuilderPhotonBase ( EMPIDBuilder ) :
__slots__ = ()
def __init__(self, name="EMPIDBuilderPhotonBase", menu=photonPIDmenu.menu2012):
EMPIDBuilder.__init__(self,name)
mlog = logging.getLogger(name+'::__init__')
mlog.debug("entering")
from AthenaCommon.AppMgr import ToolSvc
# photon Selectors
try:
from ElectronPhotonSelectorTools.ConfiguredAsgPhotonIsEMSelectors import ConfiguredAsgPhotonIsEMSelector
LoosePhotonSelector = ConfiguredAsgPhotonIsEMSelector("LoosePhotonSelector", egammaPID.PhotonIDLoose)
ToolSvc+=LoosePhotonSelector
TightPhotonSelector = ConfiguredAsgPhotonIsEMSelector("TightPhotonSelector", egammaPID.PhotonIDTight)
ToolSvc+=TightPhotonSelector
except:
mlog.error("could not get configure tools")
print traceback.format_exc()
return False
photonSelectors = [LoosePhotonSelector, TightPhotonSelector]
photonSelectorNames = ["Loose", "Tight"]
self.selectors=photonSelectors
self.selectorResultNames=photonSelectorNames
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
__doc__ = "ToolFactory to instantiate all EMShowerBuilder with default configuration"
__author__ = "Bruno Lenzi"
from AthenaCommon.Constants import INFO # OutputLevel
from egammaTools import egammaToolsConf
from egammaRec.Factories import ToolFactory, getPropertyValue
from egammaRec import egammaKeys
from egammaTools.egammaToolsFactories import EMTrackIsolationTool
from egammaCaloTools.egammaCaloToolsFactories import egammaShowerShape, egammaTopoIso, \
egammaIso, egammaIsoPtCorrection
import ROOT, PyCintex
# Need to be sure base dict is loaded first.
PyCintex.loadDictionary('xAODCoreRflxDict')
PyCintex.loadDictionary('xAODEgammaDict')
EgammaParameters = ROOT.xAOD.EgammaParameters
from CaloIdentifier import SUBCALO
from RecExConfig.RecFlags import rec
# TODO: not needed ?
# from CaloDetDescr.CaloDepthToolBase import CaloDepthToolFactory
# theCaloDepthTool=CaloDepthToolFactory(depth='showerdefault')
def configureEDCorrection(tool):
"""SL+JBdV: configure tools and algorithm for energy density correction
(only if doEnergyDensityCorrection = True)"""
# Return if doEnergyDensityCorrection is false
if not getPropertyValue(tool, 'doEnergyDensityCorrection'):
return
# Set OutputLevel to INFO or higher if tool has it too (not working...)
OutputLevel = min(getPropertyValue(tool, 'doEnergyDensityCorrection'), INFO)
try:
from AthenaCommon.AppMgr import ToolSvc
from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAlg
from JetRec.JetRecStandard import jtm
tc=configEventDensityTool("EDEgammaCentralTool", jtm.emget,
0.5,
EtaRange = [-1.5,1.5],
UseAbsoluteEta = True,
UseAreaFourMomentum = True,
VariableName = "DensityForEgammaCentral",
# OutputLevel = OutputLevel,
)
ToolSvc += tc
tf=configEventDensityTool("EDEgammaForwardTool", jtm.emget,
0.5,
EtaRange = [1.5,3.0],
UseAbsoluteEta = True,
UseAreaFourMomentum = True,
VariableName = "DensityForEgammaForward",
# OutputLevel = OutputLevel,
)
ToolSvc += tf
except Exception:
print '\nERROR: could not get handle to EDEgammaXTool'
raise
# add to topsequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += EventDensityAlg("EDEgammaCentralAlg", EventDensityTool = tc)
topSequence += EventDensityAlg("EDEgammaForwardAlg", EventDensityTool = tf)
EMShowerBuilder = ToolFactory( egammaToolsConf.EMShowerBuilder,
postInit = [configureEDCorrection],
TopoCaloClusterInputName="CaloCalTopoCluster",
CellsName = egammaKeys.caloCellKey(),
CaloNums = [SUBCALO.LAREM, SUBCALO.LARHEC, SUBCALO.TILE],
ShowerShapeTool = egammaShowerShape,
EMTopoCaloIsolationTool = egammaTopoIso,
EMCaloIsolationTool = egammaIso,
EMCaloIsoPtCorrectionTool = egammaIsoPtCorrection,
EMTrackIsolationTool = EMTrackIsolationTool,
IsoTypes = [
EgammaParameters.etcone20,
EgammaParameters.etcone30,
EgammaParameters.etcone40,
],
TopoIsoTypes = [] if rec.doHeavyIon() else \
[
EgammaParameters.topoetcone20,
EgammaParameters.topoetcone30,
EgammaParameters.topoetcone40
],
doIsolForTopoSeeded = False,
Print = False)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
__doc__ = "ToolFactory to instantiate EMTrackMatchBuilder with default configuration"
__author__ = "Bruno Lenzi"
import egammaToolsConf
from egammaRec.Factories import FcnWrapper, ToolFactory
from egammaRec import egammaKeys
from RecExConfig.RecFlags import rec
from AthenaCommon.BeamFlags import jobproperties
from egammaTrackTools.egammaTrackToolsFactories import EMExtrapolationTools, ExtrapolateToCaloTool
def appendToEMTrackMatchBuilder(tool):
"add track to calo tool (like it was done in egammaGetter)"
tool += ExtrapolateToCaloTool()
tool += EMExtrapolationTools()
EMTrackMatchBuilder = ToolFactory( egammaToolsConf.EMTrackMatchBuilder,
postInit = [appendToEMTrackMatchBuilder],
TrackParticlesName = egammaKeys.outputTrackParticleKey(),
ExtrapolationTool = EMExtrapolationTools,
broadDeltaEta = 0.1, #candidate match is done in 2 times this so +- 0.2
broadDeltaPhi = 0.15, #candidate match is done in 2 times this so +- 0.3
useLastMeasurement = False, #important for GSF!!!
useCandidateMatch = True,
useScoring = True,
SecondPassRescale = True,
UseRescaleMetric = True,
isCosmics = (jobproperties.Beam.beamType()=="cosmics")
)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
__doc__ = "ToolFactory to instantiate EMVertexBuilder with default configuration"
__author__ = "Bruno Lenzi"
import egammaToolsConf
from egammaRec.Factories import FcnWrapper, ToolFactory
from egammaRec import egammaKeys
from RecExConfig.RecFlags import rec
from AthenaCommon.BeamFlags import jobproperties
from egammaTrackTools.egammaTrackToolsFactories import EMExtrapolationTools, ExtrapolateToCaloTool
from InDetTools import egammaInDetTrackSummaryTool, \
InDet__SingleTrackConversionTool, \
egammaExtrapolator
class VertexFinderToolInstance(FcnWrapper):
def __call__(self):
#
# Configured conversion vertex reconstruction cuts
#
from InDetRecExample.ConfiguredSecondaryVertexCuts import ConfiguredSecondaryVertexCuts
egammaConversionVertexCuts = ConfiguredSecondaryVertexCuts(mode ="EGammaPileUp")
from InDetRecExample.ConfiguredSecVertexFinding import ConfiguredSecVertexFinding
theemvertexfindertool=ConfiguredSecVertexFinding (prefix = "egammaConversion",
VertexCuts = egammaConversionVertexCuts,
TrackParticles = egammaKeys.outputTrackParticleKey(),
SecVertices = egammaKeys.outputConversionKey(),
Extrapolator = egammaExtrapolator(),
TrackSummaryTool = egammaInDetTrackSummaryTool(),
printConfig = True)
return theemvertexfindertool.toolInstance()
EMVertexBuilder = ToolFactory( egammaToolsConf.EMVertexBuilder,
InputTrackParticleContainerName = egammaKeys.outputTrackParticleKey(),
OutputConversionContainerName = egammaKeys.outputConversionKey(),
VertexFinderTool = VertexFinderToolInstance(),
SingleTrackConversionTool = InDet__SingleTrackConversionTool,
ExtrapolationTool = EMExtrapolationTools)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
__doc__ = "ToolFactories to instantiate InDet tools for egamma with default configuration"
__author__ = "Bruno Lenzi"
from egammaRec.Factories import FcnWrapper, ToolFactory
#########
# What used to be egammaRec/python/EMCommonExtrapolator
def configureExtrapolator( egammaExtrapolator ):
from AthenaCommon.AppMgr import ToolSvc
egammaExtrapolator.DoCaloDynamic = False # this turns off dynamic calculation of eloss in calorimeters
# all left to MaterialEffects/EnergyLossUpdators
from TrkExTools.TrkExToolsConf import Trk__MaterialEffectsUpdator as MaterialEffectsUpdator
AtlasMaterialEffectsUpdator = MaterialEffectsUpdator(name = 'AtlasMaterialEffectsUpdator')
ToolSvc += AtlasMaterialEffectsUpdator #default material effects updator
NoElossMaterialEffectsUpdator = MaterialEffectsUpdator(name = 'NoElossMaterialEffectsUpdator')
NoElossMaterialEffectsUpdator.EnergyLoss = False
ToolSvc += NoElossMaterialEffectsUpdator
# setup MaterialEffectsUpdator arrays
MyUpdators = []
MyUpdators += [AtlasMaterialEffectsUpdator] # for ID
MyUpdators += [NoElossMaterialEffectsUpdator] # for Calo
# MyUpdators += [NoElossMaterialEffectsUpdator] # for muon
MySubUpdators = []
MySubUpdators += [AtlasMaterialEffectsUpdator.name()] # for ID
MySubUpdators += [NoElossMaterialEffectsUpdator.name()] # for Calo
MySubUpdators += [NoElossMaterialEffectsUpdator.name()] # for muon
egammaExtrapolator.MaterialEffectsUpdators = MyUpdators
egammaExtrapolator.SubMEUpdators = MySubUpdators
from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
egammaExtrapolator = ToolFactory(AtlasExtrapolator,
postInit=[configureExtrapolator],
name = 'egammaExtrapolator')
#########
# What used to be egammaRec/python/EMCommonTrackSummary.py
#
# ----------- load association tool from Inner Detector to handle pixel ganged ambiguities
#
from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
egammaInDetPrdAssociationTool = ToolFactory( InDet__InDetPRD_AssociationToolGangedPixels,
doPrint = True,
name = "egammaInDetPrdAssociationTool",
PixelClusterAmbiguitiesMapName = 'PixelClusterAmbiguitiesMap')
#
# Loading Configurable HoleSearchTool
#
from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
egammaInDetHoleSearchTool = ToolFactory( InDet__InDetTrackHoleSearchTool,
doPrint = True,
name = "egammaInDetHoleSearchTool",
Extrapolator = egammaExtrapolator)
#
# Load the InDetTrackSummaryHelperTool
#
from AthenaCommon.DetFlags import DetFlags
from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
egammaInDetTrackSummaryHelperTool = ToolFactory( InDet__InDetTrackSummaryHelperTool,
doPrint = True,
name = "egammaInDetSummaryHelper",
AssoTool = egammaInDetPrdAssociationTool,
DoSharedHits = False,
HoleSearch = egammaInDetHoleSearchTool,
usePixel = DetFlags.haveRIO.pixel_on(),
useSCT = DetFlags.haveRIO.SCT_on(),
useTRT = DetFlags.haveRIO.TRT_on() )
#
from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
egammaInDetTrackSummaryTool = ToolFactory( Trk__TrackSummaryTool,
doPrint = True,
name = "egammaInDetTrackSummaryTool",
InDetSummaryHelperTool = egammaInDetTrackSummaryHelperTool,
doSharedHits = False,
InDetHoleSearchTool = egammaInDetHoleSearchTool)
#########
# What used to be egammaRec/python/EMCommonSingleTrackConversionTool.py
def getTrkExtrapolator():
import egammaRec.EMCommonRefitter
return egammaRec.EMCommonRefitter.egTrkExtrapolator
# Helper Tool
#
from InDetConversionFinderTools import InDetConversionFinderToolsConf
InDet__ConversionFinderUtils = ToolFactory( InDetConversionFinderToolsConf.InDet__ConversionFinderUtils)
#
# Single track conversion tool
#
InDet__SingleTrackConversionTool = ToolFactory( InDetConversionFinderToolsConf.InDet__SingleTrackConversionTool,
name = "CPSingleTrackConversionTool",
ConversionFinderHelperTool = InDet__ConversionFinderUtils,
TrackSummaryTool = egammaInDetTrackSummaryTool,
Extrapolator = FcnWrapper(getTrkExtrapolator),
MinInitialHitRadius = 70.,
MinRatioOfHLhits = 0.95)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
import egammaToolsConf
from egammaRec.Factories import FcnWrapper, ToolFactory
from egammaRec import egammaKeys
from LArBadChannelTool import LArBadChannelToolConf
LArBadChanTool = ToolFactory( LArBadChannelToolConf.LArBadChanTool )
from CaloTools import CaloAffectedToolDefault as CATD
CaloAffectedToolDefault = ToolFactory( CATD.CaloAffectedToolDefault )
egammaOQFlagsBuilder = ToolFactory( egammaToolsConf.egammaOQFlagsBuilder,
QCellCut = 4000.,
QCellHECCut = 60000.,
QCellSporCut = 4000.,
LArQCut = 0.8,
TCut = 10.,
TCutVsE = 2.,
CellsName = egammaKeys.caloCellKey(),
LArBadChannelTool = LArBadChanTool,
affectedTool = CaloAffectedToolDefault)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
__doc__ = "ToolFactories to instantiate all egammaTools with default configuration"
__author__ = "Bruno Lenzi"
import egammaToolsConf
from egammaRec.Factories import FcnWrapper, ToolFactory, FullNameWrapper
from egammaRec import egammaKeys
from RecExConfig.RecFlags import rec
def configureClusterCorrections(swTool):
"Add attributes ClusterCorrectionToolsXX to egammaSwTool object"
from CaloClusterCorrection.CaloSwCorrections import make_CaloSwCorrections
from CaloRec.CaloRecMakers import _process_tools
clusterTypes = dict(
Ele35='ele35', Ele55='ele55', Ele37='ele37',
Gam35='gam35_unconv', Gam55='gam55_unconv',
Econv35='gam35_conv', Econv55='gam55_conv', Econv37='gam37_conv'
)
for attrName, clName in clusterTypes.iteritems():
x = 'ClusterCorrectionTools' + attrName
if not hasattr(swTool, x) or getattr(swTool, x):
continue
y = make_CaloSwCorrections(clName, suffix='EG', cells_name=egammaKeys.caloCellKey() )
setattr(swTool, x, _process_tools (swTool, y) )
#-------------------------
egammaSwTool = ToolFactory(egammaToolsConf.egammaSwTool,
postInit=[configureClusterCorrections])
EMClusterTool = ToolFactory(egammaToolsConf.EMClusterTool,
OutputClusterContainerName = egammaKeys.outputClusterKey(),
ElectronContainerName = egammaKeys.outputElectronKey(),
PhotonContainerName = egammaKeys.outputPhotonKey(),
ClusterCorrectionToolName = FullNameWrapper(egammaSwTool)
)
egammaCheckEnergyDepositTool = ToolFactory(egammaToolsConf.egammaCheckEnergyDepositTool,
UseThrFmax=True,
ThrF0max=0.9,
ThrF1max=0.8,
ThrF2max=0.98,
ThrF3max=0.8)
from IsolationTool.IsolationToolConf import xAOD__TrackIsolationTool
EMTrackIsolationTool = ToolFactory( egammaToolsConf.EMTrackIsolationTool,
TrackIsolationTool = ToolFactory(xAOD__TrackIsolationTool),
useBremAssoc = True)
from EMBremCollectionBuilder import egammaBremCollectionBuilder
from egammaTrackTools.egammaTrackToolsFactories import EMExtrapolationTools
EMBremCollectionBuilder = ToolFactory( egammaBremCollectionBuilder,
name = 'EMBremCollectionBuilder',
ExtrapolationTool = EMExtrapolationTools,
OutputTrackContainerName=egammaKeys.outputTrackKey(),
ClusterContainerName=egammaKeys.inputClusterKey(),
DoTruth=rec.doTruth()
)
EMConversionBuilder = ToolFactory( egammaToolsConf.EMConversionBuilder,
egammaRecContainerName = egammaKeys.outputEgammaRecKey(),
ConversionContainerName = egammaKeys.outputConversionKey(),
ExtrapolationTool = EMExtrapolationTools)
EMAmbiguityTool = ToolFactory( egammaToolsConf.EMAmbiguityTool )
from egammaTrackTools.egammaTrackToolsFactories import convUtils
import EventKernel.ParticleDataType
EMFourMomBuilder = ToolFactory( egammaToolsConf.EMFourMomBuilder,
ConversionUtils = convUtils,
dataType=EventKernel.ParticleDataType.Full )
# Electron Selectors
from EMPIDBuilderBase import EMPIDBuilderElectronBase
ElectronPIDBuilder = ToolFactory( EMPIDBuilderElectronBase, name = "ElectronPIDBuilder")
# Photon Selectors
from EMPIDBuilderBase import EMPIDBuilderPhotonBase
PhotonPIDBuilder = ToolFactory( EMPIDBuilderPhotonBase, name = "PhotonPIDBuilder")
#-------------------------
# Import the factories that are not defined here
from EMShowerBuilder import EMShowerBuilder
from egammaOQFlagsBuilder import egammaOQFlagsBuilder
from EMTrackMatchBuilder import EMTrackMatchBuilder
from EMVertexBuilder import EMVertexBuilder
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CANDIDATEMATCHHELPERS_H
#define CANDIDATEMATCHHELPERS_H
#include <cmath>
#include <iostream>
class CandidateMatchHelpers
{
public:
CandidateMatchHelpers(){}
~CandidateMatchHelpers(){}
double CorrectedEta(double clusterEta,double z_first,bool isEndCap){
//===========================================================//
//These are at the face of the calorimeter
const double Rcalo = 1500;
const double Zcalo = 3700;
double Rclus=Rcalo;
double Zclus=Zcalo;
if(clusterEta!=0){
//eta !=0
double tanthetaclus=(1/cosh(clusterEta))/tanh(clusterEta);
if (isEndCap) {
Rclus=fabs(Zcalo*(tanthetaclus));
//Negative Eta ---> negative Z
if(clusterEta<0){
Zclus = -Zclus;
}
}
else{
if(tanthetaclus!=0){
Zclus=Rcalo/(tanthetaclus);
}
}
}
else{
//eta 0
Zclus=0;
}
//===========================================================//
//correct for a possible shift in the track perigee wrt to (0,0)
double thetaclus_corrected=atan2(Rclus,Zclus-z_first);
double etaclus_corrected = 99999; //if theta =0 or M_PI the eta +-inf this happens when Rclus =0
if(Rclus!=0){
etaclus_corrected = -log(tan(thetaclus_corrected/2));
}
//===========================================================//
return etaclus_corrected;
}
double PhiROT(double Et,double Eta, int charge, double r_first ,bool isEndCap){
//===========================================================//
//Used in order to derive the formula below
const double Rcalo = 1200;
//===========================================================//
// correct phi for extrapolation to calo
double phiRot = 0.0;
double ecCorr = 1.0;
if (isEndCap) {
double ecFactor = 1.0/(0.8*atan(15.0/34.0));
double sinTheta0 = 2.0*atan(exp(-fabs(Eta)));
ecCorr = sinTheta0*sqrt(sinTheta0)*ecFactor;
}
////
double Rscaled =(Rcalo-r_first)/Rcalo;
phiRot = Rscaled*ecCorr*charge*430./(Et);
return phiRot;
}
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef EGAMMATOOLS_CONVVXSORTER_H
#define EGAMMATOOLS_CONVVXSORTER_H
#include "xAODTracking/Vertex.h"
#include "xAODEgamma/EgammaxAODHelpers.h"
/** Sort conversion vertices according to the following criteria:
- Vertices with more Si tracks have priority
- Vertices with more tracks have priority
- Vertices with smaller radii have priority
OLD SCHEME:
- Vertices with 2 tracks have priority over the ones with 1 track
- Vertices with Si + Si tracks have priority (if m_preferSi > 0)
- Vertices with Si + TRT or TRT + TRT depending on m_preferSi
- Vertices with smaller radii have priority
**/
class ConvVxSorter
: public std::binary_function<xAOD::Vertex&, xAOD::Vertex&, bool> {
public:
bool operator()(const xAOD::Vertex& vx1, const xAOD::Vertex& vx2) const
{
xAOD::EgammaParameters::ConversionType convType1, convType2;
convType1 = xAOD::EgammaHelpers::conversionType(&vx1);
convType2 = xAOD::EgammaHelpers::conversionType(&vx2);
if (convType1 != convType2)
{
// Different conversion type, preference to vertices with Si tracks
int nSi1 = xAOD::EgammaHelpers::numberOfSiTracks(convType1);
int nSi2 = xAOD::EgammaHelpers::numberOfSiTracks(convType2);
if (nSi1 != nSi2) return nSi1 > nSi2;
// Same number of Si tracks: either 0 or 1 (Si+TRT vs. Si single)
// For 1 Si track, preference to Si+TRT
if (nSi1 != 0) return convType1 == xAOD::EgammaParameters::doubleSiTRT;
// No Si track, preference to doubleTRT over single TRT
return convType1 == xAOD::EgammaParameters::doubleTRT;
}
// Same conversion type, preference to lower radius
return (vx1.position().perp() < vx2.position().perp());
}
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/********************************************************************
NAME: EMAmbiguityTool.cxx
PACKAGE: offline/Reconstruction/egamma/egammaTrackTools
CREATED: 12/06/2008
AUTHOR : T. Koffas
MODIFIED:
Dec. 28, 2009 (FD) add protections against bad pointers
May 06, 2010 (JM) use expectHitInBLayer for dead pixels
June 06, 2010 (JM) add expectHitInBLayer when tp != conversion tracks
June 07, 2010 (JM) remove LocationOfConversion function
June, 2010 (JM) expand role of tool and change interface
July 18, 2010 (JM) make it return AmbiguityResult instead of bool
Oct. 28, 2010 (JM) make it use expectHitInBLayer from track summary
Nov. 10, 2010 (JM) allow it to use outliers
Feb. 6, 2012 (JM) introduce MEDIUM AR for two-track conversions
Feb. 20, 2014 (BL) xAOD migration, changing logic
********************************************************************/
#include "EMAmbiguityTool.h"
#include "xAODEgamma/EgammaDefs.h"
#include "xAODEgamma/EgammaxAODHelpers.h"
#include "xAODTracking/Vertex.h"
#include "xAODTracking/TrackParticle.h"
EMAmbiguityTool::EMAmbiguityTool(const std::string& type, const std::string& name, const IInterface* parent) :
AthAlgTool(type, name, parent)
{
declareInterface<IEMAmbiguityTool>(this);
//Minimum silicon hits for electron
declareProperty("minNoSiHits", m_MinNoSiHits = 4, "Minimum number of silicon hits to be an electron");
declareProperty("minNoPixHits", m_MinNoPixHits = 2, "Minimum number of Pixel hits to be an electron");
}
EMAmbiguityTool::~EMAmbiguityTool() {}
StatusCode EMAmbiguityTool::initialize() {
ATH_MSG_DEBUG("Initializing " << name() << "...");
return StatusCode::SUCCESS;
}
StatusCode EMAmbiguityTool::finalize() {
return StatusCode::SUCCESS;
}
// ====================================================================
// return value: AuthorElectron, AuthorPhoton, AuthorAmbiguous, AuthorUnknown
unsigned int EMAmbiguityTool::ambiguityResolve(const xAOD::Vertex* vx,
const xAOD::TrackParticle* tp) const
{
uint8_t trkExpectBlayerHit(0), trkBlayerHits(0), trkPixelHits(0), trkSiHits(0);
if (tp && !tp->summaryValue(trkExpectBlayerHit,xAOD::expectBLayerHit))
ATH_MSG_WARNING("Could not retrieve expected BLayer hit from track");
if (tp && !tp->summaryValue(trkBlayerHits,xAOD::numberOfBLayerHits))
ATH_MSG_WARNING("Could not retrieve number of BLayer hits from track");
if (tp && !tp->summaryValue(trkPixelHits,xAOD::numberOfPixelHits))
ATH_MSG_WARNING("Could not retrieve number of pixel hits from track");
if (tp && !tp->summaryValue(trkSiHits, xAOD::numberOfSCTHits))
ATH_MSG_WARNING("Could not retrieve number of SCT hits from track");
trkSiHits += trkPixelHits;
xAOD::EgammaParameters::ConversionType convType(xAOD::EgammaHelpers::conversionType(vx));
bool vxDoubleSi = (convType == xAOD::EgammaParameters::doubleSi);
//See if the Si+Si conversion shares one track with the electron
//if not we might have a trident.
//if yes and the track is not good we definetely matched the conversion as electron.
bool shareTrack=false;
if(tp && trkSiHits>=m_MinNoSiHits && vxDoubleSi){
const xAOD::TrackParticle *trk1 = ( vx->nTrackParticles() ? vx->trackParticle(0) : 0 );
const xAOD::TrackParticle *trk2 = ( vx->nTrackParticles() > 1 ? vx->trackParticle(1) : 0 );
if( (tp==trk1) || (tp==trk2)) {
shareTrack=true;
}
}
ATH_MSG_DEBUG("Vertex, SiSi: " << (vx != 0) << " , " << vxDoubleSi);
ATH_MSG_DEBUG("Track, Si hits, pixel hits, bLayerHits, expectBlayerHit: "
<< (tp != 0) << " , " << (int) trkSiHits << " , " << (int) trkPixelHits
<< " , " << (int) trkBlayerHits << " , " << (int) trkExpectBlayerHit);
ATH_MSG_DEBUG("Share track : " << shareTrack);
//The Electron collection will NOT contain Photons
//The Photon collection will NOT contain Electrons
//So for conversions vs electrons better to go to ambiguous
//except if we are sure.
//Practically a photon here means definetely not Electron
//And vice-versa
//Photon ==> Surely not electron
// - no track
// - or no track with the minimum requirent hits to be an electron
// - or Si+Si vertex and
// - less than minimum pixel hits
// - The electron track is part of the conversion
// In this case we do not want this to be in Electrons
if (!tp ||
trkSiHits<m_MinNoSiHits ||
(vxDoubleSi && trkPixelHits< m_MinNoPixHits && shareTrack)){
ATH_MSG_DEBUG("Returning Photon");
return xAOD::EgammaParameters::AuthorPhoton;
}
//Electron ==> Surely not Photon
// - Track with at least the minimum si hits (previous selection for photons)
// - No vertex Matched
// - Or if a vertex exists and is not Si+Si
// - Either Blayer hit
// - Or 2 or more Pixel hits
// In this case we do not want this to be in Photons
if(!vx ||
(trkBlayerHits && !vxDoubleSi) ||
(trkPixelHits>=m_MinNoPixHits && !vxDoubleSi)){
ATH_MSG_DEBUG("Returning Electron");
return xAOD::EgammaParameters::AuthorElectron;
}
// Ambiguous all else, these will go to both electrons and photons
// This involves a matched Si+Si vertex and a track with both silicon and pixel hits.
// Or a non Si+Si vertex matched and a track with enough Silicon but not Pixel hits
//i.e
//1)
// - A track with minimum Si hits is matched
// - A Si+Si vertex is also matched
// - The track has also the minimum Pixel hit
//2)
// - A track with minimum Si hits is matched
// - A non Si+Si vertex is also matched
// - There is no b-layer hit or
// - Less than the minimum pixel hits
ATH_MSG_DEBUG("Returning Ambiguous");
return xAOD::EgammaParameters::AuthorAmbiguous;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef EMAMBIGUITYTOOL_H
#define EMAMBIGUITYTOOL_H
#include "AthenaBaseComps/AthAlgTool.h"
// #include "GaudiKernel/ToolHandle.h"
#include "egammaInterfaces/IEMAmbiguityTool.h"
#include "xAODTracking/VertexFwd.h"
#include "xAODTracking/TrackParticleFwd.h"
/**
@class EMAmbiguityTool
This tool resolves the electron-converted photon ambiguity.
@author Thomas Koffas
@author Bruno Lenzi
@author Christos Anastopoulos
*/
class EMAmbiguityTool : virtual public IEMAmbiguityTool, public AthAlgTool {
public:
EMAmbiguityTool (const std::string& type,const std::string& name, const IInterface* parent);
virtual ~EMAmbiguityTool();
virtual StatusCode initialize();
virtual StatusCode finalize();
unsigned int ambiguityResolve(const xAOD::Vertex* vx,
const xAOD::TrackParticle* trParticle) const;
private:
/** @brief Minimum number of silicon hits to be an electron */
unsigned int m_MinNoSiHits;
unsigned int m_MinNoPixHits;
};
#endif // EMAMBIGUITYTOOL_H
This diff is collapsed.
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef EMBREMCOLLECTIONBUILDER_H
#define EMBREMCOLLECTIONBUILDER_H
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "egammaInterfaces/IEMBremCollectionBuilder.h"
#include "TrkTrack/TrackCollection.h"
#include "CaloGeoHelpers/CaloPhiRange.h"
class IegammaTrkRefitterTool;
class IegammaCheckEnergyDepositTool;
class IEMExtrapolationTools;
#include "xAODTracking/Vertex.h"
#include "xAODTracking/TrackParticle.h"
#include "xAODTracking/VertexContainer.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "xAODCaloEvent/CaloCluster.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
namespace Trk
{
class ITrackParticleCreatorTool;
class ITrackSlimmingTool;
class ITrackSummaryTool;
}
class CaloCluster;
class EMBremCollectionBuilder : public AthAlgTool,virtual public IEMBremCollectionBuilder{
public:
EMBremCollectionBuilder(const std::string& type, const std::string& name, const IInterface* parent);
~EMBremCollectionBuilder();
virtual StatusCode initialize();
virtual StatusCode finalize();
virtual StatusCode contExecute();
private:
//------------------------------------------------------------------------
// methods
//------------------------------------------------------------------------
//
/** @brief Refit of track */
StatusCode refitTrack(const xAOD::TrackParticle* tmpTrkPart);
/** @brief broad track selection */
bool Select(const xAOD::CaloCluster* cluster,
bool trkTRT,
const xAOD::TrackParticle* track) const;
//------------------------------------------------------------------------
// configurable data members
//------------------------------------------------------------------------
/** @brief The track refitter */
ToolHandle<IegammaTrkRefitterTool> m_trkRefitTool;
/** @brief Tool to create track particle */
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool;
/** @brief Tool to slim tracks */
ToolHandle<Trk::ITrackSlimmingTool> m_slimTool;
/** @brief Tool for Track summary */
ToolHandle<Trk::ITrackSummaryTool> m_summaryTool;
/** @brief Tool for extrapolation */
ToolHandle<IEMExtrapolationTools> m_extrapolationTool;
/** @brier Option to do truth*/
bool m_doTruth;
/** @brief Names of input output collections */
std::string m_clusterContainerName;
std::string m_trackParticleContainerName;
std::string m_trackParticleTruthCollectionName;
std::string m_OutputTrkPartContainerName;
std::string m_OutputTrackContainerName;
std::string m_vxCandidatesPrimaryName;
std::string m_trackAssocName;
/** @Cut on minimum silicon hits*/
int m_MinNoSiHits;
/** @brief broad cut on deltaEta*/
double m_broadDeltaEta;
/** @brief broad cut on deltaPhi*/
double m_broadDeltaPhi;
/** @narrow windows*/
double m_narrowDeltaEta;
double m_narrowDeltaPhi;
double m_narrowDeltaPhiBrem;
double m_narrowRescale;
double m_narrowRescaleBrem;
/** @brief helper for */
CaloPhiRange m_phiHelper;
//collections
const xAOD::TrackParticleContainer* m_trackTES;
// const TrackParticleTruthCollection* m_trackTruthTES;
TrackCollection* m_finalTracks;
xAOD::TrackParticleContainer* m_finalTrkPartContainer;
// std::list<std::pair<TrackParticleTruth, Rec::TrackParticle*> > m_tpTruthMap;
//counters
unsigned int m_AllClusters;
unsigned int m_AllTracks;
unsigned int m_AllTRTTracks;
unsigned int m_AllSiTracks;
unsigned int m_SelectedTracks;
unsigned int m_SelectedTRTTracks;
unsigned int m_SelectedSiTracks;
unsigned int m_FailedFitTracks;
unsigned int m_FailedSiliconRequirFit;
unsigned int m_RefittedTracks;
//------------------------------------------------------------------------
};
#endif // ANA1_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "EMClusterTool.h"
#include "egammaInterfaces/IegammaSwTool.h"
#include "xAODEgamma/EgammaxAODHelpers.h"
#include "xAODCaloEvent/CaloCluster.h"
#include "StoreGate/StoreGateSvc.h"
#include "xAODEgamma/ElectronContainer.h"
#include "xAODEgamma/PhotonContainer.h"
#include "CaloUtils/CaloClusterStoreHelper.h"
#include "CaloUtils/CaloCellDetPos.h"
// =============================================================
EMClusterTool::EMClusterTool(const std::string& type, const std::string& name, const IInterface* parent) :
egammaBaseTool(type, name, parent),
m_storeGate(0),
m_caloCellDetPos(0)
{
declareProperty("ClusterCorrectionToolName", m_ClusterCorrectionToolName = "egammaSwTool/egammaswtool");
declareProperty("OutputClusterContainerName", m_outputClusterContainerName,
"Name of the output cluster container");
declareProperty("ElectronContainerName", m_electronContainerName,
"Name of the input electron container");
declareProperty("PhotonContainerName", m_photonContainerName,
"Name of the input photon container");
declareProperty("DoPositionInCalo", m_doPositionInCalo = true,
"Decorate clusters with positions in calo frame");
declareInterface<IEMClusterTool>(this);
m_caloCellDetPos = new CaloCellDetPos();
}
EMClusterTool::~EMClusterTool() { delete m_caloCellDetPos; }
// const InterfaceID& ClusterTool::interfaceID() {
// return IID_IClusterTool;
// }
// =============================================================
StatusCode EMClusterTool::initialize() {
ATH_MSG_DEBUG("Initializing " << name() << "...");
if (service("StoreGateSvc", m_storeGate).isFailure())
{
ATH_MSG_ERROR("Unable to retrieve pointer to StoreGateSvc");
return StatusCode::FAILURE;
}
// Get the cluster correction tool
m_clusterCorrectionTool = ToolHandle<IegammaSwTool>(m_ClusterCorrectionToolName);
if(m_clusterCorrectionTool.retrieve().isFailure()) {
ATH_MSG_ERROR("Failed to retrieve " << m_clusterCorrectionTool);
return StatusCode::SUCCESS;
}
else {
ATH_MSG_DEBUG("Retrieved tool " << m_clusterCorrectionTool);
}
ATH_MSG_DEBUG("Initialization successful");
return StatusCode::SUCCESS;
}
// =========================================================================
StatusCode EMClusterTool::finalize() {
return StatusCode::SUCCESS;
}
// =========================================================================
StatusCode EMClusterTool::contExecute()
{
// Create output cluster container and register in StoreGate
xAOD::CaloClusterContainer* outputClusterContainer = \
CaloClusterStoreHelper::makeContainer(m_storeGate,
m_outputClusterContainerName,
msg());
if (!outputClusterContainer){
ATH_MSG_ERROR("Failed to record Output Cluster Container "
<< m_outputClusterContainerName);
return StatusCode::FAILURE;
}
// Retrieve electron and photon containers
xAOD::ElectronContainer *electronContainer;
if (m_storeGate->retrieve(electronContainer, m_electronContainerName).isFailure())
{
ATH_MSG_ERROR("Cannot retrieve electron container " << m_electronContainerName);
return StatusCode::FAILURE;
}
xAOD::PhotonContainer *photonContainer;
if (m_storeGate->retrieve(photonContainer, m_photonContainerName).isFailure())
{
ATH_MSG_ERROR("Cannot retrieve photon container " << m_photonContainerName);
return StatusCode::FAILURE;
}
// Loop over electrons and create new clusters
xAOD::EgammaParameters::EgammaType egType = xAOD::EgammaParameters::electron;
for (auto electron : *electronContainer)
setNewCluster(electron, outputClusterContainer, egType);
// Loop over photons and create new clusters
for (auto photon : *photonContainer)
{
egType = (xAOD::EgammaHelpers::isConvertedPhoton(photon) ?
xAOD::EgammaParameters::convertedPhoton :
xAOD::EgammaParameters::unconvertedPhoton);
setNewCluster(photon, outputClusterContainer, egType);
}
if (CaloClusterStoreHelper::finalizeClusters(m_storeGate,
outputClusterContainer,
m_outputClusterContainerName,
msg()).isFailure() )
{
ATH_MSG_ERROR("Failed to finalize Output Cluster Container " <<
m_outputClusterContainerName);
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
// ==========================================================================
void EMClusterTool::setNewCluster(xAOD::Egamma *eg,
xAOD::CaloClusterContainer *outputClusterContainer,
xAOD::EgammaParameters::EgammaType egType)
{
if (!eg) return;
if (!eg->caloCluster())
{
ATH_MSG_DEBUG("egamma object does not have a cluster associated");
return;
}
typedef ElementLink<xAOD::CaloClusterContainer> ClusterLink_t;
xAOD::CaloCluster* cluster =0;
if(eg->author(xAOD::EgammaParameters::AuthorCaloTopo35)) {
cluster = new xAOD::CaloCluster(*(eg->caloCluster()));
}
else {
cluster = makeNewCluster(*(eg->caloCluster()), egType);
}
outputClusterContainer->push_back(cluster);
// Set the link to the new cluster
ClusterLink_t clusterLink(cluster, *outputClusterContainer);
const std::vector<ClusterLink_t> clusterLinks{clusterLink};
eg->setCaloClusterLinks( clusterLinks );
}
// ==========================================================================
xAOD::CaloCluster* EMClusterTool::makeNewCluster(const xAOD::CaloCluster& cluster, xAOD::EgammaParameters::EgammaType egType)
{
//
// Create new cluster based on an existing one
// const CaloCluster* cluster : input cluster
//
// protection against cluster not in barrel nor endcap
if (!cluster.inBarrel() && !cluster.inEndcap() )
{
ATH_MSG_ERROR("Cluster neither in barrel nor in endcap, Skipping cluster");
return 0;
}
if ((int) egType < 0 || egType >= xAOD::EgammaParameters::NumberOfEgammaTypes)
{
ATH_MSG_WARNING("Invalid egamma type");
return 0;
}
bool isBarrel = xAOD::EgammaHelpers::isBarrel(&cluster);
xAOD::CaloCluster::ClusterSize cluSize=xAOD::CaloCluster:: CSize_Unknown;
if (egType == xAOD::EgammaParameters::electron){
cluSize= (isBarrel ? xAOD::CaloCluster::SW_37ele : xAOD::CaloCluster::SW_55ele);
}
else if (egType == xAOD::EgammaParameters::convertedPhoton){
cluSize= (isBarrel ? xAOD::CaloCluster::SW_37Econv : xAOD::CaloCluster::SW_55Econv);
}
else {//(egType == xAOD::EgammaParameters::unconvertedPhoton)
cluSize = (isBarrel ? xAOD::CaloCluster::SW_35gam : xAOD::CaloCluster::SW_55gam);
}
xAOD::CaloCluster* newClus = CaloClusterStoreHelper::makeCluster(cluster.getCellLinks()->getCellContainer(),
cluster.eta0(),cluster.phi0(),
cluSize);
//FIXME/WARNING: The CaloFillRectangularClusterTool does NOT set the overall eta/phi of the cluster
//For regular SW clusters, this is done by CaloClusterUpdate after all corrections are applied
//To maintain the previous behavior, I set the eta/phi of the origial cluster
newClus->setEta(cluster.eta());
newClus->setPhi(cluster.phi());
if (m_clusterCorrectionTool->execute(newClus).isFailure())
ATH_MSG_ERROR("Problem executing cluster correction tool");
if (newClus) fillPositionsInCalo(*newClus);
return newClus;
}
// ==========================================================================
void EMClusterTool::fillPositionsInCalo(xAOD::CaloCluster& cluster)
{
bool isBarrel = xAOD::EgammaHelpers::isBarrel(&cluster);
CaloCell_ID::CaloSample sample = isBarrel ? CaloCell_ID::EMB2 : CaloCell_ID::EME2;
// eta and phi of the cluster in the calorimeter frame
double eta, phi;
m_caloCellDetPos->getDetPosition(sample, cluster.eta(), cluster.phi0(), eta, phi);
cluster.auxdata<float>("etaCalo") = eta;
cluster.auxdata<float>("phiCalo") = phi;
// eta in the second sampling
m_caloCellDetPos->getDetPosition(sample, cluster.etaBE(2), cluster.phiBE(2),
eta, phi);
cluster.auxdata<float>("etas2Calo") = eta;
// eta in the first sampling
sample = isBarrel ? CaloCell_ID::EMB1 : CaloCell_ID::EME1;
m_caloCellDetPos->getDetPosition(sample, cluster.etaBE(1), cluster.phiBE(1),
eta, phi);
cluster.auxdata<float>("etas1Calo") = eta;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef EGAMMATOOLS_EMCLUSTERTOOL_H
#define EGAMMATOOLs_EMCLUSTERTOOL_H
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "egammaInterfaces/IEMClusterTool.h"
#include "egammaBaseTool.h"
#include "xAODCaloEvent/CaloClusterFwd.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
#include "xAODEgamma/EgammaEnums.h"
class IegammaSwTool;
class StoreGateSvc;
class CaloCellDetPos;
/**
@class EMClusterTool
This tool makes the EM CaloCluster used by egamma objects.
It also defines the cluster size
- in barrel
3*7 for electrons
3*7 for converted photons with Rconv<800mm
3*5 for converted photons with Rconv>800mm
3*5 for unconverted photons
- in end-caps
5*5 for electrons
5*5 for converted photons with Rconv<800mm
5*5 for converted photons with Rconv>800mm
5*5 for unconverted photons
and applies the right cluster corrections depending on classification as electron, unconverted photon or converted photon
@author Thomas Koffas
@author F. Derue
@author B. Lenzi
@author C. Anastopoulos
*/
class EMClusterTool : public egammaBaseTool, virtual public IEMClusterTool {
public:
/** @bried constructor */
EMClusterTool (const std::string& type,const std::string& name, const IInterface* parent);
/** @brief destructor */
virtual ~EMClusterTool();
/** @brief initialize method */
virtual StatusCode initialize();
/** @brief execute on container */
virtual StatusCode contExecute();
/** @brief finalize method */
virtual StatusCode finalize();
/** @brief Set new cluster to the egamma object, decorate the new cluster
* with a link to the old one **/
void setNewCluster(xAOD::Egamma *eg,
xAOD::CaloClusterContainer *outputClusterContainer,
xAOD::EgammaParameters::EgammaType egType);
/** @brief creation of new cluster based on existing one **/
virtual xAOD::CaloCluster* makeNewCluster(const xAOD::CaloCluster&, xAOD::EgammaParameters::EgammaType);
/** @brief Decorate cluster with positions in the calorimeter frame **/
void fillPositionsInCalo(xAOD::CaloCluster& cluster);
private:
/** @brief Name of the output cluster container **/
std::string m_outputClusterContainerName;
/** @brief Name of the input electron container **/
std::string m_electronContainerName;
/** @brief Name of the input photon container **/
std::string m_photonContainerName;
/** @brief Tool to handle cluster corrections */
ToolHandle<IegammaSwTool> m_clusterCorrectionTool;
/** @brief Name of tool for cluster corrections */
std::string m_ClusterCorrectionToolName;
/** @brief Decorate clusters with positions in calo frame? **/
bool m_doPositionInCalo;
StoreGateSvc* m_storeGate;
CaloCellDetPos *m_caloCellDetPos;
};
#endif // EGAMMATOOLS_EMCLUSTERTOOL_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/********************************************************************
NAME: EMConversionBuilder.cxx
PACKAGE: offline/Reconstruction/egamma/egammaRec
AUTHORS: D. Zerwas, B. Lenzi
CREATED: Jul, 2005
CHANGES: Mar, 2014 (BL) xAOD migration
PURPOSE: subAlgorithm which creates an EMConversion object.
********************************************************************/
// INCLUDE HEADER FILES:
#include "EMConversionBuilder.h"
#include "ConvVxSorter.h"
#include "egammaInterfaces/IEMExtrapolationTools.h"
#include "xAODTracking/VertexContainer.h"
#include "egammaRecEvent/egammaRecContainer.h"
#include "egammaRecEvent/egammaRec.h"
// END OF HEADER FILES INCLUDE
/////////////////////////////////////////////////////////////////
using CLHEP::GeV;
EMConversionBuilder::EMConversionBuilder(const std::string& type,
const std::string& name,
const IInterface* parent)
: egammaBaseTool(type, name, parent),
m_extrapolationTool("EMExtrapolationTools")
{
// declare interface
declareInterface<IEMConversionBuilder>(this);
// Name of the input conversion container
declareProperty("ConversionContainerName",
m_conversionContainerName="PhotonConversionVertices",
"Name of the input conversion container");
// Name of the input egammaRec container
declareProperty("egammaRecContainerName",
m_egammaRecContainerName="egammaRecs",
"Name of the input egammaRec container");
// Name of the extrapolation tool
declareProperty("ExtrapolationTool",
m_extrapolationTool,
"Handle of the extrapolation tool");
declareProperty("RejectAllTRTConversions", m_rejectAllTRT = false,
"Ignore all conversion vertices containing exclusively TRT-only tracks");
declareProperty("MinTRTHits", m_minTRTHits = 0,
"minimum number of TRT hits for TRT-only tracks (both single and double track conversion vertices)");
declareProperty("MinSiSingleTrackPt", m_minSiSingleTrackPt = 0*GeV,
"minimum pT for Si tracks to be considered single-track conversion vertices");
declareProperty("MinTRTOnlySingleTrackPt", m_minTRTonlySingleTrackPt = 2*GeV,
"minimum pT for TRT-only tracks to be considered single-track conversion vertices");
declareProperty("MinTRTOnlyTrackPt", m_minTRTonlyTrackPt = 0*GeV,
"minimum pT for each track in TRT-only double-track conversion vertices");
declareProperty("MinSumPt", m_minSumPt = 0*GeV,
"minimum sum pT for double track conversion vertices");
}
// =================================================================
// DESTRUCTOR:
EMConversionBuilder::~EMConversionBuilder()
{
}
// ==================================================================
// INITIALIZE METHOD:
StatusCode EMConversionBuilder::initialize()
{
ATH_MSG_DEBUG("Initializing EMConversionBuilder");
// the extrapolation tool
if(m_extrapolationTool.retrieve().isFailure()){
ATH_MSG_ERROR("Cannot retrieve extrapolationTool " << m_extrapolationTool);
return StatusCode::FAILURE;
} else {
ATH_MSG_DEBUG("Retrieved extrapolationTool " << m_extrapolationTool);
}
return StatusCode::SUCCESS;
}
// =============================================================
StatusCode EMConversionBuilder::contExecute()
{
// retrieve Conversion Container
const xAOD::VertexContainer* conversions = 0;
if (evtStore()->contains<xAOD::VertexContainer>(m_conversionContainerName)) {
StatusCode sc = evtStore()->retrieve(conversions,m_conversionContainerName);
if(sc.isFailure()) {
ATH_MSG_WARNING("Could not retrieve Conversion container! EMConversionBuilder will stop.");
return StatusCode::SUCCESS;
}
} else {
ATH_MSG_DEBUG("Could not find conversion container! Acting as if there are 0 conversions.");
}
// retrieve egammaRec container
const EgammaRecContainer* egammaRecs = 0;
if (evtStore()->contains<EgammaRecContainer>(m_egammaRecContainerName)) {
StatusCode sc = evtStore()->retrieve(egammaRecs,m_egammaRecContainerName);
if(sc.isFailure()) {
ATH_MSG_WARNING("Could not retrieve egammaRec container! EMConversionBuilder will stop.");
return StatusCode::SUCCESS;
}
} else {
ATH_MSG_DEBUG("Could not find conversion container! Acting as if there are 0 egammaRecs.");
}
// Extrapolate each vertex (keeping etatCalo, phiAtCalo)
// and try to match to each cluster
// xAOD::Vertex does not have method isAvailable for the moment
// create a lambda function
auto isAvailable = [](const xAOD::Vertex& vertex, std::string name) {
SG::AuxElement::Accessor<float> acc(name, "");
return acc.isAvailable(vertex); } ;
float etaAtCalo, phiAtCalo;
for (unsigned int iVtx = 0; iVtx < conversions->size(); ++iVtx)
{
const xAOD::Vertex *vertex = conversions->at(iVtx);
// Check if vertex was already decorated with etaAtCalo, phiAtCalo
if (isAvailable(*vertex, "etaAtCalo") &&
isAvailable(*vertex, "phiAtCalo") )
{
etaAtCalo = vertex->auxdata<float>("etaAtCalo");
phiAtCalo = vertex->auxdata<float>("phiAtCalo");
}
// check extrapolation, skip vertex in case of failure
else if (!m_extrapolationTool->getEtaPhiAtCalo(vertex, &etaAtCalo, &phiAtCalo))
continue;
for (auto& egRec : *egammaRecs)
{
const xAOD::CaloCluster *cluster = egRec->caloCluster();
if (!m_extrapolationTool->matchesAtCalo(cluster, vertex, etaAtCalo, phiAtCalo))
continue;
const ElementLink< xAOD::VertexContainer > vertexLink( *conversions, iVtx );
// If this is the best (or the first) vertex, push front and keep deltaEta, deltaPhi
if (!egRec->getNumberOfVertices() || ConvVxSorter()(*vertex, *egRec->vertex()))
{
egRec->pushFrontVertex( vertexLink );
egRec->setDeltaEtaVtx( cluster->etaBE(2) - etaAtCalo );
egRec->setDeltaPhiVtx( m_phiHelper.diff(cluster->phiBE(2), phiAtCalo) );
}
else // Not the best vertex, push back
egRec->pushBackVertex( vertexLink );
}
}
return StatusCode::SUCCESS;
}
// =============================================================
StatusCode EMConversionBuilder::hltExecute(egammaRec* egRec, const xAOD::VertexContainer* conversions)
{
if (!egRec || !conversions)
{
ATH_MSG_WARNING("trackExecute: NULL pointer to egammaRec or VertexContainer");
return StatusCode::SUCCESS;
}
// Extrapolate each vertex (keeping etatCalo, phiAtCalo)
// and try to match to each cluster
// xAOD::Vertex does not have method isAvailable for the moment
// create a lambda function
auto isAvailable = [](const xAOD::Vertex& vertex, std::string name) {
SG::AuxElement::Accessor<float> acc(name, "");
return acc.isAvailable(vertex); } ;
float etaAtCalo, phiAtCalo;
for (unsigned int iVtx = 0; iVtx < conversions->size(); ++iVtx)
{
const xAOD::Vertex *vertex = conversions->at(iVtx);
// Check if vertex was already decorated with etaAtCalo, phiAtCalo
if (isAvailable(*vertex, "etaAtCalo") &&
isAvailable(*vertex, "phiAtCalo") )
{
etaAtCalo = vertex->auxdata<float>("etaAtCalo");
phiAtCalo = vertex->auxdata<float>("phiAtCalo");
}
// check extrapolation, skip vertex in case of failure
else if (!m_extrapolationTool->getEtaPhiAtCalo(vertex, &etaAtCalo, &phiAtCalo))
continue;
const xAOD::CaloCluster *cluster = egRec->caloCluster();
if (!m_extrapolationTool->matchesAtCalo(cluster, vertex, etaAtCalo, phiAtCalo))
continue;
const ElementLink< xAOD::VertexContainer > vertexLink( *conversions, iVtx );
// If this is the best (or the first) vertex, push front and keep deltaEta, deltaPhi
if (!egRec->getNumberOfVertices() || ConvVxSorter()(*vertex, *egRec->vertex()))
{
egRec->pushFrontVertex( vertexLink );
egRec->setDeltaEtaVtx( cluster->etaBE(2) - etaAtCalo );
egRec->setDeltaPhiVtx( m_phiHelper.diff(cluster->phiBE(2), phiAtCalo) );
}
else // Not the best vertex, push back
egRec->pushBackVertex( vertexLink );
}
return StatusCode::SUCCESS;
}
// ==================================================================
// FINALIZE METHOD:
StatusCode EMConversionBuilder::finalize()
{
return StatusCode::SUCCESS;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef EGAMMATOOLS_EMCONVERSIONBUILDER_H
#define EGAMMATOOLS_EMCONVERSIONBUILDER_H
/**
@class EMConversionBuilder
EMConversion data object builder. This is an Algorithm class.
Selects conversion vertices reconstructed by the ID software
after matching them to an EM calorimeter cluster.
For normal two-track conversions the original photon track parameters
at the conversion vertex are reconstructed. It is then extrapolated
to the calorimeter and checked whether it matches the cluster.
For single-track conversions, the reconstructed electron track is
extrapolated to the calorimeter.
A TrackToCalo extrapolation tool that can handle both neutral and charged
track parameters (using a Trk::ParametersBase interface) is used throughout.
The extrapolation starts at the last track measurement.
Matching is done in both eta and phi. The eta matching WAS disabled for TRT-only
tracks due to lack of accurate eta prediction BEFORE 12/2011.
@author D. Zerwas
changes: June 16, 2010 (JM) bring some stuff from PhotonRecoveryTool here
Mar, 2014 (BL) xAOD migration and new logic
*/
// INCLUDE HEADER FILES:
#include "GaudiKernel/ToolHandle.h"
#include "egammaBaseTool.h"
#include "egammaInterfaces/IEMConversionBuilder.h"
#include "CaloGeoHelpers/CaloPhiRange.h"
#include "xAODTracking/VertexContainer.h"
class IEMExtrapolationTools;
class EMConversionBuilder : public egammaBaseTool, virtual public IEMConversionBuilder
{
public:
/** @brief Default constructor*/
EMConversionBuilder(const std::string& type,
const std::string& name,
const IInterface* parent);
/** @brief Destructor*/
~EMConversionBuilder();
/** @brief initialize method*/
StatusCode initialize();
/** @brief execute method*/
virtual StatusCode contExecute();
/** @brief execute method*/
virtual StatusCode hltExecute(egammaRec* egRec, const xAOD::VertexContainer* conversions);
/** @brief finalize method*/
StatusCode finalize();
private:
// configuration:
/** @brief Name of conversion container*/
std::string m_conversionContainerName;
/** @brief Name of egammaRec container*/
std::string m_egammaRecContainerName;
/** @brief Helper used to compute angle differences in phi. Corrects within the +/- pi range.*/
CaloPhiRange m_phiHelper;
/** @brief EMExtrapolationTools */
ToolHandle<IEMExtrapolationTools> m_extrapolationTool;
/** @brief Ignore all conversion vertices that contain exclusively TRT-only tracks */
bool m_rejectAllTRT;
/** @brief minimum number of TRT hits for TRT-only tracks (both single and double track conversion vertices) */
int m_minTRTHits;
/** @brief minimum pT for Si tracks to be considered single-track conversion vertices */
double m_minSiSingleTrackPt;
/** @brief minimum pT for TRT-only tracks considered to be single-track conversion vertices */
double m_minTRTonlySingleTrackPt;
/** @brief minimum pT for each tracks in TRT-only double-track conversion vertices */
double m_minTRTonlyTrackPt;
/** @brief minimum sum pT for double track conversion vertices */
double m_minSumPt;
/** @brief Preference to vertices with more Si tracks when chosing a conversion vertex */
int m_preferSi;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment