StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcCluster.h
1 #ifndef __StEEmcCluster_h__
2 #define __StEEmcCluster_h__
3 
4 #include <TObject.h>
5 #include <TVector3.h>
6 #include "StEEmcTower.h"
7 
8 class StEmcCluster;
9 
10 class StEEmcCluster : public TObject {
11 
12  public:
13 
14  StEEmcCluster();
16 
20  void add( StEEmcTower, Float_t weight=1.0 );
21 
23  Float_t energy();
25  Float_t seedEnergy();
27  TVector3 momentum();
29  Int_t numberOfTowers();
31  StEEmcTower tower(Int_t t);
32  StEEmcTower tower(Int_t t) const;
33 
35  Float_t weight(Int_t t);
37  StEEmcTowerVec_t towers();
38 
40  void momentum( TVector3 p);
41 
46 
47  void stemc(StEmcCluster *c){ mEmcCluster = c; }
48 
49  Int_t key(){ return mKey; }
50  void key(Int_t k){ mKey=k; }
51 
52  Bool_t operator==( const StEEmcCluster &other ) const { return this->tower(0).index() == other.tower(0).index(); }
53 
54  void print();
55 
56  private:
57  protected:
58 
59  Int_t mKey;
60 
62  StEEmcTowerVec_t mTowers;
63  std::vector<Float_t> mWeights;
64 
66  Float_t mEnergy;
68  TVector3 mMomentum;
69 
71 
72  ClassDef(StEEmcCluster,1);
73 
74 };
75 
76 inline Float_t StEEmcCluster::energy(){ return mEnergy; }
77 inline Float_t StEEmcCluster::seedEnergy(){ return (mTowers.size())?mTowers[0].energy():0.; }
78 
79 inline void StEEmcCluster::momentum(TVector3 p){mMomentum=p;}
80 inline TVector3 StEEmcCluster::momentum(){ return mMomentum;}
81 inline StEEmcTower StEEmcCluster::tower(Int_t t){ return mTowers[t]; }
82 inline StEEmcTower StEEmcCluster::tower(Int_t t)const{ return mTowers[t]; }
83 inline Int_t StEEmcCluster::numberOfTowers(){ return (Int_t)mTowers.size(); }
84 inline StEEmcTowerVec_t StEEmcCluster::towers(){ return mTowers; }
85 inline Float_t StEEmcCluster::weight( Int_t t ) { return mWeights[t]; }
86 
87 typedef std::vector<StEEmcCluster> StEEmcClusterVec_t;
88 
89 #endif
TVector3 momentum() const
Definition: StEEmcCluster.h:69
StEEmcTower & tower(Int_t t)
Get the specified tower within the cluster.
Definition: StEEmcCluster.h:79
Float_t seedEnergy() const
Get the energy of the seed tower.
Definition: StEEmcCluster.h:65
TVector3 mMomentum
Momentum.
void add(const StEEmcTower &t, Float_t weight=1.0)
StEEmcTowerVec_t mTowers
Vector of towers.
Float_t weight(Int_t t) const
Get the weight associated with tower.
Definition: StEEmcCluster.h:87
Bool_t operator==(const StEEmcCluster &other) const
StEEmcTowerVec_t & towers()
Get the vector of towers in this cluster.
Definition: StEEmcCluster.h:89
void print() const
Prints cluster data.
virtual ~StEEmcCluster()
void index(Int_t i)
Definition: StEEmcTower.cxx:76
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
StEmcCluster * stemc()
Float_t mEnergy
Energy.
Definition: StEEmcCluster.h:66
Int_t numberOfTowers() const
Get the number of towers in cluster.
Definition: StEEmcCluster.h:76
Float_t energy() const
Get energy of this cluster.
Definition: StEEmcCluster.h:62
A base class for describing clusters of EEMC towers.
Definition: StEEmcCluster.h:50
StEmcCluster * mEmcCluster
Pointer to EMC cluster.
std::vector< Float_t > mWeights
Vector of tower weights.