Extacting the OCDB in a separate module. The detectors have write permission in the...
[u/mrichter/AliRoot.git] / EVE / alice-macros / trd_loader.C
CommitLineData
6983e87a 1//
2// How to steer the TRD loaders from a macro
3// For the usage of only the TRD data containers and
4// AliEve event loop check the macro "trd_detectors.C"
5//
6// Usage:
7// .L trd_loader.C
e4d5b362 8// AliCDBManager *cdb = AliCDBManager::Instance();
162637e4 9// cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
e4d5b362 10// cdb->SetRun(0)
6983e87a 11// AliEveTRDLoader *loader = trd_loader();
12// loader->NextEvent();
b2c770ec 13// loop(loader)
6983e87a 14//
15// Author:
16// Alex Bercuci (A.Bercuci@gsi.de)
17//
e4d5b362 18AliEveTRDLoader* trd_loader(Int_t event=0)
6983e87a 19{
6983e87a 20 // init single file loader
b2c770ec 21 AliEveTRDLoader *loader = new AliEveTRDLoader("Clusters");
6983e87a 22
23 // link the run loader and define the chamber setting and data type
b2c770ec 24 loader->Open("TRD.RecPoints.root");
25 loader->AddChambers(0);
26 loader->AddChambers(8);
27 loader->AddChambers(9);
28 loader->AddChambers(17);
29 loader->SetDataType(AliEveTRDLoader::kTRDClusters);
6983e87a 30
31 // load first event
b2c770ec 32 loader->GoToEvent(event);
6983e87a 33
34 // register loader with alieve
35 gEve->AddElement(loader);
36 loader->SpawnEditor();
37 gEve->Redraw3D();
38
39 return loader;
40}
b2c770ec 41
42
43void loop(AliEveTRDLoader *loader)
44{
45 while(loader->NextEvent()){
46 printf("Event[%d]\n", loader->GetEvent());
47 gEve->Redraw3D();
48 gSystem->ProcessEvents();
49 gSystem->Sleep(2000);
50 }
51}