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 
15 #include "TObject.h"
16 #include "TVector3.h"
17 
18 #include "StEEmcPool/StEEmcA2EMaker/StEEmcTower.h"
19 #include "StEEmcPool/StEEmcClusterMaker/StEEmcCluster.h"
20 #include "StEEmcPool/StEEmcClusterMaker/StEEmcSmdCluster.h"
21 
22 class StEmcPoint;
23 
24 class StEEmcPoint : public TObject {
25 public:
26 
27  StEEmcPoint();
28  StEEmcPoint( const StEEmcPoint &p );
29  virtual ~StEEmcPoint(){ /* nada */ };
30 
32  void position( const TVector3 &p ) { mPosition=p; }
34  void energy( Float_t e, Int_t layer=0 ) { mEnergy[layer]=e; }
36  void fraction ( Float_t f ) { mFraction=f; }
38  void tower( const StEEmcTower &t, Float_t w=1. ) { mTowers.push_back(t); mWeights.push_back(w); }
40  void cluster( const StEEmcSmdCluster &c, Int_t plane ) {
41  mSmdClusters[plane]=c;
42  mSector=c.sector();
43  if (plane==0)
44  mU=c.mean();
45  else
46  mV=c.mean();
47  }
48 
50  void cluster( const StEEmcCluster &c, Int_t layer){ mTowerClusters[layer].push_back(c); }
51 
53  StEEmcClusterVec_t &clusters(Int_t layer){ return mTowerClusters[layer]; }
54  const StEEmcClusterVec_t &clusters(Int_t layer) const { return mTowerClusters[layer]; }
55 
57  void numberOfRelatives( Int_t r ) { mRelatives=r; }
58 
60  const TVector3 &position() const { return mPosition; }
62  Float_t fraction() const { return mFraction; }
64  Float_t energy(Int_t layer=0) const { return mEnergy[layer]; }
66  Int_t numberOfTowers() const { return (Int_t)mTowers.size(); }
68  const StEEmcTower &tower(Int_t t) const { return mTowers[t]; }
70  Float_t weight(Int_t t) const { return mWeights[t]; }
73  StEEmcSmdCluster &cluster(Int_t c) { return mSmdClusters[c]; }
74  const StEEmcSmdCluster &cluster(Int_t c) const { return mSmdClusters[c]; }
75 
78  Int_t numberOfRelatives() const { return mRelatives; }
79 
82  StEmcPoint *stemc();
83 
85  Int_t sector() const { return mSector; }
87  void sector(Int_t s){ mSector=s; }
88 
90  Float_t sigma() const { return mSigma; }
92  void sigma(Float_t s) { mSigma=s; }
93 
95  Float_t u() const { return mU; }
97  void u(Float_t uu){ mU=uu; }
98 
100  Float_t v() const { return mV; }
102  void v(Float_t vv){ mV=vv; }
103 
105  Float_t residueU() const { return mResidueU; }
107  void residueU(Float_t r){ mResidueU=r; }
109  Float_t residueV() const { return mResidueV; }
111  void residueV(Float_t r){ mResidueV=r; }
112 
114  void print() const;
115 
117  Bool_t operator<( const StEEmcPoint &other ) const { return this->energy() < other.energy(); }
119  Bool_t chiSquare( const StEEmcPoint &other ) const;
120 
121  Int_t key() const { return mKey; }
122  void key( Int_t k ) { mKey = k; }
123 
124  Float_t asymmetry() const {
125  Float_t esum=cluster(0).energy()+cluster(1).energy();
126  Float_t edif=cluster(0).energy()-cluster(1).energy();
127  if(esum>0.)
128  return edif/esum;
129  return 9.0E9;
130  }
131 
132  Float_t chisquared() const {
133  Float_t edif = ( mSmdClusters[0].energy() - mSmdClusters[1].energy() );
134  Float_t esum = ( mSmdClusters[0].energy() + mSmdClusters[1].energy() );
135  Float_t nmip = 1000.0*esum / 1.3;
136  if ( nmip > 0. ) return (edif*edif)/nmip;
137  return -1.0;
138  }
139 
140 protected:
142  TVector3 mPosition;
144  Float_t mEnergy[4];
146  Float_t mFraction;
147 
149  Int_t mSector;
151  Float_t mSigma;
153  Float_t mU;
155  Float_t mV;
157  Float_t mResidueU;
159  Float_t mResidueV;
160 
163 
165  std::vector< StEEmcClusterVec_t > mTowerClusters;
166 
169  StEEmcTowerVec_t mTowers;
170  std::vector<Float_t> mWeights;
172 
174  Int_t mRelatives;
175 
178 
179  Int_t mKey;
180 
183 
184 };
185 
186 typedef std::vector<StEEmcPoint> StEEmcPointVec_t;
187 
188 inline Bool_t chiSquare( const StEEmcPoint &me, const StEEmcPoint &other ) { return me.chiSquare( other ); }
189 
190 inline Bool_t Asymmetry( const StEEmcPoint &me, const StEEmcPoint &other ){
191  return TMath::Abs(me.asymmetry()) < TMath::Abs(other.asymmetry());
192 }
193 
194 #endif
Float_t residueU() const
Get the residual in the U plane.
Definition: StEEmcPoint.h:105
void cluster(const StEEmcSmdCluster &c, Int_t plane)
Add an smd cluster to this point.
Definition: StEEmcPoint.h:40
Base class for representing EEMC points.
Definition: StEEmcPoint.h:24
Float_t weight(Int_t t) const
Gets the weight associated with a specific tower.
Definition: StEEmcPoint.h:70
void v(Float_t vv)
Sets mean U position.
Definition: StEEmcPoint.h:102
void energy(Float_t e, Int_t layer=0)
Set the energy of this point.
Definition: StEEmcPoint.h:34
Int_t numberOfTowers() const
Gets the number of towers.
Definition: StEEmcPoint.h:66
Bool_t chiSquare(const StEEmcPoint &other) const
Chi2 sort method.
Definition: StEEmcPoint.cxx:90
StEEmcTowerVec_t mTowers
Definition: StEEmcPoint.h:169
Float_t energy(Int_t layer=0) const
Get the energy of this point.
Definition: StEEmcPoint.h:64
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:36
StEEmcSmdCluster mSmdClusters[2]
Smd clusters associated with this point.
Definition: StEEmcPoint.h:162
void sector(Int_t s)
Sets the sector.
Definition: StEEmcPoint.h:87
Bool_t operator<(const StEEmcPoint &other) const
Point is less than another based on energy.
Definition: StEEmcPoint.h:117
Float_t fraction() const
Get the fraction of tower energy associated with this point.
Definition: StEEmcPoint.h:62
Float_t u() const
Returns mean U position.
Definition: StEEmcPoint.h:95
Float_t mSigma
Width.
Definition: StEEmcPoint.h:151
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:57
StEmcPoint * mEmcPoint
Pointer to corresponding StEmcPoint (StEvent only)
Definition: StEEmcPoint.h:177
Float_t mResidueU
Residual in U.
Definition: StEEmcPoint.h:157
void u(Float_t uu)
Sets mean U position.
Definition: StEEmcPoint.h:97
void sigma(Float_t s)
Sets the width.
Definition: StEEmcPoint.h:92
void residueV(Float_t r)
Set the residual in the V plane.
Definition: StEEmcPoint.h:111
Float_t sigma() const
Returns the width.
Definition: StEEmcPoint.h:90
StEEmcSmdCluster & cluster(Int_t c)
Definition: StEEmcPoint.h:73
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
std::vector< StEEmcClusterVec_t > mTowerClusters
Tower clusters in each layer.
Definition: StEEmcPoint.h:165
void print() const
print
Int_t mRelatives
Number of points which share tower energy with this point.
Definition: StEEmcPoint.h:174
Float_t mU
Mean U.
Definition: StEEmcPoint.h:153
Float_t residueV() const
Get the residual in the V plane.
Definition: StEEmcPoint.h:109
TVector3 mPosition
Position of the point.
Definition: StEEmcPoint.h:142
void residueU(Float_t r)
Set the residual in the U plane.
Definition: StEEmcPoint.h:107
A base class for representing clusters of EEMC smd strips.
std::vector< Float_t > mWeights
Vector of weights.
Definition: StEEmcPoint.h:171
void tower(const StEEmcTower &t, Float_t w=1.)
Add a tower with specified weight to the point.
Definition: StEEmcPoint.h:38
Float_t mEnergy[4]
Energy of the point.
Definition: StEEmcPoint.h:144
Int_t numberOfRelatives() const
Definition: StEEmcPoint.h:78
void position(const TVector3 &p)
Set the position of this point at the SMD plane.
Definition: StEEmcPoint.h:32
const TVector3 & position() const
Get the position of this point.
Definition: StEEmcPoint.h:60
A base class for describing clusters of EEMC towers.
Definition: StEEmcCluster.h:50
void cluster(const StEEmcCluster &c, Int_t layer)
Add a tower cluster to this point.
Definition: StEEmcPoint.h:50
Float_t v() const
Returns mean V position.
Definition: StEEmcPoint.h:100
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.
const StEEmcTower & tower(Int_t t) const
Gets a specific tower.
Definition: StEEmcPoint.h:68
Int_t mSector
Sector.
Definition: StEEmcPoint.h:149
Float_t mV
Mean V.
Definition: StEEmcPoint.h:155
Float_t mResidueV
Residual in V.
Definition: StEEmcPoint.h:159
StEEmcClusterVec_t & clusters(Int_t layer)
Returns tower clusters for the specified layer 0=T, 1=P, 2=Q, 3=R, 4+=crash.
Definition: StEEmcPoint.h:53