diff --git a/TopCP/Dockerfile b/TopCP/Dockerfile new file mode 100755 index 0000000..b09a9a1 --- /dev/null +++ b/TopCP/Dockerfile @@ -0,0 +1,44 @@ +# syntax=docker/dockerfile:1 + +# This is the default AnalysisBase version +ARG ANALYSIS_BASE_VERSION="25.2.38" +FROM gitlab-registry.cern.ch/atlas/athena/analysisbase:${ANALYSIS_BASE_VERSION} AS base + +ARG TOPCPTOOLKIT_TAG="v2.15.1" +ARG TOPCPTOOLKIT_BRANCH="main" + +SHELL [ "/bin/bash", "-c" ] + +USER root + +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 + +# download TopCPToolkit repo +WORKDIR / +RUN --mount=type=secret,id=GIT_KEY,env=GIT_KEY\ + git clone https://${GIT_KEY}@gitlab.cern.ch/atlasphys-top/reco/TopCPToolkit.git +WORKDIR /TopCPToolkit +RUN git checkout tags/${TOPCPTOOLKIT_TAG} + +# Make /TopCPToolkit/generate directory where runTop_el.py is executed +RUN mkdir -p generate +ENV RUN_LOC="/TopCPToolkit/generate" + +# 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/grid-security/x509_proxy + +WORKDIR /TopCPToolkit/build + +RUN source /release_setup.sh && \ + cmake ../source && \ + source */setup.sh && \ + make -j4 + +WORKDIR $RUN_LOC + +COPY ./boot.bash_profile /root/.bashrc \ No newline at end of file diff --git a/TopCP/boot.bash_profile b/TopCP/boot.bash_profile new file mode 100755 index 0000000..1c7afb5 --- /dev/null +++ b/TopCP/boot.bash_profile @@ -0,0 +1,4 @@ +#!/bin/bash +source /release_setup.sh +source /TopCPToolkit/build/x86_64-el9-gcc13-opt/setup.sh +# unset PYTHONHOME \ No newline at end of file diff --git a/TopCP/boot.sh b/TopCP/boot.sh new file mode 100755 index 0000000..5cd125a --- /dev/null +++ b/TopCP/boot.sh @@ -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 "$@" \ No newline at end of file diff --git a/TopCP/configs/customConfig/reco.yaml b/TopCP/configs/customConfig/reco.yaml new file mode 100755 index 0000000..4558ebf --- /dev/null +++ b/TopCP/configs/customConfig/reco.yaml @@ -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: '.' + 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: '.' + 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: ':' + 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' \ No newline at end of file