ATLAS Offline Software
HanConfigAlgPar.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // **********************************************************************
6 // $Id: HanConfigAlgPar.cxx,v 1.4 2007-12-14 16:04:40 mgwilson Exp $
7 // **********************************************************************
8 
10 
11 #include <iomanip>
12 #include <sstream>
13 
14 #include <TObjString.h>
15 
16 
17 //Get rid of Root macros that confuse Doxygen
21 
22 
23 namespace dqi {
24 
25 // *********************************************************************
26 // Public Methods
27 // *********************************************************************
28 
31  : m_name("")
32  , m_value(0.0)
33 {
34 }
35 
36 
39 {
40 }
41 
42 
43 void
45 SetName( std::string name_ )
46 {
47  m_name.SetString( name_.c_str() );
48 }
49 
50 
51 const char*
53 GetName() const
54 {
55  return m_name.GetName();
56 }
57 
58 
59 void
61 SetValue( float value_ )
62 {
63  m_value = value_;
64 }
65 
66 
67 float
69 GetValue() const
70 {
71  return m_value;
72 }
73 
74 
75 void
77 PrintIOStream( std::ostream& o ) const
78 {
79  o << GetName() << " = " << GetValue() << "\n";
80 }
81 
82 TList *
84 GetList()
85 {
86  TList *ret = new TList();
87 
88  std::ostringstream parValStr;
89  parValStr << std::setprecision(4) << this->m_value;
90  ret->SetName( this->GetName() );
91  ret->Add( new TObjString(parValStr.str().c_str()) );
92 
93  return ret;
94 }
95 
96 } // namespace dqi
97 
98 
99 std::ostream& operator<<( std::ostream& o, const dqi::HanConfigAlgPar& p )
100 {
101  p.PrintIOStream(o);
102  return o;
103 }
104 
105 
106 std::ostream& operator<<( std::ostream& o, const dqi::HanConfigAlgPar* p )
107 {
108  p->PrintIOStream(o);
109  return o;
110 }
111 
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
dqi::HanConfigAlgPar::SetName
virtual void SetName(std::string name_)
Definition: HanConfigAlgPar.cxx:45
dqi::HanConfigAlgPar::GetName
virtual const char * GetName() const
Definition: HanConfigAlgPar.cxx:53
dqi::HanConfigAlgPar::m_value
Float_t m_value
Definition: HanConfigAlgPar.h:42
dqi::HanConfigAlgPar::~HanConfigAlgPar
virtual ~HanConfigAlgPar()
Definition: HanConfigAlgPar.cxx:38
ClassImp
ClassImp(xAOD::TFileChecker) namespace xAOD
Definition: TFileChecker.cxx:28
dqi::HanConfigAlgPar::m_name
TObjString m_name
Definition: HanConfigAlgPar.h:41
ret
T ret(T t)
Definition: rootspy.cxx:260
dqi::HanConfigAlgPar::SetValue
virtual void SetValue(float value_)
Definition: HanConfigAlgPar.cxx:61
dqi::HanConfigAlgPar::HanConfigAlgPar
HanConfigAlgPar()
Definition: HanConfigAlgPar.cxx:30
dqi::HanConfigAlgPar::GetList
virtual TList * GetList()
Definition: HanConfigAlgPar.cxx:84
dqi::HanConfigAlgPar::GetValue
virtual float GetValue() const
Definition: HanConfigAlgPar.cxx:69
dqi::HanConfigAlgPar::PrintIOStream
virtual void PrintIOStream(std::ostream &o) const
Definition: HanConfigAlgPar.cxx:77
dqi::HanConfigAlgPar
Definition: HanConfigAlgPar.h:18
operator<<
std::ostream & operator<<(std::ostream &o, const dqi::HanConfigAlgPar &p)
Definition: HanConfigAlgPar.cxx:99
HanConfigAlgPar.h
dqi
Definition: CompositeAlgorithm.h:16