+AliMUONDDLTracker* AliMUONRawStreamTrackerHP::GetDDLTracker() const
+{
+ /// Construct and return a pointer to the DDL payload object.
+ /// \return Pointer to internally constructed AliMUONDDLTracker object.
+ /// The object is owned by this class and should not be deleted
+ /// by the caller.
+ ///
+ /// \note This method should not be used just to gain access to the DDL
+ /// payload, unless there is a good reason to have the AliMUONDDLTracker
+ /// object. For example, if you want to modify the data and then save it
+ /// to another DDL stream. Otherwise it can be an order of magnitude
+ /// faster to access the DDL headers and data with the GetBlockHeader,
+ /// GetDspHeader and GetBusPatch methods for example.
+ /// Refer to the MUONRawStreamTracker.C macro to see how to use the fast
+ /// decoder interface optimally.
+
+ if (fDDLObject != NULL) return fDDLObject;
+
+ fDDLObject = new AliMUONDDLTracker;
+ for (Int_t iBlock = 0; iBlock < (Int_t)GetBlockCount(); iBlock++)
+ {
+ AliMUONBlockHeader blockHeader;
+ AliMUONDspHeader dspHeader;
+ AliMUONBusStruct busPatch;
+
+ const AliBlockHeader* bh = GetBlockHeader(iBlock);
+ // Copy block header and add it to the DDL object.
+ memcpy(blockHeader.GetHeader(), bh->GetHeader(), sizeof(AliMUONBlockHeaderStruct));
+ fDDLObject->AddBlkHeader(blockHeader);
+
+ for (Int_t iDsp = 0; iDsp < (Int_t)bh->GetDspCount(); iDsp++)
+ {
+ const AliDspHeader* dh = bh->GetDspHeader(iDsp);
+ // Copy DSP header and add it to the DDL object.
+ memcpy(dspHeader.GetHeader(), dh->GetHeader(), sizeof(AliMUONDSPHeaderStruct));
+ fDDLObject->AddDspHeader(dspHeader, iBlock);
+
+ const AliBusPatch* bp = dh->GetFirstBusPatch();
+ while (bp != NULL)
+ {
+ // Copy bus patch header, data and add everything into DDL object.
+ memcpy(busPatch.GetHeader(), bp->GetHeader(), sizeof(AliMUONBusPatchHeaderStruct));
+ busPatch.SetAlloc(bp->GetLength());
+ memcpy(busPatch.GetData(), bp->GetData(), bp->GetDataCount()*sizeof(UInt_t));
+ busPatch.SetBlockId(iBlock);
+ busPatch.SetDspId(iDsp);
+ fDDLObject->AddBusPatch(busPatch, iBlock, iDsp);
+ bp = bp->Next();
+ }
+ }
+ }
+
+ return fDDLObject;
+}
+
+