X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=HLT%2FCALO%2FAliHLTCaloClusterizer.h;h=f2d2bbbcd6ab4175c1276237959ff60a304afaaa;hp=0ca5d8feb47eca9b947e626005a3a52ce833c8b1;hb=31b89da44fc4f4bc0fd1668f5b255506dae775f0;hpb=c375e15d8d8e758faf81f2628bd8a2a3667d6b06 diff --git a/HLT/CALO/AliHLTCaloClusterizer.h b/HLT/CALO/AliHLTCaloClusterizer.h index 0ca5d8feb47..f2d2bbbcd6a 100644 --- a/HLT/CALO/AliHLTCaloClusterizer.h +++ b/HLT/CALO/AliHLTCaloClusterizer.h @@ -43,11 +43,13 @@ #include "AliHLTCaloDigitContainerDataStruct.h" #include "AliHLTCaloDigitDataStruct.h" #include "TString.h" -#include "AliHLTCaloConstants.h" +#include "AliHLTCaloConstantsHandler.h" //#include "AliPHOSGeometry.h" +#include "AliHLTLogging.h" class TClonesArray; +class TString; //class AliPHOSDigit; //class AliPHOSRecoParamEmc; //class AliPHOSRecoParam; @@ -60,11 +62,9 @@ class TClonesArray; * * @ingroup alihlt_calo */ -//class AliHLTCaloClusterizer : public AliHLTCaloBase - -class AliHLTCaloClusterizer +class AliHLTCaloClusterizer : public AliHLTCaloConstantsHandler, public AliHLTLogging { public: @@ -74,34 +74,15 @@ public: /** Destructor */ virtual ~AliHLTCaloClusterizer(); - -// /** Copy constructor */ -// AliHLTCaloClusterizer(const AliHLTCaloClusterizer &) : -// // AliHLTCaloBase(), -// AliHLTCaloConstants(NULL), -// fRecPointDataPtr(0), -// fDigitDataPtr(0), -// fEmcClusteringThreshold(0), -// fEmcMinEnergyThreshold(0), -// fEmcTimeGate(0), -// fDigitsInCluster(0), -// fDigitContainerPtr(0), -// fMaxDigitIndexDiff(2*NZROWSMOD) -// { -// //Copy constructor not implemented -// } - - /** Assignment */ - AliHLTCaloClusterizer & operator = (const AliHLTCaloClusterizer) - { - //Assignment - return *this; - } - + /** Set digit container */ void SetDigitContainer(AliHLTCaloDigitContainerDataStruct* digitContainerPtr) { fDigitContainerPtr = digitContainerPtr; } + /** Set array with digits */ + void SetDigitArray(AliHLTCaloDigitDataStruct **digitPointerArr) + { fDigitsPointerArray = digitPointerArr; } + /** Set rec point data buffer */ void SetRecPointDataPtr(AliHLTCaloRecPointDataStruct* recPointDataPtr); @@ -118,7 +99,7 @@ public: void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; } /** Starts clusterization of the event */ - virtual Int_t ClusterizeEvent(UInt_t availableSize, UInt_t& totSize); + virtual Int_t ClusterizeEvent(Int_t nDigits); /** * For a given digit this digit scans for neighbouring digits which @@ -127,7 +108,7 @@ public: * @param digIndex index of the digit in the digit container * @param recPoint pointer to the current rec point */ - virtual void ScanForNeighbourDigits(Int_t digIndex, AliHLTCaloRecPointDataStruct* recPoint); + virtual Int_t ScanForNeighbourDigits(Int_t digIndex, AliHLTCaloRecPointDataStruct* recPoint); /** * Checks if two digits are neighbours @@ -136,14 +117,84 @@ public: */ virtual Int_t AreNeighbours(AliHLTCaloDigitDataStruct* d1, AliHLTCaloDigitDataStruct* d2); - + /** + * Get pointer to the rec points array + */ + AliHLTCaloRecPointDataStruct** GetRecPoints() const { return fRecPointArray; } + + /** + * Sort the digits by energy + */ + void SetSortDigitsByEnergy(); + + /** + * Sort the digits by position + */ + void SetSortDigitsByPosition(); + + /** + * Set the sorting function (as required by stdlib's qsort) if you don't want to use the provided ones + */ + void SetSortingFunction(Int_t (*compare)(const void*, const void*)) { fCompareFunction = compare; } + + + protected: - /** Pointer to the rec point output */ - AliHLTCaloRecPointDataStruct* fRecPointDataPtr; //! transient + /** + * Check the rec point buffer size and resize the buffer if necessary + */ + virtual Int_t CheckBuffer(); //COMMENT + + /** + * Check the rec point array size and resize the array if necessary + */ + virtual Int_t CheckArray(); //COMMENT + + /** + * Sort the digits + */ + void SortDigits(); + + /** + * Compare digits by position + */ + static Int_t CompareDigitsByPosition(const void *dig0, const void *dig); + + /** + * Compare digits by energy + */ + static Int_t CompareDigitsByEnergy(const void *dig0, const void *dig); + + /** + * Pointer to the compare function for the sorting of digits + */ + //Int_t (AliHLTCaloClusterizer::*fCompareFunction)(const void*, const void*); + Int_t (*fCompareFunction)(const void*, const void*); + + /** Array of pointers to the rec point output */ + AliHLTCaloRecPointDataStruct **fRecPointArray; //COMMENT + + /** Pointer to the rec point output */ + AliHLTCaloRecPointDataStruct *fRecPointDataPtr; //COMMENT - /** Pointer to the digit output */ - AliHLTCaloDigitDataStruct* fDigitDataPtr; //! transient + /** The first rec point in the list */ + AliHLTCaloRecPointDataStruct *fFirstRecPointPtr; //COMMENT + + /** Size of the rec point array */ + Int_t fArraySize; + + /** Available size for the rec point output */ + Int_t fAvailableSize; + + /** The used size for the rec point output */ + Int_t fUsedSize; + + /** Number of rec points created so far */ + Int_t fNRecPoints; + + /** Pointer to the digit index array in the rec point */ + Int_t* fDigitIndexPtr; //! transient /** Energy threshold for starting a cluster for the calorimeter */ Float_t fEmcClusteringThreshold; //COMMENT @@ -157,29 +208,40 @@ protected: /** Counts the digits in a rec point */ Int_t fDigitsInCluster; //COMMENT + /** Array of our digits */ + AliHLTCaloDigitDataStruct **fDigitsPointerArray; //! transient + /** Contains the digits from one event */ AliHLTCaloDigitContainerDataStruct *fDigitContainerPtr; //! transient /** Maximum difference in index to be a neighbour */ Int_t fMaxDigitIndexDiff; //COMMENT - /** Instance of calorimeter constants */ - AliHLTCaloConstants* fCaloConstants; + /** Number of digits in event */ + Int_t fNDigits; //COMMENT + + /** Are we sorting digits by position? */ + Bool_t fSortedByPosition; //COMMENT -private: + /** Are we sorting digits by energy? */ + Bool_t fSortedByEnergy; //COMMENT - AliHLTCaloClusterizer(); + /** Are we sorting at all? */ + Bool_t fSortDigits; //COMMENT - AliHLTCaloClusterizer (const AliHLTCaloClusterizer &); -// AliHLTCaloClusterizer & operator = (const AliHLTCaloClusterizer &) -// { -// return *this; -// } +private: + /** Default constructor, prohibited */ + AliHLTCaloClusterizer(); // COMMENT + + /** Copy constructor, prohibited */ + AliHLTCaloClusterizer (const AliHLTCaloClusterizer &); //COMMENT + + /** Assignment operator, prohibited */ + AliHLTCaloClusterizer & operator = (const AliHLTCaloClusterizer &); //COMMENT ClassDef(AliHLTCaloClusterizer, 0); - }; #endif