Commit bef96b91 authored by Dan Guest's avatar Dan Guest
Browse files

Add poorman's trigger training outputs

parent e97e7eec
......@@ -169,7 +169,17 @@ def trigDatasetDumper(cfgFlags, chain, config_file, output_file):
ca.addEventAlgo(matcher)
# associate fullscan tracks to the jets
ca.merge(getTrackAugmentation(cfgFlags))
fs_tracks = 'HLT_IDTrack_FS_FTF'
fs_vertices = 'HLT_IDVertex_FS'
ca.merge(getTrackAugmentation(
cfgFlags,
tpc=fs_tracks,
pvc=fs_vertices,
))
ca.addEventAlgo(CompFactory.FlavorTagDiscriminants.PoorMansIpAugmenterAlg(
TrackContainer=fs_tracks,
PrimaryVertexContainer=fs_vertices
))
ca.merge(getFSTrackAssociationAlgs(cfgFlags, temp_jets, temp_btag))
btagAlg = CompFactory.SingleBTagAlg('DatasetDumper')
......
......@@ -10,6 +10,7 @@
#include "xAODJet/Jet.h"
#include "FlavorTagDiscriminants/customGetter.h"
#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h"
/////////////////////////////////////////////
// Internal classes
......@@ -70,7 +71,19 @@ BTagTrackWriter::BTagTrackWriter(
// use custom variables from the b-tagging inference code in
// FlavorTagDiscriminants
for (const std::string& name: config.flavortagdiscriminants_sequences) {
if (name == "phiError") {
if (name == "d0Uncertainty") {
BTagTrackIpAccessor acc(config.ip_prefix);
auto getter = [acc](const TrackOutputs& t) -> float {
return acc.d0Uncertainty(*t.track);
};
fillers.add(name, std::function(getter), NAN);
} else if (name == "z0SinThetaUncertainty") {
BTagTrackIpAccessor acc(config.ip_prefix);
auto getter = [acc](const TrackOutputs& t) -> float {
return acc.z0SinThetaUncertainty(*t.track);
};
fillers.add(name, std::function(getter), NAN);
} else if (name == "phiError") {
auto getter = [](const TrackOutputs& t) -> float {
return std::sqrt(t.track->definingParametersCovMatrix()(2, 2));
};
......
......@@ -119,11 +119,11 @@ namespace ConfigFileTools {
}
DL2Config get_dl2_config(const boost::property_tree::ptree& node) {
std::map<std::string,std::string> output_remapping;
for (const auto& remappt: node.get_child("output_remapping")) {
output_remapping[remappt.first] = remappt.second.data();
std::map<std::string,std::string> remapping;
for (const auto& remappt: node.get_child("remapping")) {
remapping[remappt.first] = remappt.second.data();
}
return {node.get<std::string>("nn_file_path"), output_remapping};
return {node.get<std::string>("nn_file_path"), remapping};
}
}
......@@ -7,7 +7,7 @@
struct DL2Config {
std::string nn_file_path;
std::map<std::string, std::string> output_remapping;
std::map<std::string, std::string> remapping;
};
#endif
......@@ -95,10 +95,10 @@ SingleBTagConfig get_singlebtag_config(const std::string& config_file_name) {
config.jet_collection = cfg.get<std::string>("jet_collection");
if(config.do_calibration){
config.jet_calib_file = cfg.get<std::string>("jet_calib_file");
config.cal_seq = cfg.get<std::string>("cal_seq");
config.cal_area = cfg.get<std::string>("cal_area");
config.jvt_cut = cfg.get<float>("jvt_cut");
config.jet_calib_file = cfg.get<std::string>("jet_calib_file");
config.cal_seq = cfg.get<std::string>("cal_seq");
config.cal_area = cfg.get<std::string>("cal_area");
config.jvt_cut = cfg.get<float>("jvt_cut");
}
config.pt_cut = cfg.get<float>("pt_cut");
......
......@@ -84,7 +84,7 @@ SingleBTagTools::SingleBTagTools(const SingleBTagConfig& jobcfg,
using FlavorTagDiscriminants::FlipTagConfig;
std::string path = cfg.nn_file_path;
std::cout << "loading " << path << std::endl;
dl2s.emplace_back(path, FlipTagConfig::STANDARD, cfg.output_remapping);
dl2s.emplace_back(path, FlipTagConfig::STANDARD, cfg.remapping);
}
for (const TrackConfig& cfg: jobcfg.tracks) {
tracks.emplace_back(cfg, output);
......
......@@ -103,7 +103,7 @@ SubjetCollection::SubjetCollection(const SubjetConfig& init_cfg):
dl2s.emplace_back(
cfg.nn_file_path,
FlavorTagDiscriminants::FlipTagConfig::STANDARD,
cfg.output_remapping);
cfg.remapping);
}
}
......
......@@ -45,7 +45,7 @@
"dl2_configs":[
{
"nn_file_path": "BTagging/201903/rnnip/antiktvr30rmax4rmin02track/network.json",
"output_remapping": {
"remapping": {
"rnnip_pb": "rnnipT_pb",
"rnnip_pc": "rnnipT_pc",
"rnnip_pu": "rnnipT_pu"
......
{
"uchar": [
"numberOfInnermostPixelLayerHits",
"numberOfNextToInnermostPixelLayerHits",
"numberOfInnermostPixelLayerSharedHits",
"numberOfInnermostPixelLayerSplitHits",
"numberOfPixelHits",
"numberOfPixelHoles",
"numberOfPixelSharedHits",
"numberOfPixelSplitHits",
"numberOfSCTHits",
"numberOfSCTHoles",
"numberOfSCTSharedHits"
],
"ints": [
],
"floats": [
"chiSquared",
"numberDoF",
"IP3D_signed_d0",
"IP2D_signed_d0",
"IP3D_signed_z0",
"phi",
"theta",
"qOverP"
],
"flavortagdiscriminants_sequences": [
"d0",
"z0SinTheta",
"d0Uncertainty",
"z0SinThetaUncertainty",
"IP3D_signed_d0_significance",
"IP3D_signed_z0_significance",
"pt",
"eta"
]
}
......@@ -13,7 +13,7 @@
"dl2_configs": [
{
"nn_file_path": "dev/BTagging/20210517/dipsLoose/antikt4empflow/network.json",
"output_remapping": {
"remapping": {
"btagIp_":"poboyIp_"
}
}
......
......@@ -13,10 +13,21 @@
"dl2_configs": [
{
"nn_file_path": "dev/BTagging/20210517/dipsLoose/antikt4empflow/network.json",
"output_remapping": {
"remapping": {
"BTagTrackToJetAssociator": "FSTracks"
}
},
{
"nn_file_path": "dev/BTagging/20210517/dipsLoose/antikt4empflow/network.json",
"remapping": {
"BTagTrackToJetAssociator": "FSTracks",
"btagIp_":"poboyIp_",
"dipsLoose20210517_pb":"dipsLooseSimpleIp20210517_pb",
"dipsLoose20210517_pc":"dipsLooseSimpleIp20210517_pc",
"dipsLoose20210517_pu":"dipsLooseSimpleIp20210517_pu"
}
}
],
"variables": {
"btag": {
......@@ -24,7 +35,10 @@
"floats": [
"dipsLoose20210517_pb",
"dipsLoose20210517_pc",
"dipsLoose20210517_pu"
"dipsLoose20210517_pu",
"dipsLooseSimpleIp20210517_pb",
"dipsLooseSimpleIp20210517_pc",
"dipsLooseSimpleIp20210517_pu"
]
}
},
......@@ -57,10 +71,29 @@
"input_name": "FSTracks",
"output_name": "fs_tracks",
"variables": {
"file": "fragments/single-btag-track-variables.json"
"file": "fragments/trigger-track-variables.json"
},
"ip_prefix": "btagIp_"
},
{
"n_to_save": 40,
"selection": {
"file": "fragments/ip3d-loose-track-cuts.json",
"d0_maximum": null,
"z0_maximum": null,
"si_hits_minimum": 0,
"pix_holes_maximum": 5
},
"sort_order": "abs_beamspot_d0",
"source": "btagging",
"input_name": "FSTracks",
"output_name": "fs_tracks_simple_ip",
"variables": {
"file": "fragments/trigger-track-variables.json"
},
"ip_prefix": "poboyIp_"
}
],
"decorate": {
"jet_aug": "false",
......
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -q
asetup Athena,master,2021-07-21T2101
asetup Athena,master,2021-08-01T2101
# add h5ls
. ${BASH_SOURCE[0]%/*}/setup/add-h5-tools.sh
......@@ -5,7 +5,7 @@ echo "=== running setupATLAS ==="
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -q
echo "=== running asetup ==="
asetup Athena,22.0.39
asetup Athena,22.0.40
# add h5ls
. ${BASH_SOURCE[0]%/*}/setup/add-h5-tools.sh
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