diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkConfiguration/python/DerivationConfigList.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkConfiguration/python/DerivationConfigList.py index 9b0b7e1215add59fdb6681e4c70e3335a2a87e9f..3057c4227d4115014379e7486f9b3469262be8dc 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkConfiguration/python/DerivationConfigList.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkConfiguration/python/DerivationConfigList.py @@ -140,6 +140,7 @@ from DerivationFrameworkTLA.TLA1 import TLA1Cfg #Heavy Ion group derivations from DerivationFrameworkHI.HION4 import HION4Cfg from DerivationFrameworkHI.HION7 import HION7Cfg +from DerivationFrameworkHI.HION12 import HION12Cfg # NCB derivation running on AODs (for cosmic and BIB studies) from DerivationFrameworkNCB.NCB1 import NCB1Cfg @@ -169,6 +170,6 @@ __all__ = ['TEST1Cfg','TEST2Cfg','TEST3Cfg','TEST4Cfg','TEST5Cfg','TEST6Cfg','TE 'TRIG8Cfg','L1CALO1Cfg', 'MUON1Cfg','MUON5Cfg', 'TLA0Cfg', 'TLA1Cfg', - 'HION4Cfg','HION7Cfg', + 'HION4Cfg','HION7Cfg','HION12Cfg', 'NCB1Cfg' ] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/HION12.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/HION12.py new file mode 100644 index 0000000000000000000000000000000000000000..31c6b0a7990db52a535b347e86964af6c2c686d7 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/HION12.py @@ -0,0 +1,100 @@ +# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration +#!/usr/bin/env python +# HION12.py + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaConfiguration.Enums import MetadataCategory +from AthenaCommon.CFElements import seqAND + +######################################################################################### +#Skiming +def HION12SkimmingToolCfg(flags): + """Configure the example skimming tool""" + from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg + acc = ComponentAccumulator() + + ExtraData = [] + ExtraData += ['xAOD::VertexContainer/PrimaryVertices'] + ExtraData += ['xAOD::JetContainer/AntiKt4EMTopoJets'] + ExtraData += ['xAOD::JetContainer/AntiKt4LCTopoJets'] + ExtraData += ['xAOD::JetContainer/AntiKt4EMPFlowJets'] + ExtraData += ['xAOD::JetContainer/AntiKt4HIJets'] + ExtraData += ['xAOD::JetContainer/AntiKt4HITrackJets'] + ExtraData += ['xAOD::JetContainer/AntiKt10LCTopoJets'] + + acc.addSequence( seqAND("HION12Sequence") ) + acc.getSequence("HION12Sequence").ExtraDataForDynamicConsumers = ExtraData + acc.getSequence("HION12Sequence").ProcessDynamicDataDependencies = True + + #Building jet skimming triggers + from DerivationFrameworkHI import ListTriggers + + objectSelection = '(count(PrimaryVertices.z < 1000) < 10)' + nJetCuts = ListTriggers.HION12nJetCuts2018() + MB_triggers = ListTriggers.HION12MBtriggers2018() + triggers = ListTriggers.HION12triggers2018() + + expression = '( (' + ' || '.join(triggers+MB_triggers) + ') && '+objectSelection+ ' && ' + '(' + ' || '.join(nJetCuts) + ')' + ')' + + tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags)) + acc.addPublicTool(CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "HION12StringSkimmingTool", + expression = expression, + TrigDecisionTool=tdt), + primary = True) + return(acc) + + +def HION12KernelCfg(flags, name='HION12Kernel', **kwargs): + """Configure the derivation framework driving algorithm (kernel)""" + acc = ComponentAccumulator() + +######################################################################################### +#Thinning + from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg + + expression = "abs(InDetTrackParticles.d0)< 1000000000 && abs(InDetTrackParticles.z0*sin(InDetTrackParticles.theta)) < 1000000000 && InDetTrackParticles.pt > 200" #check limits + HION12TrackThinningTool = acc.getPrimaryAndMerge(TrackParticleThinningCfg( + flags, + name = "HION12TrackThinningTool", + StreamName = kwargs['StreamName'], + SelectionString = expression, + InDetTrackParticlesKey = "InDetTrackParticles")) + + thinningTools = [HION12TrackThinningTool] + skimmingTool = acc.getPrimaryAndMerge(HION12SkimmingToolCfg(flags)) + + DerivationKernel = CompFactory.DerivationFramework.DerivationKernel + acc.addEventAlgo(DerivationKernel(name, + SkimmingTools = [skimmingTool], + ThinningTools = thinningTools), + sequenceName = "HION12Sequence") + + return acc + +def HION12Cfg(flags): + + acc = ComponentAccumulator() + acc.merge(HION12KernelCfg(flags, name="HION12Kernel",StreamName = "StreamDAOD_HION12")) + + from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg + from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg + from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper + +######################################################################################### +#Slimming + from DerivationFrameworkHI import ListSlimming + + HION12SlimmingHelper = SlimmingHelper("HION12SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags) + + HION12SlimmingHelper.SmartCollections = ListSlimming.HION12SmartCollections() + HION12SlimmingHelper.AllVariables = ListSlimming.HION12AllVarContent() + HION12SlimmingHelper.ExtraVariables = ListSlimming.HION12Extra() + + + HION12ItemList = HION12SlimmingHelper.GetItemList() + + acc.merge(OutputStreamCfg(flags, "DAOD_HION12", ItemList=HION12ItemList, AcceptAlgs=["HION12Kernel"])) + acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_HION12", AcceptAlgs=["HION12Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData])) + + return acc \ No newline at end of file diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/ListSlimming.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/ListSlimming.py index 755d9ce63691f7ff60fd194d0bbd9385d7b88945..2efb783688a7ca88e853986a0e09cbe37369f382 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/ListSlimming.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/ListSlimming.py @@ -2,6 +2,9 @@ #!/usr/bin/env python # ListSlimming.py - List of collections for slimming from athena 21.2 HION4 and EGAM1ExtraContent.py +################################################################################# +#HION4 + def HION4SmartCollections(): variables = [] variables += ["EventInfo"] @@ -189,3 +192,109 @@ def HION4ExtraVariablesEventShape(): variables += [shape + "EventShape.DensitySigma.Density.DensityArea"] return variables + +################################################################################# +#HION12 + +def HION12SmartCollections(): + variables = [] + variables += ["Electrons"] # Smart collection for electrons + variables += ["Muons"] # Smart collection for muons + variables += ["Photons"] # Smart collection for photons + variables += ["InDetTrackParticles"] # Smart collection for tracks + + return variables + +def HION12AllVarContent(): + variables = [] + variables += ["AntiKt4EMPFlowJets"] # Include R = 0.4 anti-kt EM Particle Flow jets + variables += ["AntiKt4EMTopoJets"] # Include R = 0.4 anti-kt EM topo-jets + variables += ["AntiKt4LCTopoJets"] # Include R = 0.4 anti-kt local calibration topo-jets + variables += ["CaloCalTopoClusters"] # Include topocluster information + variables += ["PrimaryVertices"] # Include a list of all primary vertices + variables += ["NCB_MuonSegments"] # Include the non-collision background muons to handle punch-throughs. + variables += ["JetETMissChargedParticleFlowObjects"] # Include the charged particle flow objects from the Jet/ET Miss group + variables += ["JetETMissNeutralParticleFlowObjects"] # Include the neutral particle flow objects from the Jet/ET Miss group + variables += ["TauChargedParticleFlowObjects"] # Include the charged particle flow objects used for Tau reconstruction + variables += ["TauNeutralParticleFlowObjects"] # Include the neutral particle flow objects used for Tau reconstruction + variables += ["TauShotParticleFlowObjects"] # Include the["shot" particle flow objects used for Tau reconstruction + variables += ["Kt4EMPFlowEventShape"] # The event shape specifically for R=0.4 EM PFlow jets + variables += ["Kt4EMTopoOriginEventShape"] # The event shape specifically for R=0.4 EM Topo jets + variables += ["Kt4LCTopoOriginEventShape"] # The event shape specifically for R=0.4 LC Topo jets + variables += ["TopoClusterIsoCentralEventShape"] # Part of the event shape for topo-jets + variables += ["TopoClusterIsoVeryForwardEventShape"] # Part of the event shape for topo-jets + variables += ["TopoClusterIsoForwardEventShape"] # Part of the event shape for topo-jets + variables += ["NeutralParticleFlowIsoCentralEventShape"] # Part of the event shape for PFlow jets + variables += ["ParticleFlowIsoCentralEventShape"] # Part of the event shape for PFlow jets + variables += ["NeutralParticleFlowIsoForwardEventShape"] # Part of the event shape for PFlow jets + variables += ["ParticleFlowIsoForwardEventShape"] # Part of the event shape for PFlow jets + variables += ["HLT_xAOD__JetContainer_a4tcemsubjesISFS"] # Include the HLT R = 0.4 EM Topo trigger jets (2018 HI Run) + variables += ["HLT_xAOD__JetContainer_a4ionemsubjesISFS"] # Include the HLT R = 0.4 heavy ion trigger jets (2015 HI Run) + variables += ["HLT_xAOD__JetContainer_a10tclcwsubjesFS"] # Include the HLT R = 1.0 LCW Topo trigger jets (2018 HI Run) + + return variables + +def HION12HIJetBranches(): + state_vars = [] + state_vars += ["pt"] + state_vars += ["eta"] + state_vars += ["phi"] + state_vars += ["m"] + + states = [] + states += ["JetUnsubtractedScaleMomentum"] + states += ["JetSubtractedScaleMomentum"] + + HIJetBranches = [] + for v in state_vars: + HIJetBranches += [v] + for s in states: + HIJetBranches += [s+'.'+v] + + HIJetBranches += ["ConstituentScale"] + HIJetBranches += ["constituentLinks"] + HIJetBranches += ["constituentWeights"] + HIJetBranches += ["AverageLArQF"] + HIJetBranches += ["EMFrac"] + HIJetBranches += ["FracSamplingMax"] + HIJetBranches += ["FracSamplingMaxIndex"] + HIJetBranches += ["HECFrac"] + HIJetBranches += ["HECQuality"] + HIJetBranches += ["LArQuality"] + HIJetBranches += ["N90Constituents"] + HIJetBranches += ["NegativeE"] + HIJetBranches += ["Timing"] + HIJetBranches += ["BchCorrCell"] + HIJetBranches += ["LArBadHVEnergyFrac"] + HIJetBranches += ["LArBadHVNCell"] + HIJetBranches += ["EnergyPerSampling"] + HIJetBranches += ["GhostAntiKt4HITrackJets"] + HIJetBranches += ["GhostAntiKt4HITrackJetsCount"] + HIJetBranches += ["GhostAntiKt4HITrackJetsPt"] + HIJetBranches += ["GhostMuonSegmentCount"] + HIJetBranches += ["GhostTrack"] + HIJetBranches += ["NumTrkPt4000"] + HIJetBranches += ["SumPtTrkPt4000"] + HIJetBranches += ["TrackWidthPt4000"] + HIJetBranches += ["Width"] + HIJetBranches += ["MaxConstituentET"] + HIJetBranches += ["MaxOverMean"] + + return HIJetBranches + +def HION12Extra(): + ExtraJets = [] + ExtraJets += ["AntiKt4HITrackJets"] # Include R = 0.4 Heavy Ion anti-kt track jets + ExtraJets += ["AntiKt4HIJets"] # Include R = 0.4 Heavy Ion anti-kt tower jets + ExtraJets += ["AntiKt10HIJets"] # Include R = 1.0 Heavy Ion anti-kt tower jets + + HIJetBranches = HION12HIJetBranches() + + variables = [] + for collection in ExtraJets: + for branch in HIJetBranches: + variables += [collection+'.'+branch] + + variables += ['Muons.MuonSpectrometerPt'] + + return variables diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/ListTriggers.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/ListTriggers.py index 41bb20c94d7966c466ecc6fc71f67d75413b34f5..0977b92c428623cb08d79d649ca3dc0f386efa0f 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/ListTriggers.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHI/python/ListTriggers.py @@ -2,6 +2,9 @@ #!/usr/bin/env python # ListTriggers.py - List of triggers for skimming from athena 21.2 [HION4,HION12] +################################################################################# +#HION4 + def HION4SkimmingTriggers2015(): triggers = ['HLT_mb_sptrk_vetombts2in_L1MU0_VTE50'] triggers += ['HLT_noalg_L1MU0_VTE50'] @@ -236,4 +239,90 @@ def HION4SkimmingTriggersVM(): VMtrigger = ['HLT_mb_sptrk_exclusiveloose_vetosp1500_L1VTE20'] - return VMtrigger \ No newline at end of file + return VMtrigger + +################################################################################# +#HION12 + +def HION12MBtriggers2018(): + triggers = [] + + # Photo-nuclear min-bias triggers + + triggers += ['HLT_mb_sptrk_L1ZDC_XOR_TE5_VTE200'] # Main min-bias stream for photo-nuclear dijets + triggers += ['HLT_mb_sptrk_L1ZDC_XOR_VTE200'] # Min-bias stream to check the impact of the TE5 cut. Very pre-scaled. + triggers += ['HLT_noalg_L1ZDC_XOR_TE5_VTE200'] # Stream to deal with events where no tracks were re-constructed due to the rapidity gap + triggers += ['HLT_noalg_L1ZDC_XOR'] # Stream to deal with overall effects of TE5 and VTE200 cuts. Extremely pre-scaled. + triggers += ['HLT_noalg_L1TE5_VTE200'] # Stream to examine the impact of the ZDC cuts. Prescale is 276.6. + + #2015 photo-nuclear triggers which do not have an identical version in 2018 + + triggers += ['HLT_noalg_mb_L1TE50'] # 2015 MB trigger with high pre-scale on events with low total energy + triggers += ['HLT_mb_sptrk_ion_L1ZDC_A_C_VTE50'] # 2015 MB trigger with full ZDC activation for inefficiency + + # Photoproduction min-bias triggers + # Need to apply a ZDC veto in order to assess actual efficiencies for comparison. + + triggers += ['HLT_mb_sp_L1VTE50'] # Min-bias stream for dijet photoproduction up to 50 GeV. No minimum cut so high pre-scale. + triggers += ['HLT_noalg_pc_L1TE50_VTE600.0ETA49'] # Part of the main heavy ion min-bias stream from 50 to 600 GeV. In the PC stream so requires special attention. + triggers += ['HLT_mb_sptrk_L1ZDC_A_C_VTE50'] # Part of the main heavy ion min-bias stream from 0 to 50 GeV. In the PC stream so requires special attention. + + return triggers + +def HION12triggers2018(): + triggers = [] + # Photo-nuclear dijet physics triggers (j40 not included since j30 is un-prescaled for the entire run) + + triggers += ['HLT_j10_L1ZDC_XOR_TE5_VTE200'] # j10 trigger for first half of 2018 run + triggers += ['HLT_j10_0eta490_L1ZDC_XOR_TE5_VTE200'] # j10 trigger for second half of 2018 run + triggers += ['HLT_j15_L1ZDC_XOR_TE5_VTE200'] # j15 trigger for first half of 2018 run + triggers += ['HLT_j15_0eta490_L1ZDC_XOR_TE5_VTE200'] # j15 trigger for second half of 2018 run + triggers += ['HLT_j20_L1ZDC_XOR_TE5_VTE200'] # j20 trigger for first half of 2018 run + triggers += ['HLT_j20_0eta490_L1ZDC_XOR_TE5_VTE200'] # j20 trigger for second half of 2018 run + triggers += ['HLT_j30_L1ZDC_XOR_TE20_VTE200'] # j30 trigger for first half of 2018 run + triggers += ['HLT_j30_0eta490_L1ZDC_XOR_TE20_VTE200'] # j30 trigger for second half of 2018 run + triggers += ['HLT_j10_rcu4_0eta490_L1ZDC_XOR_TE5_VTE200'] # j10 rcu4 trigger for second half of 2018 run (Lower un-calibrated min-pT cut) + + # Photoproduction dijet R = 0.4 physics triggers (j40 not included because j30 is un-prescaled for the entire run) + # Actually, all of these triggers (except the rcu4) are un-prescaled. Yay! + + triggers += ['HLT_j10_L1VZDC_A_C_TE5_VTE200'] # j10 trigger for the first half of the 2018 run + triggers += ['HLT_j15_L1VZDC_A_C_TE5_VTE200'] # j15 trigger for the first half of the 2018 run + triggers += ['HLT_j20_L1VZDC_A_C_TE5_VTE200'] # j20 trigger for the first half of the 2018 run + triggers += ['HLT_j30_L1VZDC_A_C_TE20_VTE200'] # j30 trigger for the first half of the 2018 run + triggers += ['HLT_j10_0eta490_L1VZDC_A_C_TE5_VTE200'] # j10 trigger for the second half of the 2018 run + triggers += ['HLT_j15_0eta490_L1VZDC_A_C_TE5_VTE200'] # j15 trigger for the second half of the 2018 run + triggers += ['HLT_j20_0eta490_L1VZDC_A_C_TE5_VTE200'] # j20 trigger for the second half of the 2018 run + triggers += ['HLT_j30_0eta490_L1VZDC_A_C_TE20_VTE200'] # j30 trigger for the second half of the 2018 run + triggers += ['HLT_j10_rcu4_0eta490_L1VZDC_A_C_TE5_VTE200'] # j10 rcu4 trigger for second half of 2018 run (Lower un-calibrated min-pT cut) + + # Photoproduction dijet R = 1.0 physics triggers + + triggers += ['HLT_j10_a10_lcw_subjes_L1VZDC_A_C_TE5_VTE200'] # j10 R=1.0 trigger for second half of the 2018 run. Same pre-scale as j15. + triggers += ['HLT_j15_a10_lcw_subjes_L1VZDC_A_C_TE5_VTE200'] # j15 R=1.0 trigger for second half of the 2018 run. Same pre-scale as j10. + triggers += ['HLT_j20_a10_lcw_subjes_L1VZDC_A_C_TE5_VTE200'] # j20 R=1.0 trigger for second half of the 2018 run. Same pre-scale as j30. + triggers += ['HLT_j30_a10_lcw_subjes_L1VZDC_A_C_TE5_VTE200'] # j30 R=1.0 trigger for second half of the 2018 run. Same pre-scale as j20. + + #2015 photo-nuclear triggers which do not have an identical version in 2018. + + triggers += ['HLT_j10_320eta490_ion_L1TE5_VTE200'] # Forward trigger on HI jets in 2015 without ZDC requirement + triggers += ['HLT_j10_ion_L1TE5_VTE200'] # Mid-rapidity j10 trigger on HI jets in 2015 without ZDC requirement + triggers += ['HLT_j15_ion_L1TE5_VTE200'] # Mid-rapidity j15 trigger on HI jets in 2015 without ZDC requirement + triggers += ['HLT_j20_ion_L1TE5_VTE200'] # Mid-rapidity j20 trigger on HI jets in 2015 without ZDC requirement + triggers += ['HLT_j20_ion_L1ZDC_XOR_TE5_VTE200'] # Mid-rapidity j20 trigger on HI jets in 2015 with ZDC requirement + triggers += ['HLT_j10_ion_L1ZDC_XOR_TE5_VTE200'] # Mid-rapidity j10 trigger on HI jets in 2015 with ZDC requirement + triggers += ['HLT_j15_ion_L1ZDC_XOR_TE5_VTE200'] # Mid-rapidity j15 trigger on HI jets in 2015 with ZDC requirement + triggers += ['HLT_j10_ion_mb_mbts_vetombts1side2in_L1ZDC_XOR_TE5_VTE200'] # j10 trigger on HI jets in 2015 with an asymmetric MBTS and ZDC XOR requirement + + return triggers + +def HION12nJetCuts2018(): + nJetCuts = [] + nJetCuts += ['(count(AntiKt4EMTopoJets.pt > 7.0*GeV) > 0)'] + nJetCuts += ['(count(AntiKt4LCTopoJets.pt > 7.0*GeV) > 0)'] + nJetCuts += ['(count(AntiKt4EMPFlowJets.pt > 7.0*GeV) > 0)'] + nJetCuts += ['(count(AntiKt4HIJets.pt > 7.0*GeV) > 0)'] + nJetCuts += ['(count(AntiKt4HITrackJets.pt > 7.0*GeV) > 0)'] + nJetCuts += ['(count(AntiKt10LCTopoJets.pt > 7.0*GeV) > 0)'] + + return nJetCuts \ No newline at end of file