]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTCaloClusterReader.h
Moving a some structs and classes used for handling "AliESDCaloCluster like" clusters...
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTCaloClusterReader.h
1
2 #ifndef ALIHLTCALOCLUSTERREADER_H
3 #define ALIHLTCALOCLUSTERREADER_H
4
5 /**************************************************************************
6  * This file is property of and copyright by the ALICE HLT Project        * 
7  * All rights reserved.                                                   *
8  *                                                                        *
9  * Primary Authors: Oystein Djuvsland                                     *
10  *                                                                        *
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  **************************************************************************/
19
20 #include "Rtypes.h"
21
22 class AliHLTCaloClusterDataStruct;
23 class AliHLTCaloClusterHeaderStruct;
24
25 /** 
26  * @class AliHLTCaloClusterReader
27  * Reads clusters from a memory block of AliHLTCaloClusters
28  *
29  * @ingroup alihlt_phos
30  */
31 class  AliHLTCaloClusterReader
32 {
33 public:
34   /** Default constructor */
35   AliHLTCaloClusterReader();
36
37   /** Destructor */
38   virtual ~AliHLTCaloClusterReader();
39
40   /** 
41    * Get the next cluster from the memory buffer
42    */
43   AliHLTCaloClusterDataStruct*   NextCluster();
44
45   
46   /**
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
53    */
54   bool GetCell(AliHLTCaloClusterDataStruct *clusterPtr, UShort_t &cellID, Double32_t &cellAmp, UInt_t index);
55
56
57   /** 
58    * Set the memory buffer containing the clusters
59    * @param clusterHeaderPtr pointer the the first entry in the buffer, the header
60    */
61   void SetMemory(const AliHLTCaloClusterHeaderStruct* clusterHeaderPtr);
62
63   /**
64    * Reset the memory pointer and number of counts
65    */
66   void Reset();
67
68  private:
69   
70   /**
71    * Copy constructor
72    */
73   AliHLTCaloClusterReader(const  AliHLTCaloClusterReader & );
74   
75   /**
76    * Assignment operator
77    */
78   AliHLTCaloClusterReader & operator = (const  AliHLTCaloClusterReader &);
79   
80   /* Pointer to the current cluster to be read */
81   AliHLTCaloClusterDataStruct* fCurrentClusterPtr; // !transient Pointer to the current cluster to be read
82
83   /* Check if the memory has been set */
84   bool fIsSetMemory; //Check if the memory has been set
85
86   /* Max number of clusters */
87   int fMaxCnt;  // Max number of clusters
88
89   /* The current number of clusters */
90   int fCurrentCnt; // The current number of clusters
91
92 };
93
94 #endif