80#include "aliesd/AliESDEvent.h"
81#include "aliesd/AliESDfriend.h"
82#include "aliesd/AliESDtrack.h"
83#include "aliesd/AliESDRun.h"
85class AliExternalTrackParam;
93 AliExternalTrackParam* tp=0);
95void trackGetPos(AliExternalTrackParam* tp,
Double_t r[3]);
96void trackGetMomentum(AliExternalTrackParam* tp,
Double_t p[3]);
97Double_t trackGetP(AliExternalTrackParam* tp);
102const char* esd_file_name =
"http://root.cern.ch/files/alice_ESDs.root";
107const char* esd_friends_file_name =
nullptr;
109const char* esd_geom_file_name =
110 "http://root.cern.ch/files/alice_ESDgeometry.root";
116TFile *esd_file =
nullptr;
117TFile *esd_friends_file =
nullptr;
119TTree *esd_tree =
nullptr;
121AliESDEvent *esd =
nullptr;
122TList *esd_objs =
nullptr;
123AliESDfriend *esd_friend =
nullptr;
125Int_t esd_event_id = 0;
132MultiView *gMultiView =
nullptr;
150 const TString weh(
"alice_esd()");
154 printf(
"*** Opening ESD ***\n");
155 esd_file =
TFile::Open(esd_file_name,
"CACHEREAD");
159 esd_tree = (
TTree*) esd_file->
Get(
"esdTree");
161 esd_objs = esd->fESDObjects;
163 if (esd_friends_file_name != 0)
165 printf(
"*** Opening ESD-friends ***\n");
166 esd_friends_file =
TFile::Open(esd_friends_file_name,
"CACHEREAD");
167 if (!esd_friends_file)
175 TIter next(esd_objs);
177 while ((el = (
TNamed*)next()))
180 if (bname ==
"AliESDfriend")
202 Warning(
"AliESDEvent::ReadFromTree() "
203 "No Branch found with Name '%s' or '%s.'.",
204 bname.Data(),bname.Data());
229 gMultiView =
new MultiView;
231 gMultiView->ImportGeomRPhi(gGeomGentle);
232 gMultiView->ImportGeomRhoZ(gGeomGentle);
238 fgHtmlSummary =
new HtmlSummary(
"Alice Event Display Summary Table");
240 fgHtml =
new TGHtml(0, 100, 100);
242 fgHtml->MapSubwindows();
264 printf(
"Loading event %d.\n", esd_event_id);
278 gMultiView->DestroyEventRPhi();
279 gMultiView->ImportEventRPhi(top);
281 gMultiView->DestroyEventRhoZ();
282 gMultiView->ImportEventRhoZ(top);
284 update_html_summary();
303 if (esd_event_id < esd_tree->GetEntries() - 1) {
307 printf(
"Already at last event.\n");
312 if (esd_event_id > 0) {
316 printf(
"Already at first event.\n");
338 EvNavHandler *fh =
new EvNavHandler;
342 b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Bck()");
346 b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Fwd()");
364 kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
365 kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
366 kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
367 kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
381 AliESDRun *esdrun = (AliESDRun*) esd_objs->
FindObject(
"AliESDRun");
402 trkProp->
SetMagField( 0.1 * esdrun->fMagneticField );
406 AliESDtrack* at = (AliESDtrack*)
tracks->At(
n);
409 AliExternalTrackParam* tp = at;
410 if (! trackIsOn(at, kITSrefit)) {
414 TEveTrack* track = esd_make_track(trkProp,
n, at, tp);
433 AliExternalTrackParam* tp)
443 if (tp == 0) tp = at;
448 rt.
fSign = (tp->fP[4] > 0) ? 1 : -1;
450 trackGetPos(tp, vbuf); rt.
fV.
Set(vbuf);
451 trackGetMomentum(tp, pbuf); rt.
fP.
Set(pbuf);
470 return (t->fFlags & mask) > 0;
474void trackGetPos(AliExternalTrackParam* tp,
Double_t r[3])
478 r[0] = tp->fX;
r[1] = tp->fP[0];
r[2] = tp->fP[1];
481 r[0] =
x*cs -
r[1]*sn;
r[1] =
x*sn +
r[1]*cs;
485void trackGetMomentum(AliExternalTrackParam* tp,
Double_t p[3])
489 p[0] = tp->fP[4]; p[1] = tp->fP[2]; p[2] = tp->fP[3];
494 p[0]=
pt*(
r*cs - p[1]*sn); p[1]=
pt*(p[1]*cs +
r*sn); p[2]=
pt*p[2];
498Double_t trackGetP(AliExternalTrackParam* tp)
Multi-view (3d, rphi, rhoz) service class using EVE Window Manager.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
R__EXTERN TEveManager * gEve
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
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.
virtual void SetElementName(const char *name)
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=0)
Import a shape extract 'gse' under element 'parent'.
TEveViewerList * GetViewers() const
void AddElement(TEveElement *element, TEveElement *parent=0)
Add an element.
void AddGlobalElement(TEveElement *element, TEveElement *parent=0)
Add a global element, i.e.
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.
virtual void SetMarkerStyle(Style_t s)
Set marker style for the list and the elements.
virtual void SetMarkerColor(Color_t c)
Set marker color for the list and the elements.
void MakeTracks(Bool_t recurse=kTRUE)
Regenerate the visual representations of tracks.
virtual void SetMainColor(Color_t c)
Set main (line) color for the list and the elements.
TEveTrackPropagator * GetPropagator()
virtual void SetMarkerSize(Size_t s)
Set marker size for the list and the elements.
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)
void DeleteAnnotations()
Delete annotations from all viewers.
Encapsulates TGFrame into an eve-window.
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=0)
Create a new tab in a given tab-widget and populate it with a default window-slot.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static Bool_t SetCacheFileDir(ROOT::Internal::TStringView cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
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.
void Close(Option_t *option="") override
Close a file.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void MapWindow()
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=0)
Set window name. This is typically done via the 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...
virtual TObject ** GetObjectRef(const TObject *obj) const
Return address of pointer to obj.
virtual TObject * FindObject(const char *name) const
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
TGTab * GetTabRight() const
virtual const char * Getenv(const char *env)
Get environment variable.
A TTree represents a columnar dataset.
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.
virtual void SetBranchStatus(const char *bname, Bool_t status=1, UInt_t *found=0)
Set branch status to Process or DoNotProcess.
Double_t Sqrt(Double_t x)