+//
+// How to access the basic TRD data structures when a
+// pointer to an Eve opject is available. One can get a
+// valid pointer from the event display by accessing the
+// function ExportToCINT
+//
+// Usage:
+// .L trd_analysis.C
+// analyseXXX(ptr)
+//
+// Author:
+// Alex Bercuci (A.Bercuci@gsi.de)
+//
+void analyseDigits(AliEveTRDDigits *digits = 0x0)
+{
+// Simple print digits from a detector
+
+ if(!digits) {
+ Info("analyseDigits", "Invalid digits set.");
+ return;
+ }
+
+ Int_t adc ;
+ AliTRDdataArrayI *data = digits->GetData();
+ Int_t nrows = data->GetNrow(),
+ ncols = data->GetNcol(),
+ ntbs = data->GetNtime();
+ data->Expand();
+ printf("nrows[%d] ncols[%d] ntbs[%d]\n", nrows, ncols, ntbs);
+ for (Int_t row = 0; row < nrows; row++)
+ for (Int_t col = 0; col < ncols; col++)
+ for (Int_t time = 0; time < ntbs; time++) {
+ if((adc = data->GetDataUnchecked(row, col, time)) <= 1) continue;
+ printf("r[%d] c[%d] t[%d] ADC[%d]\n", row, col, time, adc);
+ }
+ data->Compress(1);
+}
+
+
void analyseClusters(TEvePointSet *points = 0x0)
{
+// print some info about clusters in one detector or
+// attached to tracks.
if(!points) {
Info("analyseClusters", "Invalid points set.");
return;
void analyseTracklet(TEveLine *line)
{
+// print tracklet information
if(!line) {
Info("analyseTracklet", "Invalid line.");
return;
}
AliTRDseedV1 *tracklet = 0x0;
- tracklet = (AliTRDseedV1*)line->GetPointId(0);
+ tracklet = (AliTRDseedV1*)line->GetUserData(0);
tracklet->Print();
-}
\ No newline at end of file
+}
+
--- /dev/null
+//
+// How to steer the TRD loaders from a macro
+// For the usage of only the TRD data containers and
+// AliEve event loop check the macro "trd_detectors.C"
+//
+// Usage:
+// .L trd_rawloader.C
+// AliEveTRDLoader *raw = trd_rawloader(filename);
+// raw->NextEvent();
+//
+// Caution:
+// In order to update the screen one has to go to GLViewer
+// and click the UpdateScene button after each NextEvent().
+//
+// Author:
+// Alex Bercuci (A.Bercuci@gsi.de)
+// Minjug Kweon (minjung@physi.uni-heidelberg.de)
+//
+AliEveTRDLoader* trd_rawloader(Char_t *file)
+{
+ Int_t fSuperModule = 0; // -1 for all
+ Int_t fStack = 4; // -1 for all
+ Int_t fLayer = -1; // -1 for all
+
+ // init RAW loader
+ AliEveTRDLoaderRaw *raw = new AliEveTRDLoaderRaw("RAW");
+ raw->SetDataType(AliEveTRDLoader::kTRDRawRoot);
+ raw->AddChambers(fSuperModule, fStack, fLayer);
+ raw->Open(file);
+
+ // load first event
+ raw->GoToEvent(0);
+
+ // register raw with alieve
+ gEve->AddElement(raw);
+ raw->SpawnEditor();
+ gEve->Redraw3D();
+
+ return raw;
+}