StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcBaseCluster.h
1 #ifndef __StEEmcBaseCluster_h__
2 #define __StEEmcBaseCluster_h__
3 
22 #include "TObject.h"
23 #include <vector>
24 
25 class StEEmcBaseCluster : public TObject {
26 public:
28  virtual ~StEEmcBaseCluster(){ /* nada */ }
29 
30  Int_t key() const {return mKey;} // returns the unique id for this cluster
31  void key(Int_t k) {mKey = k;} // sets the unique id for this cluster
32 
33  Bool_t split() const { return mSplit; }
34  void split(Bool_t s){ mSplit=s; }
35 
36  void addMatch( Int_t key, Int_t layer ) { mMatched[layer].push_back(key); } // associates another cluster with specified key in the specified layer
37  Int_t numberOfMatchingClusters( Int_t layer ) const { return (Int_t)mMatched[layer].size(); } // returns the number of matching clusters in the specified layer
38  Int_t getMatch( Int_t ith, Int_t layer ) const { return mMatched[layer][ith]; } // returns the key of the ith matching cluster in the specified layer
39 
40  Float_t energy() const { return mEnergy; } // returns the energy (or energy deposit) of the cluster
41  void energy( Float_t e){ mEnergy=e; } // Set the energy of the cluster
42  Int_t numberOfElements() const { return mNumberOfElements; } // returns the number of detector elements
43 
44 protected:
45  Int_t mKey; // a unique id assigned to each cluster, (initialized to -1 to indicate an invalid cluster
46  Bool_t mSplit; // set true if the cluster is split from another cluster, false otherwise
47  std::vector< std::vector< Int_t > > mMatched; // keys for matching clusters in each layer
48  Float_t mEnergy; // energy of the cluster
49  Int_t mNumberOfElements; // number of detector elements
50 
51  ClassDef(StEEmcBaseCluster,1);
52 };
53 
54 #endif
55 
56