11#include <ROOT/REveGeoShape.hxx>
12#include <ROOT/REveTrans.hxx>
13#include <ROOT/REveScene.hxx>
14#include <ROOT/REveViewer.hxx>
15#include <ROOT/REveElement.hxx>
16#include <ROOT/REveManager.hxx>
17#include <ROOT/REvePointSet.hxx>
18#include <ROOT/REveLine.hxx>
20#include <ROOT/REveProjectionManager.hxx>
21#include <ROOT/REveProjectionBases.hxx>
27REX::REvePointSet*
getPointSet(
int npoints = 2,
float s=2,
int color=28)
31 auto ps =
new REX::REvePointSet(
"testPnts", npoints);
33 for (
Int_t i=0; i<npoints; ++i)
34 ps->SetNextPoint(
r.Uniform(-
s,
s),
r.Uniform(-
s,
s),
r.Uniform(-
s,
s));
36 ps->SetMarkerColor(color);
37 ps->SetMarkerSize(3+
r.Uniform(1, 2));
49 REX::REveProjection* p =
mngRhoPhi->GetProjection();
50 p->AddPreScaleEntry(0, 0, 4);
51 p->AddPreScaleEntry(0, 45, 1);
52 p->AddPreScaleEntry(0, 310, 0.5);
53 p->SetUsePreScale(
kTRUE);
59 for (
auto & ie :
REX::gEve->GetGlobalScene()->RefChildren())
62 for (
auto & ie :
REX::gEve->GetEventScene()->RefChildren())
69 istringstream
f(path);
71 while (getline(
f,
s,
'/'))
80 REX::REveManager::Create();
86 auto holder =
new REX::REveElementList(
"MUON");
89 auto m =
new REX::REveGeoShape(
"MB_1");
90 m->SetShape(
n->GetVolume()->GetShape());
92 holder->AddElement(
m);
94 auto bv =
n->GetVolume();
95 for (
int i = 1; i < 5; ++i ) {
97 auto n = bv->FindNode(
Form(
"MBXC_%d",i));
98 auto gss =
n->GetVolume()->GetShape();
99 auto b1s =
new REX::REveGeoShape(
Form(
"Arc %d", i));
100 b1s->InitMainTrans();
101 const double* move =
n->GetMatrix()->GetTranslation();
102 b1s->RefMainTrans().SetFrom( *(
n->GetMatrix()));
104 b1s->SetMainColor(
kBlue);
105 holder->AddElement(b1s);
109 auto line =
new REX::REveLine();
110 line->SetNextPoint(0, 0, 0);
115 auto line2 =
new REX::REveLine();
116 line2->SetNextPoint(0, 0, 0);
118 line2->SetNextPoint(
b,
b+5,
b);
119 line2->SetMainColor(
kRed);
126 if (
type ==
"RPhi") {
R__EXTERN TEveManager * gEve
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
virtual void AddElement(TEveElement *el)
Add el to the list of children.
TEveScene * GetGlobalScene() const
TEveViewer * SpawnNewViewer(const char *name, const char *title="", Bool_t embed=kTRUE)
Create a new GL viewer.
TGeoManager * GetGeometry(const TString &filename)
Get geometry with given filename.
TEveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
TEveScene * GetEventScene() const
static Bool_t SetCacheFileDir(ROOT::Internal::TStringView cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
TGeoVolume * GetVolume() const
Int_t FindNode(const TGeoNode *node, Int_t level)
Search for a node within the branch of this one.
TGeoNode * FindNode(const char *name) const
search a daughter inside the list of nodes
This is the base class for the ROOT Random number generators.
REX::REveScene * rPhiGeomScene
REX::REveScene * rPhiEventScene
REX::REveViewer * rphiView
REX::REveProjectionManager * mngRhoPhi
TGeoNode * getNodeFromPath(TGeoNode *top, std::string path)
void makeProjectedViewsAndScene(REX::REveProjection::EPType_e type, bool scale)
void projection_prescale(std::string type="RhPhi")
REX::REvePointSet * getPointSet(int npoints=2, float s=2, int color=28)
static constexpr double s
static constexpr double ps