]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
updated documentation and minor modifications; added test macro for RCU raw ddl data...
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 May 2008 13:01:38 +0000 (13:01 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 May 2008 13:01:38 +0000 (13:01 +0000)
HLT/RCU/macros/altro-channel-selection.C
HLT/RCU/macros/check-ddl.C [new file with mode: 0644]

index 63262553cd8e9dc47424db0659ee1444203174c6..1a6d6335dace87f322fb3353bbc9a053e53e7f6d 100644 (file)
@@ -9,17 +9,21 @@
  * current directory, you might need to start the macro in one of the raw<x>
  * folders. You can easily change the sectors and readout partitions below.
  *
- * In order to apply the macro on real RCU v1 data (only on trailer word)
- * you have to specify the trailer length explicitly, look for the 
+ * The simple test writes a fake file with the list of the selected channels.
  *
- * The first version allows to write a fake file with the list of the
- * selected channels. Later it will be extended to use the ClusterFinder
- * or, better, a separate component.
+ * There are two switches in the code:
+ * - directDump=true/false <br>
+ *   determines whether the input data should be forwarded directly. Selection
+ *   of channels is disabled if \em true
+ * - textDump=true/false   <br>
+ *   write output either in ascii text dump using the TPCDigitDump or in
+ *   binary data
  *
  * Please note that this macro uses also the TPC module, but this does not
  * imply dependencies to the libAliHLTTPC.
  *
- * Matthias.Richter@ift.uib.no
+ * @author Matthias.Richter@ift.uib.no
+ * @ingroup alihlt_rcu
  */
 {
   // this is just a tool to switch the logging systems
@@ -62,7 +66,7 @@
   bool directDump=false;
 
   // choose if you want to dump to file or translate digits to text file
-  bool textDump=true;
+  bool textDump=false;
 
   // the configuration
   int iMinSlice=0; 
 
   // the writer configuration
   if (textDump)
-    AliHLTConfiguration digitdump("digitdump", "TPCDigitDump"   , writerInput.Data(), "-specfmt=_0x%08x -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
+    AliHLTConfiguration digitdump("digitdump", "TPCDigitDump"   , writerInput.Data(), "-datafile digit.dump -specfmt=_0x%08x -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
   else
-    AliHLTConfiguration digitdump("digitdump", "FileWriter"   , writerInput.Data(), "-specfmt=_0x%08x -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
+    AliHLTConfiguration digitdump("digitdump", "FileWriter"   , writerInput.Data(), "-datafile RAW.ddl -specfmt=_0x%08x -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
 
   // build the ask list and execute
   gHLT.BuildTaskList("digitdump");
diff --git a/HLT/RCU/macros/check-ddl.C b/HLT/RCU/macros/check-ddl.C
new file mode 100644 (file)
index 0000000..dfd2f8d
--- /dev/null
@@ -0,0 +1,66 @@
+// $Id$
+/**
+ * Analyze RCU RAW data ddl files.
+ *
+ * Usage:
+ *   aliroot -b -q -l check-ddl.C'("filename")' | tee check-ddl.C
+ *
+ * Check an RCU ddl file and print out the channel content by using
+ * the AliAltroDecoder.
+ *
+ * \b Note: The channel data has to be read in reverse order and is:
+ * - length of a bunch
+ * - end time bin of the bunch
+ * - bunch data
+ *
+ * E.g.
+ * <pre>
+ * ---------- channel ----------
+ * 10       314     3       300
+ * 432      3
+ * </pre>
+ * means two bunches, one at 432 signal 300 and one at 314 signal 10.
+ *
+ * @author Matthias.Richter@ift.uib.no
+ * @ingroup alihlt_rcu
+ */
+void check_ddl(const char* filename=NULL)
+{
+  if (!filename) {
+    cout << "usage: aliroot -b -l -q check-ddl.C'(\"filename\")'" << endl;
+    return;
+  }
+
+  TString param=filename;
+  param+="?filetype=raw";
+  TFile file(param);
+  if (file.IsZombie()) {
+    cout << "can not open file " << filename << endl;
+    return;
+  }
+
+  TArrayC buffer(file.GetSize());
+  if (file.ReadBuffer(buffer.GetArray(), buffer.GetSize())) {
+    cout << "error reading file " << filename << endl;
+    return;
+  }
+
+  AliAltroDecoder decoder;
+  if (decoder.SetMemory((UChar_t*)buffer.GetArray(), (UInt_t)buffer.GetSize())<0) {
+    cout << "error setting up decoder " << endl;
+    return;
+  }
+
+  if (!decoder.Decode()) {
+    cout << "error decoding file " << filename << endl;
+    return;    
+  }
+
+  cout << "RCU trailer size: " << decoder.GetRCUTrailerSize() << endl;
+
+  AliAltroData channel;
+  while (decoder.NextChannel(&channel)) {
+    cout << "---------- channel " << channel.GetHadd() << " ----------" << endl;
+    decoder.PrintInfo(channel, channel.GetDataSize(), 4);
+  }
+}