ATLAS Offline Software
TrackClassifier.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TrackClassifier_TrackClassifier_H
6 #define TrackClassifier_TrackClassifier_H
7 
8 #include <AsgTools/AsgTool.h>
10 
11 #include <xAODJet/JetContainer.h>
14 
15 #include <memory>
16 #include <fstream>
17 #include "lwtnn/lightweight_network_config.hh"
18 #include "lwtnn/LightweightNeuralNetwork.hh"
19 #include "lwtnn/LightweightGraph.hh"
20 #include "lwtnn/parse_json.hh"
21 
22 #include <math.h>
23 
24 namespace FlavorTagDiscriminants {
25  class TrackClassifier final : public asg::AsgTool, virtual public ITrackClassifier
26  {
27 
29 
30  public:
31  // this is a standard tool constructor
32  TrackClassifier (const std::string& name);
33  virtual ~TrackClassifier();
34 
35  // inherited interface
36  virtual StatusCode initialize () override;
37  virtual std::map<std::string, double> ComputeScore( const xAOD::TrackParticle* track, const xAOD::Jet* jet) const override;
38  virtual double compute_HF_Score(const xAOD::TrackParticle* track, const xAOD::Jet* jet) const override;
39  virtual bool selectTrack(const xAOD::TrackParticle* track, const xAOD::Jet* jet) const override;
40 
41  private:
42 
43  std::unique_ptr<lwt::LightweightGraph> m_lwtnn_network;
44  std::string m_NNModelFilepath;
45 
46  // the HF score cut in each jet pt bin (expressed in GeV),
47  //resembling 99% WP signal (heavy flavor tracks) efficiency in singleB jets:
48  const std::map<double, double>
50  {0.0, -1.},
51  {250.0, 0.08892564848065376},
52  {500.0, 0.046739218756556504},
53  {750.0, 0.03829977475106716},
54  {1000.0, 0.033665632829070084},
55  {1500.0, 0.033094046637415886},
56  {2000.0, 0.029787263832986355},
57  {2500.0, 0.02972860541194677},
58  {3000.0, 0.029779289849102497},
59  {4000.0, 0.026585028506815437},
60  {5000.0, 0.025235182605683804}
61  };
62 
64  bool pass_cut(const double score, const xAOD::Jet* jet) const;
65 
66  };
67 }
68 #endif
grepfile.info
info
Definition: grepfile.py:38
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
FlavorTagDiscriminants::TrackClassifier::m_WPcuts
const std::map< double, double > m_WPcuts
Definition: TrackClassifier.h:49
FlavorTagDiscriminants
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: AssociationEnums.h:11
FlavorTagDiscriminants::TrackClassifier::ComputeScore
virtual std::map< std::string, double > ComputeScore(const xAOD::TrackParticle *track, const xAOD::Jet *jet) const override
Definition: TrackClassifier.cxx:49
ITrackClassifier
Definition: ITrackClassifier.h:16
FlavorTagDiscriminants::TrackClassifier::TrackClassifier
TrackClassifier(const std::string &name)
Definition: TrackClassifier.cxx:12
FlavorTagDiscriminants::TrackClassifier::~TrackClassifier
virtual ~TrackClassifier()
Definition: TrackClassifier.cxx:17
FlavorTagDiscriminants::TrackClassifier::selectTrack
virtual bool selectTrack(const xAOD::TrackParticle *track, const xAOD::Jet *jet) const override
Definition: TrackClassifier.cxx:132
FlavorTagDiscriminants::TrackClassifier::m_NNModelFilepath
std::string m_NNModelFilepath
Definition: TrackClassifier.h:44
FlavorTagDiscriminants::TrackClassifier::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: TrackClassifier.cxx:19
xAOD::SummaryType
SummaryType
Enumerates the different types of information stored in Summary.
Definition: TrackingPrimitives.h:228
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FlavorTagDiscriminants::TrackClassifier::get
int get(const xAOD::TrackParticle *part, xAOD::SummaryType info) const
Definition: TrackClassifier.cxx:33
FlavorTagDiscriminants::TrackClassifier::m_lwtnn_network
std::unique_ptr< lwt::LightweightGraph > m_lwtnn_network
Definition: TrackClassifier.h:43
FlavorTagDiscriminants::TrackClassifier::compute_HF_Score
virtual double compute_HF_Score(const xAOD::TrackParticle *track, const xAOD::Jet *jet) const override
Definition: TrackClassifier.cxx:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
FlavorTagDiscriminants::TrackClassifier::pass_cut
bool pass_cut(const double score, const xAOD::Jet *jet) const
Definition: TrackClassifier.cxx:106
xAOD::score
@ score
Definition: TrackingPrimitives.h:513
TrackParticle.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetContainer.h
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
ITrackClassifier.h
FlavorTagDiscriminants::TrackClassifier
Definition: TrackClassifier.h:26
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
AsgTool.h
TrackParticleContainer.h