* 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
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");
--- /dev/null
+// $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);
+ }
+}