2 #ifndef ALIHLTCALOCLUSTERREADER_H
3 #define ALIHLTCALOCLUSTERREADER_H
5 /**************************************************************************
6 * This file is property of and copyright by the ALICE HLT Project *
7 * All rights reserved. *
9 * Primary Authors: Oystein Djuvsland *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
22 class AliHLTCaloClusterDataStruct;
23 class AliHLTCaloClusterHeaderStruct;
26 * @class AliHLTCaloClusterReader
27 * Reads clusters from a memory block of AliHLTCaloClusters
29 * @ingroup alihlt_phos
31 class AliHLTCaloClusterReader
34 /** Default constructor */
35 AliHLTCaloClusterReader();
38 virtual ~AliHLTCaloClusterReader();
41 * Get the next cluster from the memory buffer
43 AliHLTCaloClusterDataStruct* NextCluster();
47 * Get cell properties from a cluster
48 * @param clusterPtr is a pointer to the cluster
49 * @param cellID is a reference to the variable containing the absolute ID
50 * @param cellAmp is a reference to the variable containing the cell amplitude fraction
51 * @param index is the index of the cell
52 * @return true if the cell exists
54 bool GetCell(AliHLTCaloClusterDataStruct *clusterPtr, UShort_t &cellID, Double32_t &cellAmp, UInt_t index);
58 * Set the memory buffer containing the clusters
59 * @param clusterHeaderPtr pointer the the first entry in the buffer, the header
61 void SetMemory(const AliHLTCaloClusterHeaderStruct* clusterHeaderPtr);
64 * Reset the memory pointer and number of counts
73 AliHLTCaloClusterReader(const AliHLTCaloClusterReader & );
78 AliHLTCaloClusterReader & operator = (const AliHLTCaloClusterReader &);
80 /* Pointer to the current cluster to be read */
81 AliHLTCaloClusterDataStruct* fCurrentClusterPtr; // !transient Pointer to the current cluster to be read
83 /* Check if the memory has been set */
84 bool fIsSetMemory; //Check if the memory has been set
86 /* Max number of clusters */
87 int fMaxCnt; // Max number of clusters
89 /* The current number of clusters */
90 int fCurrentCnt; // The current number of clusters