The Gaudi Framework  v33r1 (b1225454)
H1D.h
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 #ifndef HISTOGRAMSVC_H1D_H
12 #define HISTOGRAMSVC_H1D_H 1
13 
14 #include "Generic1D.h"
15 #include <AIDA/IHistogram1D.h>
16 #include <GaudiKernel/DataObject.h>
17 #include <TH1D.h>
18 
19 #include <mutex>
20 
21 namespace Gaudi {
22 
29  class GAUDI_API Histogram1D : public DataObject, public Gaudi::Generic1D<AIDA::IHistogram1D, TH1D> {
30  private:
31  void init( const std::string& title, bool initialize_axis = true );
32  void initSums();
33 
34  protected:
36  double m_sumwx = 0;
37 
38  public:
40  Histogram1D();
42  Histogram1D( TH1D* rep );
43 
45  void adoptRepresentation( TObject* rep ) override;
47  virtual bool setBinContents( int i, int entries, double height, double error, double centre );
49  bool reset() override;
51  virtual bool setStatistics( int allEntries, double eqBinEntries, double mean, double rms );
53  bool fill( double x, double weight ) override;
55  bool setRms( double rms );
57  void copyFromAida( const AIDA::IHistogram1D& h );
59  const CLID& clID() const override { return classID(); }
60  static const CLID& classID() { return CLID_H1D; }
65  StreamBuffer& serialize( StreamBuffer& s );
66 
71  StreamBuffer& serialize( StreamBuffer& s ) const;
72 
73  private:
75 
76  }; // end class IHistogram1D
77 } // end namespace Gaudi
78 #endif // HISTOGRAMSVC_H1D_H
std::mutex m_fillSerialization
Definition: H1D.h:74
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:51
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:45
STL class.
AIDA implementation for 1 D histograms using ROOT THD1.
Definition: H1D.h:29
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
static const CLID & classID()
Definition: H1D.h:60
string s
Definition: gaudirun.py:328
#define GAUDI_API
Definition: Kernel.h:81
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:40
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
Common AIDA implementation stuff for histograms and profiles using ROOT implementations.
Definition: Generic1D.h:45
const CLID & clID() const override
Retrieve reference to class defininition identifier.
Definition: H1D.h:59