StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBarrelEmcCluster.h
1 // //
3 // StBarrelEmcCluster //
4 // //
5 // Pibero Djawotho //
6 // Indiana University //
7 // 30 May 2007 //
8 // //
9 // Cosmetic update by Michael Betancourt //
10 // //
12 
13 #ifndef STAR_StBarrelEmcCluster
14 #define STAR_StBarrelEmcCluster
15 
16 class StGammaTower;
17 
18 #include <iostream>
19 #include <vector>
20 #include "TVector3.h"
21 
22 using namespace std;
23 
24 class StBarrelEmcCluster: public TObject
25 {
26 
27  public:
28 
30  ~StBarrelEmcCluster() {};
31 
32  virtual const char* GetCVS() const
33  {static const char cvs[] = "Tag $Name: $ $Id: StBarrelEmcCluster.h,v 1.6 2014/08/06 11:43:17 jeromel Exp $ built " __DATE__ " " __TIME__; return cvs; }
34 
35  float energy() const;
36  const TVector3& position() const;
37  const TVector3& momentum() const;
38  StGammaTower *seed() const;
39  StGammaTower *tower(int deta, int dphi) const;
40 
41  void setEnergy(float energy);
42  void setPosition(const TVector3& position);
43  void setMomentum(const TVector3& momentum);
44  void setSeed(StGammaTower* tower);
45  void setTower(int deta, int dphi, StGammaTower* tower);
46 
47  private:
48 
49  float mEnergy;
50  TVector3 mPosition;
51  TVector3 mMomentum;
52  StGammaTower* mTowers[3][3];
53 
54  ClassDef(StBarrelEmcCluster, 1);
55 
56 };
57 
58 inline StBarrelEmcCluster::StBarrelEmcCluster() { memset(mTowers, 0, sizeof(mTowers)); }
59 inline float StBarrelEmcCluster::energy() const { return mEnergy; }
60 inline const TVector3& StBarrelEmcCluster::position() const { return mPosition; }
61 inline const TVector3& StBarrelEmcCluster::momentum() const { return mMomentum; }
62 inline StGammaTower* StBarrelEmcCluster::seed() const { return tower(0,0); }
63 inline StGammaTower* StBarrelEmcCluster::tower(int deta, int dphi) const { return mTowers[deta+1][dphi+1]; }
64 
65 inline void StBarrelEmcCluster::setEnergy(float energy) { mEnergy = energy; }
66 inline void StBarrelEmcCluster::setPosition(const TVector3& position) { mPosition = position; }
67 inline void StBarrelEmcCluster::setMomentum(const TVector3& momentum) { mMomentum = momentum; }
68 inline void StBarrelEmcCluster::setSeed(StGammaTower* tower) { setTower(0, 0, tower); }
69 inline void StBarrelEmcCluster::setTower(int deta, int dphi, StGammaTower* tower) { mTowers[deta+1][dphi+1] = tower; }
70 
71 ostream& operator<<(ostream& out, const StBarrelEmcCluster& cluster);
72 
73 #endif