20#include <ROOT/REveGeoShape.hxx>
21#include <ROOT/REveTrans.hxx>
22#include <ROOT/REveScene.hxx>
23#include <ROOT/REveViewer.hxx>
24#include <ROOT/REveElement.hxx>
25#include <ROOT/REveManager.hxx>
26#include <ROOT/REvePointSet.hxx>
27#include <ROOT/REveLine.hxx>
28#include <ROOT/REveProjectionManager.hxx>
29#include <ROOT/REveProjectionBases.hxx>
35REX::REvePointSet*
getPointSet(
int npoints = 2,
float s=2,
int color=28)
39 auto ps =
new REX::REvePointSet(
"testPnts",
"title", npoints);
41 for (
Int_t i=0; i<npoints; ++i)
42 ps->SetNextPoint(
r.Uniform(-
s,
s),
r.Uniform(-
s,
s),
r.Uniform(-
s,
s));
44 ps->SetMarkerColor(color);
45 ps->SetMarkerSize(3+
r.Uniform(1, 2));
57 REX::REveProjection* p =
mngRhoPhi->GetProjection();
58 p->AddPreScaleEntry(0, 0, 4);
59 p->AddPreScaleEntry(0, 45, 1);
60 p->AddPreScaleEntry(0, 310, 0.5);
61 p->SetUsePreScale(
kTRUE);
67 for (
auto &ie :
eveMng->GetGlobalScene()->RefChildren())
70 for (
auto &ie :
eveMng->GetEventScene()->RefChildren())
77 istringstream
f(path);
79 while (getline(
f,
s,
'/'))
88 eveMng = REX::REveManager::Create();
92 auto geoManager =
eveMng->GetGeometry(
"http://root.cern.ch/files/cms.root");
94 auto holder =
new REX::REveElement(
"MUON");
95 eveMng->GetGlobalScene()->AddElement(holder);
97 auto m =
new REX::REveGeoShape(
"MB_1");
98 m->SetShape(
n->GetVolume()->GetShape());
100 holder->AddElement(
m);
102 auto bv =
n->GetVolume();
103 for (
int i = 1; i < 5; ++i ) {
105 auto n = bv->FindNode(
Form(
"MBXC_%d",i));
106 auto gss =
n->GetVolume()->GetShape();
107 auto b1s =
new REX::REveGeoShape(
Form(
"Arc %d", i));
108 b1s->InitMainTrans();
109 const double* move =
n->GetMatrix()->GetTranslation();
110 b1s->RefMainTrans().SetFrom( *(
n->GetMatrix()));
112 b1s->SetMainColor(
kBlue);
113 holder->AddElement(b1s);
117 auto line =
new REX::REveLine();
118 line->SetNextPoint(0, 0, 0);
123 auto line2 =
new REX::REveLine();
124 line2->SetNextPoint(0, 0, 0);
126 line2->SetNextPoint(
b,
b+5,
b);
127 line2->SetMainColor(
kRed);
128 eveMng->GetEventScene()->AddElement(line2);
134 if (
type ==
"RPhi") {
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
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.
TGeoNode * getNodeFromPath(TGeoNode *top, std::string path)
REX::REveManager * eveMng
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)
REX::REveScene * rPhiGeomScene
REX::REveScene * rPhiEventScene
REX::REveViewer * rphiView
REX::REveProjectionManager * mngRhoPhi
static constexpr double s
static constexpr double ps