Skip to content
Snippets Groups Projects
Commit c10946cb authored by Maximilian Emanuel Goblirsch-Kolb's avatar Maximilian Emanuel Goblirsch-Kolb Committed by Frank Winklmeier
Browse files

add track pattern info to IDPVM ntuple

parent ef637f3a
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2021 CERN for the benefit of the ATLAS collaboration
*/
#include "InDetPerfNtuple_TruthToReco.h"
InDetPerfNtuple_TruthToReco::InDetPerfNtuple_TruthToReco(InDetPlotBase* pParent, const std::string & dirName, const std::string & treeName):
......@@ -15,6 +19,7 @@ InDetPerfNtuple_TruthToReco::InDetPerfNtuple_TruthToReco(InDetPlotBase* pParent,
m_truth_qOverP("truth_qOverP",m_undefinedValue,*this),
m_truth_qOverPt("truth_qOverPt",m_undefinedValue,*this),
m_truth_z0sin("truth_z0sin",m_undefinedValue,*this),
m_track_patternInfo("track_patternInfo",-1,*this),
m_track_truthMatchRanking("track_truthMatchRanking",-1,*this),
m_track_truthMatchProb("track_truthMatchProb",m_undefinedValue,*this),
m_track_charge("track_charge",m_undefinedValue,*this),
......@@ -116,6 +121,17 @@ void InDetPerfNtuple_TruthToReco::fillTrack(const xAOD::TrackParticle& track, co
// This is the most likely case when there is a linked truth because most associations are one-to-one
// n = 1, 2, ... : Assoicated truth available and this is the second, third, ... 'best matched' associated track
// This handles rare cases where there are multiple tracks associated to the same truth
try{
m_track_patternInfo = track.patternRecoInfo().to_ulong();
}
// to_ulong may throw if the bitset can not be represented by an unsigned long
catch (std::overflow_error & err){
// we print a warning and reset the pattern info to the value that would be written in case of no
// reco track.
// Not deserving of an ERROR since it is a single branch of a validation ntuple not written in production use
ATH_MSG_WARNING("Track pattern info can not be represented by an unsigned long on your system - branch in IDPVM ntuple will be invalid.");
m_track_patternInfo = -1;
}
m_track_truthMatchRanking = truthMatchRanking;
float prob = (track.isAvailable<float>("truthMatchProbability") ? track.auxdata<float>("truthMatchProbability") : m_undefinedValue);
......
/*
Copyright (C) 2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef INDET__PERF__NTUPLE_TRUTHTORECO__H
#define INDET__PERF__NTUPLE_TRUTHTORECO__H
......@@ -39,6 +43,7 @@ private:
InDetPerfNtupleBranch<float> m_truth_z0sin;
//Track variables
InDetPerfNtupleBranch<unsigned long> m_track_patternInfo;
InDetPerfNtupleBranch<int> m_track_truthMatchRanking;
InDetPerfNtupleBranch<float> m_track_truthMatchProb;
InDetPerfNtupleBranch<float> m_track_charge;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment