Commit 0fe27d77 authored by Samuel Van Stroud's avatar Samuel Van Stroud Committed by Dan Guest
Browse files

Add ambiguity solver ordering variable

parent ba9dfd80
Pipeline #3280278 passed with stages
in 14 minutes and 34 seconds
......@@ -53,6 +53,7 @@ atlas_add_library(dataset-dumper
src/DecoratorExample.cxx
src/TrackTruthDecorator.cxx
src/TrackVertexDecorator.cxx
src/TrackAmbiDecorator.cxx
src/ConfigFileTools.cxx
src/BTagInputChecker.cxx
src/TruthCorruptionCounter.cxx
......
......@@ -29,19 +29,10 @@ BATCH_TAG=$(date +%F-T%H%M%S)-R${RANDOM}
DEFAULT_CONFIG=EMPFlow.json
# R21 samples
# R22 validation samples
INPUT_DATASETS=(
mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_FTAG1.e6337_s3126_r9364_p3985
mc16_13TeV.427080.Pythia8EvtGen_A14NNPDF23LO_flatpT_Zprime.deriv.DAOD_FTAG1.e5362_s3126_r9364_p3985
mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_FTAG1.e6337_s3126_r10201_p3985
mc16_13TeV.427080.Pythia8EvtGen_A14NNPDF23LO_flatpT_Zprime.deriv.DAOD_FTAG1.e5362_s3126_r10201_p3985
mc16_13TeV.427081.Pythia8EvtGen_A14NNPDF23LO_flatpT_Zprime_Extended.deriv.DAOD_FTAG1.e6928_e5984_s3126_r10201_r10210_p3985
mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_FTAG1.e6337_s3126_r10724_p3985
mc16_13TeV.427080.Pythia8EvtGen_A14NNPDF23LO_flatpT_Zprime.deriv.DAOD_FTAG1.e5362_s3126_r10724_p3985
)
# R22 validation samples from ATR-23018
INPUT_DATASETS=(
valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.AOD.e4993_s3214_d1616_r12463_tid24505785_00
mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_PHYSVAL.e6337_e5984_s3126_r12629_p4724
mc16_13TeV.800030.Py8EG_A14NNPDF23LO_flatpT_Zprime_Extended.deriv.DAOD_PHYSVAL.e7954_s3672_r12629_r12636_p4724
)
######################################################
......
......@@ -73,6 +73,7 @@ namespace {
cfg.soft_muon = cft::boolinate(pt, "soft_muon");
cfg.track_truth_info = cft::boolinate(pt, "track_truth_info");
cfg.track_sv_info = cft::boolinate(pt, "track_sv_info");
cfg.track_ambiguity_solver_ranking = cft::boolinate(pt, "track_ambiguity_solver_ranking");
cfg.hits = cft::boolinate(pt, "hits");
return cfg;
}
......
......@@ -30,6 +30,7 @@ struct DecorateConfig {
bool soft_muon;
bool track_truth_info;
bool track_sv_info;
bool track_ambiguity_solver_ranking;
bool hits;
};
......
......@@ -8,6 +8,7 @@
#include "DecoratorExample.hh"
#include "TrackTruthDecorator.hh"
#include "TrackVertexDecorator.hh"
#include "TrackAmbiDecorator.hh"
#include "TruthCorruptionCounter.hh"
#include "HitDecorator.hh"
......@@ -81,6 +82,7 @@ struct SingleBTagTools {
TrackTruthDecorator trkTruthDecorator;
TrackVertexDecorator trkVertexDecorator;
TrackAmbiDecorator trkAmbiDecorator;
DecoratorExample example_decorator;
TruthCorruptionCounter truth_counts;
......
#include "TrackAmbiDecorator.hh"
// the constructor just builds the decorator
TrackAmbiDecorator::TrackAmbiDecorator(const std::string& prefix):
m_ambiRank(prefix + "ambiRank")
{
}
// this call actually does the work on the jet
void TrackAmbiDecorator::decorateAll(const xAOD::TrackParticleContainer& tracks) const {
float n_tracks = tracks.size();
for ( unsigned int i = 0; i < tracks.size(); i++ ) {
auto track = tracks.at(i);
m_ambiRank(*track) = float(i) / n_tracks;
}
}
#ifndef TRACK_AMBI_DECORATOR_HH
#define TRACK_AMBI_DECORATOR_HH
#include "xAODTracking/TrackParticle.h"
#include "xAODTracking/TrackParticleContainer.h"
#include <string>
// this is a bare-bones example of a class that could be used to
// decorate a track with additional information
class TrackAmbiDecorator
{
public:
TrackAmbiDecorator(const std::string& decorator_prefix = "");
// this is the function that actually does the decoration
void decorateAll(const xAOD::TrackParticleContainer& tracks) const;
private:
SG::AuxElement::Decorator<float> m_ambiRank;
};
#endif
......@@ -105,6 +105,13 @@ void processSingleBTagEventImpl(Event& event,
}
}
// decorate all tracks
if ( jobcfg.decorate.track_ambiguity_solver_ranking ) {
const xAOD::TrackParticleContainer* tracks = nullptr;
check_rc( event.retrieve(tracks, "InDetTrackParticles"));
tools.trkAmbiDecorator.decorateAll(*tracks);
}
// second loop: select calibrated jets and write out to HDF5
// we'll need truth particles and event info
std::vector<const xAOD::TruthParticle*> truth_leptons;
......
......@@ -42,6 +42,7 @@
"soft_muon": "false",
"track_truth_info": "false",
"track_sv_info": "false",
"track_ambiguity_solver_ranking": "false",
"hits": "false"
}
}
......@@ -176,6 +176,7 @@
"soft_muon": "true",
"track_truth_info": "true",
"track_sv_info": "true",
"track_ambiguity_solver_ranking": "false",
"hits": "false"
}
}
......@@ -11,10 +11,62 @@
"pt_cut": 20000,
"vertex_collection": "PrimaryVertices",
"n_jets_per_event": 0,
"dl2_configs": [],
"dl2_configs": [
{
"nn_file_path": "BTagging/20210729/dipsLoose/antikt4empflow/network.json",
"remapping": {
"dipsLoose20210729_pu": "dipsLoose20210729_pu",
"dipsLoose20210729_pc": "dipsLoose20210729_pc",
"dipsLoose20210729_pb": "dipsLoose20210729_pb"
}
},
{
"nn_file_path": "BTagging/20210729/dips/antikt4empflow/network.json",
"remapping": {
"dips20210729_pc": "dips20210729_pc",
"dips20210729_pu": "dips20210729_pu",
"dips20210729_pb": "dips20210729_pb"
}
},
{
"nn_file_path": "BTagging/20210824r22/dl1dLoose/antikt4empflow/network.json",
"remapping": {
"DL1dv00_pu": "DL1dLoose20210824r22_pu",
"DL1dv00_pc": "DL1dLoose20210824r22_pc",
"DL1dv00_pb": "DL1dLoose20210824r22_pb"
}
},
{
"nn_file_path": "BTagging/20210824r22/dl1d/antikt4empflow/network.json",
"remapping": {
"DL1d20210824r22_pu": "DL1d20210824r22_pu",
"DL1d20210824r22_pc": "DL1d20210824r22_pc",
"DL1d20210824r22_pb": "DL1d20210824r22_pb"
}
},
{
"nn_file_path": "BTagging/20210824r22/dl1r/antikt4empflow/network.json",
"remapping": {
"DL1r20210824r22_pu": "DL1r20210824r22_pu",
"DL1r20210824r22_pc": "DL1r20210824r22_pc",
"DL1r20210824r22_pb": "DL1r20210824r22_pb"
}
}
],
"variables": {
"btag": {
"file": "fragments/single-btag-variables.json"
"file": "fragments/single-btag-variables-gnn.json",
"floats": [
"DL1d20210824r22_pu",
"DL1d20210824r22_pc",
"DL1d20210824r22_pb",
"DL1r20210824r22_pu",
"DL1r20210824r22_pc",
"DL1r20210824r22_pb",
"DL1dLoose20210824r22_pu",
"DL1dLoose20210824r22_pc",
"DL1dLoose20210824r22_pb"
]
},
"default_mapping": {
"file": "fragments/default-mapping.json"
......@@ -24,7 +76,7 @@
{
"n_to_save": 40,
"selection": {
"file": "fragments/ip3d-loose-track-cuts.json"
"file": "fragments/gnn-track-cuts.json"
},
"sort_order": "d0_significance",
"source": "btagging",
......@@ -42,6 +94,7 @@
"soft_muon": "false",
"track_truth_info": "true",
"track_sv_info": "true",
"track_ambiguity_solver_ranking": "true",
"hits": "false"
}
}
......@@ -37,6 +37,7 @@
"soft_muon": "false",
"track_truth_info": "false",
"track_sv_info": "false",
"track_ambiguity_solver_ranking": "false",
"hits": "false"
}
}
......@@ -30,6 +30,7 @@
"soft_muon": "false",
"track_truth_info": "false",
"track_sv_info": "false",
"track_ambiguity_solver_ranking": "false",
"hits": "true"
}
}
{
"pt_minimum": 500,
"abs_eta_maximum": 2.5,
"d0_maximum": 5.0,
"z0_maximum": 5.0,
"si_hits_minimum": 7,
"si_shared_maximum": 99,
"si_holes_maximum": 2,
"pix_holes_maximum": 1
}
......@@ -21,15 +21,12 @@
"floats": [
"chiSquared",
"numberDoF",
"IP3D_signed_d0",
"IP2D_signed_d0",
"IP3D_signed_z0",
"btagIp_d0",
"btagIp_z0SinTheta",
"phi",
"theta",
"qOverP",
"AMVFWeightPV"
"AMVFWeightPV",
"ambiRank"
],
"flavortagdiscriminants_sequences": [
"IP3D_signed_d0_significance",
......
{
"chars": [
"IP2D_isDefaults",
"IP3D_isDefaults",
"JetFitter_isDefaults",
"SV1_isDefaults",
"JetFitterSecondaryVertex_isDefaults",
"rnnip_isDefaults"
],
"jet_int_variables": [
"GhostBHadronsFinalCount",
"GhostCHadronsFinalCount",
"HadronConeExclTruthLabelID",
"HadronConeExclExtendedTruthLabelID",
"PartonTruthLabelID",
"jetPtRank"
],
"floats": [
"pt_btagJes",
"eta_btagJes",
"absEta_btagJes",
"DL1_pu",
"DL1_pc",
"DL1_pb",
"DL1r_pu",
"DL1r_pc",
"DL1r_pb"
],
"doubles": [],
"jet_floats": [
"GhostBHadronsFinalPt",
"bTagJVT",
"pt",
"eta",
"mass",
"energy"
],
"ints_as_float": [
],
"event": [
"mcEventWeight",
"eventNumber",
"averageInteractionsPerCrossing",
"actualInteractionsPerCrossing",
"nPrimaryVertices"
]
}
......@@ -54,6 +54,7 @@
"soft_muon": "false",
"track_truth_info": "false",
"track_sv_info": "false",
"track_ambiguity_solver_ranking": "false",
"hits": "false"
}
}
......@@ -152,6 +152,7 @@
"soft_muon": "false",
"track_truth_info": "false",
"track_sv_info": "false",
"track_ambiguity_solver_ranking": "false",
"hits": "false"
}
}
\ No newline at end of file
......@@ -42,6 +42,7 @@
"soft_muon": "false",
"track_truth_info": "false",
"track_sv_info": "false",
"track_ambiguity_solver_ranking": "false",
"hits": "false"
}
}
......@@ -38,6 +38,7 @@
"soft_muon": "false",
"track_truth_info": "false",
"track_sv_info": "false",
"track_ambiguity_solver_ranking": "false",
"hits": "false"
}
}
Supports Markdown
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