ATLAS Offline Software
PunchThroughClassifier.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_PUNCHTHROUGHTOOLS_SRC_PUNCHTHROUGHCLASSIFIER_H
6 #define ISF_PUNCHTHROUGHTOOLS_SRC_PUNCHTHROUGHCLASSIFIER_H 1
7 
8 // ISF includes
10 
12 
14 
16 
17 
18 #include <map>
19 
20 //LWTNN
21 #include "lwtnn/LightweightGraph.hh"
22 
23 
24 namespace ISF {
25 
26 class PunchThroughClassifier : public extends<AthAlgTool, IPunchThroughClassifier> {
27 public:
28 
30  PunchThroughClassifier(const std::string&,const std::string&,const IInterface*);
31 
33  virtual ~PunchThroughClassifier() = default;
34 
36  virtual StatusCode initialize() override final;
37 
39  StatusCode initializeScaler(const std::string & scalerConfigFile);
40 
42  StatusCode initializeNetwork(const std::string & networkConfigFile);
43 
45  StatusCode initializeCalibrator(const std::string & calibratorConfigFile);
46 
48  virtual double computePunchThroughProbability(const ISF::ISFParticle &isfp, const TFCSSimulationState& simulstate) const override;
49 
51  static std::map<std::string, std::map<std::string, double> > computeInputs(const ISF::ISFParticle &isfp, const TFCSSimulationState& simulstate) ;
52 
54  std::map<std::string, std::map<std::string, double> > scaleInputs(std::map<std::string, std::map<std::string, double> >& inputs) const;
55 
57  double calibrateOutput(double& networkOutput) const;
58 
59 private:
61  std::unique_ptr<lwt::LightweightGraph> m_graph{};
62 
64  double m_scalerMin{};
65  double m_scalerMax{};
66  std::map<std::string, double> m_scalerMinMap;
67  std::map<std::string, double> m_scalerMaxMap;
68 
71  double m_calibrationMin{};
72  double m_calibrationMax{};
73  std::map<double, double> m_calibrationMap;
74 
75  //properties
79 
80 };
81 }
82 
83 #endif //ISF_PUNCHTHROUGHTOOLS_SRC_PUNCHTHROUGHCLASSIFIER_H
ISF::PunchThroughClassifier::m_scalerMaxMap
std::map< std::string, double > m_scalerMaxMap
Definition: PunchThroughClassifier.h:67
ISF::PunchThroughClassifier::m_graph
std::unique_ptr< lwt::LightweightGraph > m_graph
NN graph.
Definition: PunchThroughClassifier.h:61
ISF::PunchThroughClassifier::m_calibrationMap
std::map< double, double > m_calibrationMap
Definition: PunchThroughClassifier.h:73
ISF::PunchThroughClassifier::calibrateOutput
double calibrateOutput(double &networkOutput) const
calibrate NN output using isotonic regressor
Definition: PunchThroughClassifier.cxx:198
ISF::PunchThroughClassifier
Definition: PunchThroughClassifier.h:26
ISF::ISFParticle
Definition: ISFParticle.h:42
ISF::PunchThroughClassifier::initializeScaler
StatusCode initializeScaler(const std::string &scalerConfigFile)
input variable MinMaxScaler initialize method
Definition: PunchThroughClassifier.cxx:71
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
ISF::PunchThroughClassifier::m_calibrationMax
double m_calibrationMax
Definition: PunchThroughClassifier.h:72
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
ISF::PunchThroughClassifier::m_calibrationMin
double m_calibrationMin
Definition: PunchThroughClassifier.h:71
ISF::PunchThroughClassifier::m_scalerMin
double m_scalerMin
input variable MinMaxScaler members
Definition: PunchThroughClassifier.h:64
ISF::PunchThroughClassifier::initialize
virtual StatusCode initialize() override final
AlgTool initialize method.
Definition: PunchThroughClassifier.cxx:46
ISFParticle.h
ISF::PunchThroughClassifier::computeInputs
static std::map< std::string, std::map< std::string, double > > computeInputs(const ISF::ISFParticle &isfp, const TFCSSimulationState &simulstate)
calcalate NN inputs based on isfp and simulstate
Definition: PunchThroughClassifier.cxx:157
ISF::PunchThroughClassifier::scaleInputs
std::map< std::string, std::map< std::string, double > > scaleInputs(std::map< std::string, std::map< std::string, double > > &inputs) const
scale NN inputs using MinMaxScaler
Definition: PunchThroughClassifier.cxx:179
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
lwt
Definition: NnClusterizationFactory.h:52
ISF::PunchThroughClassifier::m_scalerMax
double m_scalerMax
Definition: PunchThroughClassifier.h:65
ISF::PunchThroughClassifier::~PunchThroughClassifier
virtual ~PunchThroughClassifier()=default
Destructor.
ISF::PunchThroughClassifier::initializeNetwork
StatusCode initializeNetwork(const std::string &networkConfigFile)
neural network initialize method
Definition: PunchThroughClassifier.cxx:105
ISF::PunchThroughClassifier::m_calibratorConfigFileName
std::string m_calibratorConfigFileName
Definition: PunchThroughClassifier.h:78
ISF::PunchThroughClassifier::computePunchThroughProbability
virtual double computePunchThroughProbability(const ISF::ISFParticle &isfp, const TFCSSimulationState &simulstate) const override
interface method to return probability prediction of punch through
Definition: PunchThroughClassifier.cxx:32
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
ISF::PunchThroughClassifier::initializeCalibrator
StatusCode initializeCalibrator(const std::string &calibratorConfigFile)
isotonic regressor calibrator initialize method
Definition: PunchThroughClassifier.cxx:126
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
TFCSSimulationState.h
ISF::PunchThroughClassifier::m_scalerConfigFileName
std::string m_scalerConfigFileName
Definition: PunchThroughClassifier.h:77
ISF::PunchThroughClassifier::PunchThroughClassifier
PunchThroughClassifier(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition: PunchThroughClassifier.cxx:24
IPunchThroughClassifier.h
TFCSSimulationState
Definition: TFCSSimulationState.h:32
ISF::PunchThroughClassifier::m_calibratorConfigFile
std::string m_calibratorConfigFile
isotonic regressor calibrator members
Definition: PunchThroughClassifier.h:70
ISF::PunchThroughClassifier::m_networkConfigFileName
std::string m_networkConfigFileName
Definition: PunchThroughClassifier.h:76
ISF::PunchThroughClassifier::m_scalerMinMap
std::map< std::string, double > m_scalerMinMap
Definition: PunchThroughClassifier.h:66