]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
several corrections, still needs testing
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Oct 2007 21:45:54 +0000 (21:45 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Oct 2007 21:45:54 +0000 (21:45 +0000)
HLT/BASE/util/AliHLTRawReaderPublisherComponent.cxx
HLT/BASE/util/AliHLTRawReaderPublisherComponent.h

index ed034df6916b4053a9c86f7c2be7cf5b030c5d73..02d2d526bd82194006494e551c8759f81fb8742f 100644 (file)
@@ -164,11 +164,6 @@ int AliHLTRawReaderPublisherComponent::DoInit( int argc, const char** argv )
 
   if (iResult<0) return iResult;
 
-  if (fDetector.IsNull()) {
-    AliErrorStream() << "detector required, use \'-detector\' option" << endl;
-    return -EINVAL;
-  }
-
   if (fMinEquId>fMaxEquId) fMaxEquId=fMinEquId;
 
   if (fMinEquId<0) {
@@ -176,6 +171,11 @@ int AliHLTRawReaderPublisherComponent::DoInit( int argc, const char** argv )
     return -EINVAL;
   }
 
+  if (!fDetector.IsNull()) {
+    AliErrorStream() << "option \'-detector\' not implemented" << endl;
+    return -ENOSYS;
+  }
+
   AliHLTUInt32_t dummy;
   if (fMinEquId!=fMaxEquId && GetSpecificationFromEquipmentId(0, dummy)==-ENOSYS) {
     AliWarningStream() << "publication of multiple equipment ids needs implementation of a child and function GetSpecificationFromEquipmentId to set correct specifications" << endl;
@@ -184,10 +184,7 @@ int AliHLTRawReaderPublisherComponent::DoInit( int argc, const char** argv )
 
   AliRawReader* pRawReader=GetRawReader();
   if ((pRawReader=GetRawReader())!=NULL) {
-    pRawReader->Select(fDetector.Data(), fMinEquId, fMaxEquId);
-    if (!pRawReader->RewindEvents()) {
-      AliWarning(Form("can not rewind RawReader %p", pRawReader));
-    }
+    pRawReader->SelectEquipment(-1, fMinEquId, fMaxEquId);
   } else {
     AliErrorStream() << "RawReader instance needed" << endl;
     return -EINVAL;
@@ -213,14 +210,14 @@ int AliHLTRawReaderPublisherComponent::GetEvent(const AliHLTComponentEventData&
   int iResult=0;
   int offset=0;
   AliHLTUInt8_t* pTgt=outputPtr;
-  assert(outputPtr!=NULL);
+  assert(outputPtr!=NULL || size==0);
   AliRawReader* pRawReader=GetRawReader();
   if (pRawReader) {
     AliInfo(Form("get event from RawReader %p", pRawReader));
     while (pRawReader->ReadHeader() && (iResult>=0 || iResult==-ENOSPC)) {
       int readSize=pRawReader->GetDataSize();
       int id=pRawReader->GetEquipmentId();
-      AliInfo(Form("got header for id %d, size %d", readSize, id));
+      AliInfo(Form("got header for id %d, size %d", id, readSize));
       if (fMinEquId<id || fMaxEquId>id) {
        AliError(Form("id %d returned from RawReader is outside range [%d,%d]", id, fMinEquId, fMaxEquId));
        continue;
@@ -233,6 +230,7 @@ int AliHLTRawReaderPublisherComponent::GetEvent(const AliHLTComponentEventData&
            break;
          }
        } else {
+         // we keep the loop going in order to collect the full size
          fMaxSize=offset+readSize;
          iResult=-ENOSPC;
        }
@@ -250,9 +248,9 @@ int AliHLTRawReaderPublisherComponent::GetEvent(const AliHLTComponentEventData&
       offset+=readSize;
     }
     // go to next event, or beginning if last event was processed
-    if (pRawReader->NextEvent()) {
-      pRawReader->RewindEvents();
-    }
+//     if (pRawReader->NextEvent()) {
+//       pRawReader->RewindEvents();
+//     }
     if (offset<=size) size=offset;
   } else {
     AliErrorStream() << "RawReader uninitialized" << endl;
index f7d2e58445a7b05bb698dc55103a01a62a524544..532db654a3148b33ac3e9e85bdc39210fa6c1dc2 100644 (file)
@@ -25,6 +25,7 @@
  * @class AliHLTRawReaderPublisherComponent
  * A general data publisher component for the AliRawReader.
  * The component publishs the data of a given detector and equipment ID.
+ * 
  * Publication of several IDs, i.e. DDLs, requires derivation of
  * the data type and/or specification from the ID. This requires a child
  * class and implementation of @ref GetSpecificationFromEquipmentId.
  * \li -detector     <i> detector name      </i>
  *      e.g. <tt> -detector TPC </tt>
  * \li -equipmentid  <i> id      </i>
- *      the equipmentid
+ *      the equipmentid within the detector, e.g. TPC 0 is 768
  * \li -minid  <i> id      </i>
- *      the minimum equipmentid
+ *      the minimum equipmentid including detector offset, e.g. 768 is TPC 0
  * \li -maxid  <i> id      </i>
- *      the maximum equipmentid
+ *      the maximum equipmentid including detector offset
  * \li -verbose<br>
  *      print out some more info messages, mainly for the sake of tutorials
  * \li -datatype     <i> datatype   dataorigin </i> <br>