Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HistoProps.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // ============================================================================
12 // Include files
13 // ============================================================================
14 // GaudiKernel
15 // ============================================================================
18 // ============================================================================
19 // GaudiAlg
20 // ============================================================================
21 #include "GaudiAlg/GaudiHistoAlg.h"
22 // ============================================================================
28 // ============================================================================
29 namespace Gaudi {
30  namespace Examples {
36  class HistoProps : public GaudiHistoAlg {
37  public:
38  // ======================================================================
40  StatusCode execute() override;
41  // ======================================================================
42  public:
43  // ======================================================================
48  HistoProps( const std::string& name, ISvcLocator* pSvc ) : GaudiHistoAlg( name, pSvc ) {
49  setProperty( "PropertiesPrint", true ).ignore();
50  setProperty( "HistoPrint", true ).ignore();
51  }
52  // ======================================================================
53  private:
54  Gaudi::Property<Gaudi::Histo1DDef> m_hist1{ this, "Histo1", Gaudi::Histo1DDef( "Histogram1", -3, 3, 200 ),
55  "The parameters for the first histogram" };
57  this, "Histo2", { "Histogram2", -5, 5, 200 }, "The parameters for the second histogram" };
58  };
59  } // namespace Examples
60 } // end of namespace Gaudi
61 // ============================================================================
65 // ============================================================================
66 // Execute the algorithm
67 // ============================================================================
69 
70  Rndm::Numbers gauss( randSvc(), Rndm::Gauss( 0.0, 1.0 ) );
71 
72  plot( gauss(), m_hist1.value() );
73  plot( gauss(), m_hist2.value() );
74 
75  return StatusCode::SUCCESS;
76 }
77 // ============================================================================
78 // The END
79 // ============================================================================
Gaudi::Examples::HistoProps::m_hist1
Gaudi::Property< Gaudi::Histo1DDef > m_hist1
Definition: HistoProps.cpp:54
std::string
STL class.
RndmGenerators.h
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:528
PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
Definition: IProperty.h:39
ISvcLocator
Definition: ISvcLocator.h:46
IRndmGenSvc.h
GaudiHistoAlg.h
Gaudi::Histo1DDef
Definition: HistoDef.h:41
Gaudi::Examples::HistoProps::execute
StatusCode execute() override
Execute the algorithm.
Definition: HistoProps.cpp:68
StatusCode
Definition: StatusCode.h:65
Rndm::Gauss
Parameters for the Gauss random number generation.
Definition: RndmGenerators.h:32
Rndm::Numbers
Random number accessor This small class encapsulates the use of the random number generator.
Definition: RndmGenerators.h:359
GaudiPython.Pythonizations.execute
execute
Definition: Pythonizations.py:588
Gaudi::Examples::HistoProps::m_hist2
Gaudi::Property< Gaudi::Histo1DDef > m_hist2
Definition: HistoProps.cpp:56
GaudiPython.Pythonizations.plot
plot
Definition: Pythonizations.py:135
HistoUtilsEx.gauss
gauss
Definition: HistoUtilsEx.py:66
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
GaudiHistoAlg
Definition: GaudiHistoAlg.h:47
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
Gaudi::Examples::HistoProps
Definition: HistoProps.cpp:36
Gaudi::Property< Gaudi::Histo1DDef >
Gaudi::Examples::HistoProps::HistoProps
HistoProps(const std::string &name, ISvcLocator *pSvc)
standard constructor
Definition: HistoProps.cpp:48