Commit ee1e2f39 authored by Yeonju Go's avatar Yeonju Go Committed by Frank Winklmeier
Browse files

HLT jet reconstruction for heavy ion events in release 22

parent c699a8ef
......@@ -162,7 +162,7 @@ int HIClusterSubtraction::execute() const
m_subtractorTool->subtract(p4,cl,shape,es_index,m_modulatorTool,eshape);
HIJetRec::setClusterP4(p4,cl,HIJetRec::subtractedClusterState());
if(isOriginPossible)
if(isOriginPossible && m_originCorrection)
{
ATH_MSG_DEBUG("Applying origin correction"
<< std::setw(12) << "Before:"
......
......@@ -865,3 +865,57 @@ def hltCaloTopoClusterCalibratorCfg(flags, name, clustersin, clustersout, **kwar
acc.addEventAlgo(calibrator, primary=True)
return acc
## Heavy Ion
class TrigCaloTowerMaker_hijet (TrigCaloTowerMakerBase):
__slots__ = []
def __init__ (self, name='TrigCaloTowerMaker_hijet'):
super(TrigCaloTowerMaker_hijet, self).__init__(name)
# input to LArTowerBuilder: cells in LArEM and LARHEC
from LArRecUtils.LArRecUtilsConf import LArTowerBuilderTool,LArFCalTowerBuilderTool
larcmbtwrbldr = LArTowerBuilderTool("LArCmbTwrBldr", # noqa: ATL900 (OutputLevel)
CellContainerName = "AllCalo",
IncludedCalos = [ "LAREM", "LARHEC" ],
OutputLevel=ERROR
)
fcalcmbtwrbldr = LArFCalTowerBuilderTool("FCalCmbTwrBldr", # noqa: ATL900 (OutputLevel)
CellContainerName = "AllCalo",
MinimumEt = 0.*MeV,
OutputLevel=ERROR
)
#input to TileTowerBuilder: cells in TILE
from TileRecUtils.TileRecUtilsConf import TileTowerBuilderTool
tilecmbtwrbldr = TileTowerBuilderTool("TileCmbTwrBldr",
CellContainerName = "AllCalo",
#DumpTowers = False,
#DumpWeightMap = False
)
self +=larcmbtwrbldr
self +=fcalcmbtwrbldr
self +=tilecmbtwrbldr
self.NumberOfPhiTowers=64
self.NumberOfEtaTowers=100
self.EtaMin=-5.0
self.EtaMax=5.0
self.DeltaEta=1.2
self.DeltaPhi=1.2
self.TowerMakerTools = [ tilecmbtwrbldr.getFullName(), larcmbtwrbldr.getFullName(), fcalcmbtwrbldr.getFullName() ]
def hltHICaloTowerMakerCfg(flags, name, clustersKey, cellsKey="CaloCells"):
acc = ComponentAccumulator()
from TrigEDMConfig.TriggerEDMRun3 import recordable
alg = CompFactory.TrigCaloTowerMaker(name,
Cells=cellsKey,
CaloClusters=recordable(clustersKey),
)
from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
acc.merge(CaloNoiseCondAlgCfg(flags))
acc.addEventAlgo(alg, primary=True)
return acc
......@@ -162,6 +162,6 @@ auto velmuAccessors = initAccessors<std::vector<ElementLink<xAOD::MuonContainer>
auto velvtxAccessors = initAccessors<std::vector<ElementLink<xAOD::VertexContainer>>>("SV1_vertices");
auto velipAccessors = initAccessors<std::vector<ElementLink<xAOD::IParticleContainer>>>("GhostTrack");
auto velipAccessors = initAccessors<std::vector<ElementLink<xAOD::IParticleContainer>>>("GhostTrack", "HLT_HIClusters_DR8Assoc");
} // namespace TriggerEDMAuxAccessors
......@@ -86,6 +86,9 @@ def getBTagViewName(jetType, jetDetailStr="subresjesgscIS_ftf"):
BTagViewsEMTopo = getBTagViewName("AntiKt4EMTopoJets")
BTagViewsEMPFlow = getBTagViewName("AntiKt4EMPFlowJets")
HIJetVarsToKeep = JetVarsToKeep + ['HLT_HIClusters_DR8Assoc']
HIJetVars = '.'.join(HIJetVarsToKeep)
BTagOutput = ['jetLink','BTagTrackToJetAssociator','Muons',]
BTagOutput_IP2D = ['IP2D_TrackParticleLinks','IP2D_nTrks','IP2D_isDefaults','IP2D_cu','IP2D_bu','IP2D_bc',]
BTagOutput_IP3D = ['IP3D_TrackParticleLinks','IP3D_nTrks','IP3D_isDefaults','IP3D_cu','IP3D_bu','IP3D_bc',]
......@@ -603,6 +606,16 @@ TriggerHLTListRun3 = [
('xAOD::JetContainer#HLT_AntiKt4EMPFlowCSSKJets_nojcalib_ftf', 'BS ESD AODFULL', 'Jet'),
('xAOD::JetAuxContainer#HLT_AntiKt4EMPFlowCSSKJets_nojcalib_ftfAux.'+JetVars, 'BS ESD AODFULL', 'Jet'),
# Heavy ion
('xAOD::JetContainer#HLT_AntiKt4HIJets_Unsubtracted', 'BS ESD AODFULL', 'Jet'),
('xAOD::JetAuxContainer#HLT_AntiKt4HIJets_UnsubtractedAux.'+HIJetVars, 'BS ESD AODFULL', 'Jet'),
('xAOD::JetContainer#HLT_AntiKt4HIJets_sub_noCalib', 'BS ESD AODFULL', 'Jet'),
('xAOD::JetAuxContainer#HLT_AntiKt4HIJets_sub_noCalibAux.'+HIJetVars, 'BS ESD AODFULL', 'Jet'),
('xAOD::JetContainer#HLT_AntiKt4HIJets', 'BS ESD AODFULL', 'Jet'),
('xAOD::JetAuxContainer#HLT_AntiKt4HIJetsAux.'+HIJetVars, 'BS ESD AODFULL', 'Jet'),
# TLA jets
('xAOD::JetContainer#HLT_AntiKt4EMTopoJets_subjesIS_TLA', 'BS JetDS ESD', 'Jet'),
......@@ -642,6 +655,19 @@ TriggerHLTListRun3 = [
('xAOD::HIEventShapeContainer#HLT_HIEventShapeEG', 'BS ESD AODFULL', 'Egamma'),
('xAOD::HIEventShapeAuxContainer#HLT_HIEventShapeEGAux.', 'BS ESD AODFULL', 'Egamma'),
# HI event shape for jet
('xAOD::HIEventShapeContainer#HLTHIEventShape', 'BS ESD AODFULL', 'Jet'),
('xAOD::HIEventShapeAuxContainer#HLTHIEventShapeAux.', 'BS ESD AODFULL', 'Jet'),
('xAOD::HIEventShapeContainer#HLTHIEventShape_iter_egamma', 'BS ESD AODFULL', 'Jet'),
('xAOD::HIEventShapeAuxContainer#HLTHIEventShape_iter_egammaAux.', 'BS ESD AODFULL', 'Jet'),
('xAOD::HIEventShapeContainer#HLTHIEventShapeWeighted', 'BS ESD AODFULL', 'Jet'),
('xAOD::HIEventShapeAuxContainer#HLTHIEventShapeWeightedAux.', 'BS ESD AODFULL', 'Jet'),
('xAOD::HIEventShapeContainer#HLTHIEventShapeWeighted_iter0', 'BS ESD AODFULL', 'Jet'),
('xAOD::HIEventShapeAuxContainer#HLTHIEventShapeWeighted_iter0Aux.', 'BS ESD AODFULL', 'Jet'),
('xAOD::HIEventShapeContainer#HLTHIEventShape_iter1', 'BS ESD AODFULL', 'Jet'),
('xAOD::HIEventShapeAuxContainer#HLTHIEventShape_iter1Aux.', 'BS ESD AODFULL', 'Jet'),
# custom BeamSpot tracks - we don't want to write these out in general so this
# is commented, if we want to write them out at some point, then these lines
# should be uncommented and they should get written out
......
......@@ -55,3 +55,21 @@ def CaloClusterCfg(flags, doLCCalib=False):
)
)
return acc
def HICaloTowerCfg(flags):
""" Create the towers for heavy ion """
acc = ComponentAccumulator()
acc.merge(FSCaloCellCfg(flags))
from TrigCaloRec.TrigCaloRecConfig import hltHICaloTowerMakerCfg
# Then build the clusters
acc.merge(
hltHICaloTowerMakerCfg(
flags,
"HLTHICaloTowerMakerFS",
clustersKey=caloFSRoI,
cellsKey=fs_cells,
)
)
return acc
......@@ -99,3 +99,17 @@ def LCCaloClusterRecoSequence(
OutputClusters = outputName,
OutputCellLinks = outputName+"_cellLinks")
return parOR(name+"RecoSequence", [em_sequence, alg]), str(alg.OutputClusters)
def caloTowerHIRecoSequence(
flags, name="HLTHICaloTowerMakerFS", RoIs=caloFSRoI,
outputName="HLT_HICaloTowerFS"):
""" Create the EM-level fullscan clusters for heavy-ion"""
cell_sequence, cells_name = RecoFragmentsPool.retrieve(cellRecoSequence, flags=None, RoIs=RoIs)
from TrigCaloRec.TrigCaloRecConfig import TrigCaloTowerMaker_hijet
alg = TrigCaloTowerMaker_hijet(
name,
)
alg.RoIs=RoIs
alg.Cells=cells_name
alg.CaloTowers=outputName
return parOR(name+"RecoSequence", [cell_sequence, alg]), str(alg.CaloTowers), str(cells_name)
......@@ -123,7 +123,10 @@ class JetChainConfiguration(ChainConfigurationBase):
# Only one step for now, but we might consider adding steps for
# reclustering and trimming workflows
chainSteps = []
if self.recoDict["trkopt"]=="ftf":
if self.recoDict["ionopt"]=="ion":
jetCollectionName, jetDef, jetHICaloHypoStep = self.getJetHICaloHypoChainStep()
chainSteps.append( jetHICaloHypoStep )
elif self.recoDict["trkopt"]=="ftf":
if self.trkpresel=="nopresel":
clustersKey, caloRecoStep = self.getJetCaloRecoChainStep()
chainSteps.append( caloRecoStep )
......@@ -168,6 +171,16 @@ class JetChainConfiguration(ChainConfigurationBase):
return jetCollectionName, jetDef ,ChainStep(stepName, [jetSeq], multiplicity=[1], chainDicts=[self.dict])
def getJetHICaloHypoChainStep(self):
stepName = "MainStep_HIjet"
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from TriggerMenuMT.HLTMenuConfig.Jet.JetMenuSequences import jetHICaloHypoMenuSequence
jetSeq, jetDef = RecoFragmentsPool.retrieve( jetHICaloHypoMenuSequence,
ConfigFlags, isPerf=self.isPerf, **self.recoDict )
jetCollectionName = str(jetSeq.hypo.Alg.Jets)
return jetCollectionName, jetDef ,ChainStep(stepName, [jetSeq], multiplicity=[1], chainDicts=[self.dict])
def getJetTrackingHypoChainStep(self, clustersKey):
jetDefStr = jetRecoDictToString(self.recoDict)
......@@ -204,6 +217,7 @@ class JetChainConfiguration(ChainConfigurationBase):
'clusterCalib':'em',
'constitMod':'',
'trkopt':'notrk',
'ionopt':'noion',
}
''' #Here you can set custom calibrations for large-R preselections. If you set to LCW you'll get an issue though, as the trigger expects the *same* topocluster collection to be used in the preselection and in the PFlow stage with tracking. Therefore this would need to be adapted, but it might not be so easy...
......
......@@ -51,6 +51,23 @@ def jetCaloRecoSequences( configFlags, RoIs, **jetRecoDict ):
return [topoClusterSequence,jetRecoSeq], jetsOut, jetDef, clustersKey
# This sets up the reconstruction starting from calo towers for heavy ion events.
def jetHICaloRecoSequences( configFlags, RoIs, **jetRecoDict ):
if jetRecoDict["ionopt"] == "noion":
raise ValueError("Heavy-ion calorimeter jet reco called without a ion option!")
# Get the tower reconstruction sequence
from .JetHIConfig import jetHIClusterSequence
jetHIClusterSequence, clustersKey, towerKey = RecoFragmentsPool.retrieve(
jetHIClusterSequence, configFlags, ionopt=jetRecoDict["ionopt"], RoIs=RoIs)
# Get the jet reconstruction sequence including the jet definition and output collection
from .JetHIConfig import jetHIRecoSequence
jetHIRecoSeq, jetsOut, jetDef = RecoFragmentsPool.retrieve(
jetHIRecoSequence, configFlags, clustersKey=clustersKey, towerKey=towerKey, **jetRecoDict )
return [jetHIClusterSequence,jetHIRecoSeq], jetsOut, jetDef, clustersKey
# This sets up the reconstruction where tracks are required.
# Topoclustering will not be scheduled, we just pass in the name of the cluster collection.
def jetTrackingRecoSequences(configFlags, RoIs, clustersKey, **jetRecoDict):
......@@ -157,6 +174,22 @@ def jetCaloHypoMenuSequence(configFlags, isPerf, **jetRecoDict):
if isPerf: hypoType = JetHypoAlgType.PASSTHROUGH
return makeMenuSequence(jetAthSeq,InputMakerAlg,jetsIn,jetDefString,hypoType) ,jetDef
# A full hypo selecting only on heavy ion calo jets (step 1)
# Passing isPerf = True disables the hypo
def jetHICaloHypoMenuSequence(configFlags, isPerf, **jetRecoDict):
InputMakerAlg = getInitialInputMaker()
jetSequences, jetsIn, jetDef, clustersKey = RecoFragmentsPool.retrieve(
jetHICaloRecoSequences,
configFlags, RoIs=caloFSRoI, **jetRecoDict)
strtemp = "HI_{recoAlg}_{jetCalib}"
jetDefString = strtemp.format(**jetRecoDict)
jetAthSeq = seqAND("jetSeqHICaloHypo_"+jetDefString,[InputMakerAlg]+jetSequences)
hypoType = JetHypoAlgType.STANDARD
if isPerf: hypoType = JetHypoAlgType.PASSTHROUGH
return makeMenuSequence(jetAthSeq,InputMakerAlg,jetsIn,jetDefString,hypoType), jetDef
# A full hypo selecting on jets with track reco (step 2)
# To combine either with a presel or a passthrough sequence
# As this does not run topoclustering, the cluster collection
......
......@@ -35,7 +35,7 @@ def interpretJetCalibDefault(recoDict):
else:
raise RuntimeError('No default calibration is defined for %s' % recoDict['recoAlg'])
recoKeys = ['recoAlg','constitType','clusterCalib','constitMod','jetCalib','trkopt']
recoKeys = ['recoAlg','constitType','clusterCalib','constitMod','jetCalib','trkopt','ionopt']
cleaningDict = {
'CLEANlb': 'LooseBad',
......@@ -229,6 +229,22 @@ def defineGroomedJets(jetRecoDict,ungroomedDef):#,ungroomedJetsName):
}[groomAlg]
return groomDef
def defineHIJets(jetRecoDict,clustersKey=None,prefix='',suffix=''):
minpt = {
4: 7000,
10: 50000,
}
jetalg, jetradius, jetextra = interpretRecoAlg(jetRecoDict["recoAlg"])
actualradius = float(jetradius)/10
constitMods = [] # modifiers
jetConstit = []
jetConstit = JetInputConstitSeq( "HLT_HIConstit",xAODType.CaloCluster, constitMods, inputname=clustersKey, outputname=clustersKey,label='HI')
from JetRecConfig.StandardJetConstits import stdConstitDic
stdConstitDic.setdefault(jetConstit.name, jetConstit)
jetDef = JetDefinition( "AntiKt", actualradius, jetConstit, ptmin=minpt[jetradius], prefix=prefix, suffix=suffix)
return jetDef
##########################################################################################
# Generation of modifier lists. So far only calib, but can add track, substructure mods
......
......@@ -5,7 +5,7 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
import pprint
from AthenaCommon.Logging import logging
from ..CommonSequences.FullScanDefs import trkFSRoI, em_clusters
from ..CommonSequences.FullScanDefs import trkFSRoI, em_clusters, caloFSRoI
from .JetRecoConfiguration import jetRecoDictToString
log = logging.getLogger(__name__)
......@@ -25,21 +25,33 @@ def generateChains( flags, chainDict ):
from TrigT2CaloCommon.CaloDef import clusterFSInputMaker
InEventReco = InEventRecoCA(f"Jet_{jetDefStr}Reco",inputMaker=clusterFSInputMaker())
clustersname = em_clusters
# HI jet reconstruction sequence is starting
if jetRecoDict["ionopt"] == "noion":
clustersname = em_clusters
from ..CommonSequences.CaloConfig import CaloClusterCfg
InEventReco.mergeReco(CaloClusterCfg(flags, doLCCalib=False))
from ..CommonSequences.CaloConfig import CaloClusterCfg
InEventReco.mergeReco(CaloClusterCfg(flags, doLCCalib=False))
if jetRecoDict["trkopt"] != "notrk":
from .JetTrackingConfig import JetTrackingCfg
trk_acc, trkcolls = JetTrackingCfg(flags, jetRecoDict["trkopt"], trkFSRoI)
InEventReco.mergeReco(trk_acc)
if jetRecoDict["trkopt"] != "notrk":
from .JetTrackingConfig import JetTrackingCfg
trk_acc, trkcolls = JetTrackingCfg(flags, jetRecoDict["trkopt"], trkFSRoI)
InEventReco.mergeReco(trk_acc)
else:
trkcolls = None
from .JetRecoConfig import JetRecoCfg
jet_acc, jetsOut, jetDef = JetRecoCfg(flags, clustersKey=clustersname, trkcolls=trkcolls, **jetRecoDict)
InEventReco.mergeReco(jet_acc)
else:
trkcolls = None
clustersname = caloFSRoI
from ..CommonSequences.CaloConfig import HICaloTowerCfg
InEventReco.mergeReco(HICaloTowerCfg(flags))
from .JetRecoConfig import JetRecoCfg
jet_acc, jetsOut, jetDef = JetRecoCfg(flags, clustersKey=clustersname, trkcolls=trkcolls, **jetRecoDict)
InEventReco.mergeReco(jet_acc)
from .JetHIConfig import JetHICfg
jet_acc, jetsOut, jetDef = JetHICfg(flags, clustersKey=clustersname, **jetRecoDict)
InEventReco.mergeReco(jet_acc)
acc.merge(InEventReco,stepReco.getName())
#hypo
......
......@@ -11,7 +11,7 @@
from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import SingleMuonGroup,SinglePhotonGroup,MinBiasGroup,MultiMuonGroup,SingleElectronGroup,MultiElectronGroup,PrimaryLegGroup,PrimaryL1MuGroup,SupportLegGroup,SupportGroup
from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import SingleMuonGroup,SinglePhotonGroup,MinBiasGroup,MultiMuonGroup,SingleElectronGroup,MultiElectronGroup,PrimaryLegGroup,PrimaryL1MuGroup,SupportLegGroup,SupportGroup,SingleJetGroup
import TriggerMenuMT.HLTMenuConfig.Menu.PhysicsP1_HI_run3_v1 as HIp1_menu
......@@ -66,6 +66,16 @@ def setupMenu():
ChainProp(name='HLT_g20_loose_L1EM12', stream=[HardProbesStream], groups=SinglePhotonGroup+SupportLegGroup),
]
chains['Jet'] += [
ChainProp(name='HLT_j40_ion_L1RD0_FILLED', l1SeedThresholds=['FSNOSEED'], stream=[HardProbesStream], groups=SingleJetGroup+SupportLegGroup),
ChainProp(name='HLT_j50_ion_L1RD0_FILLED', l1SeedThresholds=['FSNOSEED'], stream=[HardProbesStream], groups=SingleJetGroup+SupportLegGroup),
ChainProp(name='HLT_j60_ion_L1J15', l1SeedThresholds=['FSNOSEED'], stream=[HardProbesStream], groups=SingleJetGroup+PrimaryLegGroup),
ChainProp(name='HLT_j75_ion_L1J20', l1SeedThresholds=['FSNOSEED'], stream=[HardProbesStream], groups=SingleJetGroup+PrimaryLegGroup),
ChainProp(name='HLT_j75_ion_L1J30', l1SeedThresholds=['FSNOSEED'], stream=[HardProbesStream], groups=SingleJetGroup+PrimaryLegGroup),
ChainProp(name='HLT_j85_ion_L1J15', l1SeedThresholds=['FSNOSEED'], stream=[HardProbesStream], groups=SingleJetGroup+PrimaryLegGroup),
ChainProp(name='HLT_j85_ion_L1J30', l1SeedThresholds=['FSNOSEED'], stream=[HardProbesStream], groups=SingleJetGroup+PrimaryLegGroup),
]
chains['MinBias'] += [
ChainProp(name='HLT_mb_sp_L1RD0_FILLED', l1SeedThresholds=['FSNOSEED'], stream=[MinBiasStream], groups=MinBiasGroup+SupportGroup),
]
......
......@@ -135,6 +135,8 @@ JetChainParts = {
['jes', 'subjes', 'subjesIS', 'subjesgscIS', 'subresjesgscIS', 'subjesgsc', 'subresjesgsc', 'nojcalib'],
'scan' : # No longer used?
['FS',],
'ionopt' : # Heavy ion configuration
['noion','ion'],
'trkopt' : # Tracking configuration
['notrk','ftf'],
'trkpresel' : # Tracking preselection
......@@ -285,6 +287,7 @@ JetChainParts_Default = {
'constitMod' :'',
'jetCalib' :'default',
'scan' :'FS',
'ionopt' : 'noion',
'trkopt' : 'notrk',
'trkpresel' : 'nopresel',
#
......
Markdown is supported
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