Example of usage of the new altro decoding code
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Aug 2007 13:42:44 +0000 (13:42 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Aug 2007 13:42:44 +0000 (13:42 +0000)
RAW/altroFast.C [new file with mode: 0644]

diff --git a/RAW/altroFast.C b/RAW/altroFast.C
new file mode 100644 (file)
index 0000000..f4876c9
--- /dev/null
@@ -0,0 +1,47 @@
+#if !defined(__CINT__) || defined(__MAKECINT__)
+  #include <TStopwatch.h>
+  #include "AliRawReaderRoot.h"
+  #include "AliRawReaderDate.h"
+  #include "AliAltroRawStreamFast.h"
+  #include "AliLog.h"
+#endif
+
+
+void altroFast(const char *fileName)
+{
+  //  AliLog::SetGlobalLogLevel(AliLog::kFatal);
+
+  //  AliRawReader *reader = new AliRawReaderRoot(fileName);
+  AliRawReader *reader = new AliRawReaderDate(fileName);
+  reader->Reset();
+
+  TStopwatch timer;
+  timer.Start();
+
+  AliAltroRawStreamFast* stream = new AliAltroRawStreamFast(reader);
+  stream->SelectRawData("TPC");
+
+  while (reader->NextEvent()) {
+
+    while (stream->NextDDL()) {
+
+      while (stream->NextChannel()) {
+
+       while (stream->NextBunch()) {
+         const UInt_t *adc = stream->GetSignals();
+         for(UInt_t i = stream->GetStartTimeBin(); i <= stream->GetEndTimeBin(); i++) {
+           // cout i - timebin, *adc - ADC signal, ...
+           adc++;
+         }
+       }
+      }
+    }
+  }
+
+  timer.Stop();
+  timer.Print();
+
+  delete stream;
+
+  return;
+}