Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches

Detailed Description

This is an example of visualization of containers with REveDataCollection and REveDataProxyBuilders.

#include "TGeoTube.h"
#include "TROOT.h"
#include "TList.h"
#include "TParticle.h"
#include "TRandom.h"
#include "TApplication.h"
#include "TFile.h"
#include "TH2F.h"
#include <iostream>
const Double_t kR_min = 299;
const Double_t kR_max = 300;
const Double_t kZ_d = 500;
namespace fw3dlego {
const int xbins_n = 83;
const double xbins[xbins_n] = {
-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};
} // namespace fw3dlego
using namespace ROOT::Experimental;
//==============================================================================
//============== EMULATE FRAMEWORK CLASSES =====================================
//==============================================================================
// a demo class, can be provided from experiment framework
class Jet : public TParticle {
public:
float fEtaSize{0};
float fPhiSize{0};
float GetEtaSize() const { return fEtaSize; }
float GetPhiSize() const { return fPhiSize; }
void SetEtaSize(float iEtaSize) { fEtaSize = iEtaSize; }
void SetPhiSize(float iPhiSize) { fPhiSize = iPhiSize; }
: TParticle(pdg, status, mother1, mother2, daughter1, daughter2, px, py, pz, etot, 0, 0, 0, 0)
{
}
};
class RecHit : public TObject {
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) {}
};
class RCaloTower : public TObject {
public:
float fEta{0};
float fPhi{0};
float fEt{0};
RCaloTower(float eta, float phi, float et) : fEta(eta), fPhi(phi), fEt(et) {}
};
private:
REveDataCollection *fCollection{nullptr};
public:
: REveCaloDataSliceSelector(s), fCollection(c), fCaloData(h)
{
}
using REveCaloDataSliceSelector::ProcessSelection;
void ProcessSelection(REveCaloData::vCellId_t &sel_cells, UInt_t selectionId, Bool_t multi) override
{
std::set<int> item_set;
for (auto &cellId : sel_cells) {
fCaloData->GetCellData(cellId, cd);
// loop over enire collection and check its eta/phi range
for (int t = 0; t < fCollection->GetNItems(); ++t) {
RCaloTower *tower = (RCaloTower *)fCollection->GetDataPtr(t);
if (tower->fEta > cd.fEtaMin && tower->fEta < cd.fEtaMax && tower->fPhi > cd.fPhiMin &&
tower->fPhi < cd.fPhiMax && fCollection->GetDataItem(t)->GetVisible()) {
item_set.insert(t);
}
}
}
fCollection->GetItemList()->RefSelectedSet() = item_set;
sel->NewElementPicked(fCollection->GetItemList()->GetElementId(), multi, true, item_set);
}
using REveCaloDataSliceSelector::GetCellsFromSecondaryIndices;
void GetCellsFromSecondaryIndices(const std::set<int> &idcs, REveCaloData::vCellId_t &out) override
{
TH2F *hist = fCaloData->GetHist(GetSliceIndex());
std::set<int> cbins;
float total = 0;
for (auto &i : idcs) {
RCaloTower *tower = (RCaloTower *)fCollection->GetDataPtr(i);
int bin = hist->FindBin(tower->fEta, tower->fPhi);
float frac = tower->fEt / hist->GetBinContent(bin);
bool ex = false;
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;
ex = true;
break;
}
}
if (!ex) {
out.push_back(REveCaloData::CellId_t(bin, GetSliceIndex(), frac));
}
}
}
};
class Event {
public:
int eventId{0};
int N_tracks{0};
int N_jets{0};
std::vector<TList *> fListData;
Event()
{
auto baseHist = new TH2F("dummy", "dummy", fw3dlego::xbins_n - 1, fw3dlego::xbins, 72, -TMath::Pi(), TMath::Pi());
fCaloData->AddHistogram(baseHist);
auto selector = new REveCaloDataSelector();
fCaloData->SetSelector(selector);
eveMng->GetEventScene()->AddElement(fCaloData);
}
void MakeJets(int N)
{
r.SetSeed(0);
TList *list = new TList();
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 phi = r.Uniform(-TMath::Pi(), TMath::Pi());
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->Add(jet);
}
fListData.push_back(list);
}
void MakeParticles(int N)
{
r.SetSeed(0);
TList *list = new TList();
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 phi = r.Uniform(0, TMath::TwoPi());
double px = pt * std::cos(phi);
double py = pt * std::sin(phi);
double pz = pt * (1. / (std::tan(2 * std::atan(std::exp(-eta)))));
// printf("Event::MakeParticles %2d: pt=%.2f, eta=%.2f, phi=%.2f\n", i, pt, eta, phi);
auto particle =
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);
particle->SetPdgCode(pdg);
list->Add(particle);
}
fListData.push_back(list);
}
void MakeRecHits(int N)
{
r.SetSeed(0);
TList *list = new TList();
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);
auto rechit = new RecHit(pt, x, y, z);
list->Add(rechit);
}
fListData.push_back(list);
}
void Clear()
{
for (auto &l : fListData)
fListData.clear();
}
void Create()
{
Clear();
// refill calo data from jet list
TList *elist = new TList();
elist->SetName("ECAL");
fListData.push_back(elist);
TList *hlist = new TList();
hlist->SetName("HCAL");
fListData.push_back(hlist);
for (int i = 0; i <= jlist->GetLast(); ++i) {
const Jet *j = (Jet *)jlist->At(i);
float offX = j->Eta();
float offY = j->Phi() > TMath::Pi() ? j->Phi() - TMath::TwoPi() : j->Phi();
for (int k = 0; k < 20; ++k) {
double x, y, v;
x = gRandom->Uniform(-j->GetEtaSize(), j->GetEtaSize());
y = gRandom->Uniform(-j->GetPhiSize(), j->GetPhiSize());
v = j->Pt();
auto etower = new RCaloTower(offX + x, offY + y, v + gRandom->Uniform(2, 3));
elist->Add(etower);
auto htower = new RCaloTower(offX + x, offY + y, v + gRandom->Uniform(1, 2));
hlist->Add(htower);
}
}
fCaloData->DataChanged();
}
};
//==============================================================================
//== PROXY BUILDERS ============================================================
//==============================================================================
bool HaveSingleProduct() const override { return false; }
using REveDataSimpleProxyBuilderTemplate<Jet>::BuildItemViewType;
void BuildItemViewType(const Jet &dj, int idx, REveElement *iItemHolder, const std::string &viewType,
const REveViewContext *context) override
{
auto jet = new REveJetCone();
jet->SetCylinder(context->GetMaxR(), context->GetMaxZ());
jet->AddEllipticCone(dj.Eta(), dj.Phi(), dj.GetEtaSize(), dj.GetPhiSize());
SetupAddElement(jet, iItemHolder, true);
jet->SetLineColor(jet->GetMainColor());
float size = 50.f * dj.Pt(); // values are saved in scale
double theta = dj.Theta();
// printf("%s jet theta = %f, phi = %f \n", iItemHolder->GetCName(), theta, dj.Phi());
double phi = dj.Phi();
if (viewType == "Projected") {
static const float_t offr = 6;
float r_ecal = context->GetMaxR() + offr;
float z_ecal = context->GetMaxZ() + offr;
double r = 0;
bool debug = false;
if (theta < transAngle || 3.14 - theta < transAngle) {
z_ecal = context->GetMaxZ() + offr / transAngle;
r = z_ecal / fabs(cos(theta));
} else {
debug = true;
r = r_ecal / sin(theta);
}
REveVector p1(0, (phi < TMath::Pi() ? r * fabs(sin(theta)) : -r * fabs(sin(theta))), r * cos(theta));
REveVector p2(0, (phi < TMath::Pi() ? (r + size) * fabs(sin(theta)) : -(r + size) * fabs(sin(theta))),
(r + size) * cos(theta));
auto marker = new REveScalableStraightLineSet("jetline");
marker->SetScaleCenter(p1.fX, p1.fY, p1.fZ);
marker->AddLine(p1, p2);
marker->SetLineWidth(4);
if (debug)
marker->AddMarker(0, 0.9);
SetupAddElement(marker, iItemHolder, true);
marker->SetName(Form("line %s %d", Collection()->GetCName(), idx));
}
}
using REveDataProxyBuilderBase::LocalModelChanges;
void LocalModelChanges(int idx, REveElement *el, const REveViewContext *ctx) override
{
// printf("LocalModelChanges jet %s ( %s )\n", el->GetCName(), el->FirstChild()->GetCName());
REveJetCone *cone = dynamic_cast<REveJetCone *>(el->FirstChild());
cone->SetLineColor(cone->GetMainColor());
}
};
void BuildItem(const TParticle &p, int idx, REveElement *iItemHolder, const REveViewContext *context) override
{
const TParticle *x = &p;
auto track = new REveTrack((TParticle *)(x), 1, context->GetPropagator());
track->MakeTrack();
SetupAddElement(track, iItemHolder, true);
}
};
private:
class FWBoxSet : public REveBoxSet {
public:
using REveElement::GetSelectionMaster;
REveElement *GetSelectionMaster() override
{
if (fSelectionMaster) {
REveDataItemList *il = dynamic_cast<REveDataItemList *>(fSelectionMaster);
il->RefSelectedSet() = RefSelectedSet();
return il;
}
return nullptr;
}
};
REveBoxSet *fBoxSet{nullptr};
{
auto collection = Collection();
boxset->SetMainColor(collection->GetMainColor());
boxset->SetName(collection->GetCName());
boxset->SetPickable(true);
boxset->SetAlwaysSecSelect(true);
boxset->SetDetIdsAsSecondaryIndices(true);
boxset->SetSelectionMaster(((REveDataCollection *)collection)->GetItemList());
boxset->Reset(REveBoxSet::kBT_FreeBox, true, collection->GetNItems());
TRandom r(0);
#define RND_BOX(x) (Float_t) r.Uniform(-(x), (x))
for (int h = 0; h < collection->GetNItems(); ++h) {
RecHit *hit = (RecHit *)collection->GetDataPtr(h);
const REveDataItem *item = Collection()->GetDataItem(h);
Float_t x = hit->fX;
Float_t y = hit->fY;
Float_t z = hit->fZ;
Float_t a = hit->fPt;
Float_t d = 0.05;
Float_t verts[24] = {x - a + RND_BOX(d), y - a + RND_BOX(d), z - a + RND_BOX(d), x - a + RND_BOX(d),
y + a + RND_BOX(d), z - a + RND_BOX(d), x + a + RND_BOX(d), y + a + RND_BOX(d),
z - a + RND_BOX(d), x + a + RND_BOX(d), y - a + RND_BOX(d), z - a + RND_BOX(d),
x - a + RND_BOX(d), y - a + RND_BOX(d), z + a + RND_BOX(d), x - a + RND_BOX(d),
y + a + RND_BOX(d), z + a + RND_BOX(d), x + a + RND_BOX(d), y + a + RND_BOX(d),
z + a + RND_BOX(d), x + a + RND_BOX(d), y - a + RND_BOX(d), z + a + RND_BOX(d)};
boxset->AddBox(verts);
boxset->DigitValue(item->GetVisible() ? 1 : 0);
if (item->GetVisible())
boxset->DigitColor(item->GetMainColor());
}
boxset->RefitPlex();
boxset->StampObjProps();
}
public:
using REveDataProxyBuilderBase::Build;
void BuildProduct(const REveDataCollection *collection, REveElement *product, const REveViewContext *) override
{
fBoxSet = new FWBoxSet();
product->AddElement(fBoxSet);
}
using REveDataProxyBuilderBase::FillImpliedSelected;
void FillImpliedSelected(REveElement::Set_t &impSet, const std::set<int> &sec_idcs, Product *p) override
{
// printf("RecHit fill implioed ----------------- !!!%zu\n",
// Collection()->GetItemList()->RefSelectedSet().size());
impSet.insert(fBoxSet);
}
using REveDataProxyBuilderBase::ModelChanges;
void ModelChanges(const REveDataCollection::Ids_t &ids, Product *product) override
{
for (auto &i : ids) {
auto digi = fBoxSet->GetDigit(i);
auto item = Collection()->GetDataItem(i);
fBoxSet->SetCurrentDigit(i);
if (item->GetVisible()) {
fBoxSet->DigitValue(1);
fBoxSet->DigitColor(item->GetMainColor());
} else {
fBoxSet->DigitValue(0);
}
}
fBoxSet->StampObjProps();
}
}; // RecHitProxyBuilder
private:
TH2F *fHist{nullptr};
int fSliceIndex{-1};
void assertSlice()
{
if (!fHist) {
TDirectory::TContext ctx{nullptr}; // Don't register histograms to the current directory
fHist = new TH2F("caloHist", "caloHist", fw3dlego::xbins_n - 1, fw3dlego::xbins, 72, -M_PI, M_PI);
fSliceIndex = fCaloData->AddHistogram(fHist);
fCaloData->RefSliceInfo(fSliceIndex)
.Setup(Collection()->GetCName(), 0., Collection()->GetMainColor(), Collection()->GetMainTransparency());
fCaloData->GetSelector()->AddSliceSelector(std::unique_ptr<REveCaloDataSliceSelector>(
}
}
public:
using REveDataProxyBuilderBase::Build;
void BuildProduct(const REveDataCollection *collection, REveElement *product, const REveViewContext *) override
{
fHist->Reset();
if (collection->GetRnrSelf()) {
fCaloData->RefSliceInfo(fSliceIndex)
.Setup(Collection()->GetCName(), 0., Collection()->GetMainColor(), Collection()->GetMainTransparency());
for (int h = 0; h < collection->GetNItems(); ++h) {
RCaloTower *tower = (RCaloTower *)collection->GetDataPtr(h);
const REveDataItem *item = Collection()->GetDataItem(h);
if (!item->GetVisible())
continue;
fHist->Fill(tower->fEta, tower->fPhi, tower->fEt);
}
}
fCaloData->DataChanged();
}
using REveDataProxyBuilderBase::FillImpliedSelected;
void FillImpliedSelected(REveElement::Set_t &impSet, const std::set<int> &sec_idcs, Product *) override
{
fCaloData->GetSelector()->SetActiveSlice(fSliceIndex);
impSet.insert(fCaloData);
fCaloData->FillImpliedSelectedSet(impSet, sec_idcs);
}
using REveDataProxyBuilderBase::ModelChanges;
void ModelChanges(const REveDataCollection::Ids_t &ids, Product *product) override
{
BuildProduct(Collection(), nullptr, nullptr);
}
}; // CaloTowerProxyBuilder
//==============================================================================
//== COLLECTION MANGER ================================================================
//==============================================================================
private:
Event *fEvent{nullptr};
std::vector<REveScene *> m_scenes;
REveViewContext *m_viewContext{nullptr};
std::vector<REveDataProxyBuilderBase *> m_builders;
bool m_inEventLoading{false};
public:
CollectionManager(Event *event) : fEvent(event)
{
// view context
float r = 300;
float z = 300;
auto prop = new REveTrackPropagator();
prop->SetMagFieldObj(new REveMagFieldDuo(350, 3.5, -2.0));
prop->SetMaxR(r);
prop->SetMaxZ(z);
prop->SetMaxOrbs(6);
prop->IncRefCount();
m_viewContext = new REveViewContext();
m_viewContext->SetBarrel(r, z);
m_viewContext->SetTrackPropagator(prop);
// table specs
tableInfo->table("TParticle").column("pt", 1, "i.Pt()").column("eta", 3, "i.Eta()").column("phi", 3, "i.Phi()");
tableInfo->table("Jet")
.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");
m_viewContext->SetTableViewInfo(tableInfo);
for (auto &c : eveMng->GetScenes()->RefChildren()) {
if (c != eveMng->GetGlobalScene() && strncmp(c->GetCName(), "Geometry", 8)) {
m_scenes.push_back((REveScene *)c);
}
if (!strncmp(c->GetCName(), "Table", 5))
c->AddElement(m_viewContext->GetTableViewInfo());
}
m_collections = eveMng->SpawnNewScene("Collections", "Collections");
}
{
for (auto &l : fEvent->fListData) {
TIter next(l);
if (collection->GetName() == std::string(l->GetName())) {
collection->ClearItems();
for (int i = 0; i <= l->GetLast(); ++i) {
std::string cname = collection->GetName();
auto len = cname.size();
char end = cname[len - 1];
if (end == 's') {
cname = cname.substr(0, len - 1);
}
TString pname(Form("%s %2d", cname.c_str(), i));
collection->AddItem(l->At(i), pname.Data(), "");
}
}
collection->ApplyFilter();
}
}
void LoadEvent()
{
for (auto &el : m_collections->RefChildren()) {
auto c = dynamic_cast<REveDataCollection *>(el);
}
for (auto proxy : m_builders) {
proxy->Build();
}
fEvent->fCaloData->DataChanged();
}
{
m_collections->AddElement(collection);
// load data
glBuilder->SetCollection(collection);
glBuilder->SetHaveAWindow(true);
for (auto scene : m_scenes) {
if (strncmp(scene->GetCName(), "Tables", 5) == 0)
continue;
REveElement *product = glBuilder->CreateProduct(scene->GetTitle(), m_viewContext);
if (!strncmp(scene->GetCTitle(), "Projected", 8)) {
g_projMng->ImportElements(product, scene);
} else {
scene->AddElement(product);
}
}
m_builders.push_back(glBuilder);
glBuilder->Build();
// Tables
tableBuilder->SetHaveAWindow(true);
tableBuilder->SetCollection(collection);
REveElement *tablep = tableBuilder->CreateProduct("table-type", m_viewContext);
auto tableMng = m_viewContext->GetTableViewInfo();
if (showInTable) {
tableMng->SetDisplayedCollection(collection->GetElementId());
}
for (auto s : m_scenes) {
if (strncmp(s->GetCTitle(), "Table", 5) == 0) {
s->AddElement(tablep);
tableBuilder->Build();
}
}
tableMng->AddDelegate([=]() { tableBuilder->ConfigChanged(); });
// set tooltip expression for items
auto tableEntries = tableMng->RefTableEntries(collection->GetItemClass()->GetName());
int N = TMath::Min(int(tableEntries.size()), 3);
for (int t = 0; t < N; t++) {
auto te = tableEntries[t];
collection->GetItemList()->AddTooltipExpression(te.fName, te.fExpression);
}
collection->GetItemList()->SetItemsChangeDelegate(
this->ModelChanged(collection, ids);
});
collection->GetItemList()->SetFillImpliedSelectedDelegate(
this->FillImpliedSelected(collection, impSelSet, sec_idcs);
});
}
{
auto mngTable = m_viewContext->GetTableViewInfo();
if (mngTable) {
for (auto &el : m_collections->RefChildren()) {
if (el->GetName() == "Tracks")
mngTable->SetDisplayedCollection(el->GetElementId());
}
}
}
{
return;
for (auto proxy : m_builders) {
if (proxy->Collection()->GetItemList() == itemList) {
// printf("Model changes check proxy %s: \n", proxy->Type().c_str());
proxy->ModelChanges(ids);
}
}
}
void FillImpliedSelected(REveDataItemList *itemList, REveElement::Set_t &impSelSet, const std::set<int> &sec_idcs)
{
return;
for (auto proxy : m_builders) {
if (proxy->Collection()->GetItemList() == itemList) {
proxy->FillImpliedSelected(impSelSet, sec_idcs);
}
}
}
};
//==============================================================================
//== Event Manager =============================================================
//==============================================================================
class EventManager : public REveElement {
private:
Event *fEvent;
public:
EventManager(Event *e, CollectionManager *m) : fEvent(e), fCMng(m) {}
~EventManager() override {}
virtual void NextEvent()
{
eveMng->GetSelection()->ClearSelection();
eveMng->GetHighlight()->ClearSelection();
fEvent->Create();
fCMng->LoadEvent();
}
};
public:
using REveSelection::Deviator::DeviateSelection;
bool DeviateSelection(REveSelection *selection, REveElement *el, bool multi, bool secondary,
const std::set<int> &secondary_idcs) override
{
if (el) {
auto *colItems = dynamic_cast<REveDataItemList *>(el);
if (colItems) {
// std::cout << "Deviate RefSelected=" << colItems->RefSelectedSet().size() << " passed set " <<
// secondary_idcs.size() << "\n";
ExecuteNewElementPicked(selection, colItems, multi, true, colItems->RefSelectedSet());
return true;
}
}
return false;
}
};
//==============================================================================
//== main() ====================================================================
//==============================================================================
void collection_proxies(bool proj = true)
{
eveMng = REveManager::Create();
auto event = new Event();
event->Create();
// divert selection to map proxy builder products with collection
auto deviator = std::make_shared<FWSelectionDeviator>();
eveMng->GetSelection()->SetDeviator(deviator);
eveMng->GetHighlight()->SetDeviator(deviator);
// create scenes and views
auto b1 = new REveGeoShape("Barrel 1");
b1->SetShape(new TGeoTube(kR_min, kR_max, kZ_d));
b1->SetMainColor(kCyan);
b1->SetMainTransparency(90);
eveMng->GetGlobalScene()->AddElement(b1);
rhoZEventScene = eveMng->SpawnNewScene("RhoZ Scene", "Projected");
g_projMng = new REveProjectionManager(REveProjection::kPT_RhoZ);
g_projMng->SetImportEmpty(true);
auto rhoZView = eveMng->SpawnNewViewer("RhoZ View");
rhoZView->SetCameraType(REveViewer::kCameraOrthoXOY);
auto pgeoScene = eveMng->SpawnNewScene("Geometry projected");
rhoZView->AddScene(pgeoScene);
g_projMng->ImportElements(b1, pgeoScene);
auto tableScene = eveMng->SpawnNewScene("Tables", "Tables");
auto tableView = eveMng->SpawnNewViewer("Table", "Table View");
tableView->AddScene(tableScene);
// create event data from list
auto collectionMng = new CollectionManager(event);
trackCollection->SetMainColor(kGreen);
trackCollection->SetFilterExpr("i.Pt() > 4.1 && std::abs(i.Eta()) < 1");
collectionMng->addCollection(trackCollection, new TParticleProxyBuilder(), true);
jetCollection->SetItemClass(Jet::Class());
jetCollection->SetMainColor(kYellow);
jetCollection->SetFilterExpr("i.Pt() > 1");
hitCollection->SetItemClass(RecHit::Class());
hitCollection->SetMainColor(kOrange + 7);
hitCollection->SetFilterExpr("i.fPt > 5");
collectionMng->addCollection(hitCollection, new RecHitProxyBuilder(), true);
// add calorimeters
auto calo3d = new REveCalo3D(event->fCaloData);
calo3d->SetBarrelRadius(kR_max);
calo3d->SetEndCapPos(kZ_d);
calo3d->SetMaxTowerH(300);
eveMng->GetEventScene()->AddElement(calo3d);
ecalCollection->SetItemClass(RCaloTower::Class());
ecalCollection->SetMainColor(kRed);
collectionMng->addCollection(ecalCollection, new CaloTowerProxyBuilder(event->fCaloData));
hcalCollection->SetItemClass(RCaloTower::Class());
hcalCollection->SetMainColor(kBlue);
collectionMng->addCollection(hcalCollection, new CaloTowerProxyBuilder(event->fCaloData));
// event navigation
auto eventMng = new EventManager(event, collectionMng);
eventMng->SetName("EventManager");
eveMng->GetWorld()->AddElement(eventMng);
eveMng->GetWorld()->AddCommand("NextEvent", "sap-icon://step", eventMng, "NextEvent()");
eveMng->Show();
}
#define d(i)
Definition RSha256.hxx:102
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
#define e(i)
Definition RSha256.hxx:103
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define M_PI
Definition Rotated.cxx:105
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:78
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:61
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
double Double_t
Double 8 bytes.
Definition RtypesCore.h:74
#define ClassDef(name, id)
Definition Rtypes.h:344
@ kRed
Definition Rtypes.h:67
@ kOrange
Definition Rtypes.h:68
@ kGreen
Definition Rtypes.h:67
@ kCyan
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
@ kYellow
Definition Rtypes.h:67
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define N
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
Definition TRandom.h:73
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2570
Definition JetEvent.h:49
Jet()
Definition JetEvent.h:57
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.
Definition TDirectory.h:89
Cylindrical tube class.
Definition TGeoTube.h:17
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
Definition TH1.cxx:3823
static Bool_t AddDirectoryStatus()
Check whether TH1-derived classes should register themselves to the current gDirectory.
Definition TH1.cxx:772
2-D histogram with a float per channel (see TH1 documentation)
Definition TH2.h:345
Double_t GetBinContent(Int_t binx, Int_t biny) const override
Definition TH2.h:97
A doubly linked list.
Definition TList.h:38
void Add(TObject *obj) override
Definition TList.h:81
Mother of all ROOT objects.
Definition TObject.h:42
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:461
static TClass * Class()
Description of the dynamic properties of a particle.
Definition TParticle.h:26
static TClass * Class()
This is the base class for the ROOT Random number generators.
Definition TRandom.h:28
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Definition TRandom.cxx:681
Basic string class.
Definition TString.h:138
TPaveText * pt
RVec< PromoteType< T > > abs(const RVec< T > &v)
Definition RVec.hxx:1812
RVec< PromoteType< T > > cos(const RVec< T > &v)
Definition RVec.hxx:1832
RVec< PromoteType< T > > atan(const RVec< T > &v)
Definition RVec.hxx:1836
RVec< PromoteType< T > > sin(const RVec< T > &v)
Definition RVec.hxx:1831
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Double_t ex[n]
Definition legend1.C:17
Namespace for ROOT features in testing.
Definition TROOT.h:100
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)
Definition MathFuncs.h:96
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:197
constexpr Double_t Pi()
Definition TMath.h:40
constexpr Double_t TwoPi()
Definition TMath.h:47
TMarker m
Definition textangle.C:8
TLine l
Definition textangle.C:4
Author
Alja Mrak-Tadel

Definition in file collection_proxies.C.