60 for (
Int_t i = 0; i < npoints; ++i)
61 ps->SetNextPoint(
r.Uniform(-s, s),
r.Uniform(-s, s),
r.Uniform(-s, s));
63 ps->SetMarkerColor(color);
65 ps->SetMarkerStyle(4);
75 auto ps1 = getPointSet(20, 100);
76 ps1->SetName(
"Points_1");
77 ps1->SetTitle(
"Points_1 title");
79 pntHolder->AddElement(ps1);
81 auto ps2 = getPointSet(10, 200, 4);
82 ps2->SetName(
"Points_2");
83 ps2->SetTitle(
"Points_2 title");
84 ps2->SetAlwaysSecSelect(
true);
85 pntHolder->AddElement(ps2);
87 event->AddElement(pntHolder);
106 int N_Tracks = 10 +
r.Integer(20);
107 for (
int i = 0; i < N_Tracks; i++) {
110 int pdg = 11 * (
r.Integer(2) > 0 ? 1 : -1);
113 p.SetProductionVertex(
r.Uniform(-
v,
v),
r.Uniform(-
v,
v),
r.Uniform(-
v,
v), 1);
114 p.SetMomentum(
r.Uniform(-
m,
m),
r.Uniform(-
m,
m),
r.Uniform(-
m,
m) *
r.Uniform(1, 3), 1);
119 track->SetMainColor(
kBlue);
120 track->SetName(
Form(
"RandomTrack_%d", i));
121 track->SetTitle(
Form(
"RandomTrack_%d title", i));
122 trackHolder->AddElement(track);
125 event->AddElement(trackHolder);
135 int N_Jets = 5 +
r.Integer(5);
136 for (
int i = 0; i < N_Jets; i++) {
138 jet->SetTitle(
Form(
"Jet_%d\n pT = %.2f", i,
r.Uniform(1, 40)));
139 jet->SetCylinder(2 * kR_max, 2 * kZ_d);
140 jet->AddEllipticCone(
r.Uniform(-3.5, 3.5),
r.Uniform(0,
TMath::TwoPi()),
r.Uniform(0.02, 0.2),
141 r.Uniform(0.02, 0.3));
142 jet->SetFillColor(
kPink - 8);
143 jet->SetLineColor(
kBlack);
145 jetHolder->AddElement(jet);
147 event->AddElement(jetHolder);
157void makeGeometryScene()
160 b1->SetShape(
new TGeoTube(kR_min, kR_max, kZ_d));
161 b1->SetMainColor(
kCyan);
162 b1->SetNSegments(80);
163 b1->SetMainTransparency(70);
168 b1->SetNSegments(40);
174void createProjectionStuff()
177 rPhiGeomScene = eveMng->
SpawnNewScene(
"RPhi Geometry",
"RPhi");
178 rPhiEventScene = eveMng->
SpawnNewScene(
"RPhi Event Data",
"RPhi");
189 rhoZGeomScene = eveMng->
SpawnNewScene(
"RhoZ Geometry",
"RhoZ");
190 rhoZEventScene = eveMng->
SpawnNewScene(
"RhoZ Event Data",
"RhoZ");
200void projectScenes(
bool geomp,
bool eventp)
203 for (
auto &ie : eveMng->GetGlobalScene()->RefChildren()) {
212 for (
auto &ie : eveMng->GetEventScene()->RefChildren()) {
234 bool fAutoplay{
false};
237 std::chrono::duration<double> fDeltaTime{1};
239 std::thread *fTimerThread{
nullptr};
241 std::condition_variable fCV;
246 std::chrono::milliseconds ms(100);
250 ~EventManager()
override {}
257 projectScenes(
false,
true);
261 void autoplay_scheduler()
266 std::unique_lock<std::mutex> lock{fMutex};
271 if (fCV.wait_for(lock, fDeltaTime) != std::cv_status::timeout) {
272 printf(
"autoplay not timed out \n");
274 printf(
"exit thread post wait\n");
280 autoplay = fAutoplay;
283 REX::REveManager::ChangeGuard ch;
293 static std::mutex autoplay_mutex;
294 std::unique_lock<std::mutex> aplock{autoplay_mutex};
296 std::unique_lock<std::mutex> lock{fMutex};
297 fAutoplay = !fAutoplay;
300 fTimerThread->join();
302 fTimerThread =
nullptr;
305 fTimerThread =
new std::thread{[
this] { autoplay_scheduler(); }};
312 virtual void QuitRoot()
314 printf(
"Quit ROOT\n");
315 REX::REveManager::QuitRoot();
326 eveMng = REX::REveManager::Create();
329 auto eventMng =
new EventManager();
330 eventMng->SetName(
"EventManager");
335 eveMng->
GetWorld()->
AddCommand(
"NextEvent",
"sap-icon://step", eventMng,
"NextEvent()");
337 eveMng->
GetWorld()->
AddCommand(
"Autoplay",
"sap-icon://refresh", eventMng,
"Autoplay()");
343 createProjectionStuff();
344 projectScenes(
true,
true);
int Int_t
Signed integer 4 bytes (int)
double Double_t
Double 8 bytes.
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 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 prop
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.
virtual void DestroyElements()
Destroy all children of this element.
REveMagFieldDuo Interface to magnetic field with two different values depending on radius.
REveScene * GetEventScene() const
void AllowMultipleRemoteConnections(bool loopBack=true, bool useAuthKey=true)
Utility function to allow remote RWebWindow connections.
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.
REveViewer * GetDefaultViewer() const
Get the default viewer.
REveScene * GetWorld() const
void Show(const RWebDisplayArgs &args="")
Show eve manager in specified browser.
REveProjectionManager Manager class for steering of projections and managing projected objects.
void SetCurrentDepth(Float_t d)
virtual REveElement * ImportElements(REveElement *el, REveElement *ext_list=nullptr)
Recursively import elements and apply projection to the newly imported objects.
void AddCommand(const std::string &name, const std::string &icon, const REveElement *element, const std::string &action)
REveTrackPropagator Calculates path of a particle taking into account special path-marks and imposed ...
REveTrack Track with given vertex, momentum and optional referece-points (path-marks) along its path.
REveViewer Reve representation of TGLViewer.
void SetCameraType(REveCamera::ECameraType type)
Set camera by type (backward compatibility with old API)
virtual void AddScene(REveScene *scene)
Add 'scene' to the list of scenes.
Description of the dynamic properties of a particle.
This is the base class for the ROOT Random number generators.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Namespace for ROOT features in testing.
constexpr Double_t TwoPi()