17#include <ROOT/REveGeoShape.hxx>
18#include <ROOT/REveScene.hxx>
19#include <ROOT/REveViewer.hxx>
20#include <ROOT/REveElement.hxx>
21#include <ROOT/REveManager.hxx>
22#include <ROOT/REveProjectionManager.hxx>
23#include <ROOT/REveProjectionBases.hxx>
24#include <ROOT/REvePointSet.hxx>
25#include <ROOT/REveJetCone.hxx>
27#include <ROOT/REveTrack.hxx>
28#include <ROOT/REveTrackPropagator.hxx>
35REX::REveProjectionManager *
mngRhoZ =
nullptr;
49REX::REvePointSet*
getPointSet(
int npoints = 2,
float s=2,
int color=28)
53 auto ps =
new REX::REvePointSet(
"fu", npoints);
55 for (
Int_t i=0; i<npoints; ++i)
56 ps->SetNextPoint(
r.Uniform(-
s,
s),
r.Uniform(-
s,
s),
r.Uniform(-
s,
s));
58 ps->SetMarkerColor(color);
59 ps->SetMarkerSize(3+
r.Uniform(1, 2));
60 ps->SetMarkerStyle(4);
66 REX::REveElement*
event =
eveMng->GetEventScene();
67 REX::REveElement* pntHolder =
new REX::REveElementList(
"Hits");
69 ps1->SetElementName(
"Points_1");
70 pntHolder->AddElement(ps1);
76 event->AddElement(pntHolder);
83 REX::REveElement*
event =
eveMng->GetEventScene();
84 auto prop =
new REX::REveTrackPropagator();
85 prop->SetMagFieldObj(
new REX::REveMagFieldDuo(350, -3.5, 2.0));
89 REX::REveElement* trackHolder =
new REX::REveElementList(
"Tracks");
98 int pdg = 11* (
r.Integer(2) -1);
103 auto track =
new REX::REveTrack(p, 1, prop);
105 track->SetMainColor(
kBlue);
106 track->SetElementName(
Form(
"RandomTrack_%d",i ));
107 trackHolder->AddElement(track);
110 event->AddElement(trackHolder);
117 REX::REveElement*
event =
eveMng->GetEventScene();
118 auto jetHolder =
new REX::REveElementList(
"Jets");
120 for (
int i = 0; i <
N_Jets; i++)
122 auto jet =
new REX::REveJetCone(
Form(
"Jet_%d",i ));
124 jet->AddEllipticCone(
r.Uniform(-3.5, 3.5),
r.Uniform(0,
TMath::TwoPi()),
125 r.Uniform(0.02, 0.2),
r.Uniform(0.02, 0.3));
126 jet->SetFillColor(
kPink - 8);
127 jet->SetLineColor(
kViolet - 7);
129 jetHolder->AddElement(jet);
131 event->AddElement(jetHolder);
143 auto b1 =
new REX::REveGeoShape(
"Barrel 1");
145 b1->SetMainColor(
kCyan);
146 eveMng->GetGlobalScene()->AddElement(b1);
150 b1->SetNSegments(40);
160 mngRhoPhi =
new REX::REveProjectionManager(REX::REveProjection::kPT_RPhi);
171 mngRhoZ =
new REX::REveProjectionManager(REX::REveProjection::kPT_RhoZ);
182 for (
auto & ie :
eveMng->GetGlobalScene()->RefChildren())
190 for (
auto & ie :
eveMng->GetEventScene()->RefChildren())
208#pragma link C++ class EventManager+;
210class EventManager :
public REX::REveElementList
213 EventManager() =
default;
215 virtual ~EventManager() {}
217 virtual void NextEvent()
219 printf(
"NEXT EVENT \n");
221 REveElement::List_t ev_scenes;
222 ev_scenes.push_back(
eveMng->GetEventScene());
228 eveMng->DestroyElementsOf(ev_scenes);
234 eveMng->BroadcastElementsOf(ev_scenes);
247 eveMng = REX::REveManager::Create();
249 auto eventMng =
new EventManager();
250 eventMng->SetElementName(
"EventManager");
251 eveMng->GetWorld()->AddElement(eventMng);
253 eveMng->GetWorld()->AddCommand(
"NextEvent",
"sap-icon://step", eventMng,
"NextEvent()");
#define ClassDef(name, id)
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
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()