00001 #include "StEEmcPoint.h" 00002 #include "StEEmcUtil/EEmcGeom/EEmcGeomDefs.h" 00003 #include <iostream> 00004 00005 #include "StEvent/StEmcPoint.h" 00006 00007 ClassImp(StEEmcPoint); 00008 00009 // ---------------------------------------------------------------------------- 00010 StEEmcPoint::StEEmcPoint() 00011 { 00012 mEmcPoint=0; 00013 mRelatives=999; 00014 } 00015 00016 // ---------------------------------------------------------------------------- 00017 StEEmcPoint::StEEmcPoint( const StEEmcPoint &p ) 00018 { 00019 00020 mPosition = p.mPosition; 00021 mEnergy = p.mEnergy; 00022 mFraction = p.mFraction; 00023 mTowers = p.mTowers; 00024 mWeights = p.mWeights; 00025 mSmdClusters[0] = p.mSmdClusters[0]; 00026 mSmdClusters[1] = p.mSmdClusters[1]; 00027 mEmcPoint = p.mEmcPoint; 00028 mRelatives = p.mRelatives; 00029 00030 } 00031 00032 // ---------------------------------------------------------------------------- 00033 00034 /* 00035 void StEEmcPoint::print() 00036 { 00037 std::cout << " X=" << mPosition.X() 00038 << " Y=" << mPosition.Y() 00039 << " energy=" << mEnergy 00040 << " frac=" << mFraction 00041 << std::endl; 00042 } 00043 */ 00044 00045 // ---------------------------------------------------------------------------- 00046 00047 StEmcPoint *StEEmcPoint::stemc() 00048 { 00049 00050 StThreeVectorF position( mPosition.X(), mPosition.Y(), mPosition.Z() ); 00051 00052 mEmcPoint = new StEmcPoint(); 00053 mEmcPoint->setEnergy( energy() ); 00054 mEmcPoint->setPosition( position ); 00055 00058 StThreeVectorF error( 1.0, 1.0, 1.0 ); 00059 mEmcPoint->setPositionError( error ); 00060 00064 mEmcPoint->addCluster( kEndcapEmcTowerId, 0 ); 00065 00066 mEmcPoint->addCluster( kEndcapSmdUStripId, mSmdClusters[0].stemc() ); 00067 mEmcPoint->addCluster( kEndcapSmdVStripId, mSmdClusters[1].stemc() ); 00068 00069 return mEmcPoint; 00070 00071 } 00072 00073 00074 00075 00076 00077 // -------------------------------------------------------------------------- 00078 Bool_t StEEmcPoint::chiSquare( const StEEmcPoint &other ) const 00079 { 00080 00083 00084 Float_t myChi2 = ( mSmdClusters[0].energy() - mSmdClusters[1].energy() ); 00085 myChi2 *= myChi2; 00086 00087 Float_t otherChi2 = ( other.mSmdClusters[0].energy() - other.mSmdClusters[1].energy() ); 00088 otherChi2 *= otherChi2; 00089 00090 return myChi2 < otherChi2; 00091 00092 } 00093 00094 00095 // ---------------------------------------------------------------------------- 00096 00097 void StEEmcPoint::print() 00098 { 00099 00100 std::cout << "---------------------------------" << std::endl; 00101 for ( UInt_t i=0; i<mTowers.size(); i++ ) 00102 mTowers[i].print(); 00103 00104 std::cout << "ucluster:" << std::endl; 00105 mSmdClusters[0].print(); 00106 std::cout << "vcluster:" << std::endl; 00107 mSmdClusters[1].print(); 00108 00109 } 00110 00111
1.5.9