Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
single_dark.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_eve_7
3///
4/// \macro_code
5///
6/// \author Alja Mrak-Tadel
7
8#include "TRandom.h"
10#include <ROOT/REveScene.hxx>
11#include <ROOT/REveManager.hxx>
12#include <ROOT/REveJetCone.hxx>
14#include <ROOT/RWebWindow.hxx>
15
16
17const Double_t kR_min = 240;
18const Double_t kR_max = 250;
19const Double_t kZ_d = 300;
20
21using namespace ROOT::Experimental;
22
24{
25 TRandom &r = *gRandom;
26
27 for (int i = 0; i < N_Jets; i++) {
28 auto jet = new REveJetCone(Form("Jet_%d", i));
29 jet->SetCylinder(2 * kR_max, 2 * kZ_d);
30 jet->AddEllipticCone(r.Uniform(-0.5, 0.5), r.Uniform(0, TMath::TwoPi()), 0.1, 0.2);
31 jet->SetFillColor(kPink - 8);
32 jet->SetLineColor(kViolet - 7);
33
34 jetHolder->AddElement(jet);
35 }
36}
37
38void single_dark()
39{
40 auto eveMng = REveManager::Create();
41 eveMng->AllowMultipleRemoteConnections(false, false);
42
43 // openui5 theme
44 gEnv->SetValue("WebGui.DarkMode", "yes");
45
46 // default viewer, event scene
47 eveMng->GetDefaultViewer()->SetBlackBackground(true);
48 REveElement *jetHolder = new REveElement("Jets");
49 eveMng->GetEventScene()->AddElement(jetHolder);
51
52 // projected view
53 auto view = eveMng->SpawnNewViewer("RPhiView", "");
54 view->SetBlackBackground(true);
55 view->SetCameraType(REveViewer::kCameraOrthoXOY);
56 auto eventScene = eveMng->SpawnNewScene("RPZScene");
57 view->AddScene(eventScene);
58 view->SetMandatory(false);
59
60 auto mngRhoZ = new REveProjectionManager(REveProjection::kPT_RhoZ);
61 mngRhoZ->ImportElements(jetHolder, eventScene);
62
63 auto text = new REveText();
64 text->SetText("Single View");
65 text->SetTextColor(kWhite);
66 text->SetPosition(REveVector(0.02, 0.9, 0.2));
67 text->SetFontSize(0.05);
68 text->SetFont("LiberationSerif-Regular");
69 text->SetFillAlpha(228);
70 std::string rf_dir = gSystem->ExpandPathName("${ROOTSYS}/fonts/");
71 text->AssertSdfFont("LiberationSerif-Regular", rf_dir + "LiberationSerif-Regular.ttf");
72 eventScene->AddElement(text);
73
74 // append ?Single=RPhiView"
75 std::string url = eveMng->GetWebWindow()->GetUrl();
76 url += "?Single=RPhiView";
77 std::cout << "Single view URL" << url << "\n";
79 args.SetUrlOpt("Single=RPhiView");
80
81 eveMng->GetWebWindow()->Show();
82 eveMng->GetWebWindow()->Show(args);
83}
double Double_t
Double 8 bytes.
Definition RtypesCore.h:74
@ kPink
Definition Rtypes.h:68
@ kWhite
Definition Rtypes.h:66
@ kViolet
Definition Rtypes.h:68
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TEnv * gEnv
Definition TEnv.h:126
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 text
R__EXTERN TRandom * gRandom
Definition TRandom.h:73
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2570
R__EXTERN TSystem * gSystem
Definition TSystem.h:582
Base class for REveUtil visualization elements, providing hierarchy management, rendering control and...
Draws a jet cone with leading particle is specified in (eta,phi) and cone radius is given.
Manager class for steering of projections and managing projected objects.
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
RWebDisplayArgs & SetUrlOpt(const std::string &opt)
set window url options
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.
Definition TEnv.cxx:752
This is the base class for the ROOT Random number generators.
Definition TRandom.h:28
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition TSystem.cxx:1289
Namespace for ROOT features in testing.
Definition TROOT.h:100
constexpr Double_t TwoPi()
Definition TMath.h:47