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 
42 #include <TObject.h>
43 #include <TVector3.h>
44 #include <TMath.h>
45 #include "StEEmcPool/StEEmcA2EMaker/StEEmcTower.h"
46 #include "StEEmcBaseCluster.h"
47 
48 class StEmcCluster;
49 
51 public:
52  StEEmcCluster();
53  StEEmcCluster ( const StEEmcCluster &other );
54  virtual ~StEEmcCluster();
55 
59  void add(const StEEmcTower &t, Float_t weight=1.0 );
60 
62  Float_t energy() const {return mEnergy;}
63 
65  Float_t seedEnergy() const {return (mTowers.size())?mTowers[0].energy():0.;}
66 
69  TVector3 momentum() const {return mMomentum;}
70 
73  TVector3 position() const {return mPosition;}
74 
76  Int_t numberOfTowers() const { return (Int_t)mTowers.size(); }
77 
79  StEEmcTower &tower(Int_t t) { return mTowers[t]; }
80  const StEEmcTower &tower(Int_t t) const { return mTowers[t]; }
81 
84  Float_t sigmaE() const;
85 
87  Float_t weight(Int_t t) const { return mWeights[t]; }
89  StEEmcTowerVec_t &towers() { return mTowers; }
90  const StEEmcTowerVec_t &towers() const { return mTowers; }
91 
96  void momentum(const TVector3 &p) {mMomentum=p;}
97 
101  StEmcCluster *stemc();
102 
104  void stemc(StEmcCluster *c){ mEmcCluster = c; }
105 
108  Bool_t operator==( const StEEmcCluster &other ) const { return this->tower(0).index() == other.tower(0).index(); }
109 
111  void print() const;
112 
113  void printLine(Bool_t Endl=false) const;
114 
116  Bool_t isNeighbor(const StEEmcTower &tower) const;
117 
119  Float_t fracEtabin() const;
121  Float_t fracPhibin() const;
122 
124  Float_t sigmaEtabin() const { return TMath::Sqrt(mSumEta2W/mEnergy-mSumEtaW*mSumEtaW/mEnergy/mEnergy); }
125  Float_t sigmaPhibin() const { return TMath::Sqrt(mSumPhi2W/mEnergy-mSumPhiW*mSumPhiW/mEnergy/mEnergy); }
126 
128  Bool_t hasTower(const StEEmcTower &tower) const;
129 
130  Bool_t operator<( const StEEmcCluster &other ) const { return this->energy() < other.energy(); }
131  Bool_t operator>( const StEEmcCluster &other ) const { return this->energy() > other.energy(); }
132 
133  Int_t numberOfEtabins() const;
134  Int_t numberOfPhibins() const;
135 
136 protected:
138  StEEmcTowerVec_t mTowers;
140  std::vector<Float_t> mWeights;
141 
143  TVector3 mMomentum;
144  TVector3 mPosition;
145 
148 
149  Float_t mfEtabin;
150  Float_t mfPhibin;
152  Float_t mSumEta2W;
153  Float_t mSumEtaW;
154  Float_t mSumPhi2W;
155  Float_t mSumPhiW;
156 
157  ClassDef(StEEmcCluster,1);
158 };
159 
160 typedef std::vector<StEEmcCluster> StEEmcClusterVec_t;
161 
162 #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 sigmaEtabin() const
Returns the sigma (sqrt variance) in units of etabins.
Float_t seedEnergy() const
Get the energy of the seed tower.
Definition: StEEmcCluster.h:65
Float_t fracEtabin() const
Returns the fractional mean etabin.
TVector3 mMomentum
Momentum.
void add(const StEEmcTower &t, Float_t weight=1.0)
Bool_t hasTower(const StEEmcTower &tower) const
Returns true if the specified tower is in the cluster.
StEEmcTowerVec_t mTowers
Vector of towers.
TVector3 position() const
Definition: StEEmcCluster.h:73
Float_t weight(Int_t t) const
Get the weight associated with tower.
Definition: StEEmcCluster.h:87
void momentum(const TVector3 &p)
Definition: StEEmcCluster.h:96
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()
Float_t mfEtabin
void index(Int_t i)
Definition: StEEmcTower.cxx:76
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
StEmcCluster * stemc()
Bool_t isNeighbor(const StEEmcTower &tower) const
Returns true if tower is adjacent to any tower in the cluster.
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 mfPhibin
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.
Float_t sigmaE() const
std::vector< Float_t > mWeights
Vector of tower weights.
Float_t fracPhibin() const
Returns the fractional mean phibin.
void stemc(StEmcCluster *c)
Pointer to StEmcCluster for embedding.