Complex example showing ALICE ESD track visualization.
No ALICE code is needed, only four simple coordinate-transformation functions declared in this macro.
A simple geometry of 10KB, extracted from the full TGeo-geometry, is used to outline the central detectors of ALICE.
All files are access from the web by using the "CACHEREAD" option.
To be able to access the event data in a natural way, by using data-members of classes and object containers, the header files and class dictionaries are automatically generated from the TStreamerInfo classes stored in the ESD file by using the TFile::MakeProject() function. The header files and a shared library is created in the aliesd/ directory and can be loaded dynamically into the ROOT session.
Most common use of the event-display is to browse through a collection of events. Thus a simple GUI allowing this is created in the function make_gui().
Eve uses the configurable ROOT-browser as its main window and so we create an extra tab in the left working area of the browser and provide backward/forward buttons.
As this is a simple macro, we store the information about the current event in the global variable 'Int_t esd_event_id'. The functions for event-navigation simply modify this variable and call the load_event() function which does the following:
#include "aliesd/AliESDEvent.h"
#include "aliesd/AliESDfriend.h"
#include "aliesd/AliESDtrack.h"
#include "aliesd/AliESDRun.h"
const char *
esd_file_name =
"http://root.cern.ch/files/alice_ESDs.root";
{
printf(
"*** Opening ESD ***\n");
return;
printf(
"*** Opening ESD-friends ***\n");
return;
esd_tree->SetBranchStatus(
"ESDfriend*", 1);
}
{
if (bname == "AliESDfriend") {
} else {
} else {
} else {
Warning(
"AliESDEvent::ReadFromTree() "
"No Branch found with Name '%s' or '%s.'.",
bname.Data(), bname.Data());
}
}
}
}
}
{
return;
}
wf->SetElementName(
"Summary");
}
{
}
public:
{
} else {
printf(
"Already at last event.\n");
}
}
{
} else {
printf(
"Already at first event.\n");
}
}
};
{
{
b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Bck()");
b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Fwd()");
}
browser->SetTabTitle(
"Event Control", 0);
}
};
{
}
}
}
}
{
rt.fSign = (
tp->fP[4] > 0) ? 1 : -1;
}
{
return (t->fFlags &
mask) > 0;
}
{
}
{
}
{
}
Multi-view (3d, rphi, rhoz) service class using EVE Window Manager.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
R__EXTERN TEveManager * gEve
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 mask
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 index
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
Html table and event summary for alice_esd.C.
A TTree is a list of TBranches.
An array of clone (identical) objects.
Specialization of TRootBrowser for Eve.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
static TEveGeoShape * ImportShapeExtract(TEveGeoShapeExtract *gse, TEveElement *parent=nullptr)
Import a shape extract 'gse' under element 'parent'.
void AddElement(TEveElement *element, TEveElement *parent=nullptr)
Add an element.
void AddGlobalElement(TEveElement *element, TEveElement *parent=nullptr)
Add a global element, i.e.
TEveViewerList * GetViewers() const
TEveBrowser * GetBrowser() const
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
TEveEventManager * GetCurrentEvent() const
A list of tracks supporting change of common attributes and selection based on track parameters.
Holding structure for a number of track rendering parameters.
Visual representation of a track.
void DeleteAnnotations()
Delete annotations from all viewers.
Encapsulates TGFrame into an eve-window.
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=nullptr)
Create a new tab in a given tab-widget and populate it with a default window-slot.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
static Bool_t SetCacheFileDir(std::string_view cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Sets the directory where to locally stage/cache remote files.
A composite frame that layout their children in horizontal way.
Defines top level windows that interact with the system Window Manager.
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
The TNamed class is the base class for all named ROOT classes.
Mother of all ROOT objects.
TGTab * GetTabRight() const
virtual const char * Getenv(const char *env)
Get environment variable.
A TTree represents a columnar dataset.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.