]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
From Alexandru: new/improved TRD macros.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Jun 2008 12:26:50 +0000 (12:26 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Jun 2008 12:26:50 +0000 (12:26 +0000)
EVE/alice-macros/trd_analyse.C
EVE/alice-macros/trd_rawloader.C [new file with mode: 0644]

index ed96d638e49e4f0f3f8ca4c1bc972019f84344dd..879aa5b6860f979ab4f2218c7cb0e02cd7e6b05f 100644 (file)
@@ -1,5 +1,46 @@
+//
+// 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;
@@ -15,12 +56,14 @@ void analyseClusters(TEvePointSet *points = 0x0)
 
 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
+}
+
diff --git a/EVE/alice-macros/trd_rawloader.C b/EVE/alice-macros/trd_rawloader.C
new file mode 100644 (file)
index 0000000..9aff6be
--- /dev/null
@@ -0,0 +1,40 @@
+//
+// 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;
+}