// // File : EyePixelList.hh // // Purpose: Header file for EyePixelList.cc, // containing TEyePixelList class declaration // // $Id: EyePixelList.hh 12083 2011-02-21 17:11:42Z mathes $ // #ifndef _EyePixelList_hh_ #define _EyePixelList_hh_ #include #include #include /** @file EyePixelList.hh * Declaration of the class TEyePixelList. * @author H.-J. Mathes, FzK */ #include #include // ----- forward declaration class TBuffer; /** Class which hold a list of all pixels of the Eye which are present in the * current event. * Internally the TEyePixelList is implemented using a bit vector where each * set bit corresponds to an added pixel. * * The class TEyePixelList allows two different access schemes: * @li an iterator-like scheme using the methods NumPixels() and Pixel(). * @li an array-like access scheme using the operator []. */ class TEyePixelList : public TObject { friend class TEyeEvent; public: /** Constructor for the class TEyePixelList. * * The following things are initialized: * @li number of pixels stored is set to 0. * @li pixel number store is allocated. */ TEyePixelList(); /** Copy constructor of the class TEyePixelList. */ TEyePixelList(const TEyePixelList& rhs); /** Assignment operator for the class TEyePixelList. */ TEyePixelList& operator=(const TEyePixelList&); /** Compare operator for the class TEyePixelList. */ bool operator==(const TEyePixelList&) const; /** Destructor for the class TEyePixelList. */ virtual ~TEyePixelList(); /** Add the pixel specified by its FdPixelNumber. * * It is checked that only valid pixel numbers are added. */ void AddPixel(FdUtil::Fd::FdPixelNumber); /** Add the pixel specified by its PixelNumber. * * It is checked that only valid pixel numbers are added. */ void AddPixel(FdUtil::Fd::PixelNumber pixel) { AddPixel( FdUtil::Fd::GetFdPixelNumber( pixel ) ); } /** Add a Mirrors pixel list to the Eye pixel list. * * After the Mirrors pixel lists content have been added to the Eye pixel * list some internal bookkeeping is done to provide the operator[] with * the necessary information. */ void AddPixelList(TMirrorPixelList*); /** Clear the contents of the TEyePixelList object. */ void Clear(Option_t *option=""); /** Print the contents of the TEyePixelList to the specified stream. */ void Show(std::ostream& ostr=std::cout); /** Remove the pixel with the specified pixel number from the pixel list. */ void RemovePixel(FdUtil::Fd::FdPixelNumber); /** Remove the pixel with the specified pixel number from the pixel list. */ void RemovePixel(FdUtil::Fd::PixelNumber pixel) { RemovePixel( FdUtil::Fd::GetFdPixelNumber( pixel ) ); } /** Get the Eye number stored in the TEyePixelList object. */ UInt_t GetEyeNo() const { return fEyeNo + FdUtil::Fd::kFD_FIRST_EYE ; } /** Get the number of pixels stored in the TEyePixelList object. */ UInt_t GetNumPixels() const { return fNPixels; } /** Access pixel at the position 'sequence' of the list. */ FdUtil::Fd::FdPixelNumber GetPixel(UInt_t); /** Test if the specified pixel is contained in the TEyePixelList. * Return true, if this is the case. */ bool TestPixel(FdUtil::Fd::FdPixelNumber); #ifndef DPA /** operator[] for a TEyePixelList. * * The valid indices for the array subscript are (according to the numbering * conventions) in the range 1 ... 6*480.
* If a wrong array subscript is used, a NULL pointer is returned. * If the specified pixel is not present, a NULL pointer is returned. */ FdUtil::Fd::FdPixelNumber operator[](UInt_t); #endif // DPA protected: /** Construct the internally used pixel list from the bit vector. */ void ConstructPixelList(); /** Get the word and bit position of the specified pixel in the internal * bit vector. No checks are done ! */ void GetPosition(FdUtil::Fd::FdPixelNumber,UInt_t*,UInt_t*) const; /** Set the Eye number (1..4) which is internally needed to return the * correct pixel numbers. */ void SetEyeNo(UInt_t eye_no); private: Version_t fStreamerVersion; //! version read from file UInt_t fEyeNo; // Eye number (0..3) UInt_t fNPixels; // number of pixels in list UInt_t fPixelVectorSize; // size of the pixel bit vector UInt_t *fPixelVector; // [fPixelVectorSize] #ifndef __CINT__ std::vector fPixelList; //! list of pixel numbers #endif // __CINT__ FdUtil::Fd::FdPixelNumberRec fPixelNumber; //! pixel number to return ClassDef(TEyePixelList,EyeEVENTVERSIONv4) }; #endif // _EyePixelList_hh_