9#ifndef ROOT_Browsable_RFieldProvider
10#define ROOT_Browsable_RFieldProvider
29using namespace std::string_literals;
47 std::shared_ptr<ROOT::Experimental::Detail::RPageSource>
fNtplSource;
54 auto buf =
fHist->GetBuffer();
56 if (!buf || (
len < 5))
70 if (is_integer && (max-min < 100)) {
72 if (min > 1) min -= 2;
74 std::unique_ptr<TH1>
h1 = std::make_unique<TH1F>(
fHist->GetName(),
fHist->GetTitle(), npoints, min, max);
77 h1->
Fill(buf[2 + 2*
n], buf[1 + 2*
n]);
85 std::string title =
"Drawing of RField "s + field.
GetName();
87 fHist = std::make_unique<TH1F>(
"hdraw", title.c_str(), 100, 0, 0);
88 fHist->SetDirectory(
nullptr);
90 auto bufsize = (
fHist->GetBufferSize() - 1) / 2;
92 if (bufsize > 10) bufsize-=3;
else bufsize = -1;
95 for (
auto i : view.GetFieldRange()) {
97 if (++cnt == bufsize) {
105 fHist->BufferEmpty();
110 std::map<std::string, int> values;
115 for (
auto i : view.GetFieldRange()) {
116 std::string
v = view(i);
118 auto iter = values.find(
v);
119 if (iter != values.end())
121 else if (values.size() >= 50)
129 std::string title =
"Drawing of RField "s + field.
GetName();
130 fHist = std::make_unique<TH1F>(
"h",title.c_str(),3,0,3);
131 fHist->SetDirectory(
nullptr);
135 for (
auto &entry : values)
136 fHist->Fill(entry.first.c_str(), entry.second);
137 fHist->LabelsDeflate();
142 explicit RDrawVisitor(std::shared_ptr<ROOT::Experimental::Detail::RPageSource> ntplSource)
148 return fHist.release();
167 if (
const auto f32 = field.As32Bit()) {
169 }
else if (
const auto f64 = field.As64Bit()) {
180 if (!holder)
return nullptr;
185 std::unique_ptr<ROOT::Experimental::Detail::RFieldBase> field;
187 auto descriptorGuard = ntplSource->GetSharedDescriptorGuard();
188 field = descriptorGuard->GetFieldDescriptor(holder->
GetId()).CreateField(descriptorGuard.GetRef());
190 name.append(field->GetName());
193 field->AcceptVisitor(drawVisitor);
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
auto GetParentName() const
auto GetNtplSource() const
void VisitCardinalityField(const ROOT::Experimental::RCardinalityField &field) final
void VisitUInt16Field(const RField< std::uint16_t > &field) final
void FillStringHistogram(const RField< std::string > &field)
std::unique_ptr< TH1 > fHist
void VisitUInt32Field(const RField< std::uint32_t > &field) final
void TestHistBuffer()
Test collected entries if it looks like integer values and one can use better binning.
void FillHistogram(const RField< T > &field)
void VisitDoubleField(const RField< double > &field) final
std::shared_ptr< ROOT::Experimental::Detail::RPageSource > fNtplSource
void VisitInt8Field(const RField< std::int8_t > &field) final
void VisitCharField(const RField< char > &field) final
RDrawVisitor(std::shared_ptr< ROOT::Experimental::Detail::RPageSource > ntplSource)
void VisitUInt64Field(const RField< std::uint64_t > &field) final
void VisitStringField(const RField< std::string > &field) final
void VisitInt64Field(const RField< std::int64_t > &field) final
void VisitBoolField(const RField< bool > &field) final
void VisitUInt8Field(const RField< std::uint8_t > &field) final
void VisitInt16Field(const RField< std::int16_t > &field) final
void VisitField(const ROOT::Experimental::Detail::RFieldBase &) final
void VisitIntField(const RField< int > &field) final
void VisitFloatField(const RField< float > &field) final
Base class for provider of RNTuple drawing.
TH1 * DrawField(RFieldHolder *holder)
Provider of different browsing methods for supported classes.
A field translates read and write calls from/to underlying columns to/from tree values.
std::string GetName() const
DescriptorId_t GetOnDiskId() const
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...
Classes with dictionaries that can be inspected by TClass.
An RNTupleView provides read-only access to a single field of the ntuple.
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.