45 #include "StEvent/StFmsCluster.h"
46 #include "StEvent/StFmsHit.h"
50 namespace FMSCluster {
52 : mIndex(0), mDetectorId(detectorId), mEtot(0.0), mEnergyCutoff(0.5), mCluster(cluster) {
58 void StFmsTowerCluster::Clear(
const char* ) {
66 Double_t w0, w1, mtmp, mx, my, sigx, sigy, sigXY;
67 w0 = w1 = mtmp = mx = my = sigx = sigy = sigXY = 0;
68 for (Towers::const_iterator i =
mTowers.begin(); i !=
mTowers.end(); ++i) {
71 if(tower->
hit()->detectorId() != mDetectorId){
72 xxx = (tower->
column() - 0.5)/1.5;
73 yyy = (tower->
row() - 0.5)/1.5 + 9.0;
75 xxx = tower->
column() - 0.5;
76 yyy = tower->
row() - 0.5;
78 mtmp = log(tower->
hit()->energy() + 1. - Ecoff) > 0 ?
79 log(tower->
hit()->energy() + 1. - Ecoff) : 0;
81 w0 += tower->
hit()->energy();
84 sigx += mtmp * xxx * xxx;
85 sigy += mtmp * yyy * yyy;
86 sigXY += mtmp * xxx * yyy;
111 Double_t dSigma2, aA, bB;
115 if (mSigmaXY < 1e-10) {
117 bB = sqrt(dSigma2 * dSigma2 + 4.0 * mSigmaXY * mSigmaXY) - dSigma2;
122 Double_t myPi = TMath::Pi();
136 TVector2 vaxis(cos(theta), sin(theta));
141 for (Towers::const_iterator i =
mTowers.begin(); i !=
mTowers.end(); ++i) {
147 if(emax<tower->
hit()->energy()) {emax=tower->
hit()->energy(); flag=1;}
148 if(tower->
hit()->detectorId() != mDetectorId){
149 xxx = (tower->
column() - 0.5)/1.5;
150 yyy = (tower->
row() - 0.5)/1.5 + 9.0;
151 if(flag==1) isSmall=1;
153 xxx = tower->
column() - 0.5;
154 yyy = tower->
row() - 0.5;
155 if(flag==1) isSmall=0;
157 tower->
setXY(xxx*xwidth,yyy*ywidth);
162 Double_t dis = (v1.Norm(vaxis)).Mod();
167 sigma += wtmp * dis * dis;
170 return wnew > 0 ? sqrt(sigma / wnew) : 0;
172 return wnew > 0 ? 1.5*sqrt(sigma / wnew) : 0;
Double_t mSigmaY
2nd moment in y
Double_t mThetaAxis
of least-2nd-sigma axis
Towers mTowers
Towers that make the cluster.
Double_t mSigmaX
2nd moment in x
Double_t getSigma(Double_t theta, Double_t xwidth, Double_t ywidth)
Double_t mChiSquare2
Chi-square of the fitting 2 photon.
const StFmsHit * hit() const
Declaration of StFmsTower, a simple FMS tower wrapper.
void findClusterAxis(Double_t Ecoff, Double_t xwidth, Double_t ywidth)
Declaration of StFmsTowerCluster, a cluster of FMS towers.
virtual ~StFmsTowerCluster()
void setXY(double x, double y)
void calculateClusterMoments(Double_t energyCutoff)
std::unique_ptr< StFmsCluster > mCluster
Pointer to StEvent cluster.
StFmsTowerCluster(StFmsCluster *cluster, Int_t detectorId)
Double_t mChiSquare1
Chi-square of the fitting 1 photon.
Double_t mChiSquare
Chi-square of the fitting.
Double_t mEnergyCutoff
Cutoff on towers to use in moment calculations.
Double_t mSigmaXY
2nd moment in x-y