// // File : AnalysedPixelData.hh // // Purpose: Declaration of class TAnalysedPixelData // // $Id: AnalysedPixelData.hh 9725 2010-09-28 07:31:17Z mathes $ // /** @file AnalysedPixelData.hh * Declaration of the class TAnalysedPixelData. * @author H.-J. Mathes, FzK */ #ifndef _AnalysedPixelData_hh_ #define _AnalysedPixelData_hh_ #include #include #include #include #include #include #include "AkSltPattern.hh" // module of AK #ifndef MIN # define MIN(a,b) (a > b) ? b : a #endif #ifndef MAX # define MAX(a,b) (a < b) ? b : a #endif // --- forward declaration(s) class PixelPattern; /** This class contains information extracted from the TMirrorPixelData object. * * @todo: * @li add processing for illegal patterns * @li use some time critera to validate patterns * @li Attention ! The methods AssignPixels() and AssignPixelTimes() * are wrong (and not used) */ class TAnalysedPixelData : public TMirrorPixelData { public: /** Constructor of the class TAnalysedPixelData. All data members * are initialized. */ TAnalysedPixelData(TMirrorPixelData*); /** Destructor for the class TAnalysedPixelData. Clean up everything. */ ~TAnalysedPixelData(); /** Analyse the passed SLT data. */ void Analyse(); /** Assign the SLt times to the pixel of a pattern. This requires a more * detailed look into the SLT data. */ void AssignPixelTimes(PixelPattern*); /** Assign pixels to a given pattern (up to five). */ void AssignPixels(PixelPattern*,unsigned int); /** Return the number of patterns found. */ unsigned int GetNPattern() { return fFoundPattern.size(); } /** Return the number of valid patterns found. */ unsigned int GetNValidPattern() { return fValidPattern.size(); } /** Return the n-th valid pattern. * * Returns NULL, if an invalid pattern number is specified or if * no valid patterns are present. */ PixelPattern* GetValidPattern(unsigned int); /** Return true, if at least one invalid pattern (0x7f type) was found. */ bool HasMultiPattern() { return (fNMultiPattern > 0); } /** Return true, if at least one illegal (i.e. too short) pattern was found. */ bool HasIllegalPattern() { return (fInvalidPattern.size() > 0); } /** Invalidate a valid pattern after some analysis steps. The pattern * is then deleted from the internal list. */ void InvalidatePattern(unsigned int); /** Print the actual parameter settings for this class to cout. */ void PrintSettings(); /** Set the first SLT time bin from where to start the analysis. * The valid range is 0 .. MI_NBINS - 1. */ void SetFirstSltBin(int first) { fFirstSltBin = MIN((FdUtil::Fd::kMI_NSLT_BINS-1),(MAX(first,0))); } /** Set the last SLT time bin where to stop the analysis. */ void SetLastSltBin(int last) { fLastSltBin = MIN((FdUtil::Fd::kMI_NSLT_BINS-1),(MAX(last,0))); } /** Set the maximum number of pattern to be searched for. The search is * stopped if this limit is exceeded. The default for this value * is set to 10. */ void SetMaxNumSearchedPattern(unsigned int maxp) { fNMaxPattern = maxp; } /** Set the (verbose) print level for all objects of this class. */ static void SetPrintLevel(unsigned int level = 1) { fgPrintLevel = level; } protected: /** Add an invalid pattern to the list of invalid pattern. */ void AddInvalidPattern(PixelPattern* patt) { fInvalidPattern.push_back(patt); } /** Add a found pattern to the internal list of found pattern. */ void AddPattern(PixelPattern* patt) { fFoundPattern.push_back(patt); } /** Add a valid pattern to the list of valid pattern. */ void AddValidPattern(PixelPattern* patt) { fValidPattern.push_back(patt); } /** Try to assign pixels to found multi pattern (pattern id = 0x7f) and * add this pattern then to the list of multiple pattern. * * This method wraps the call to SltPattern::findPixelList() of * A. Kopmann. */ void AssignMultiPatternAK(PixelPattern*); #if 0 /** Get the pixels assigned to a given pattern which starts in a certain * column and a certain time. * * This method wraps the call to SltPattern::getPixelList() of * A. Kopmann. */ void AssignPixelsAK(PixelPattern*); #endif /** Find all occurring patterns in the data. This methods creates the * for each found pattern a PixelPattern object and adds it to the list * of found pattern. For each found pattern, the pattern id and the * column and SLT time bin are marked. */ void FindPattern(); private: // these ones don't exist TAnalysedPixelData(); TAnalysedPixelData(TAnalysedPixelData&); TAnalysedPixelData& operator=(TAnalysedPixelData&); static const unsigned int kNOdd = 12; static const unsigned int kNEven = 12; static int fgOddRowNextRow[kNOdd]; static int fgOddRowNextColumn[kNOdd]; static int fgEvenRowNextRow[kNEven]; static int fgEvenRowNextColumn[kNEven]; static unsigned int fgPrintLevel; TMirrorBitArray *fBitArray; int fFirstSltBin; // first SLT time bin to analyse int fLastSltBin; // last SLT time bin to analyse std::list fFoundPattern; // list of found patterns std::vector fValidPattern; // list (vector) of valid patterns std::list fInvalidPattern; // list (vector) of invalid patterns unsigned int fNMaxPattern; // max. number of pattern to search unsigned int fNMultiPattern; // flag for 0x7f pattern type uint32_t *fRawPixelData; // ptr. to pixel raw data Ak::SltPattern fSltPattern; // SLT data processor (AK) }; #endif // _AnalysedPixelData_hh_