Complex example showing ALICE VSD visualization.
alice_vsd.C - a simple event-display for ALICE
Only standard ROOT is used to process the ALICE VSD files.
No ALICE code is needed – the VSD file is exported from AliRoot into VSD format – see TEveVSDStructs.h and TEveVSD.h.
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.
MultiView* gMultiView = 0;
class TVSDReader
{
public:
public:
TVSDReader(const char* file_name) :
fFile(0), fDirectory(0), fEvDirKeys(0),
fVSD(0),
fMaxEv(-1), fCurEv(-1),
fTrackList(0),
fITSClusters(0), fTPCClusters(0), fTRDClusters(0), fTOFClusters(0)
{
if (!fFile)
{
Error(
"VSD_Reader",
"Can not open file '%s' ... terminating.",
file_name);
}
while (lnk)
{
{
}
}
if (fMaxEv == 0)
{
Error(
"VSD_Reader",
"No events to show ... terminating.");
}
}
virtual ~TVSDReader()
{
DropEvent();
delete fVSD;
delete fEvDirKeys;
delete fFile;
}
void AttachEvent()
{
}
void DropEvent()
{
delete fDirectory;
fDirectory = 0;
}
void NextEvent()
{
GotoEvent(fCurEv + 1);
}
void PrevEvent()
{
GotoEvent(fCurEv - 1);
}
{
if (ev < 0 || ev >= fMaxEv)
{
Warning(
"GotoEvent",
"Invalid event id %d.", ev);
}
DropEvent();
fCurEv = ev;
AttachEvent();
LoadClusters(fITSClusters, "ITS", 0);
LoadClusters(fTPCClusters, "TPC", 1);
LoadClusters(fTRDClusters, "TRD", 2);
LoadClusters(fTOFClusters, "TOF", 3);
LoadEsdTracks();
gMultiView->DestroyEventRPhi();
gMultiView->ImportEventRPhi(top);
gMultiView->DestroyEventRhoZ();
gMultiView->ImportEventRhoZ(top);
}
{
if (ps == 0)
{
}
else
{
}
ss.Select();
}
enum ESDTrackFlags
{
kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
kHMPIDpid=0x20000,
kEMCALmatch=0x40000,
kTRDbackup=0x80000,
kTRDStop=0x20000000,
kESDpid=0x40000000,
kTIME=0x80000000
};
{
}
void LoadEsdTracks()
{
if (fTrackList == 0)
{
}
else
{
}
for (
Int_t n = 0; n < nTracks; ++
n)
{
}
}
};
TVSDReader* gVSDReader = 0;
void make_gui();
void alice_vsd(const char* vsd_file_name=
"http://mtadel.home.cern.ch/mtadel/root/AliVSD.root")
{
gVSDReader = new TVSDReader(vsd_file_name);
{
TFile::Open(
"http://mtadel.home.cern.ch/mtadel/root/alice_mini_geom.root",
"CACHEREAD");
if (!geom)
return;
delete geom;
}
gMultiView = new MultiView;
gMultiView->SetDepth(-10);
gMultiView->ImportGeomRPhi(gentle_geom);
gMultiView->ImportGeomRhoZ(gentle_geom);
gMultiView->SetDepth(0);
make_gui();
gVSDReader->GotoEvent(0);
}
void make_gui()
{
{
b->
Connect(
"Clicked()",
"TVSDReader", gVSDReader,
"PrevEvent()");
b->
Connect(
"Clicked()",
"TVSDReader", gVSDReader,
"NextEvent()");
}
}
- Author
- Matevz Tadel
Definition in file alice_vsd.C.