Commit bf9d4192 authored by Kevin Dungs's avatar Kevin Dungs
Browse files

Expose more headers for ZmqHistogramSvc to work with.

parent 2883ce18
Pipeline #7023 failed with stage
.svn/
*~
*.pyc
.*.swp
......
/*
* AIDA_visibility_hack.h
*
* Created on: Jan 27, 2009
* Author: Marco Clemencic
*/
#ifndef AIDA_VISIBILITY_HACK_H_
#define AIDA_VISIBILITY_HACK_H_
/// @FIXME: AIDA interfaces visibility
// For the GAUDI_API macro
#include "GaudiKernel/Kernel.h"
// To avoid breaking STL
#include <string>
#include <vector>
// Force visibility of the classes
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wkeyword-macro"
#endif
#define class class GAUDI_API
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#include "AIDA/IBaseHistogram.h"
#include "AIDA/IHistogram1D.h"
#include "AIDA/IHistogram2D.h"
#include "AIDA/IHistogram3D.h"
#include "AIDA/IProfile1D.h"
#include "AIDA/IProfile2D.h"
#include "AIDA/IAnnotation.h"
#include "AIDA/IAxis.h"
#undef class
#endif /* AIDA_VISIBILITY_HACK_H_ */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef GAUDISVC__IAXIS_H
#define GAUDISVC__IAXIS_H 1
/// @FIXME: AIDA interfaces visibility
#include "AIDA_visibility_hack.h"
// This file is part of the AIDA library
// Copyright (C) 2002 by the AIDA team. All rights reserved.
// This library is free software and under the terms of the
// GNU Library General Public License described in the LGPL.txt
#include "AIDA/IAxis.h"
#include "TAxis.h"
namespace Gaudi {
/**
* An IAxis represents a binned histogram axis. A 1D Histogram would have
* one Axis representing the X axis, while a 2D Histogram would have two
* axes representing the X and Y Axis.
*
* @author The AIDA team (http://aida.freehep.org/)
*
*/
class Axis : public AIDA::IAxis
{
public:
typedef Axis self;
static int toRootIndex(int index, int nbins) {
if (index==AIDA::IAxis::OVERFLOW_BIN) return nbins+1;
if (index==AIDA::IAxis::UNDERFLOW_BIN) return 0;
return index+1;
}
static int toAidaIndex(int index, int bins) {
if ( index == bins + 1 ) return AIDA::IAxis::OVERFLOW_BIN ;
if ( index == 0 ) return AIDA::IAxis::UNDERFLOW_BIN ;
return index - 1 ;
}
/**
* Convert a AIDA bin number on the axis to the ROOT bin number.
* @param index TheAIDA bin number
* @return The corresponding ROOT bin number.
*
*/
int rIndex(int index) const { return toRootIndex(index, bins());}
/**
* Convert a ROOT bin number on the axis to the AIDA bin number.
* @param index The ROOT bin number: 1 to bins() for the in-range bins or bins()+1 for OVERFLOW or 0 for UNDERFLOW.
* @return The corresponding AIDA bin number.
*
*/
int aIndex( int index ) const { return toAidaIndex(index, bins()); }
public:
Axis() = default;
explicit Axis ( TAxis * itaxi ) : taxis_(itaxi) {}
void initialize (TAxis * itaxi , bool ) { taxis_ = itaxi; }
/// Destructor.
~Axis() override = default;
/**
* Check if the IAxis has fixed binning, i.e. if all the bins have the same width.
* @return <code>true</code> if the binning is fixed, <code>false</code> otherwise.
*
*/
bool isFixedBinning() const override
{
return 0 == taxis_ ? true : !taxis_->IsVariableBinSize() ;
}
/**
* Get the lower edge of the IAxis.
* @return The IAxis's lower edge.
*
*/
double lowerEdge() const override { return taxis().GetXmin();}
/**
* Get the upper edge of the IAxis.
* @return The IAxis's upper edge.
*
*/
double upperEdge() const override { return taxis().GetXmax();}
/**
* The number of bins (excluding underflow and overflow) on the IAxis.
* @return The IAxis's number of bins.
*
*/
int bins() const override { return taxis().GetNbins();}
/**
* Get the lower edge of the specified bin.
* @param index The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW.
* @return The lower edge of the corresponding bin; for the underflow bin this is <tt>Double.NEGATIVE_INFINITY</tt>.
*
*/
double binLowerEdge(int index) const override { return taxis().GetBinLowEdge(rIndex(index));}
/**
* Get the upper edge of the specified bin.
* @param index The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW.
* @return The upper edge of the corresponding bin; for the overflow bin this is <tt>Double.POSITIVE_INFINITY</tt>.
*
*/
double binUpperEdge(int index) const override { return taxis().GetBinUpEdge(rIndex(index));}
/**
* Get the width of the specified bin.
* @param index The bin number: 0 to bins()-1) for the in-range bins or OVERFLOW or UNDERFLOW.
* @return The width of the corresponding bin.
*
*/
double binWidth(int index) const override { return taxis().GetBinWidth(rIndex(index));}
/**
* Convert a coordinate on the axis to a bin number.
* If the coordinate is less than the lowerEdge UNDERFLOW is returned; if the coordinate is greater or
* equal to the upperEdge OVERFLOW is returned.
* @param coord The coordinate to be converted.
* @return The corresponding bin number.
*
*/
int coordToIndex(double coord) const override
{
return aIndex( taxis().FindBin(coord) );
}
/**
*
*/
TAxis & taxis() const { return *me().taxis_;}
private:
self & me() const { return const_cast<self&>(*this);}
TAxis * taxis_ = nullptr;
}; // class
} // namespace Gaudi
#endif /* ifndef AIDA_IAXIS_H */
#ifndef GAUDISVC_GAUDIPI_H
#define GAUDISVC_GAUDIPI_H
/// @FIXME: AIDA interfaces visibility
#include "AIDA_visibility_hack.h"
#include <vector>
#include <utility>
#include "AIDA/IHistogram1D.h"
#include "AIDA/IHistogram2D.h"
#include "AIDA/IHistogram3D.h"
#include "AIDA/IProfile1D.h"
#include "AIDA/IProfile2D.h"
#include "GaudiKernel/HistogramBase.h"
class DataObject;
class TH2D;
namespace Gaudi {
typedef std::vector<double> Edges;
template <class Q, class T> T* getRepresentation(const Q& hist) {
T* result = nullptr;
const HistogramBase *p = dynamic_cast<const HistogramBase*>(&hist);
if ( p ) {
result = dynamic_cast<T*>(p->representation());
}
return result;
}
/// Copy constructor
std::pair<DataObject*,AIDA::IHistogram1D*> createH1D(const AIDA::IHistogram1D& hist);
/// Creator for 1D histogram with fixed bins
std::pair<DataObject*,AIDA::IHistogram1D*> createH1D(const std::string& title, int nBins=10, double lowerEdge=0., double upperEdge=1.);
/// Creator for 1D histogram with variable bins
std::pair<DataObject*,AIDA::IHistogram1D*> createH1D(const std::string& title, const Edges& e);
/// Copy constructor
std::pair<DataObject*,AIDA::IHistogram2D*> createH2D(const AIDA::IHistogram2D& hist);
/// "Adopt" constructor
std::pair<DataObject*,AIDA::IHistogram2D*> createH2D(TH2D* rep);
/// Creator for 2 D histograms with fixed bins
std::pair<DataObject*,AIDA::IHistogram2D*> createH2D(const std::string& title, int binsX, double iminX, double imaxX, int binsY, double iminY, double imaxY);
/// Creator for 2 D histograms with variable bins
std::pair<DataObject*,AIDA::IHistogram2D*> createH2D(const std::string& title, const Edges& eX, const Edges& eY);
/// Create 1D slice from 2D histogram
std::pair<DataObject*,AIDA::IHistogram1D*> slice1DX(const std::string& name, const AIDA::IHistogram2D& h, int firstbin, int lastbin);
/// Create 1D profile in X from 2D histogram
std::pair<DataObject*,AIDA::IProfile1D*> profile1DX(const std::string& name, const AIDA::IHistogram2D& h, int firstbin, int lastbin);
/// Create 1D projection in X from 2D histogram
std::pair<DataObject*,AIDA::IHistogram1D*> project1DX(const std::string& name, const AIDA::IHistogram2D& h, int firstbin, int lastbin);
/// Create 1D slice from 2D histogram
std::pair<DataObject*,AIDA::IHistogram1D*> slice1DY (const std::string& name, const AIDA::IHistogram2D& h, int firstbin, int lastbin);
/// Create 1D profile in Y from 2D histogram
std::pair<DataObject*,AIDA::IProfile1D*> profile1DY(const std::string& name, const AIDA::IHistogram2D& h, int firstbin, int lastbin);
/// Create 1D projection in Y from 2D histogram
std::pair<DataObject*,AIDA::IHistogram1D*> project1DY(const std::string& name, const AIDA::IHistogram2D& h, int firstbin, int lastbin);
/// Copy constructor
std::pair<DataObject*,AIDA::IHistogram3D*> createH3D(const AIDA::IHistogram3D& hist);
/// Create 3D histogram with fixed bins
std::pair<DataObject*,AIDA::IHistogram3D*> createH3D(const std::string& title, int nBinsX, double xlow, double xup, int nBinsY, double ylow, double yup, int nBinsZ, double zlow, double zup);
/// Create 3D histogram with variable bins
std::pair<DataObject*,AIDA::IHistogram3D*> createH3D(const std::string& title, const Edges & eX,const Edges& eY, const Edges& eZ);
/// Copy constructor
std::pair<DataObject*,AIDA::IProfile1D*> createProf1D(const AIDA::IProfile1D& hist);
/// Creator of 1D profile with fixed bins
std::pair<DataObject*,AIDA::IProfile1D*> createProf1D
(const std::string& title, int nBins, double xlow, double xup, double ylow, double yup, const std::string& opt="" );
/// Creator of 1D profile with variable bins
std::pair<DataObject*,AIDA::IProfile1D*> createProf1D
(const std::string& title, const Edges& e, double ylow, double yup, const std::string& opt="");
/// Copy constructor
std::pair<DataObject*,AIDA::IProfile2D*> createProf2D(const AIDA::IProfile2D& hist);
/// Creator for 2 D profile with fixed bins
std::pair<DataObject*,AIDA::IProfile2D*> createProf2D(const std::string& title, int binsX, double iminX, double imaxX, int binsY, double iminY, double imaxY, double lowerValue, double upperValue);
/// Creator for 2 D profile with variable bins
std::pair<DataObject*,AIDA::IProfile2D*> createProf2D(const std::string& title, const Edges& eX, const Edges& eY, double lowerValue, double upperValue);
}
#endif // GAUDIPI_GAUDIPI_H
......@@ -9,7 +9,7 @@
// coming from TString.h
#pragma warning(disable:4996)
#endif
#include "H1D.h"
#include "GaudiCommonSvc/H1D.h"
#include "GaudiCommonSvc/GaudiPI.h"
#include "GaudiKernel/StreamBuffer.h"
#include "GaudiKernel/ObjectFactory.h"
......
......@@ -9,12 +9,12 @@
// coming from TString.h
#pragma warning(disable:4996)
#endif
#include "H2D.h"
#include "H1D.h"
#include "P1D.h"
#include "GaudiCommonSvc/H1D.h"
#include "GaudiCommonSvc/H2D.h"
#include "GaudiCommonSvc/P1D.h"
#include "GaudiKernel/ObjectFactory.h"
#include "TH1D.h"
#include "TProfile.h"
#include "GaudiKernel/ObjectFactory.h"
std::pair<DataObject*,IHistogram2D*> Gaudi::createH2D(const std::string & title,int binsX,double iminX,double imaxX,int binsY,double iminY,double imaxY) {
auto p = new Histogram2D(new TH2D(title.c_str(),title.c_str(),binsX, iminX, imaxX, binsY, iminY, imaxY));
......
......@@ -10,10 +10,10 @@
#pragma warning(disable:4996)
#endif
#include "GaudiCommonSvc/GaudiPI.h"
#include "GaudiCommonSvc/Generic3D.h"
#include "GaudiKernel/DataObject.h"
#include "GaudiKernel/ObjectFactory.h"
#include "GaudiCommonSvc/GaudiPI.h"
#include "Generic3D.h"
#include "TH3D.h"
namespace Gaudi {
......
This diff is collapsed.
......@@ -11,7 +11,7 @@
#endif
#include <cmath>
#include "P1D.h"
#include "GaudiCommonSvc/P1D.h"
#include "GaudiKernel/ObjectFactory.h"
std::pair<DataObject*,AIDA::IProfile1D*> Gaudi::createProf1D
......
......@@ -9,12 +9,12 @@
// coming from TString.h
#pragma warning(disable:4996)
#endif
#include "GaudiCommonSvc/GaudiPI.h"
#include "GaudiCommonSvc/Generic2D.h"
#include "GaudiKernel/DataObject.h"
#include "GaudiKernel/ObjectFactory.h"
#include "GaudiCommonSvc/GaudiPI.h"
#include "Generic2D.h"
#include "TProfile2D.h"
#include "TH2D.h"
#include "TProfile2D.h"
namespace Gaudi {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment