StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcIUCluster.h
1 #ifndef __StEEmcIUCluster_h__
2 #define __StEEmcIUCluster_h__
3 
4 #include <TObject.h>
5 #include <TVector3.h>
6 #include "StEEmcPool/StEEmcA2EMaker/StEEmcTower.h"
7 
8 class StEmcCluster;
9 
10 class StEEmcIUCluster : public TObject {
11 
12  public:
13 
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);
33  StEEmcTower tower(Int_t t) const;
34 
36  Float_t weight(Int_t t);
38  StEEmcTowerVec_t towers();
39 
41  void momentum( TVector3 p);
42 
47 
49  void stemc(StEmcCluster *c){ mEmcCluster = c; }
50 
52  Int_t key(){ return mKey; }
54  void key(Int_t k){ mKey=k; }
55 
58  Bool_t operator==( const StEEmcIUCluster &other ) const { return this->tower(0).index() == other.tower(0).index(); }
59 
61  void print();
62 
63  private:
64  protected:
65 
67  Int_t mKey;
68 
70  StEEmcTowerVec_t mTowers;
72  std::vector<Float_t> mWeights;
73 
75  Float_t mEnergy;
77  TVector3 mMomentum;
78 
81 
84 
85 };
86 
87 inline Float_t StEEmcIUCluster::energy(){ return mEnergy; }
88 inline Float_t StEEmcIUCluster::seedEnergy(){ return (mTowers.size())?mTowers[0].energy():0.; }
89 
90 inline void StEEmcIUCluster::momentum(TVector3 p){mMomentum=p;}
91 inline TVector3 StEEmcIUCluster::momentum(){ return mMomentum;}
92 inline StEEmcTower StEEmcIUCluster::tower(Int_t t){ return mTowers[t]; }
93 inline StEEmcTower StEEmcIUCluster::tower(Int_t t)const{ return mTowers[t]; }
94 inline Int_t StEEmcIUCluster::numberOfTowers(){ return (Int_t)mTowers.size(); }
95 inline StEEmcTowerVec_t StEEmcIUCluster::towers(){ return mTowers; }
96 inline Float_t StEEmcIUCluster::weight( Int_t t ) { return mWeights[t]; }
97 
98 typedef std::vector<StEEmcIUCluster> StEEmcIUClusterVec_t;
99 
100 #endif
void print()
Prints cluster data.
void key(Int_t k)
Sets the unique id of the cluster.
StEmcCluster * stemc()
ClassDef(StEEmcIUCluster, 1)
Makes class available to root.
TVector3 momentum()
Get the momentum of this cluster.
std::vector< Float_t > mWeights
Vector of tower weights.
void add(StEEmcTower, Float_t weight=1.0)
A base class for describing clusters of EEMC towers.
StEEmcTowerVec_t towers()
Get the vector of towers in this cluster.
StEmcCluster * mEmcCluster
Pointer to EMC cluster.
StEEmcTowerVec_t mTowers
Vector of towers.
void stemc(StEmcCluster *c)
Pointer to StEmcCluster for embedding.
void index(Int_t i)
Definition: StEEmcTower.cxx:76
Int_t key()
Returns unique id of the cluster.
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
Bool_t operator==(const StEEmcIUCluster &other) const
Int_t mKey
Unique cluster ID.
Float_t weight(Int_t t)
Get the weight associated with tower.
StEEmcTower tower(Int_t t)
Get the specified tower.
Int_t numberOfTowers()
Get the number of towers in cluster.
TVector3 mMomentum
Momentum.
Float_t energy()
Get energy of this cluster.
Float_t seedEnergy()
Get the energy of the seed tower.
Float_t mEnergy
Energy.