Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:34

0001 /// \file ROOT/RHistDisplayItem.hxx
0002 /// \ingroup HistDrawV7
0003 /// \author Sergey Linev <s.linev@gsi.de>
0004 /// \date 2020-06-25
0005 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
0006 /// is welcome!
0007 
0008 /*************************************************************************
0009  * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers.               *
0010  * All rights reserved.                                                  *
0011  *                                                                       *
0012  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0013  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0014  *************************************************************************/
0015 
0016 #ifndef ROOT7_RHistDisplayItem
0017 #define ROOT7_RHistDisplayItem
0018 
0019 #include <ROOT/RDisplayItem.hxx>
0020 
0021 #include <vector>
0022 
0023 namespace ROOT {
0024 namespace Experimental {
0025 
0026 class RAxisBase;
0027 
0028 class RHistDisplayItem : public RIndirectDisplayItem {
0029    std::vector<const RAxisBase *> fAxes;   ///< histogram axes, only temporary pointers
0030    std::vector<int> fIndicies;             ///< [left,right,step] for each axes
0031    std::vector<double> fBinContent;        ///< extracted bins values
0032    double fContMin{0.};                    ///< minimum content value
0033    double fContMinPos{0.};                 ///< minimum positive value
0034    double fContMax{0.};                    ///< maximum content value
0035 
0036 public:
0037    RHistDisplayItem() = default;
0038 
0039    RHistDisplayItem(const RDrawable &dr);
0040 
0041    void AddAxis(const RAxisBase *axis, int left = -1, int right = -1, int step = 1)
0042    {
0043       fAxes.emplace_back(axis);
0044       fIndicies.emplace_back(left);
0045       fIndicies.emplace_back(right);
0046       fIndicies.emplace_back(step);
0047    }
0048 
0049    auto &GetBinContent() { return fBinContent; }
0050 
0051    void SetContentMinMax(double min, double minpos, double max)
0052    {
0053       fContMin = min;
0054       fContMinPos = minpos;
0055       fContMax = max;
0056    }
0057 };
0058 
0059 } // namespace Experimental
0060 } // namespace ROOT
0061 
0062 #endif