12TrackClassifier :: TrackClassifier (
const std::string& name) :
AsgTool (name)
19StatusCode TrackClassifier :: initialize ()
25 std::ifstream inFileNN(fullPathToModelFile);
26 lwt::GraphConfig
config(lwt::parse_json_graph(inFileNN));
30 return StatusCode::SUCCESS;
35 bool ok = track->summaryValue(val, info);
36 if (!ok)
throw std::logic_error(
"problem getting track summary value");
43 std::map<std::string, double> track_outputs =
ComputeScore( track,
jet );
44 double HF_score = track_outputs[
"FromB"]+track_outputs[
"FromBC"]+track_outputs[
"FromC"];
51 double dphi = -(
jet->p4()).DeltaPhi(track->p4());
52 double deta = -(
jet->eta() - track->eta());
53 double dr = (track->p4()).DeltaR(
jet->p4());
54 double ptfrac = (track->pt())/(
jet->pt());
61 std::map<std::string, double> track_inputs{
62 {
"eta_btagJes", (double)
jet->eta()},
63 {
"log_pt_btagJes", (double) std::log(
jet->pt())},
64 {
"dphi", (double) dphi},
65 {
"deta", (double) deta},
66 {
"log_dr", (double) std::log(dr)},
67 {
"log_ptfrac", (double) std::log(ptfrac)},
68 {
"qOverP", (double) track->qOverP()},
80 {
"AMVFWeightPV", (double) AMVFWeightPVAcc(*track)}
84 std::map<std::string, std::map<std::string, double> > inputs {
85 {
"track_inputs", track_inputs}
91 std::map<std::string, double> track_outputs{
92 {
"Pileup",(double) discriminant[
"Pileup"]},
93 {
"Fake",(double) discriminant[
"Fake"]},
94 {
"Primary",(double) discriminant[
"Primary"]},
95 {
"FromB",(double) discriminant[
"FromB"]},
96 {
"FromBC",(double) discriminant[
"FromBC"]},
97 {
"FromC",(double) discriminant[
"FromC"]},
98 {
"FromTau",(double) discriminant[
"FromTau"]},
99 {
"OtherSecondary",(double) discriminant[
"OtherSecondary"]}
102 return track_outputs;
108 static constexpr float const& MeVtoGeV = 1e-3;
109 double pt=
jet->pt()*MeVtoGeV;
112 if(pt>=std::prev(
m_WPcuts.end())->first){
113 if(score > std::prev(
m_WPcuts.end())->second)
118 auto nit = std::next(it);
119 if(pt>=it->first && pt<nit->first){
120 if(score > nit->second){
Base class for elements of a container that can have aux data.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool pass_cut(const double score, const xAOD::Jet *jet) const
std::unique_ptr< lwt::LightweightGraph > m_lwtnn_network
virtual bool selectTrack(const xAOD::TrackParticle *track, const xAOD::Jet *jet) const override
const std::map< double, double > m_WPcuts
virtual ~TrackClassifier()
std::string m_NNModelFilepath
virtual double compute_HF_Score(const xAOD::TrackParticle *track, const xAOD::Jet *jet) const override
int get(const xAOD::TrackParticle *part, xAOD::SummaryType info) const
virtual std::map< std::string, double > ComputeScore(const xAOD::TrackParticle *track, const xAOD::Jet *jet) const override
SG::ConstAccessor< T, ALLOC > ConstAccessor
Jet_v1 Jet
Definition of the current "jet version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
SummaryType
Enumerates the different types of information stored in Summary.
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfPixelSplitHits
number of Pixel all-layer hits split by cluster splitting [unit8_t].
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
@ numberOfInnermostPixelLayerSplitHits
number of Pixel 0th layer barrel hits split by cluster splitting
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].