StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcIUPoint.cxx
1 
11 #include "StEEmcIUPoint.h"
12 #include "StEEmcUtil/EEmcGeom/EEmcGeomDefs.h"
13 #include <iostream>
14 
15 #include "StEvent/StEmcPoint.h"
16 
17 ClassImp(StEEmcIUPoint);
18 
19 // ----------------------------------------------------------------------------
20 StEEmcIUPoint::StEEmcIUPoint()
21 {
22  mEmcPoint=0;
23  mRelatives=999;
24  for ( Int_t i=0;i<4;i++ ) mEnergy[i]=0.;
25  mResidueU=0.;
26  mResidueV=0.;
27 }
28 
29 // ----------------------------------------------------------------------------
30 StEEmcIUPoint::StEEmcIUPoint( const StEEmcIUPoint &p )
31 {
32 
33  mPosition = p.mPosition;
34  for ( Int_t i = 0; i < 4; i++ )
35  mEnergy[i] = p.mEnergy[i];
36  mFraction = p.mFraction;
37  mTowers = p.mTowers;
38  mWeights = p.mWeights;
39  mSmdClusters[0] = p.mSmdClusters[0];
40  mSmdClusters[1] = p.mSmdClusters[1];
41  mEmcPoint = p.mEmcPoint;
43 
44  mSector = p.mSector;
45  mSigma = p.mSigma;
46  mU = p.mU;
47  mV = p.mV;
48 
49  mResidueU = p.mResidueU;
50  mResidueV = p.mResidueV;
51 
52 }
53 
54 // ----------------------------------------------------------------------------
55 
56 /*
57 void StEEmcIUPoint::print()
58 {
59  std::cout << " X=" << mPosition.X()
60  << " Y=" << mPosition.Y()
61  << " energy=" << mEnergy
62  << " frac=" << mFraction
63  << std::endl;
64 }
65 */
66 
67 // ----------------------------------------------------------------------------
68 
70 {
71 
73 
74  mEmcPoint = new StEmcPoint();
75  mEmcPoint->setEnergy( energy() );
76  mEmcPoint->setPosition( position );
77 
80  StThreeVectorF error( 1.0, 1.0, 1.0 );
81  mEmcPoint->setPositionError( error );
82 
86  mEmcPoint->addCluster( kEndcapEmcTowerId, 0 );
87 
88  mEmcPoint->addCluster( kEndcapSmdUStripId, mSmdClusters[0].stemc() );
89  mEmcPoint->addCluster( kEndcapSmdVStripId, mSmdClusters[1].stemc() );
90 
91  return mEmcPoint;
92 
93 }
94 
95 
96 
97 
98 
99 // --------------------------------------------------------------------------
100 Bool_t StEEmcIUPoint::chiSquare( const StEEmcIUPoint &other ) const
101 {
102 
105 
106  Float_t myChi2 = ( (mSmdClusters[0].energy() - mSmdClusters[1].energy())/(mSmdClusters[0].energy() + mSmdClusters[1].energy()) );
107  myChi2 *= myChi2;
108  Float_t otherChi2 = ( (other.mSmdClusters[0].energy() - other.mSmdClusters[1].energy())/(other.mSmdClusters[0].energy() + other.mSmdClusters[1].energy()) );
109  otherChi2 *= otherChi2;
110 
111  return myChi2 < otherChi2;
112 
113 }
114 
115 
116 // ----------------------------------------------------------------------------
117 
119 {
120 
121  std::cout << "---------------------------------" << std::endl;
122  std::cout << " X=" << mPosition.X()
123  << " Y=" << mPosition.Y()
124  << " energy=" << mEnergy[0]
125  << " frac=" << mFraction
126  << std::endl;
127 
128  for ( UInt_t i=0; i<mTowers.size(); i++ )
129  mTowers[i].print();
130 
131  std::cout << "ucluster:" << std::endl;
132  mSmdClusters[0].print();
133  std::cout << "vcluster:" << std::endl;
134  mSmdClusters[1].print();
135 
136 }
137 
138 
TVector3 position()
Get the position of this point.
Definition: StEEmcIUPoint.h:37
Float_t mU
Mean U.
Bool_t chiSquare(const StEEmcIUPoint &other) const
Chi2 sort method.
void print()
print
Int_t mRelatives
Number of points which share tower energy with this point.
StEmcPoint * mEmcPoint
Pointer to corresponding StEmcPoint (StEvent only)
void energy(Float_t e, Int_t layer=0)
Set the energy of this point.
Definition: StEEmcIUPoint.h:25
Float_t mFraction
...
Int_t mSector
Sector.
Float_t mEnergy[4]
Energy of the point.
Float_t mResidueV
Residual in V.
Float_t mResidueU
Residual in U.
std::vector< Float_t > mWeights
Vector of weights.
StEEmcTowerVec_t mTowers
StEmcPoint * stemc()
StEEmcIUSmdCluster mSmdClusters[2]
Smd clusters associated with this point.
TVector3 mPosition
Position of the point.
Base class for representing EEMC points.
Definition: StEEmcIUPoint.h:12
Float_t mV
Mean V.
Float_t mSigma
Width.
Float_t energy()
Return the energy of this cluster.