StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcPoint.cxx
1 #include "StEEmcPoint.h"
2 #include "StEEmcUtil/EEmcGeom/EEmcGeomDefs.h"
3 #include <iostream>
4 
5 #include "StEvent/StEmcPoint.h"
6 
7 ClassImp(StEEmcPoint);
8 
9 // ----------------------------------------------------------------------------
10 StEEmcPoint::StEEmcPoint()
11 {
12  mEmcPoint=0;
13  mRelatives=999;
14 }
15 
16 // ----------------------------------------------------------------------------
17 StEEmcPoint::StEEmcPoint( const StEEmcPoint &p )
18 {
19 
20  mPosition = p.mPosition;
21  mEnergy = p.mEnergy;
22  mFraction = p.mFraction;
23  mTowers = p.mTowers;
24  mWeights = p.mWeights;
25  mSmdClusters[0] = p.mSmdClusters[0];
26  mSmdClusters[1] = p.mSmdClusters[1];
27  mEmcPoint = p.mEmcPoint;
29 
30 }
31 
32 // ----------------------------------------------------------------------------
33 
34 /*
35 void StEEmcPoint::print()
36 {
37  std::cout << " X=" << mPosition.X()
38  << " Y=" << mPosition.Y()
39  << " energy=" << mEnergy
40  << " frac=" << mFraction
41  << std::endl;
42 }
43 */
44 
45 // ----------------------------------------------------------------------------
46 
48 {
49 
51 
52  mEmcPoint = new StEmcPoint();
53  mEmcPoint->setEnergy( energy() );
54  mEmcPoint->setPosition( position );
55 
58  StThreeVectorF error( 1.0, 1.0, 1.0 );
59  mEmcPoint->setPositionError( error );
60 
64  mEmcPoint->addCluster( kEndcapEmcTowerId, 0 );
65 
66  mEmcPoint->addCluster( kEndcapSmdUStripId, mSmdClusters[0].stemc() );
67  mEmcPoint->addCluster( kEndcapSmdVStripId, mSmdClusters[1].stemc() );
68 
69  return mEmcPoint;
70 
71 }
72 
73 
74 
75 
76 
77 // --------------------------------------------------------------------------
78 Bool_t StEEmcPoint::chiSquare( const StEEmcPoint &other ) const
79 {
80 
83 
84  Float_t myChi2 = ( mSmdClusters[0].energy() - mSmdClusters[1].energy() );
85  myChi2 *= myChi2;
86 
87  Float_t otherChi2 = ( other.mSmdClusters[0].energy() - other.mSmdClusters[1].energy() );
88  otherChi2 *= otherChi2;
89 
90  return myChi2 < otherChi2;
91 
92 }
93 
94 
95 // ----------------------------------------------------------------------------
96 
97 void StEEmcPoint::print()
98 {
99 
100  std::cout << "---------------------------------" << std::endl;
101  for ( UInt_t i=0; i<mTowers.size(); i++ )
102  mTowers[i].print();
103 
104  std::cout << "ucluster:" << std::endl;
105  mSmdClusters[0].print();
106  std::cout << "vcluster:" << std::endl;
107  mSmdClusters[1].print();
108 
109 }
110 
111 
Base class for representing EEMC points.
Definition: StEEmcPoint.h:24
Bool_t chiSquare(const StEEmcPoint &other) const
Chi2 sort method.
Definition: StEEmcPoint.cxx:90
StEEmcTowerVec_t mTowers
Definition: StEEmcPoint.h:169
StEEmcSmdCluster mSmdClusters[2]
Smd clusters associated with this point.
Definition: StEEmcPoint.h:162
Float_t mFraction
...
Definition: StEEmcPoint.h:146
StEmcPoint * mEmcPoint
Pointer to corresponding StEmcPoint (StEvent only)
Definition: StEEmcPoint.h:177
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
std::vector< Float_t > mWeights
Vector of weights.
Definition: StEEmcPoint.h:171
Float_t mEnergy[4]
Energy of the point.
Definition: StEEmcPoint.h:144
const TVector3 & position() const
Get the position of this point.
Definition: StEEmcPoint.h:60
StEmcPoint * stemc()
Definition: StEEmcPoint.cxx:63
Float_t energy()
Get the energy of this point.
Definition: StEEmcPoint.h:39