StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcPoint.h
1 #ifndef __StEEmcPoint_h__
2 #define __StEEmcPoint_h__
3 
4 #include "TObject.h"
5 #include "TVector3.h"
6 
7 #include "StEEmcTower.h"
8 #include "StEEmcSmdCluster.h"
9 
10 class StEmcPoint;
11 
12 class StEEmcPoint : public TObject {
13 
14  public:
15 
16  StEEmcPoint();
17  ~StEEmcPoint(){ /* nada */ };
18 
20  StEEmcPoint( const StEEmcPoint &p );
21 
23  void position( TVector3 p ) { mPosition=p; }
25  void energy( Float_t e ) { mEnergy=e; }
27  void fraction ( Float_t f ) { mFraction=f; }
29  void tower( StEEmcTower t, Float_t w=1. ) { mTowers.push_back(t); mWeights.push_back(w); }
31  void cluster( StEEmcSmdCluster c, Int_t plane ){mSmdClusters[plane]=c;}
32 
34  void numberOfRelatives( Int_t r ){ mRelatives=r; }
35 
37  TVector3 position(){ return mPosition; }
39  Float_t energy(){ return mEnergy; }
41  Float_t fraction(){ return mFraction; }
43  Float_t energy() const { return mEnergy; }
45  Int_t numberOfTowers(){ return (Int_t)mTowers.size(); }
47  StEEmcTower tower(Int_t t){ return mTowers[t]; }
49  Float_t weight(Int_t t){ return mWeights[t]; }
52  StEEmcSmdCluster cluster(Int_t c){ return mSmdClusters[c]; }
53 
56  Int_t numberOfRelatives(){ return mRelatives; }
57 
60  StEmcPoint *stemc();
61 
63  Int_t sector();
64 
65  void print();
66 
67  Bool_t operator<( const StEEmcPoint &other ) const;
68  Bool_t chiSquare( const StEEmcPoint &other ) const;
69 
70  private:
71  protected:
72 
74  TVector3 mPosition;
75  Float_t mEnergy;
76  Float_t mFraction;
77 
80 
83  StEEmcTowerVec_t mTowers;
84  std::vector<Float_t> mWeights;
85 
86  Int_t mRelatives;
87 
89 
91 
92 };
93 
94 typedef std::vector<StEEmcPoint> StEEmcPointVec_t;
95 
96 inline Bool_t StEEmcPoint::operator<( const StEEmcPoint &other ) const { return this->energy() < other.energy(); }
97 inline Bool_t chiSquare( const StEEmcPoint &me, const StEEmcPoint &other ) { return me.chiSquare( other ); }
98 
99 inline Int_t StEEmcPoint::sector(){ if ( mSmdClusters[0].sector()==mSmdClusters[1].sector() ) return mSmdClusters[0].sector(); else return -1; }
100 
101 #endif
Base class for representing EEMC points.
Definition: StEEmcPoint.h:24
Float_t fraction()
Get the fraction of tower energy associated with this point.
Definition: StEEmcPoint.h:41
void energy(Float_t e, Int_t layer=0)
Set the energy of this point.
Definition: StEEmcPoint.h:34
Bool_t chiSquare(const StEEmcPoint &other) const
Chi2 sort method.
Definition: StEEmcPoint.cxx:90
StEEmcTower tower(Int_t t)
Gets a specific tower.
Definition: StEEmcPoint.h:47
StEEmcSmdCluster cluster(Int_t c)
Definition: StEEmcPoint.h:52
void position(TVector3 p)
Set the position of this point at the SMD plane.
Definition: StEEmcPoint.h:23
StEEmcTowerVec_t mTowers
Definition: StEEmcPoint.h:169
Int_t sector() const
Returns the sector.
Definition: StEEmcPoint.h:85
void fraction(Float_t f)
Set the fraction of the tower energy used.
Definition: StEEmcPoint.h:27
StEEmcSmdCluster mSmdClusters[2]
Smd clusters associated with this point.
Definition: StEEmcPoint.h:162
Bool_t operator<(const StEEmcPoint &other) const
Point is less than another based on energy.
Definition: StEEmcPoint.h:117
Float_t energy() const
Get the energy of this point.
Definition: StEEmcPoint.h:43
Int_t numberOfRelatives()
Definition: StEEmcPoint.h:56
Float_t mFraction
...
Definition: StEEmcPoint.h:146
void numberOfRelatives(Int_t r)
Set the number of other points which share tower energy.
Definition: StEEmcPoint.h:34
StEmcPoint * mEmcPoint
Pointer to corresponding StEmcPoint (StEvent only)
Definition: StEEmcPoint.h:177
Float_t weight(Int_t t)
Gets the weight associated with a specific tower.
Definition: StEEmcPoint.h:49
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
void tower(StEEmcTower t, Float_t w=1.)
Add a tower with specified weight to the point.
Definition: StEEmcPoint.h:29
TVector3 position()
Get the position of this point.
Definition: StEEmcPoint.h:37
void print() const
print
Int_t mRelatives
Number of points which share tower energy with this point.
Definition: StEEmcPoint.h:174
TVector3 mPosition
Position of the point.
Definition: StEEmcPoint.h:142
A base class for representing clusters of EEMC smd strips.
void cluster(StEEmcSmdCluster c, Int_t plane)
Add an smd cluster to this point.
Definition: StEEmcPoint.h:31
Int_t numberOfTowers()
Gets the number of towers.
Definition: StEEmcPoint.h:45
std::vector< Float_t > mWeights
Vector of weights.
Definition: StEEmcPoint.h:171
Float_t mEnergy[4]
Energy of the point.
Definition: StEEmcPoint.h:144
StEmcPoint * stemc()
Definition: StEEmcPoint.cxx:63
Float_t energy()
Get the energy of this point.
Definition: StEEmcPoint.h:39
ClassDef(StEEmcPoint, 1)
Makes class available to root.
void energy(Float_t e)
Set the energy of this point.
Definition: StEEmcPoint.h:25