9#ifndef ROOT_Browsable_RFieldProvider
10#define ROOT_Browsable_RFieldProvider
29using namespace std::string_literals;
51 auto buf =
fHist->GetBuffer();
53 if (!buf || (
len < 5))
69 if (min > 1) min -= 2;
71 std::unique_ptr<TH1>
h1 = std::make_unique<TH1F>(
fHist->GetName(),
fHist->GetTitle(),
npoints, min, max);
74 h1->
Fill(buf[2 + 2*
n], buf[1 + 2*
n]);
82 std::string title =
"Drawing of RField "s +
field.GetFieldName();
84 fHist = std::make_unique<TH1F>(
"hdraw", title.c_str(), 100, 0, 0);
85 fHist->SetDirectory(
nullptr);
101 fHist->BufferEmpty();
104 template <
typename T>
111 template <
typename T>
120 std::map<std::string, int> values;
125 for (
auto i : view.GetFieldRange()) {
126 std::string
v = view(i);
128 auto iter = values.find(
v);
129 if (iter != values.end())
131 else if (values.size() >= 50)
139 std::string title =
"Drawing of RField "s +
field.GetFieldName();
140 fHist = std::make_unique<TH1F>(
"h",title.c_str(),3,0,3);
141 fHist->SetDirectory(
nullptr);
145 for (
auto &
entry : values)
147 fHist->LabelsDeflate();
155 return fHist.release();
174 if (
const auto f32 =
field.As32Bit()) {
176 }
else if (
const auto f64 =
field.As64Bit()) {
187 if (!
holder)
return nullptr;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
void FillHistogram(const ROOT::RField< T > &field)
std::unique_ptr< TH1 > fHist
void TestHistBuffer()
Test collected entries if it looks like integer values and one can use better binning.
void VisitUInt64Field(const ROOT::RIntegralField< std::uint64_t > &field) final
void VisitStringField(const ROOT::RField< std::string > &field) final
void VisitField(const ROOT::RFieldBase &) final
void VisitBoolField(const ROOT::RField< bool > &field) final
void FillStringHistogram(const ROOT::RField< std::string > &field)
void VisitCharField(const ROOT::RField< char > &field) final
void VisitCardinalityField(const ROOT::RCardinalityField &field) final
void VisitUInt32Field(const ROOT::RIntegralField< std::uint32_t > &field) final
void VisitUInt8Field(const ROOT::RIntegralField< std::uint8_t > &field) final
std::shared_ptr< ROOT::RNTupleReader > fNtplReader
void VisitFloatField(const ROOT::RField< float > &field) final
void VisitInt32Field(const ROOT::RIntegralField< std::int32_t > &field) final
void VisitInt8Field(const ROOT::RIntegralField< std::int8_t > &field) final
void VisitInt16Field(const ROOT::RIntegralField< std::int16_t > &field) final
RDrawVisitor(std::shared_ptr< ROOT::RNTupleReader > ntplReader)
void VisitInt64Field(const ROOT::RIntegralField< std::int64_t > &field) final
void VisitDoubleField(const ROOT::RField< double > &field) final
void VisitUInt16Field(const ROOT::RIntegralField< std::uint16_t > &field) final
void FillHistogramImpl(const ROOT::RFieldBase &field, ROOT::RNTupleView< T > &view)
void FillHistogram(const ROOT::RIntegralField< T > &field)
Base class for provider of RNTuple drawing.
TH1 * DrawField(RFieldHolder *holder)
Provider of different browsing methods for supported classes.
Abstract base class for classes implementing the visitor design pattern.
An artificial field that transforms an RNTuple column that contains the offset of collections into co...
A field translates read and write calls from/to underlying columns to/from tree values.
Classes with dictionaries that can be inspected by TClass.
ROOT::RNTupleGlobalRange GetFieldRange() const
Returns the global field range of this view.
An RNTupleView for a known type.
TH1 is the base class of all histogram classes in ROOT.
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.