45 setAttribute(Qt::WA_DeleteOnClose);
51 fHisto =
new TH1F(
"gaus1",
"Example of TH1 drawing in TCanvas", 100, -5, 5);
55 gPad = fxTCanvasWidget->getCanvas();
58 static constexpr int nth2points = 40;
59 fHisto2 = std::make_shared<TH2I>(
"gaus2",
"Example of TH2 drawing in RCanvas", nth2points, -5, 5, nth2points, -5, 5);
61 for (
int n=0;
n<nth2points;++
n) {
62 for (
int k=0;k<nth2points;++k) {
63 double x = 10.*
n/nth2points-5.;
64 double y = 10.*k/nth2points-5.;
81 auto viewer = fxGeomViewerWidget->getGeomViewer();
108 auto viewer = fxGeomViewerWidget->getGeomViewer();
131 viewer->SetDrawOptions(
"clipxyz");
195 R->AddNode(bar1, 1, tr1);
198 R->AddNode(bar2, 1, tr2);
199 R->AddNode(bar2, 2, tr3);
202 R->AddNode(tub1, 1, tr4);
233 T->AddNode(bar5, 1, tr8);
236 T->AddNode(bar6, 1, tr9);
251 auto canv = fxTCanvasWidget->getCanvas();
259 for (
int n=0;
n<21;
n++)
260 pm->SetPoint(
n, -120 +
n*10, -20, 25);
263 pm->SetMarkerSize(2);
264 pm->SetMarkerColor(4);
265 pm->SetMarkerStyle(2);
272 pl->SetPoint(0, -120, -20, -30);
273 pl->SetPoint(1, 80, -20, -30);
274 pl->SetPoint(2, 80, 20, -30);
275 pl->SetPoint(3, -120, 20, -30);
276 pl->SetPoint(4, -120, -20, -30);
288 QMessageBox::information(
this,
"QtRoot standalone example",
"Demo how QRootCanvas can be inserted into the QWidget");
293 if (fxTabWidget->count() > 3) {
295 fxTabWidget->setCurrentIndex(3);
303 auto widget = fxTabWidget->widget(3);
304 fxTabWidget->removeTab(3);
307 fxTabWidget->setCurrentIndex(2);
309 fxTabWidget->setCurrentIndex(2);
314#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
315 gROOT->SetWebDisplay(
"qt5");
317 gROOT->SetWebDisplay(
"qt6");
320 auto h1 =
new TH1F(
"gaus_standalone",
"Example of standalone TCanvas", 100, -5, 5);
324 auto c =
new TCanvas(
"standalone",
"Standalone canvas");
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
Provides v7 drawing facilities for TObject types (TGraph, TH1, TH2, etc).
static Bool_t SetCacheFileDir(std::string_view cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Sets the directory where to locally stage/cache remote files.
virtual void SetVertex(Int_t vnum, Double_t x, Double_t y)
Class describing rotation + translation.
The manager class for any TGeo geometry.
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=nullptr)
Make an TGeoArb8 volume.
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
void DefaultColors()
Set default volume colors according to A of material.
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
TGeoVolume * MakeTubs(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a tube segment shape with given medium.
Base class describing materials.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Class describing rotations.
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
void SetLineWidth(Width_t lwidth) override
Set the line width.
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
void SetTransparency(Char_t transparency=0)
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
void SetLineColor(Color_t lcolor) override
Set the line color.
TGeoShape * GetShape() const
1-D histogram with a float per channel (see TH1 documentation)
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 void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr)
void Draw(Option_t *option="") override
Draw this histogram with options.
A 3-dimensional polyline.
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.