This is an example of visualization of containers with REveDataCollection and REveDataProxyBuilders.
#include <iostream>
-5.191, -4.889, -4.716, -4.538, -4.363, -4.191, -4.013, -3.839, -3.664, -3.489, -3.314, -3.139, -2.964, -2.853,
-2.650, -2.500, -2.322, -2.172, -2.043, -1.930, -1.830, -1.740, -1.653, -1.566, -1.479, -1.392, -1.305, -1.218,
-1.131, -1.044, -0.957, -0.870, -0.783, -0.696, -0.609, -0.522, -0.435, -0.348, -0.261, -0.174, -0.087, 0.000,
0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696, 0.783, 0.870, 0.957, 1.044, 1.131, 1.218,
1.305, 1.392, 1.479, 1.566, 1.653, 1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.853,
2.964, 3.139, 3.314, 3.489, 3.664, 3.839, 4.013, 4.191, 4.363, 4.538, 4.716, 4.889, 5.191};
}
public:
:
TParticle(
pdg, status,
mother1,
mother2,
daughter1,
daughter2, px, py, pz,
etot, 0, 0, 0, 0)
{
}
};
public:
float fX{0};
float fY{0};
float fZ{0};
float fPt{0};
RecHit(
float pt,
float x,
float y,
float z) : fPt(
pt), fX(
x), fY(
y), fZ(z) {}
};
public:
float fEta{0};
float fPhi{0};
};
private:
public:
{
}
using REveCaloDataSliceSelector::ProcessSelection;
{
for (int t = 0; t < fCollection->GetNItems(); ++t) {
if (
tower->fEta > cd.fEtaMin &&
tower->fEta < cd.fEtaMax &&
tower->fPhi > cd.fPhiMin &&
tower->fPhi < cd.fPhiMax && fCollection->GetDataItem(t)->GetVisible()) {
}
}
}
fCollection->GetItemList()->RefSelectedSet() =
item_set;
sel->NewElementPicked(fCollection->GetItemList()->GetElementId(),
multi,
true,
item_set);
}
using REveCaloDataSliceSelector::GetCellsFromSecondaryIndices;
{
for (
size_t ci = 0;
ci < out.size(); ++
ci) {
if (out[
ci].fTower ==
bin && out[
ci].fSlice == GetSliceIndex()) {
float oldv = out[
ci].fFraction;
out[
ci].fFraction =
oldv + frac;
break;
}
}
}
}
}
};
class Event {
public:
Event()
{
}
{
list->SetName("Jets");
for (
int i = 1; i <=
N; ++i) {
double pt =
r.Uniform(0.5, 10);
double eta =
r.Uniform(-2.55, 2.55);
double px =
pt * std::cos(phi);
double py =
pt * std::sin(phi);
double pz =
pt * (1. / (std::tan(2 * std::atan(std::exp(-eta)))));
auto jet =
new Jet(0, 0, 0, 0, 0, 0, px, py, pz, std::sqrt(px * px + py * py + pz * pz + 80 * 80));
jet->SetEtaSize(
r.Uniform(0.02, 0.2));
jet->SetPhiSize(
r.Uniform(0.01, 0.3));
}
}
{
list->SetName("Tracks");
for (
int i = 1; i <=
N; ++i) {
double pt =
r.Uniform(0.5, 10);
double eta =
r.Uniform(-2.55, 2.55);
double px =
pt * std::cos(phi);
double py =
pt * std::sin(phi);
double pz =
pt * (1. / (std::tan(2 * std::atan(std::exp(-eta)))));
new TParticle(0, 0, 0, 0, 0, 0, px, py, pz, std::sqrt(px * px + py * py + pz * pz + 80 * 80), 0, 0, 0, 0);
int pdg = 11 * (
r.Integer(2) > 0 ? 1 : -1);
}
}
{
list->SetName("RecHits");
for (
int i = 1; i <=
N; ++i) {
float pt =
r.Uniform(0.5, 10);
float x =
r.Uniform(-200, 200);
float y =
r.Uniform(-200, 200);
float z =
r.Uniform(-500, 500);
}
}
void Clear()
{
}
void Create()
{
Clear();
for (
int i = 0; i <=
jlist->GetLast(); ++i) {
for (int k = 0; k < 20; ++k) {
}
}
}
};
bool HaveSingleProduct() const override { return false; }
{
jet->AddEllipticCone(
dj.Eta(),
dj.Phi(),
dj.GetEtaSize(),
dj.GetPhiSize());
jet->SetLineColor(
jet->GetMainColor());
double theta =
dj.Theta();
} else {
}
marker->SetScaleCenter(
p1.fX,
p1.fY,
p1.fZ);
marker->SetLineWidth(4);
marker->AddMarker(0, 0.9);
marker->SetName(
Form(
"line %s %d", Collection()->GetCName(), idx));
}
}
using REveDataProxyBuilderBase::LocalModelChanges;
{
cone->SetLineColor(
cone->GetMainColor());
}
};
{
}
};
private:
public:
using REveElement::GetSelectionMaster;
{
if (fSelectionMaster) {
il->RefSelectedSet() = RefSelectedSet();
}
return nullptr;
}
};
{
boxset->SetAlwaysSecSelect(
true);
boxset->SetDetIdsAsSecondaryIndices(
true);
#define RND_BOX(x) (Float_t) r.Uniform(-(x), (x))
}
}
public:
using REveDataProxyBuilderBase::Build;
{
}
using REveDataProxyBuilderBase::FillImpliedSelected;
{
}
using REveDataProxyBuilderBase::ModelChanges;
{
for (auto &i : ids) {
auto item = Collection()->GetDataItem(i);
if (
item->GetVisible()) {
} else {
}
}
}
};
private:
{
if (!fHist) {
fHist =
new TH2F(
"caloHist",
"caloHist", fw3dlego::xbins_n - 1, fw3dlego::xbins, 72, -
M_PI,
M_PI);
.Setup(Collection()->GetCName(), 0., Collection()->GetMainColor(), Collection()->GetMainTransparency());
fCaloData->GetSelector()->AddSliceSelector(std::unique_ptr<REveCaloDataSliceSelector>(
}
}
public:
using REveDataProxyBuilderBase::Build;
{
fHist->Reset();
.Setup(Collection()->GetCName(), 0., Collection()->GetMainColor(), Collection()->GetMainTransparency());
continue;
}
}
}
using REveDataProxyBuilderBase::FillImpliedSelected;
{
}
using REveDataProxyBuilderBase::ModelChanges;
{
BuildProduct(Collection(), nullptr, nullptr);
}
};
private:
Event *fEvent{nullptr};
std::vector<REveDataProxyBuilderBase *>
m_builders;
public:
{
float z = 300;
m_viewContext->SetBarrel(
r, z);
m_viewContext->SetTrackPropagator(
prop);
tableInfo->table(
"TParticle").column(
"pt", 1,
"i.Pt()").column(
"eta", 3,
"i.Eta()").column(
"phi", 3,
"i.Phi()");
.column("eta", 1, "i.Eta()")
.column("phi", 1, "i.Phi()")
.column("etasize", 2, "i.GetEtaSize()")
.column("phisize", 2, "i.GetPhiSize()");
tableInfo->table(
"RecHit").column(
"pt", 1,
"i.fPt");
tableInfo->table(
"RCaloTower").column(
"eta", 3,
"i.fEta").column(
"phi", 3,
"i.fPhi").column(
"Et", 3,
"i.fEt");
for (
auto &
c :
eveMng->GetScenes()->RefChildren()) {
if (
c !=
eveMng->GetGlobalScene() &&
strncmp(
c->GetCName(),
"Geometry", 8)) {
}
if (!
strncmp(
c->GetCName(),
"Table", 5))
c->AddElement(m_viewContext->GetTableViewInfo());
}
}
{
for (
int i = 0; i <=
l->GetLast(); ++i) {
if (end == 's') {
}
}
}
}
}
{
}
}
fEvent->fCaloData->DataChanged();
}
{
continue;
} else {
scene->AddElement(product);
}
}
auto tableMng = m_viewContext->GetTableViewInfo();
}
if (
strncmp(s->GetCTitle(),
"Table", 5) == 0) {
}
}
for (
int t = 0; t <
N; t++) {
collection->GetItemList()->AddTooltipExpression(
te.fName,
te.fExpression);
}
collection->GetItemList()->SetItemsChangeDelegate(
});
collection->GetItemList()->SetFillImpliedSelectedDelegate(
});
}
{
auto mngTable = m_viewContext->GetTableViewInfo();
if (
el->GetName() ==
"Tracks")
mngTable->SetDisplayedCollection(
el->GetElementId());
}
}
}
{
return;
proxy->ModelChanges(ids);
}
}
}
{
return;
}
}
}
};
private:
Event *fEvent;
public:
virtual void NextEvent()
{
eveMng->GetSelection()->ClearSelection();
eveMng->GetHighlight()->ClearSelection();
fEvent->Create();
}
};
public:
using REveSelection::Deviator::DeviateSelection;
{
return true;
}
}
return false;
}
};
{
eveMng = REveManager::Create();
auto event = new Event();
event->Create();
auto deviator = std::make_shared<FWSelectionDeviator>();
b1->SetMainTransparency(90);
eveMng->GetGlobalScene()->AddElement(b1);
rhoZView->SetCameraType(REveViewer::kCameraOrthoXOY);
eveMng->GetWorld()->AddCommand(
"NextEvent",
"sap-icon://step",
eventMng,
"NextEvent()");
}
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
#define ClassDef(name, id)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
static unsigned int total
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 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 Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
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
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 cname
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 Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Collection of 3D primitives (fixed-size boxes, boxes of different sizes, or arbitrary sexto-epipeds,...
Visualization of a calorimeter event data in 2D.
Visualization of a calorimeter event data in 3D.
A central manager for calorimeter data of an event written in TH2F.
Cell data inner structure.
Base class for REveUtil visualization elements, providing hierarchy management, rendering control and...
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
Draws a jet cone with leading particle is specified in (eta,phi) and cone radius is given.
Implements constant magnetic filed that switches on given axial radius fR2 from vector fBIn to fBOut.
Manager class for steering of projections and managing projected objects.
Straight-line-set with extra scaling, useful for projectables that need to be scaled in accordance wi...
Eve representation of TGLScene.
Make sure there is a SINGLE running REveSelection for each selection type (select/highlight).
Holding structure for a number of track rendering parameters.
Visual representation of a track.
std::vector< CellId_t > vCellId_t
std::set< REveElement * > Set_t
REveProjectionManager Manager class for steering of projections and managing projected objects.
REveTrackPropagator * GetPropagator() const
void SetName(const char *name)
TDirectory::TContext keeps track and restore the current directory.
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
static Bool_t AddDirectoryStatus()
Check whether TH1-derived classes should register themselves to the current gDirectory.
2-D histogram with a float per channel (see TH1 documentation)
Double_t GetBinContent(Int_t binx, Int_t biny) const override
void Add(TObject *obj) override
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
Description of the dynamic properties of a particle.
This is the base class for the ROOT Random number generators.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
RVec< PromoteType< T > > abs(const RVec< T > &v)
RVec< PromoteType< T > > cos(const RVec< T > &v)
RVec< PromoteType< T > > atan(const RVec< T > &v)
RVec< PromoteType< T > > sin(const RVec< T > &v)
Namespace for ROOT features in testing.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
double product(DoubleArray factors, std::size_t nFactors)
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
constexpr Double_t TwoPi()