Go to Notes and Further References, Exercises, top,

RawData Package

Package Components

Access to the digitizations

Notes and Further References

There is a link to the development RawData class directory here.

In the Writing ROOT macros you saw a macro that just dumped event headers, but there is rather more to the raw data record than that. If you look at RawRecord.h you will see, amongst other things:-

class RawRecord : public RecMinos {

   const RawHeader    *GetRawHeader() const;
   TIter               GetRawBlockIter();
if the class statement is still strange to you, take a look at class syntax in the C++ crib.

Along with the method GetRawHeader() that you have already used to access the RawHeader there is another, GetRawBlockIter() which gives access to the raw data itself. The raw data consists of an arbitrary number RawDataBlocks so what GetRawBlockIter() does is give you an object (a TIter) that in turn will sequentially give access to each RawDataBlock in turn. All you really need to know is that if you send a TIter its Next() message it returns a pointer to each RawDataBlock in turn, finally returning 0 when there are no more.

The following code gets a TIter and then loops over each RawDataBlock and gets each to print itself:-

     TIter itr = raw->GetRawBlockIter();
     RawDataBlock* rawBlk = dynamic_cast<RawDataBlock*>(itr.Next());
     while ( rawBlk ) {
       rawBlk = dynamic_cast<RawDataBlock*>(itr.Next());
     while ( rawBlk ) {
is a very common construction when using pointers. The C++ value for false is zero; all other values are true. So the while loop will continue until the pointer is zero.

TIter is another class that has the operator() defined. Its equivalent to Next() so you often see e.g.:-

     RawDataBlock* rawBlk = dynamic_cast<RawDataBlock*>(itr());
and even the old style:-
     RawDataBlock* rawBlk = (RawDataBlock*)itr();
If you want to know more about iterators, there is a brief description of the iterator pattern. There is also general discussion of ROOT Containers.


Make sure that you have carried out the preparation steps.

In the Writing ROOT macros you ran a macro that just dumped event headers. Now we will take a look at the data.

Contact: Nick West <n.west1@physics.ox.ac.uk>
Security, Privacy, Legal Fermi National Accelerator Laboratory