{
AliHLTSystem gHLT;
gHLT.LoadComponentLibraries("libAliHLTUtil.so libAliHLTSample.so");
+ // The AliHLTFilePublisher (component Id \em 'FilePublisher' provides
+ // the given file (see AliHLTFilePublisher for more options) to the
+ // subsequent components in the chain.
AliHLTConfiguration publisher("fp1", "FilePublisher", NULL, "-datafile some-data.dat");
+
+ // The AliHLTDummyComponent (Id \em 'Dummy') just forwards a certain
+ // fraction of the input to the output or just repeats the input data
+ // if percentage > 100
AliHLTConfiguration copy("cp", "Dummy", "fp1", "output_percentage 80");
+
+ // The AliHLTFileWriter (Id 'FileWriter') is a data sink. It writes
+ // all incoming data blocks to files. Several options available.
AliHLTConfiguration sink1("sink1", "FileWriter", "cp", NULL);
+
+ // here you specify the top most configuration of the chain. The
+ // configuration depends on all the parents. The task lisy is build
+ // according to that.
gHLT.BuildTaskList("sink1");
gHLT.Run();
}
{
AliHLTSystem gHLT;
// load the component library
- gHLT.LoadComponentLibraries("libAliHLTUtil.so libAliHLTTPC.so");
+ gHLT.LoadComponentLibraries("libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so");
// data source components
- AliHLTConfiguration fp0("fp0", "FilePublisher", NULL, "-datatype DDL_RWPK 'TPC ' -dataspec 0x00000000"
+ AliHLTConfiguration fp0("fp0", "FilePublisher", NULL, "-datatype 'DDL_RAW ' 'TPC ' -dataspec 0x00000000"
"-datafile TPC_768.ddl");
- AliHLTConfiguration fp1("fp1", "FilePublisher", NULL, "-datatype DDL_RWPK 'TPC ' -dataspec 0x00000101"
+ AliHLTConfiguration fp1("fp1", "FilePublisher", NULL, "-datatype 'DDL_RAW ' 'TPC ' -dataspec 0x00000101"
"-datafile TPC_769.ddl");
- AliHLTConfiguration fp2("fp2", "FilePublisher", NULL, "-datatype DDL_RWPK 'TPC ' -dataspec 0x00000202"
+ AliHLTConfiguration fp2("fp2", "FilePublisher", NULL, "-datatype 'DDL_RAW ' 'TPC ' -dataspec 0x00000202"
"-datafile TPC_840.ddl");
- AliHLTConfiguration fp3("fp3", "FilePublisher", NULL, "-datatype DDL_RWPK 'TPC ' -dataspec 0x00000303"
+ AliHLTConfiguration fp3("fp3", "FilePublisher", NULL, "-datatype 'DDL_RAW ' 'TPC ' -dataspec 0x00000303"
"-datafile TPC_841.ddl");
- AliHLTConfiguration fp4("fp4", "FilePublisher", NULL, "-datatype DDL_RWPK 'TPC ' -dataspec 0x00000404"
+ AliHLTConfiguration fp4("fp4", "FilePublisher", NULL, "-datatype 'DDL_RAW ' 'TPC ' -dataspec 0x00000404"
"-datafile TPC_842.ddl");
- AliHLTConfiguration fp5("fp5", "FilePublisher", NULL, "-datatype DDL_RWPK 'TPC ' -dataspec 0x00000505"
+ AliHLTConfiguration fp5("fp5", "FilePublisher", NULL, "-datatype 'DDL_RAW ' 'TPC ' -dataspec 0x00000505"
"-datafile TPC_843.ddl");
// cluster finders
int patch=AliHLTTPCDefinitions::GetMinPatchNr(pBlock->fSpecification);
if (slice!=AliHLTTPCDefinitions::GetMaxSliceNr(pBlock->fSpecification) ||
patch!=AliHLTTPCDefinitions::GetMaxPatchNr(pBlock->fSpecification)) {
- HLTError("ambiguous readout partition (specification 0x%80x), skipping input block", pBlock->fSpecification);
+ HLTError("ambiguous readout partition (specification 0x%08x), skipping input block", pBlock->fSpecification);
break;
}
- if (slice<0 || slice>35 || patch<0 || slice>5) {
- HLTError("invalid readout partition %d/%d (specification 0x%80x, skipping input block", slice, patch, pBlock->fSpecification);
+ if (slice<0 || slice>35 || patch<0 || patch>5) {
+ HLTError("invalid readout partition %d/%d (specification 0x%08x, skipping input block", slice, patch, pBlock->fSpecification);
break;
}
--- /dev/null
+// $Id$
+/**
+ * @file extract-ddlraw.C
+ * @brief Tool to extract DDL raw data.
+ *
+ * Usage:
+ * <pre>
+ * aliroot -b -q 'extract-ddlraw.C("raw.root", 768, 769)' | tee extract-ddlraw.log
+ * </pre>
+ *
+ * This macro is an example for the AliHLTRawReaderPublisherComponent.
+ * It extracts the DDL payload from an AliRawReader in a given equipment
+ * range. Input can be either a root file or the path to the directory
+ * containing the 'rawx' sub folders.
+ *
+ * A light-weight AliReconstruction-like setup creates the appropriate
+ * RawReader for the specified input and uses the standard AliHLTReconstructor
+ * to run a small HLT chain. The chain utilizes the AliRawReaderPublisher
+ * to extract the payload of the equipments and writes this to files.
+ *
+ * @note In this example the AliHLTRawReaderPublisherComponent does not set any data
+ * type nor specification for the published data blocks. Please remember
+ * to provide appropriate arguments via '-datatype' and '-dataspec'
+ * arguments (see AliHLTRawReaderPublisherComponent).
+ *
+ * @author Matthias.Richter@ift.uib.no
+ * @ingroup alihlt_tutorial
+ */
+void extract_ddlraw(const char* input, int iMinDDLno, int iMaxDDLno)
+{
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // some defaults
+ const char* baseName="RAW.ddl";
+
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // setup of the RawReader
+ if (!input) {
+ cerr << "invalid path" << endl;
+ cerr << "usage: aliroot -b -q 'extract-ddlraw.C(\"raw.root\", 768, 769)'" << endl;
+ return;
+ }
+
+ AliRawReader* pRawReader=AliRawReader::Create(input);
+ if (!pRawReader) {
+ cout << "can not open RawReader for file " << input << endl;
+ return;
+ }
+ if (!pRawReader->NextEvent()) {
+ cerr << "no events available" << endl;
+ return;
+ }
+
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // setup of the HLT system
+ gSystem->Load("libHLTrec");
+ AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance();
+ if (!pHLT) {
+ cerr << "fatal error: can not get HLT instance" << endl;
+ }
+
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // the configuration chain
+ // we show two possible configurations:
+ // 1. having one publisher for each ddl, the configurations are created
+ // in a loop
+ // 2. all in one publisher
+ // can be easily switched with the following
+ bool bAllInOne=false;
+
+ TString writerInput;
+ TString arg;
+
+ if (!bAllInOne) {
+ // create one publisher for each ddl
+ for (int ddlno=iMinDDLno; ddlno<=iMaxDDLno; ddlno++) {
+ TString arg, publisher;
+
+ // raw data publisher components
+ arg.Form("-minid %d -skipempty", ddlno);
+ publisher.Form("DP_%d", ddlno);
+ // see AliHLTRawReaderPublisherComponent
+ AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
+
+ if (!writerInput.IsNull()) writerInput+=" ";
+ writerInput+=publisher;
+ }
+ } else {
+ // publish all ddls by the same component, this is much more
+ // effective as it avoids repeated parsing through the data
+ arg.Form("-minid %d -maxid %d -skipempty", iMinDDLno, iMaxDDLno);
+ // see AliHLTRawReaderPublisherComponent
+ AliHLTConfiguration pubconf("publisher", "AliRawReaderPublisher", NULL , arg.Data());
+ if (!writerInput.IsNull()) writerInput+=" ";
+ writerInput+="publisher";
+ }
+
+ // the writer configuration is the same for both
+ arg.Form("-specfmt=_%%d -subdir=raw%%d -blcknofmt= -idfmt= -datafile %s", baseName);
+ // see AliHLTFileWriter
+ AliHLTConfiguration fwconf("sink1", "FileWriter" , writerInput.Data(), arg.Data());
+
+
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // the reconstructor setup
+ AliHLTReconstructor hltRec;
+ hltRec.SetOption("libAliHLTUtil.so loglevel=0x7c chains=sink1");
+ if (hltRec.Init()<0) {
+ cerr << "initialization of reconstructor failed" << endl;
+ return;
+ }
+
+ // this is just a dummy ESD to provide valid parameters to the
+ // reconstructor
+ AliESDEvent* pESD = new AliESDEvent;
+ pESD->CreateStdContent();
+
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // the reconstruction loop
+ Int_t event=0;
+ UChar_t* pData=NULL;
+ pRawReader->RewindEvents();
+ while (pRawReader->NextEvent()) {
+ cout << "=======================================================" << endl;
+ cout << "event " << event << endl;
+ cout << "-------------------------------------------------------" << endl;
+ pRawReader->Reset();
+ hltRec.FillESD(pRawReader, NULL, pESD);
+ event++;
+ }
+
+ delete pESD;
+}
+
+void extract_ddlraw()
+{
+ cerr << "===============================================================" << endl;
+ cerr << "usage: aliroot -b -q 'extract-ddlraw.C(\"raw.root\", 768, 769)'" << endl << endl;
+ cerr << "please provide input, min and max equipment id" << endl;
+ cerr << "===============================================================" << endl;
+}
//log.SwitchAliLog(0);
AliHLTSystem gHLT;
- //gHLT.SetGlobalLoggingLevel(0x7c);
+ gHLT.SetGlobalLoggingLevel(0x7c);
// load the component library
gHLT.LoadComponentLibraries("libAliHLTUtil.so");
--- /dev/null
+// $Id$
+/**
+ * @file publish-rawreader-data.C
+ * @brief Publish data from the the RawReader provided by the AliReconstruction.
+ *
+ * Usage:
+ * <pre>
+ * aliroot -b -q 'publish-rawreader-data.C("raw.root", 768, 769)' | tee publish-rawreader-data.log
+ * </pre>
+ *
+ * This macro runs shows a use case of the AliHLTRawReaderPublisherComponent
+ * An HLT chain is run inside the AliReconstruction and the DDL payload is
+ * extracted from the AliRawReader in a given equipment range.
+ * Input can be either a root file or the path to the directory containing
+ * the 'rawx' sub folders.
+ *
+ * @author Matthias.Richter@ift.uib.no
+ */
+
+const char* defaultInput="./";
+const int defaultMinId=768;
+const int defaultMaxId=769;
+
+void publish_rawreader_data(const char* input, int iMinDDLno, int iMaxDDLno)
+{
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // some defaults
+ const char* baseName="RAW.ddl";
+
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // setup of the reconstruction
+ if (!input) {
+ cerr << "invalid path" << endl;
+ cerr << "usage: aliroot -b -q 'publish-rawreader-data.C(\"raw.root\", 768, 769)'" << endl;
+ return;
+ }
+
+ AliReconstruction rec;
+ rec.SetInput(input);
+ rec.SetOption("HLT", "libAliHLTUtil.so loglevel=0x7c chains=sink1");
+
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // setup of the HLT system
+ gSystem->Load("libHLTrec");
+ AliHLTSystem* pHLT=AliHLTReconstructorBase::GetInstance();
+ if (!pHLT) {
+ cerr << "fatal error: can not get HLT instance" << endl;
+ }
+
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // the configuration chain
+ TString writerInput;
+ TString arg;
+
+ arg.Form("-minid %d -maxid %d -skipempty", iMinDDLno, iMaxDDLno);
+ AliHLTConfiguration pubconf("publisher", "AliRawReaderPublisher", NULL , arg.Data());
+ if (!writerInput.IsNull()) writerInput+=" ";
+ writerInput+="publisher";
+
+ // the writer configuration
+ arg.Form("-specfmt=_%%d -subdir=raw%%d -blocknofmt= -idfmt= -datafile %s", baseName);
+ AliHLTConfiguration fwconf("sink1", "FileWriter" , writerInput.Data(), arg.Data());
+
+
+ /////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // the reconstruction loop
+ rec.SetRunLocalReconstruction("HLT");
+ rec.SetRunReconstruction("HLT");
+ rec.SetRunTracking("");
+ rec.SetFillESD("HLT");
+ rec.SetRunVertexFinder(kFALSE);
+ rec.SetLoadAlignFromCDB(0);
+ rec.Run();
+}
+
+void publish_rawreader_data()
+{
+ cout << "runnig from defaults: input " << defaultInput << " " << defaultMinId << "-" << defaultMaxId << endl;
+ publish_rawreader_data(defaultInput, defaultMinId, defaultMaxId);
+}
//log.SwitchAliLog(0);
AliHLTSystem gHLT;
- //gHLT.SetGlobalLoggingLevel(0x7c);
+ gHLT.SetGlobalLoggingLevel(0x7c);
// load the component library
gHLT.LoadComponentLibraries("libAliHLTUtil.so");