Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TopCPToolkit science image #24

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
30 changes: 30 additions & 0 deletions TopCP/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# use AnalysisBase:25.2.14 as base image. Will be dynamic in the future
ARG BASE_IMAGE=gitlab-registry.cern.ch/atlas/athena/analysisbase:25.2.14
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps update default to 25.2.35

FROM ${BASE_IMAGE} AS base

SHELL [ "/bin/bash", "-c" ]

RUN yum update -y
RUN yum install -y https://repo.opensciencegrid.org/osg/3.6/osg-3.6-el9-release-latest.rpm && yum install -y osg-ca-certs
RUN yum install -y nc

# Import TopCPToolkit from local filesystem
COPY ./TopCPToolkit /TopCPToolkit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to figure out how to build TopCPToolkit within the container. The only complicated part of this is that the relevant repository is password-protected, so we need to inject the access token into the build somehow. But I've verified that we can do the git checkout and build inside the analysisbase container.

WORKDIR /TopCPToolkit

# Make /TopCPToolkit/generate directory where runTop_el.py is executed
RUN mkdir -p generate
ENV RUN_LOC "/TopCPToolkit/generate"
WORKDIR $RUN_LOC

# Define config location where user defined YAML files will reside
ENV CONFIG_LOC "/TopCPToolkit/source/TopCPToolkit/share/configs/customConfig"
RUN mkdir -p $CONFIG_LOC

ENV X509_USER_PROXY=/tmp/x509_proxy

RUN chmod +x /TopCPToolkit/build/x86_64-el9-gcc13-opt/setup.sh

USER servicex

COPY ./boot.bash_profile /
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File needs to go to /root/.bash_profile

1 change: 1 addition & 0 deletions TopCP/TopCPToolkit
Submodule TopCPToolkit added at ae2a1b
4 changes: 4 additions & 0 deletions TopCP/boot.bash_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
source /release_setup.sh
source /TopCPToolkit/build/x86_64-el9-gcc13-opt/setup.sh
unset PYTHONHOME
7 changes: 7 additions & 0 deletions TopCP/boot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
source /release_setup.sh
source /TopCPToolkit/build/x86_64-el9-gcc13-opt/setup.sh
unset PYTHONHOME

echo "Arguments received: $@"
exec "$@"
234 changes: 234 additions & 0 deletions TopCP/configs/customConfig/reco.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
CommonServices:
systematicsHistogram: 'listOfSystematics'

PileupReweighting: {}

EventCleaning:
runEventCleaning: True

Jets:
- containerName: 'AnaJets'
jetCollection: 'AntiKt4EMPFlowJets'
runJvtUpdate: False
runNNJvtUpdate: True
runGhostMuonAssociation: True
systematicsModelJES: 'Category'
systematicsModelJER: 'Full'
JVT: {}
PtEtaSelection:
minPt: 25000.0
maxEta: 2.5
FlavourTagging:
- btagger: 'DL1dv01'
btagWP: 'FixedCutBEff_85'
generator: 'autoconfig'
- btagger: 'DL1dv01'
btagWP: 'FixedCutBEff_77'
generator: 'autoconfig'
- btagger: 'DL1dv01'
btagWP: 'FixedCutBEff_70'
generator: 'autoconfig'
- btagger: 'DL1dv01'
btagWP: 'FixedCutBEff_60'
generator: 'autoconfig'
- btagger: 'DL1dv01'
btagWP: 'Continuous'
generator: 'autoconfig'
# BTaggingScores:
# #- bTagCalibFile : /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/xAODBTaggingEfficiency/13p6TeV/2023-22-13p6TeV-MC21-CDI_Test_2023-08-1_v1.root
# - bTagCalibFile : /workdir/BtaggerCalibration
# taggerName: 'GN2v00LegacyWP'
# #taggerName: 'DL1dv01'
# minPt: 25000.0
# saveAllProbabilities: True
# eventSelection : ''
FlavourTaggingEventSF:
- containerName: 'AnaJets.baselineJvt'
btagger: 'DL1dv01'
btagWP: 'Continuous'

Electrons:
- containerName: 'AnaElectrons'
crackVeto: True
IFFClassification: {}
WorkingPoint:
- selectionName: 'loose'
likelihoodWP: 'TightLH'
isolationWP: 'NonIso'
- selectionName: 'tight'
likelihoodWP: 'TightLH'
isolationWP: 'Tight_VarRad'
PtEtaSelection:
minPt: 25000.0
maxEta: 2.47

Muons:
- containerName: 'AnaMuons'
IFFClassification: {}
WorkingPoint:
- selectionName: 'loose'
quality: 'Medium'
isolation: 'NonIso'
- selectionName: 'tight'
quality: 'Medium'
isolation: 'Tight_VarRad'
systematicBreakdown: True
PtEtaSelection:
minPt: 25000.0
maxEta: 2.5


GeneratorLevelAnalysis: {}

# containerName and postfix must be defined in their respective blocks
MissingET:
- containerName: 'AnaMET'
# Format should follow Object: '<containerName>.<postfix>'
jets: 'AnaJets'
#taus: 'AnaTauJets.tight'
electrons: 'AnaElectrons.tight'
#photons: 'AnaPhotons.tight&&selectPtEta'
muons: 'AnaMuons.tight'

# containerName and postfix must be defined in their respective blocks
OverlapRemoval:
inputLabel: 'preselectOR'
outputLabel: 'passesOR'
# Format should follow Object: '<containerName>.<postfix>'
jets: 'AnaJets.baselineJvt'
#taus: 'AnaTauJets.tight'
electrons: 'AnaElectrons.tight'
#photons: 'AnaPhotons.tight'
muons: 'AnaMuons.tight'

