42MultiView *gMultiView =
nullptr;
51 TDirectory *fDirectory;
53 TObjArray *fEvDirKeys;
63 TEveTrackList *fTrackList;
64 TEvePointSet *fITSClusters;
65 TEvePointSet *fTPCClusters;
66 TEvePointSet *fTRDClusters;
67 TEvePointSet *fTOFClusters;
70 TVSDReader(
const char *file_name)
80 fITSClusters(nullptr),
81 fTPCClusters(nullptr),
82 fTRDClusters(nullptr),
87 Error(
"VSD_Reader",
"Can not open file '%s' ... terminating.", file_name);
91 fEvDirKeys =
new TObjArray;
92 TPMERegexp name_re(
"Event\\d+");
103 Error(
"VSD_Reader",
"No events to show ... terminating.");
110 virtual ~TVSDReader()
137 gEve->GetViewers()->DeleteAnnotations();
138 gEve->GetCurrentEvent()->DestroyElements();
144 fDirectory =
nullptr;
151 void NextEvent() { GotoEvent(fCurEv + 1); }
153 void PrevEvent() { GotoEvent(fCurEv - 1); }
157 if (ev < 0 || ev >= fMaxEv) {
158 Warning(
"GotoEvent",
"Invalid event id %d.", ev);
167 fDirectory = (TDirectory *)((TKey *)fEvDirKeys->
At(fCurEv))->ReadObj();
174 LoadClusters(fITSClusters,
"ITS", 0);
175 LoadClusters(fTPCClusters,
"TPC", 1);
176 LoadClusters(fTRDClusters,
"TRD", 2);
177 LoadClusters(fTOFClusters,
"TOF", 3);
183 auto top =
gEve->GetCurrentEvent();
185 gMultiView->DestroyEventRPhi();
186 gMultiView->ImportEventRPhi(top);
188 gMultiView->DestroyEventRhoZ();
189 gMultiView->ImportEventRhoZ(top);
200 void LoadClusters(TEvePointSet *&ps,
const TString &det_name,
Int_t det_id)
203 ps =
new TEvePointSet(det_name);
216 gEve->AddElement(ps);
241 kEMCALmatch = 0x40000,
242 kTRDbackup = 0x80000,
243 kTRDStop = 0x20000000,
244 kESDpid = 0x40000000,
259 if (fTrackList ==
nullptr) {
260 fTrackList =
new TEveTrackList(
"ESD Tracks");
278 for (
Int_t n = 0;
n < nTracks; ++
n) {
281 TEveTrack *track =
new TEveTrack(&fVSD->
fR, trkProp);
290 gEve->AddElement(fTrackList);
296TVSDReader *gVSDReader =
nullptr;
302void alice_vsd(
const char *vsd_file_name =
"http://mtadel.home.cern.ch/mtadel/root/AliVSD.root")
317 gVSDReader =
new TVSDReader(vsd_file_name);
324 auto geom =
TFile::Open(
"http://mtadel.home.cern.ch/mtadel/root/alice_mini_geom.root",
"CACHEREAD");
331 gEve->AddGlobalElement(gentle_geom);
337 gMultiView =
new MultiView;
340 gMultiView->SetDepth(-10);
341 gMultiView->ImportGeomRPhi(gentle_geom);
342 gMultiView->ImportGeomRhoZ(gentle_geom);
343 gMultiView->SetDepth(0);
348 gEve->GetViewers()->SwitchColorSet();
351 gEve->GetBrowser()->GetTabRight()->SetTab(1);
357 gVSDReader->GotoEvent(0);
367 auto browser =
gEve->GetBrowser();
371 frmMain->SetWindowName(
"XX GUI");
381 b->Connect(
"Clicked()",
"TVSDReader", gVSDReader,
"PrevEvent()");
385 b->Connect(
"Clicked()",
"TVSDReader", gVSDReader,
"NextEvent()");
387 frmMain->AddFrame(hf);
389 frmMain->MapSubwindows();
391 frmMain->MapWindow();
393 browser->StopEmbedding();
394 browser->SetTabTitle(
"Event Control", 0);
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).
short Color_t
Color number (short).
#define ClassDef(name, id)
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
TList * GetListOfKeys() const override
virtual void AddElement(TEveElement *el)
Add el to the list of children.
virtual void SetMainColor(Color_t color)
Set main color of the element.
void IncDenyDestroy()
Increases the deny-destroy count of the element.
virtual void DestroyElements()
Destroy all children of this element.
Base class for event management and navigation.
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.
virtual void SetTitle(const char *t)
void Reset(Int_t n_points=0, Int_t n_int_ids=0)
Drop all data and set-up the data structures to recive new data.
void SetMarkerStyle(Style_t mstyle=1) override
Set marker style, propagate to projecteds.
void SetMarkerSize(Size_t msize=1) override
Set marker size, propagate to projecteds.
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()
void SetMagField(Double_t bX, Double_t bY, Double_t bZ)
Set constant magnetic field and rebuild tracks.
void SetAttLineAttMarker(TEveTrackList *tl)
Set line and marker attributes from TEveTrackList.
virtual void SetStdTitle()
Set standard track title based on most data-member values.
static void DisableTObjectStreamersForVSDStruct()
Disable TObject streamers for those VSD structs that inherit from TObject directly.
virtual void SetBranchAddresses()
Set branche addresses of internal trees.
virtual void DeleteTrees()
Delete internal trees.
virtual void SetDirectory(TDirectory *dir)
Set directory in which the trees are (or will be) created.
TTree * fTreeC
! Clusters.
virtual void LoadTrees()
Load internal trees from directory.
TTree * fTreeR
! Reconstructed tracks.
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.
A composite frame that layout their children in horizontal way.
Defines top level windows that interact with the system Window Manager.
virtual TObjLink * FirstLink() const
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
TObject * GetObject() const
virtual const char * GetName() const
Returns name of object.
virtual Int_t Size() const
virtual void SetName(const char *name)
Change (i.e.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual Long64_t GetEntries() const