8#include <ROOT/REvePointSet.hxx>
9#include <ROOT/REveScene.hxx>
10#include <ROOT/REveJetCone.hxx>
11#include <ROOT/REveGeoShape.hxx>
12#include "ROOT/REveDataClasses.hxx"
13#include <ROOT/REveTrack.hxx>
14#include <ROOT/REveTrackPropagator.hxx>
15#include <ROOT/REveViewer.hxx>
16#include <ROOT/REveProjectionManager.hxx>
17#include "ROOT/REveManager.hxx"
32REX::REveProjectionManager *
mngRhoZ =
nullptr;
38REX::REvePointSet *
getPointSet(
int npoints = 2,
float s=2,
int color=28)
42 REX::REvePointSet*
ps =
new REX::REvePointSet(
"fu", npoints);
44 for (
Int_t i=0; i<npoints; ++i)
45 ps->SetNextPoint(
r.Uniform(-
s,
s),
r.Uniform(-
s,
s),
r.Uniform(-
s,
s));
47 ps->SetMarkerColor(color);
48 ps->SetMarkerSize(3+
r.Uniform(1, 2));
49 ps->SetMarkerStyle(4);
57 REX::REveElement*
event =
eveMng->GetEventScene();
58 auto jetHolder =
new REX::REveElementList(
"Jets");
60 for (
int i = 0; i <
N_Jets; i++)
62 auto jet =
new REX::REveJetCone(
"Jet_1");
64 jet->AddEllipticCone(
r.Uniform(-3.5, 3.5),
r.Uniform(0,
TMath::TwoPi()),
65 r.Uniform(0.02, 0.2),
r.Uniform(0.02, 0.3));
69 jetHolder->AddElement(jet);
71 event->AddElement(jetHolder);
82 for (
int i = 1; i <=
N; ++i)
84 double pt =
r.Uniform(0.5, 10);
85 double eta =
r.Uniform(-2.55, 2.55);
96 px, py, pz,
std::sqrt(px*px + py*py + pz*pz + 80*80),
99 int pdg = 11 * (
r.Integer(2) > 0 ? 1 : -1);
100 ext_col.back().SetPdgCode(pdg);
106 auto b1 =
new REX::REveGeoShape(
"Barrel 1");
109 b1->SetFillColor(
kGray);
110 eveMng->GetGlobalScene()->AddElement(b1);
112 auto b2 =
new REX::REveGeoShape(
"Barell 2");
114 b2->SetFillColor(
kGray);
115 b2->SetMainTransparency(80);
116 eveMng->GetGlobalScene()->AddElement(b2);
122 REX::REveElement*
event =
eveMng->GetEventScene();
124 auto prop =
new REX::REveTrackPropagator();
125 prop->SetMagFieldObj(
new REX::REveMagFieldDuo(350, -3.5, 2.0));
128 prop->SetMaxOrbs(0.5);
129 REX::REveElement* trackHolder =
new REX::REveElementList(
"Tracks");
136 auto track =
new REX::REveTrack(&p, 1, prop);
137 track->SetMainColor(
kBlue+2);
141 track->SetElementName(pname.
Data());
142 track->SetRnrSelf(!col->GetDataItem(i)->GetFiltered());
143 printf(
"track %s [filtered %d/%d]: eta= %.2f, pt=%.2f \n", track->GetElementName(),col->GetDataItem(i)->GetFiltered(), track->GetRnrSelf(), p.Eta(), p.Phi());
144 trackHolder->AddElement(track);
147 event->AddElement(trackHolder);
152 ps1->SetElementName(
"Points_1");
153 ps1->SetMainColor(
kRed);
154 event->AddElement(ps1);
159 ps1->SetElementName(
"Points_2");
160 ps1->SetMainColor(
kCyan);
161 event->AddElement(ps1);
170 auto tbl =
new REX::REveDataTable();
172 tbl->SetCollection(col);
175 auto c =
new REX::REveDataColumn(
"pt");
177 c->SetExpressionAndType(
"std::abs(i.Pt())", REX::REveDataColumn::FT_Double);
181 auto c =
new REX::REveDataColumn(
"phi");
183 c->SetExpressionAndType(
"i.Phi()", REX::REveDataColumn::FT_Double);
188 auto c =
new REX::REveDataColumn(
"eta");
190 c->SetExpressionAndType(
"i.Eta()", REX::REveDataColumn::FT_Double);
200 auto scene =
eveMng->SpawnNewScene(
"Table",
"Table");
201 scene->AddElement(tbl);
202 auto view =
eveMng->SpawnNewViewer(
"Table",
"Table");
203 view->AddScene(scene);
225 mngRhoZ =
new REX::REveProjectionManager(REX::REveProjection::kPT_RhoZ);
236 for (
auto & ie :
eveMng->GetGlobalScene()->RefChildren())
244 for (
auto & ie :
eveMng->GetEventScene()->RefChildren())
254 eveMng = REX::REveManager::Create();
258 auto col =
new REX::REveDataCollection();
268 col->AddItem(&p, pname.
Data(),
"");
271 col->SetFilterExpr(
"i.Pt() > 1 && std::abs(i.Eta()) < 1");
273 eveMng->GetWorld()->AddElement(col);
R__EXTERN TRandom * gRandom
Description of the dynamic properties of a particle.
This is the base class for the ROOT Random number generators.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
REX::REveScene * rPhiGeomScene
REX::REveScene * rPhiEventScene
std::vector< TParticle > ext_col
REX::REveProjectionManager * mngRhoZ
REX::REveManager * eveMng
void makeEventScene(REX::REveDataCollection *col)
void makeTableScene(REX::REveDataCollection *col)
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()