ROOT
master
Reference Guide
Loading...
Searching...
No Matches
compound.C File Reference
Tutorials
»
Visualisation tutorials
»
Event display for ROOT 7 tutorials
Detailed Description
#include "
TRandom.h
"
#include <
ROOT/REveManager.hxx
>
#include <
ROOT/REveScene.hxx
>
#include <
ROOT/REveLine.hxx
>
#include <
ROOT/REveCompound.hxx
>
namespace
REX
=
ROOT::Experimental
;
REX::REveLine
*
random_line
(
TRandom
&
rnd
,
Int_t
n
,
Float_t
delta)
{
auto
line
=
new
REX::REveLine
;
line
->SetMainColor(
kGreen
);
Float_t
x
= 0,
y
= 0, z = 0;
for
(
Int_t
i = 0; i <
n
; ++i) {
line
->SetNextPoint(
x
,
y
, z);
x
+=
rnd
.Uniform(0, delta);
y
+=
rnd
.Uniform(0, delta);
z +=
rnd
.Uniform(0, delta);
}
return
line
;
}
void
compound
()
{
// disable browser cache - all scripts and html files will be loaded every time, useful for development
// gEnv->SetValue("WebGui.HttpMaxAge", 0);
auto
eveMng
= REX::REveManager::Create();
TRandom
rnd
(0);
/*
auto* ml = random_line(rnd, 20, 10);
ml->SetMainColor(kRed);
ml->SetLineStyle(kDashed);
ml->SetLineWidth(3);
eveMng->InsertVizDBEntry("BigLine", ml);
*/
auto
cmp =
new
REX::REveCompound
;
cmp->
SetMainColor
(
kGreen
);
cmp->OpenCompound();
cmp->AddElement(
random_line
(
rnd
, 20, 10));
cmp->AddElement(
random_line
(
rnd
, 20, 10));
auto
line
=
random_line
(
rnd
, 20, 12);
line
->SetMainColor(
kRed
);
line
->
SetLineStyle
(
kDashed
);
line
->
SetLineWidth
(3);
// line->ApplyVizTag("BigLine");
cmp->AddElement(
line
);
cmp->CloseCompound();
eveMng
->GetEventScene()->AddElement(cmp);
eveMng
->Show();
}
REveCompound.hxx
REveLine.hxx
REveManager.hxx
REveScene.hxx
Int_t
int Int_t
Signed integer 4 bytes (int)
Definition
RtypesCore.h:60
Float_t
float Float_t
Float 4 bytes (float)
Definition
RtypesCore.h:72
kRed
@ kRed
Definition
Rtypes.h:67
kGreen
@ kGreen
Definition
Rtypes.h:67
kDashed
@ kDashed
Definition
TAttLine.h:54
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:359
TRandom.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:312
ROOT::Experimental::REveCompound
Definition
REveCompound.hxx:28
ROOT::Experimental::REveCompound::SetMainColor
void SetMainColor(Color_t color) override
SetMainColor for the compound.
Definition
REveCompound.cxx:49
ROOT::Experimental::REveLine
REveLine An arbitrary polyline with fixed line and marker attributes.
Definition
REveLine.hxx:30
TAttLine::SetLineStyle
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition
TAttLine.h:46
TAttLine::SetLineWidth
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition
TAttLine.h:47
TRandom
This is the base class for the ROOT Random number generators.
Definition
TRandom.h:28
line
TLine * line
Definition
entrylistblock_figure1.C:235
y
Double_t y[n]
Definition
legend1.C:17
x
Double_t x[n]
Definition
legend1.C:17
n
const Int_t n
Definition
legend1.C:16
CPyCppyy::TypeManip::compound
std::string compound(const std::string &name)
Definition
TypeManip.cxx:156
ROOT::Experimental
Namespace for ROOT features in testing.
Definition
TROOT.h:100
Author
Alja Mrak-Tadel
Definition in file
compound.C
.
tutorials
visualisation
eve7
compound.C
ROOTmaster - Reference Guide Generated on Wed Aug 26 2026 04:57:16 (GVA Time) using Doxygen 1.10.0