Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:45

0001 /***********************************************************************************\
0002 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
0003 *                                                                                   *
0004 * This software is distributed under the terms of the Apache version 2 licence,     *
0005 * copied verbatim in the file "LICENSE".                                            *
0006 *                                                                                   *
0007 * In applying this licence, CERN does not waive the privileges and immunities       *
0008 * granted to it by virtue of its status as an Intergovernmental Organization        *
0009 * or submit itself to any jurisdiction.                                             *
0010 \***********************************************************************************/
0011 #ifndef GAUDIUTILS_HISTOLABELS_H
0012 #define GAUDIUTILS_HISTOLABELS_H 1
0013 
0014 #include <string>
0015 #include <utility>
0016 #include <vector>
0017 
0018 #include "GaudiKernel/Kernel.h"
0019 
0020 namespace AIDA {
0021   class IHistogram1D;
0022   class IHistogram2D;
0023   class IProfile1D;
0024   class IProfile2D;
0025 } // namespace AIDA
0026 
0027 namespace Gaudi {
0028   namespace Utils {
0029     namespace Histos {
0030       // --------------------------------------------------------------------------
0031 
0032       /// Typedef for a list of labels
0033       typedef std::vector<std::string> Labels;
0034       /// Typedef for a bin number and its associated label
0035       typedef std::pair<unsigned, std::string> BinLabel;
0036       /// Typedef for a list of bin numbers and their associated label
0037       typedef std::vector<BinLabel> BinLabels;
0038 
0039       // --------------------------------------------------------------------------
0040 
0041       /** @brief Set the Bin labels for a given 1D histogram
0042        *
0043        *  The labels will be applied in the order they appear in the list,
0044        *  starting at the first bin. If the list of labels is too short, the
0045        *  later bins will be missing a label. If the list is too long, only
0046        *  the first N will be used, where N is the number of bins in the histogram
0047        *
0048        *  @param hist   Pointer to the histogram
0049        *  @param labels The list of labels
0050        *
0051        *  @return Boolean indicating if the labels were successfully applied or not
0052        *  @retval TRUE  Labels were applied OK
0053        *  @retval FALSE Labels were NOT applied
0054        */
0055       GAUDI_API bool setBinLabels( AIDA::IHistogram1D* hist, const Labels& labels );
0056 
0057       /** @brief Set the Bin labels for a given 1D histogram
0058        *
0059        *  Each entry in 'labels' gives the bin number and its associated label
0060        *
0061        *  @param hist   Pointer to the histogram
0062        *  @param labels The list of labels
0063        *
0064        *  @return Boolean indicating if the labels were successfully applied or not
0065        *  @retval TRUE  Labels were applied OK
0066        *  @retval FALSE Labels were NOT applied
0067        */
0068       GAUDI_API bool setBinLabels( AIDA::IHistogram1D* hist, const BinLabels& labels );
0069 
0070       // --------------------------------------------------------------------------
0071 
0072       /** @brief Set the Bin labels for a given 1D profile histogram
0073        *
0074        *  The labels will be applied in the order they appear in the list,
0075        *  starting at the first bin. If the list of labels is too short, the
0076        *  later bins will be missing a label. If the list is too long, only
0077        *  the first N will be used, where N is the number of bins in the histogram
0078        *
0079        *  @param hist   Pointer to the histogram
0080        *  @param labels The list of labels
0081        *
0082        *  @return Boolean indicating if the labels were successfully applied or not
0083        *  @retval TRUE  Labels were applied OK
0084        *  @retval FALSE Labels were NOT applied
0085        */
0086       GAUDI_API bool setBinLabels( AIDA::IProfile1D* hist, const Labels& labels );
0087 
0088       /** @brief Set the Bin labels for a given 1D profile histogram
0089        *
0090        *  Each entry in 'labels' gives the bin number and its associated label
0091        *
0092        *  @param hist   Pointer to the histogram
0093        *  @param labels The list of bin numbers and the associated label
0094        *
0095        *  @return Boolean indicating if the labels were successfully applied or not
0096        *  @retval TRUE  Labels were applied OK
0097        *  @retval FALSE Labels were NOT applied
0098        */
0099       GAUDI_API bool setBinLabels( AIDA::IProfile1D* hist, const BinLabels& labels );
0100 
0101       // --------------------------------------------------------------------------
0102 
0103       /** @brief Set the Bin labels for a given 2D histogram
0104        *
0105        *  The labels will be applied in the order they appear in the lists,
0106        *  starting at the first bin. If the list of labels is too short, the
0107        *  later bins will be missing a label. If the list is too long, only
0108        *  the first N will be used, where N is the number of bins in the histogram
0109        *
0110        *  @param hist   Pointer to the histogram
0111        *  @param xlabels The list of x labels
0112        *  @param ylabels The list of y labels
0113        *
0114        *  @return Boolean indicating if the labels were successfully applied or not
0115        *  @retval TRUE  Labels were applied OK
0116        *  @retval FALSE Labels were NOT applied
0117        */
0118       GAUDI_API bool setBinLabels( AIDA::IHistogram2D* hist, const Labels& xlabels, const Labels& ylabels );
0119 
0120       /** @brief Set the Bin labels for a given 2D histogram
0121        *
0122        *  Each entry in 'labels' lists gives the bin number and its associated label
0123        *
0124        *  @param hist   Pointer to the histogram
0125        *  @param xlabels The list of x bin numbers and the associated label
0126        *  @param ylabels The list of y bin numbers and the associated label
0127        *
0128        *  @return Boolean indicating if the labels were successfully applied or not
0129        *  @retval TRUE  Labels were applied OK
0130        *  @retval FALSE Labels were NOT applied
0131        */
0132       GAUDI_API bool setBinLabels( AIDA::IHistogram2D* hist, const BinLabels& xlabels, const BinLabels& ylabels );
0133 
0134       // --------------------------------------------------------------------------
0135 
0136       /** @brief Set the Bin labels for a given 2D profile histogram
0137        *
0138        *  The labels will be applied in the order they appear in the lists,
0139        *  starting at the first bin. If the list of labels is too short, the
0140        *  later bins will be missing a label. If the list is too long, only
0141        *  the first N will be used, where N is the number of bins in the histogram
0142        *
0143        *  @param hist   Pointer to the histogram
0144        *  @param xlabels The list of x labels
0145        *  @param ylabels The list of y labels
0146        *
0147        *  @return Boolean indicating if the labels were successfully applied or not
0148        *  @retval TRUE  Labels were applied OK
0149        *  @retval FALSE Labels were NOT applied
0150        */
0151       GAUDI_API bool setBinLabels( AIDA::IProfile2D* hist, const Labels& xlabels, const Labels& ylabels );
0152 
0153       /** @brief Set the Bin labels for a given 2D profile histogram
0154        *
0155        *  Each entry in 'labels' lists gives the bin number and its associated label
0156        *
0157        *  @param hist   Pointer to the histogram
0158        *  @param xlabels The list of x bin numbers and the associated label
0159        *  @param ylabels The list of y bin numbers and the associated label
0160        *
0161        *  @return Boolean indicating if the labels were successfully applied or not
0162        *  @retval TRUE  Labels were applied OK
0163        *  @retval FALSE Labels were NOT applied
0164        */
0165       GAUDI_API bool setBinLabels( AIDA::IProfile2D* hist, const BinLabels& xlabels, const BinLabels& ylabels );
0166 
0167       // --------------------------------------------------------------------------
0168 
0169       /** @brief Set the axis labels for the given 1D histogram
0170        *
0171        *  @param hist  Pointer to the histogram
0172        *  @param xAxis Label for the x axis
0173        *  @param yAxis Label for the y axis
0174        *
0175        *  @return Boolean indicating if the labels were successfully applied or not
0176        *  @retval TRUE  Labels were applied OK
0177        *  @retval FALSE Labels were NOT applied
0178        */
0179       GAUDI_API bool setAxisLabels( AIDA::IHistogram1D* hist, const std::string& xAxis, const std::string& yAxis );
0180 
0181       /** @brief Set the axis labels for the given 1D profile histogram
0182        *
0183        *  @param hist  Pointer to the histogram
0184        *  @param xAxis Label for the x axis
0185        *  @param yAxis Label for the y axis
0186        *
0187        *  @return Boolean indicating if the labels were successfully applied or not
0188        *  @retval TRUE  Labels were applied OK
0189        *  @retval FALSE Labels were NOT applied
0190        */
0191       GAUDI_API bool setAxisLabels( AIDA::IProfile1D* hist, const std::string& xAxis, const std::string& yAxis );
0192 
0193       // --------------------------------------------------------------------------
0194 
0195       /** @brief Set the axis labels for the given 2D histogram
0196        *
0197        *  @param hist  Pointer to the histogram
0198        *  @param xAxis Label for the x axis
0199        *  @param yAxis Label for the y axis
0200        *
0201        *  @return Boolean indicating if the labels were successfully applied or not
0202        *  @retval TRUE  Labels were applied OK
0203        *  @retval FALSE Labels were NOT applied
0204        */
0205       GAUDI_API bool setAxisLabels( AIDA::IHistogram2D* hist, const std::string& xAxis, const std::string& yAxis );
0206 
0207       /** @brief Set the axis labels for the given 2D profile histogram
0208        *
0209        *  @param hist  Pointer to the histogram
0210        *  @param xAxis Label for the x axis
0211        *  @param yAxis Label for the y axis
0212        *
0213        *  @return Boolean indicating if the labels were successfully applied or not
0214        *  @retval TRUE  Labels were applied OK
0215        *  @retval FALSE Labels were NOT applied
0216        */
0217       GAUDI_API bool setAxisLabels( AIDA::IProfile2D* hist, const std::string& xAxis, const std::string& yAxis );
0218 
0219       // --------------------------------------------------------------------------
0220     } // namespace Histos
0221   }   // namespace Utils
0222 } // namespace Gaudi
0223 
0224 #endif // GAUDIUTILS_HISTOLABELS_H