This example display projection prescale.
#include <sstream>
#include <iostream>
{
for (
Int_t i = 0; i < npoints; ++i)
ps->SetNextPoint(
r.Uniform(-s, s),
r.Uniform(-s, s),
r.Uniform(-s, s));
ps->SetMarkerColor(color);
ps->SetMarkerSize(3 +
r.Uniform(1, 2));
return ps;
}
void makeProjectedViewsAndScene(REX::REveProjection::EPType_e
type,
bool scale)
{
auto rPhiGeomScene = eveMng->
SpawnNewScene(
Form(
"Project%s Geo", scale ?
"PreScaled" :
""));
auto rPhiEventScene = eveMng->
SpawnNewScene(
Form(
"Project%s Event", scale ?
"PreScaled" :
""));
if (scale) {
p->AddPreScaleEntry(0, 0, 4);
p->AddPreScaleEntry(0, 45, 1);
p->AddPreScaleEntry(0, 310, 0.5);
}
rphiView->AddScene(rPhiEventScene);
rphiView->SetCameraType(REX::REveViewer::kCameraOrthoXOY);
for (auto &ie : eveMng->GetGlobalScene()->RefChildren())
mngRhoPhi->ImportElements(ie, rPhiGeomScene);
for (auto &ie : eveMng->GetEventScene()->RefChildren())
mngRhoPhi->ImportElements(ie, rPhiEventScene);
}
{
string s;
while (getline(
f, s,
'/'))
return node;
}
void projection_prescale(std::string
type =
"RPhi")
{
eveMng = REX::REveManager::Create();
auto geoManager = eveMng->
GetGeometry(
"http://root.cern/files/cms.root");
auto n = getNodeFromPath(top,
"MUON_1/MB_1");
m->SetShape(
n->GetVolume()->GetShape());
auto bv =
n->GetVolume();
for (int i = 1; i < 5; ++i) {
auto n = bv->FindNode(
Form(
"MBXC_%d", i));
auto gss =
n->GetVolume()->GetShape();
b1s->InitMainTrans();
const double *move =
n->GetMatrix()->GetTranslation();
b1s->RefMainTrans().SetFrom(*(
n->GetMatrix()));
b1s->SetShape(gss);
b1s->SetMainColor(
kBlue);
holder->AddElement(b1s);
}
line->SetNextPoint(0, 0, 0);
line2->SetNextPoint(0, 0, 0);
line2->SetNextPoint(
b,
b + 5,
b);
line2->SetMainColor(
kRed);
auto points = getPointSet(10, 30);
makeProjectedViewsAndScene(REX::REveProjection::kPT_RPhi, true);
makeProjectedViewsAndScene(REX::REveProjection::kPT_RPhi, false);
} else {
makeProjectedViewsAndScene(REX::REveProjection::kPT_RhoZ, true);
makeProjectedViewsAndScene(REX::REveProjection::kPT_RhoZ, false);
}
}
int Int_t
Signed integer 4 bytes (int)
winID h TVirtualViewer3D TVirtualGLPainter p
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 r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
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 type
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
virtual void AddElement(REveElement *el)
Add el to the list of children.
REveLine An arbitrary polyline with fixed line and marker attributes.
REveScene * GetEventScene() const
TGeoManager * GetGeometry(const TString &filename)
Get geometry with given filename.
REveScene * GetGlobalScene() const
REveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
REveViewer * SpawnNewViewer(const char *name, const char *title="")
Create a new GL viewer.
void Show(const RWebDisplayArgs &args="")
Show eve manager in specified browser.
REveProjectionManager Manager class for steering of projections and managing projected objects.
REveProjection Base for specific classes that implement non-linear projections.
virtual void AddScene(REveScene *scene)
Add 'scene' to the list of scenes.
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.
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.
Namespace for ROOT features in testing.