80#include "aliesd/AliESDEvent.h"
81#include "aliesd/AliESDfriend.h"
82#include "aliesd/AliESDtrack.h"
83#include "aliesd/AliESDRun.h"
85class AliExternalTrackParam;
93void trackGetPos(AliExternalTrackParam *tp,
Double_t r[3]);
94void trackGetMomentum(AliExternalTrackParam *tp,
Double_t p[3]);
95Double_t trackGetP(AliExternalTrackParam *tp);
99const char *esd_file_name =
"http://root.cern.ch/files/alice_ESDs.root";
104const char *esd_friends_file_name =
nullptr;
106const char *esd_geom_file_name =
"http://root.cern.ch/files/alice_ESDgeometry.root";
112TFile *esd_file =
nullptr;
113TFile *esd_friends_file =
nullptr;
115TTree *esd_tree =
nullptr;
117AliESDEvent *esd =
nullptr;
118TList *esd_objs =
nullptr;
119AliESDfriend *esd_friend =
nullptr;
121Int_t esd_event_id = 0;
128MultiView *gMultiView =
nullptr;
146 const TString weh(
"alice_esd()");
150 printf(
"*** Opening ESD ***\n");
151 esd_file =
TFile::Open(esd_file_name,
"CACHEREAD");
155 esd_tree = (
TTree *)esd_file->
Get(
"esdTree");
157 esd_objs = esd->fESDObjects;
159 if (esd_friends_file_name != 0) {
160 printf(
"*** Opening ESD-friends ***\n");
161 esd_friends_file =
TFile::Open(esd_friends_file_name,
"CACHEREAD");
162 if (!esd_friends_file)
170 TIter next(esd_objs);
172 while ((el = (
TNamed *)next())) {
174 if (bname ==
"AliESDfriend") {
187 Warning(
"AliESDEvent::ReadFromTree() "
188 "No Branch found with Name '%s' or '%s.'.",
189 bname.Data(), bname.Data());
206 gEve->AddGlobalElement(gGeomGentle);
212 gMultiView =
new MultiView;
214 gMultiView->ImportGeomRPhi(gGeomGentle);
215 gMultiView->ImportGeomRhoZ(gGeomGentle);
220 fgHtmlSummary =
new HtmlSummary(
"Alice Event Display Summary Table");
222 fgHtml =
new TGHtml(0, 100, 100);
224 fgHtml->MapSubwindows();
230 gEve->GetBrowser()->GetTabRight()->SetTab(1);
245 printf(
"Loading event %d.\n", esd_event_id);
247 gEve->GetViewers()->DeleteAnnotations();
259 gMultiView->DestroyEventRPhi();
260 gMultiView->ImportEventRPhi(top);
262 gMultiView->DestroyEventRhoZ();
263 gMultiView->ImportEventRhoZ(top);
265 update_html_summary();
282 if (esd_event_id < esd_tree->GetEntries() - 1) {
286 printf(
"Already at last event.\n");
291 if (esd_event_id > 0) {
295 printf(
"Already at first event.\n");
317 EvNavHandler *fh =
new EvNavHandler;
321 b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Bck()");
325 b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Fwd()");
359 kEMCALmatch = 0x40000,
360 kTRDbackup = 0x80000,
361 kTRDStop = 0x20000000,
362 kESDpid = 0x40000000,
371 AliESDRun *esdrun = (AliESDRun *)esd_objs->
FindObject(
"AliESDRun");
380 if (gTrackList == 0) {
387 gEve->AddElement(gTrackList);
391 trkProp->
SetMagField(0.1 * esdrun->fMagneticField);
394 AliESDtrack *at = (AliESDtrack *)
tracks->At(
n);
397 AliExternalTrackParam *tp = at;
398 if (!trackIsOn(at, kITSrefit)) {
402 TEveTrack *track = esd_make_track(trkProp,
n, at, tp);
434 rt.
fSign = (tp->fP[4] > 0) ? 1 : -1;
436 trackGetPos(tp, vbuf);
438 trackGetMomentum(tp, pbuf);
458 return (t->fFlags & mask) > 0;
462void trackGetPos(AliExternalTrackParam *tp,
Double_t r[3])
471 r[0] =
x * cs -
r[1] * sn;
472 r[1] =
x * sn +
r[1] * cs;
476void trackGetMomentum(AliExternalTrackParam *tp,
Double_t p[3])
487 p[0] =
pt * (
r * cs - p[1] * sn);
488 p[1] =
pt * (p[1] * cs +
r * sn);
493Double_t trackGetP(AliExternalTrackParam *tp)
Multi-view (3d, rphi, rhoz) service class using EVE Window Manager.
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
TEveRecTrackT< Float_t > TEveRecTrack
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Html table and event summary for alice_esd.C.
A TTree is a list of TBranches.
virtual void SetAddress(void *add)
Set address of this branch.
An array of clone (identical) objects.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Specialization of TRootBrowser for Eve.
void SetElementName(const char *name) override
Virtual function for setting of name of an element.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
virtual void AddElement(TEveElement *el)
Add el to the list of children.
virtual void DestroyElements()
Destroy all children of this element.
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'.
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
A list of tracks supporting change of common attributes and selection based on track parameters.
void SetMarkerStyle(Style_t s) override
Set marker style for the list and the elements.
void SetMarkerColor(Color_t c) override
Set marker color for the list and the elements.
void SetMainColor(Color_t c) override
Set main (line) color for the list and the elements.
void SetMarkerSize(Size_t s) override
Set marker size for the list and the elements.
void MakeTracks(Bool_t recurse=kTRUE)
Regenerate the visual representations of tracks.
TEveTrackPropagator * GetPropagator()
Holding structure for a number of track rendering parameters.
void SetMagField(Double_t bX, Double_t bY, Double_t bZ)
Set constant magnetic field and rebuild tracks.
Visual representation of a track.
void SetAttLineAttMarker(TEveTrackList *tl)
Set line and marker attributes from TEveTrackList.
virtual void SetStdTitle()
Set standard track title based on most data-member values.
void Set(const Float_t *v)
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 file, usually with extension .root, that stores data and code in the form of serialized objects in ...
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.
void Close(Option_t *option="") override
Close a file.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapWindow() override
map window
A composite frame that layout their children in horizontal way.
Defines top level windows that interact with the system Window Manager.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
TObject ** GetObjectRef(const TObject *obj) const override
Return address of pointer to obj.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
The TNamed class is the base class for all named ROOT classes.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual void SetName(const char *name)
Change (i.e.
void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1) override
Start embedding external frame in the tab "pos" and tab element "subpos".
void SetTabTitle(const char *title, Int_t pos=kRight, Int_t subpos=-1)
Set text "title" of Tab "subpos" in TGTab "pos".
void StopEmbedding(const char *name=nullptr) override
A TTree represents a columnar dataset.
virtual void SetBranchStatus(const char *bname, bool status=true, UInt_t *found=nullptr)
Set branch status to Process or DoNotProcess.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual TList * GetUserInfo()
Return a pointer to the list containing user objects associated to this tree.
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.