ATLAS Offline Software
Loading...
Searching...
No Matches
InDetNNScoringTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// Markus Elsing
8
9#ifndef INDETNNSCORINGTOOL_H
10#define INDETNNSCORINGTOOL_H
11
13#include "GaudiKernel/ToolHandle.h"
14#include "GaudiKernel/ServiceHandle.h"
19#include "lwtnn/lightweight_network_config.hh"
20#include "lwtnn/LightweightNeuralNetwork.hh"
21#include "lwtnn/LightweightGraph.hh"
22#include "lwtnn/parse_json.hh"
27// MagField cache
30#include <fstream>
31#include <vector>
32#include <string>
34
35namespace Trk {
36 class IExtrapolator;
37 class Track;
38 class TrackSummary;
39
40}
41class EventContext;
42
43namespace InDet {
45
48 public AthAlgTool
49{
50
51 public:
52 InDetNNScoringTool(const std::string&,const std::string&,const IInterface*);
53 virtual ~InDetNNScoringTool () = default;
54 virtual StatusCode initialize() override;
56 virtual bool passBasicSelections( const Trk::Track& track ) const override;
57
59 virtual Trk::TrackScore score( const Trk::Track& track, bool checkBasicSel ) const override;
60
62 virtual Trk::TrackScore simpleScore( const Trk::Track& track, const Trk::TrackSummary& trackSum ) const override;
63 Trk::TrackScore ambigScore( const Trk::Track& track, const Trk::TrackSummary& trackSum ) const;
64 Trk::TrackScore calcNnScore( const Trk::Track &track, const Trk::TrackSummary& trackSum , const Trk::Perigee *extrapolatedPerigee) const;
65
66
67 private:
69
70 // DNN tools
71 std::unique_ptr<lwt::LightweightGraph> m_graph;
72 std::map<std::string, double> m_DNN_inputValues;
73
75 bool isEmCaloCompatible(const Trk::Track& track, const EventContext& ctx) const;
76
77
78 //these are used for ScoreModifiers
85 std::vector<double> m_boundsSigmaChi2,
87
89 ToolHandle<ITrtDriftCircleCutTool> m_selectortool
90 {this, "DriftCircleCutTool", "InDet::InDetTrtDriftCircleCutTool"};
91
93 std::vector<Trk::TrackScore> m_summaryTypeScore;
94
95 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
96
97 ToolHandle<Trk::IExtrapolator> m_extrapolator
98 {this, "Extrapolator", "Trk::Extrapolator"};
99
100 // Read handle for conditions object to get the field cache
101 SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"};
102
103
105 BooleanProperty m_useAmbigFcn{this, "useAmbigFcn", true};
106 BooleanProperty m_useTRT_AmbigFcn{this, "useTRT_AmbigFcn", false};
107 BooleanProperty m_useSigmaChi2{this, "useSigmaChi2", false};
108
109 StringProperty m_nnCutConfig{this, "nnCutConfig", ""};
110 DoubleProperty m_nnCutThreshold{this, "nnCutThreshold", -0.1};
111
112 BooleanProperty m_usePixel{this, "usePixel", true};
113 BooleanProperty m_useSCT{this, "useSCT", true};
114
116 DoubleProperty m_minPt{this, "minPt", 500., "minimal Pt cut"};
117 DoubleProperty m_maxEta{this, "maxEta", 2.7, "maximal Eta cut"};
118 DoubleProperty m_maxRPhiImp
119 {this, "maxRPhiImp", 10., "maximal RPhi impact parameter cut"};
120 DoubleProperty m_maxZImp
121 {this, "maxZImp", 250., "maximal z impact parameter cut"};
122
123 IntegerProperty m_minSiClusters
124 {this, "minSiClusters", 7, "minimal number of Si clusters"};
125 IntegerProperty m_maxDoubleHoles
126 {this, "maxDoubleHoles", 2, "maximum number of SCT double holes"};
127 IntegerProperty m_maxSiHoles
128 {this, "maxSiHoles", 5, "max number of Silicon (Pixel+SCT) holes"};
129 IntegerProperty m_maxPixelHoles
130 {this, "maxPixelHoles", 5, "max number of Pixel holes"};
131 IntegerProperty m_maxSctHoles
132 {this, "maxSCTHoles", 5, "max number of SCT holes"};
133 IntegerProperty m_minTRTonTrk
134 {this, "minTRTonTrk", 9, "minimum number of TRT hits"};
135 DoubleProperty m_minTRTprecision
136 {this, "minTRTPrecisionFraction", 0.5, "minimum fraction of TRT precision hits"};
137 IntegerProperty m_minPixel
138 {this, "minPixel", 0, "minimum number of pixel clusters"};
139
140 DoubleProperty m_maxRPhiImpEM
141 {this, "maxRPhiImpEM", 50., "maximal RPhi impact parameter cut track that match EM clusters"};
142 BooleanProperty m_useEmClusSeed{this, "doEmCaloSeed", true};
143 FloatProperty m_phiWidthEm{this, "phiWidthEM", 0.075};
144 FloatProperty m_etaWidthEm{this, "etaWidthEM", 0.05};
145
147 {this, "EMROIPhiRZContainer", "", "Name of the calo cluster ROIs in Phi,R,Z parameterization"};
148};
149
150
151} // namespace InDet
152
153
154#endif
macros to associate a CLID to a type
defines and typedefs for IOVSvc
Property holding a SG store/key/clid from which a ReadHandle is made.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
The abstract interface base class for the trt segment selector tools.
std::vector< double > m_factorPixHoles
std::vector< double > m_boundsSigmaChi2
std::vector< Trk::TrackScore > m_summaryTypeScore
holds the scores assigned to each Trk::SummaryType from the track's Trk::TrackSummary
std::vector< double > m_factorB_LayerHits
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
virtual ~InDetNNScoringTool()=default
std::vector< double > m_factorDblHoles
Trk::TrackScore ambigScore(const Trk::Track &track, const Trk::TrackSummary &trackSum) const
virtual Trk::TrackScore simpleScore(const Trk::Track &track, const Trk::TrackSummary &trackSum) const override
create a score based on how good the passed TrackSummary is
ToolHandle< Trk::IExtrapolator > m_extrapolator
std::vector< double > m_factorSCT_Holes
std::vector< double > m_factorHits
std::map< std::string, double > m_DNN_inputValues
SG::ReadHandleKey< ROIPhiRZContainer > m_caloClusterROIKey
std::vector< double > m_factorGangedFakes
virtual bool passBasicSelections(const Trk::Track &track) const override
check track selections independent from TrackSummary
std::unique_ptr< lwt::LightweightGraph > m_graph
Trk::TrackScore calcNnScore(const Trk::Track &track, const Trk::TrackSummary &trackSum, const Trk::Perigee *extrapolatedPerigee) const
virtual Trk::TrackScore score(const Trk::Track &track, bool checkBasicSel) const override
create a score based on how good the passed track is
std::vector< double > m_factorTrtRatio
std::vector< double > m_boundsTrtFittedRatio
BooleanProperty m_useAmbigFcn
use the scoring tuned to Ambiguity processing or not
bool isEmCaloCompatible(const Trk::Track &track, const EventContext &ctx) const
Check if the cluster is compatible with a EM cluster.
std::vector< double > m_factorSigmaChi2
ToolHandle< ITrtDriftCircleCutTool > m_selectortool
Returns minimum number of expected TRT drift circles depending on eta.
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
std::vector< double > m_factorPixelHits
virtual StatusCode initialize() override
std::vector< double > m_factorPixLay
DoubleProperty m_minPt
cuts for selecting good tracks
InDetNNScoringTool(const std::string &, const std::string &, const IInterface *)
std::vector< double > m_boundsTrtRatio
std::vector< double > m_factorTrtFittedRatio
Property holding a SG store/key/clid from which a ReadHandle is made.
Interface class for the extrapolation AlgTool, it inherits from IAlgTool Detailed information about p...
Interface for tool to return a score from a given track.
A summary of the information contained by a track.
Primary Vertex Finder.
Ensure that the ATLAS eigen extensions are properly loaded.
float TrackScore
Definition TrackScore.h:10
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee