76#include "aliesd/AliESDEvent.h"
77#include "aliesd/AliESDRun.h"
78#include "aliesd/AliESDtrack.h"
87class AliExternalTrackParam;
91void update_projections();
95 AliExternalTrackParam* tp=0);
97void trackGetPos(AliExternalTrackParam* tp,
Double_t r[3]);
98void trackGetMomentum(AliExternalTrackParam* tp,
Double_t p[3]);
99Double_t trackGetP(AliExternalTrackParam* tp);
104const char* esd_file_name =
"http://root.cern.ch/files/alice_ESDs.root";
105const char* esd_friends_file_name =
"http://root.cern.ch/files/alice_ESDfriends.root";
106const char* esd_geom_file_name =
"http://root.cern.ch/files/alice_ESDgeometry.root";
108TFile *esd_file =
nullptr;
109TFile *esd_friends_file =
nullptr;
111TTree *esd_tree =
nullptr;
113AliESDEvent *esd =
nullptr;
114AliESDfriend *esd_friend =
nullptr;
116Int_t esd_event_id = 0;
140 printf(
"*** Opening ESD ***\n");
141 esd_file =
TFile::Open(esd_file_name,
"CACHEREAD");
145 printf(
"*** Opening ESD-friends ***\n");
146 esd_friends_file =
TFile::Open(esd_friends_file_name,
"CACHEREAD");
147 if (!esd_friends_file)
150 esd_tree = (
TTree*) esd_file->
Get(
"esdTree");
156 TIter next(esd->fESDObjects);
158 while ((el=(
TNamed*)next()))
161 if(bname.CompareTo(
"AliESDfriend")==0)
164 esd_tree->
SetBranchAddress(
"ESDfriend.", esd->fESDObjects->GetObjectRef(el));
182 if (screen_ratio > 1.5) {
207 gRPhiMgr->ImportElements(gGeoShape);
213 gRhoZMgr->ImportElements(gGeoShape);
218 update_projections();
229 printf(
"Loading event %d.\n", esd_event_id);
231 gTextEntry->
SetText(
Form(
"Loading event %d...",esd_event_id));
243 gTextEntry->
SetText(
Form(
"Event %d loaded",esd_event_id));
244 gROOT->ProcessLine(
"SplitGLView::UpdateSummary()");
248void update_projections()
254 if (gRPhiMgr && top) {
256 gRPhiMgr->ImportElements(gGeoShape);
257 gRPhiMgr->ImportElements(top);
259 if (gRhoZMgr && top) {
260 gRhoZMgr->DestroyElements();
261 gRhoZMgr->ImportElements(gGeoShape);
262 gRhoZMgr->ImportElements(top);
279 if (esd_event_id < esd_tree->GetEntries() - 1) {
282 update_projections();
285 gTextEntry->
SetText(
"Already at last event");
286 printf(
"Already at last event.\n");
291 if (esd_event_id > 0) {
294 update_projections();
297 gTextEntry->
SetText(
"Already at first event");
298 printf(
"Already at first event.\n");
308 gROOT->ProcessLine(
".L SplitGLView.C+");
313 browser->
ExecPlugin(
"SplitGLView", 0,
"new SplitGLView(gClient->GetRoot(), 600, 450, kTRUE)");
327 EvNavHandler *fh =
new EvNavHandler;
331 b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Bck()");
335 b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Fwd()");
363 kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
364 kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
365 kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
366 kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
380 AliESDRun *esdrun = (AliESDRun*) esd->fESDObjects->FindObject(
"AliESDRun");
387 if (track_list == 0) {
399 trkProp->
SetMagField( 0.1 * esdrun->fMagneticField );
405 AliESDtrack* at = (AliESDtrack*)
tracks->At(
n);
408 AliExternalTrackParam* tp = at;
409 if (! trackIsOn(at, kITSrefit)) {
413 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)
ULong_t Pixel_t
Pixel value.
R__EXTERN TEveManager * gEve
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
An array of clone (identical) objects.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Specialization of TRootBrowser for Eve.
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.
TEveElement * FindChild(const TString &name, const TClass *cls=0)
Find the first child with given name.
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'.
void AddElement(TEveElement *element, TEveElement *parent=0)
Add an element.
TEveSceneList * GetScenes() const
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
Axes for non-linear projections.
Manager class for steering of projections and managing projected objects.
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)
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 Move(Int_t x, Int_t y)
Move frame.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
virtual void MapWindow()
map window
void ShowPosition(Bool_t set=kTRUE, Bool_t percent=kTRUE, const char *format="%.2f")
Show postion text, either in percent or formatted according format.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
void Increment(Float_t inc)
Increment progress position.
virtual void SetBarColor(Pixel_t color)
Set progress bar color.
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
void SetEnabled(Bool_t flag=kTRUE)
virtual void SetTextColor(Pixel_t color, Bool_t local=kTRUE)
Changes text color.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
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.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
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
virtual void ShowCloseTab(Bool_t show)
Long_t ExecPlugin(const char *name=nullptr, const char *fname=nullptr, const char *cmd=nullptr, Int_t pos=kRight, Int_t subpos=-1) override
Execute a macro and embed the created frame in the tab "pos" and tab element "subpos".
virtual const char * Getenv(const char *env)
Get environment variable.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
A TTree represents a columnar dataset.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
virtual Int_t GetEntry(Long64_t entry=0, 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)