ObjectCutFlow:
- containerName: 'AnaElectrons'
selectionName: 'tight'
- containerName: 'AnaMuons'
selectionName: 'tight'
# - containerName: 'AnaTauJets'
# selectionName: 'tight'
# - containerName: 'AnaPhotons'
# selectionName: 'tight'
- containerName: 'AnaJets'
selectionName: 'baselineJvt'

Thinning:
- containerName: 'AnaJets'
outputName: 'OutJets'
selectionName: 'baselineJvt'
- containerName: 'AnaElectrons'
outputName: 'OutElectrons'
selectionName: 'tight||loose'
# - containerName: 'AnaPhotons'
# outputName: 'OutPhotons'
# selectionName: 'tight||loose'
- containerName: 'AnaMuons'
outputName: 'OutMuons'
selectionName: 'tight||loose'
# - containerName: 'AnaTauJets'
# outputName: 'OutTauJets'
# selectionName: 'tight'

LeptonSF:
- electrons: 'AnaElectrons.tight'
muons: 'AnaMuons.tight'
lepton_postfix: 'tight'

Trigger:
triggerChainsPerYear:
'2015':
- 'HLT_e24_lhmedium_L1EM20VH || HLT_e60_lhmedium || HLT_e120_lhloose'
- 'HLT_mu20_iloose_L1MU15 || HLT_mu40'
'2016':
- 'HLT_e26_lhtight_nod0_ivarloose || HLT_e60_lhmedium_nod0 || HLT_e140_lhloose_nod0'
- 'HLT_mu26_ivarmedium || HLT_mu50'
'2017':
- 'HLT_e26_lhtight_nod0_ivarloose || HLT_e60_lhmedium_nod0 || HLT_e140_lhloose_nod0'
- 'HLT_mu26_ivarmedium || HLT_mu50'
'2018':
- 'HLT_e26_lhtight_nod0_ivarloose || HLT_e60_lhmedium_nod0 || HLT_e140_lhloose_nod0'
- 'HLT_mu26_ivarmedium || HLT_mu50'
'2022':
- 'HLT_e26_lhtight_ivarloose_L1EM22VHI || HLT_e60_lhmedium_L1EM22VHI || HLT_e140_lhloose_L1EM22VHI'
- 'HLT_mu26_ivarmedium_L1MU14FCH || HLT_mu50_L1MU14FCH'
noFilter: False
electrons: 'AnaElectrons.tight'
muons: 'AnaMuons.tight'
electronID: 'Tight'
electronIsol: 'Tight_VarRad'
muonID: 'Medium'

EventSelection:
- electrons: 'AnaElectrons.loose'
muons: 'AnaMuons.tight'
jets: 'AnaJets.baselineJvt'
met: 'AnaMET'
btagDecoration: 'ftag_select_DL1dv01_FixedCutBEff_85'
noFilter: False
cutFlowHistograms: True
selectionCutsDict:
'ejets': |
EL_N 25000 == 1
MU_N 100 == 0
JET_N 25000 >= 3
SAVE
'mujets': |
MU_N 25000 == 1
EL_N 100 == 0
JET_N 25000 >= 3
SAVE


# After configuring each container, many variables will be saved automatically.
Output:
treeName: 'reco'
vars: [OutJets_NOSYS.HadronConeExclTruthLabelID -> jet_TruthFlavour]
metVars: []
containers:
# Format should follow: '<suffix>:<output container>'
mu_: 'OutMuons'
el_: 'OutElectrons'
jet_: 'OutJets'
met_: 'AnaMET'
'': 'EventInfo'
commands:
# Turn output branches on and off with 'enable' and 'disable'
- disable jet_.*_eff.*
- disable jet_jvtEfficiency.*
- disable trigPassed_HLT.*
- enable trigPassed_HLT_e.*

AddConfigBlocks:
- modulePath: 'TopCPToolkit.LeptonSFCalculatorConfig'
functionName: 'LeptonSFCalculatorConfig'
algName: 'LeptonSF'
pos: 'Output'
- modulePath: 'TopCPToolkit.KLFitterConfig'
functionName: 'KLFitterConfig'
algName: 'KLFitter'
pos: 'Output'
- modulePath: 'TopCPToolkit.TopSpaNetConfig'
functionName: 'TopSpaNetConfig'
algName: 'SpaNet'
pos: 'Output'
- modulePath: 'TopCPToolkit.particleLevelConfig'
functionName: 'particleLevelConfig'
algName: 'ParticleLevel'
pos: 'Output'
- modulePath: 'TopCPToolkit.truthConfig'
functionName: 'truthConfig'
algName: 'PartonHistory'
pos: 'Output'
- modulePath: 'TopCPToolkit.JetMatchingConfig'
functionName: 'JetMatchingConfig'
algName: 'JetMatching'
pos: 'Output'
- modulePath: 'TopCPToolkit.BTagScoresConfig'
functionName: 'BTagScoresConfig'
algName: 'BTaggingScores'
superBlocks: 'Jets'
- modulePath: 'TopCPToolkit.PartonToJetsMatchConfig'
functionName: 'PartonToJetsMatchConfig'
algName: 'PartonToJetsMatch'
pos: 'Output'
1 change: 1 addition & 0 deletions TopCP/generate/exampleInput.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root://xrootd.aglt2.org:1094//pnfs/aglt2.org/atlasdatadisk/rucio/mc20_13TeV/d4/32/DAOD_PHYS.37620644._000804.pool.root.1