CSCChamberDataItr

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#ifndef EventFilter_CSCRawToDigi_CSCChamberDataItr_h
#define EventFilter_CSCRawToDigi_CSCChamberDataItr_h

/** a class to help users iterate over CSC chambers,
    without having to know about DCCs and DDUs
    \Author Rick Wilkinson, Caltech
*/

#include "EventFilter/CSCRawToDigi/interface/CSCDDUDataItr.h"
class CSCDCCEventData;
class CSCDDUEventData;
class CSCEventData;
#include <vector>

class CSCChamberDataItr {
public:
  /// construct from data buffer.  Will figure out whether it's
  /// DCC or DDU
  CSCChamberDataItr(const char *buf);
  ~CSCChamberDataItr();

  bool next();

  const CSCEventData &operator*();

private:
  /// for DCC data.
  void constructFromDCC(const CSCDCCEventData &);
  /// for DDU-only data
  void constructFromDDU(const CSCDDUEventData &);

  /// sets theDDU & theNumberOfCSCs
  void initDDU();

  /// a little confusing here.  This class will either
  /// own theDCCData, in which case the DDUs points inside it,
  //  or if there's no DCC, it will
  /// make a new vector of DDUs (length 1).
  const CSCDCCEventData *theDCCData;
  CSCDDUDataItr *theDDUItr;
  unsigned theCurrentDDU;
  unsigned theNumberOfDDUs;
};

#endif