18#include <ROOT/REveGeoShape.hxx>
19#include <ROOT/REveScene.hxx>
20#include <ROOT/REveViewer.hxx>
21#include <ROOT/REveElement.hxx>
22#include <ROOT/REveManager.hxx>
23#include <ROOT/REveProjectionManager.hxx>
24#include <ROOT/REveProjectionBases.hxx>
25#include <ROOT/REvePointSet.hxx>
26#include <ROOT/REveJetCone.hxx>
28#include <ROOT/REveTrack.hxx>
29#include <ROOT/REveTrackPropagator.hxx>
36REX::REveProjectionManager *
mngRhoZ =
nullptr;
50REX::REvePointSet *
getPointSet(
int npoints = 2,
float s=2,
int color=28)
54 auto ps =
new REX::REvePointSet(
"fu",
"", npoints);
56 for (
Int_t i=0; i<npoints; ++i)
57 ps->SetNextPoint(
r.Uniform(-
s,
s),
r.Uniform(-
s,
s),
r.Uniform(-
s,
s));
59 ps->SetMarkerColor(color);
60 ps->SetMarkerSize(3+
r.Uniform(1, 7));
61 ps->SetMarkerStyle(4);
67 REX::REveElement*
event =
eveMng->GetEventScene();
69 auto pntHolder =
new REX::REveElement(
"Hits");
72 ps1->SetName(
"Points_1");
73 pntHolder->AddElement(ps1);
76 ps2->SetName(
"Points_2");
77 pntHolder->AddElement(ps2);
79 event->AddElement(pntHolder);
86 REX::REveElement*
event =
eveMng->GetEventScene();
87 auto prop =
new REX::REveTrackPropagator();
88 prop->SetMagFieldObj(
new REX::REveMagFieldDuo(350, -3.5, 2.0));
93 auto trackHolder =
new REX::REveElement(
"Tracks");
102 int pdg = 11* (
r.Integer(2) -1);
107 auto track =
new REX::REveTrack(p, 1, prop);
109 track->SetMainColor(
kBlue);
110 track->SetName(
Form(
"RandomTrack_%d", i));
111 trackHolder->AddElement(track);
114 event->AddElement(trackHolder);
121 REX::REveElement *
event =
eveMng->GetEventScene();
122 auto jetHolder =
new REX::REveElement(
"Jets");
124 for (
int i = 0; i <
N_Jets; i++)
126 auto jet =
new REX::REveJetCone(
Form(
"Jet_%d", i));
128 jet->AddEllipticCone(
r.Uniform(-3.5, 3.5),
r.Uniform(0,
TMath::TwoPi()),
129 r.Uniform(0.02, 0.2),
r.Uniform(0.02, 0.3));
130 jet->SetFillColor(
kPink - 8);
131 jet->SetLineColor(
kViolet - 7);
133 jetHolder->AddElement(jet);
135 event->AddElement(jetHolder);
147 auto b1 =
new REX::REveGeoShape(
"Barrel 1");
149 b1->SetMainColor(
kCyan);
150 eveMng->GetGlobalScene()->AddElement(b1);
154 b1->SetNSegments(40);
164 mngRhoPhi =
new REX::REveProjectionManager(REX::REveProjection::kPT_RPhi);
175 mngRhoZ =
new REX::REveProjectionManager(REX::REveProjection::kPT_RhoZ);
186 for (
auto &ie :
eveMng->GetGlobalScene()->RefChildren())
194 for (
auto &ie :
eveMng->GetEventScene()->RefChildren())
212class EventManager :
public REX::REveElement
215 EventManager() =
default;
217 virtual ~EventManager() {}
219 virtual void NextEvent()
221 printf(
"NEXT EVENT \n");
223 REveElement::List_t ev_scenes;
224 ev_scenes.push_back(
eveMng->GetEventScene());
230 eveMng->DestroyElementsOf(ev_scenes);
236 eveMng->BroadcastElementsOf(ev_scenes);
239 virtual void QuitRoot()
241 printf(
"Quit ROOT\n");
254 eveMng = REX::REveManager::Create();
256 auto eventMng =
new EventManager();
257 eventMng->SetName(
"EventManager");
258 eveMng->GetWorld()->AddElement(eventMng);
260 eveMng->GetWorld()->AddCommand(
"QuitRoot",
"sap-icon://log", eventMng,
"QuitRoot()");
262 eveMng->GetWorld()->AddCommand(
"NextEvent",
"sap-icon://step", eventMng,
"NextEvent()");
R__EXTERN TApplication * gApplication
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
Description of the dynamic properties of a particle.
void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
void SetPdgCode(Int_t pdg)
Change the PDG code for this particle.
void SetProductionVertex(Double_t vx, Double_t vy, Double_t vz, Double_t t)
This is the base class for the ROOT Random number generators.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
REX::REveScene * rPhiGeomScene
REX::REveScene * rPhiEventScene
REX::REveProjectionManager * mngRhoZ
REX::REveManager * eveMng
REX::REveViewer * rhoZView
REX::REveScene * rhoZEventScene
void createProjectionStuff()
REX::REveViewer * rphiView
REX::REveProjectionManager * mngRhoPhi
REX::REveScene * rhoZGeomScene
void projectScenes(bool geomp, bool eventp)
REX::REvePointSet * getPointSet(int npoints=2, float s=2, int color=28)
static constexpr double s
static constexpr double ps
constexpr Double_t TwoPi()