-void alieve_create_vsd()
-{
- // Invoke as: aliroot alieve_create_vsd.C
-
- gSystem->Load("libPhysics");
- gSystem->Load("libEG");
- gSystem->Load("libTreePlayer");
- gSystem->Load("libGed");
- gSystem->Load("libRGL");
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
- gSystem->Load("libReve");
- gSystem->Load("libAlieve");
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
+ * full copyright notice. *
+ **************************************************************************/
- DisablePODTObjectStreamers();
+void alieve_create_vsd(Int_t nEvents=1, Int_t minTracks=0)
+{
+ // Invoke from a running alieve.
+ // nEvents will be domped starting from current one.
+ // If minTracks is set at least that many ESD tracks must exist.
- TGeoManager::Import("geometry.root");
+ TEveVSD::DisableTObjectStreamersForVSDStruct();
- Alieve::VSDCreator vc;
+ AliEveVSDCreator vc;
vc.SetDebugLevel(2);
- vc.CreateVSD(".", 0, "AliVSD.root");
+
+ Int_t nDone = 0;
+ while (nDone < nEvents)
+ {
+ if (minTracks)
+ {
+ AliESDEvent* esd = AliEveEventManager::AssertESD();
+ while (esd->GetNumberOfTracks() < minTracks)
+ {
+ AliEveEventManager::GetMaster()->NextEvent();
+ esd = AliEveEventManager::AssertESD();
+ }
+ }
+ vc.CreateVSD("AliVSD.root");
+ ++nDone;
+
+ AliEveEventManager::GetMaster()->NextEvent();
+ }
}