ATLAS Offline Software
Loading...
Searching...
No Matches
Reconstruction/PanTau/PanTauAlgs/PanTauAlgs/HelperFunctions.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef PANTAUALGS_TOOL_HELPERFUNCTIONS
6#define PANTAUALGS_TOOL_HELPERFUNCTIONS
7
8#include <string>
9#include <iostream>
10#include <vector>
11
13#include "AsgTools/ToolHandle.h"
14
15class TLorentzVector;
16class TVector3;
17
18namespace PanTau {
19 class TauConstituent;
20}
21
22class TVector3;
23
24namespace PanTau {
25
27
28 public:
29
30 // from PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/MethodBase.h
31 HelperFunctions(const std::string& name = ""):
32 AsgMessaging(name),
33 m_name(name)
34 {}
35
36 virtual ~HelperFunctions () {};
37
38 virtual std::string convertNumberToString(double x) const;
39
40 virtual int getBinIndex(const std::vector<double>& binEdges, double value) const;
41
42 virtual double stddev(double sumOfSquares, double sumOfValues, int numConsts) const;
43
44#ifdef XAOD_ANALYSIS
45 template<class T>
46 static StatusCode bindToolHandle( ToolHandle<T>& handle, std::string tool_name){
47 T* tool = dynamic_cast<T*> (asg::ToolStore::get(tool_name));
48 if(!tool->isInitialized())
49 if (tool->initialize().isFailure())
50 return StatusCode::FAILURE;
51 handle = ToolHandle<T>(tool);
52 return StatusCode::SUCCESS;
53 }
54#else
55 template<class T>
56 static StatusCode bindToolHandle( ToolHandle<T>& , std::string){return StatusCode::SUCCESS;}
57#endif
58
59 const std::string& getName() const
60 {
61 return m_name;
62 }
63
64
65 private:
66
67 std::string m_name;
68
69
70 }; //end class Tool_HelperFunctions
71
72
73}//end namespace PanTau
74
75
76
77
78#endif // PANTAUALGS_TOOL_HELPERFUNCTIONS
#define x
static StatusCode bindToolHandle(ToolHandle< T > &, std::string)
virtual double stddev(double sumOfSquares, double sumOfValues, int numConsts) const
virtual int getBinIndex(const std::vector< double > &binEdges, double value) const
Input object for PanTau.
Class mimicking the AthMessaging class from the offline software.
AsgMessaging(const std::string &name)
Constructor with a name.
static IAsgTool * get(const std::string &name, bool silent=false)
Retrieve a tool by name.
Definition ToolStore.cxx:57