00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "StTofCell.h"
00030 #include "StTrack.h"
00031 #include "StThreeVectorD.hh"
00032
00033 static const char rcsid[] = "$Id: StTofCell.cxx,v 2.5 2007/09/19 17:32:02 ullrich Exp $";
00034
00035 ClassImp(StTofCell)
00036
00037 StTofCell::StTofCell()
00038 : mTrayIndex(0), mModuleIndex(0), mCellIndex(0), mDaqIndex(0), mAdc(0), mTdc(0),
00039 mLeadingEdgeTime(0), mTrailingEdgeTime(0), mAssociatedTrack(0), mZhit(0),
00040 mMatchFlag(0)
00041 { }
00042
00043 StTofCell::StTofCell(int trayId, int moduleId, int cellId, int daqId,
00044 int rawAdc, int rawTdc, StTrack *track, float zhit,
00045 int flag, const StThreeVectorD& pos)
00046 : mTrayIndex(trayId), mModuleIndex(moduleId), mCellIndex(cellId),
00047 mDaqIndex(daqId), mAdc(rawAdc), mTdc(rawTdc),
00048 mLeadingEdgeTime(0.), mTrailingEdgeTime(0.),
00049 mAssociatedTrack(track), mZhit(zhit), mMatchFlag(flag), mPosition(pos)
00050 { }
00051
00052 StTofCell::StTofCell(int trayId, int moduleId, int cellId, int daqId,
00053 StTrack *track, float zhit,
00054 int flag, const StThreeVectorD& pos)
00055 : mTrayIndex(trayId), mModuleIndex(moduleId), mCellIndex(cellId),
00056 mDaqIndex(daqId), mAdc(0), mTdc(0),
00057 mLeadingEdgeTime(0.), mTrailingEdgeTime(0.),
00058 mAssociatedTrack(track), mZhit(zhit), mMatchFlag(flag), mPosition(pos)
00059 { }
00060
00061 StTofCell::~StTofCell() { }
00062
00063 void
00064 StTofCell::setAssociatedTrack(StTrack* val)
00065 {
00066 mAssociatedTrack = val;
00067 }
00068
00069 StTrack*
00070 StTofCell::associatedTrack() {return mAssociatedTrack;}
00071
00072 const StTrack*
00073 StTofCell::associatedTrack() const {return mAssociatedTrack;}
00074
00075 void
00076 StTofCell::setPosition(const StThreeVectorD& p) {mPosition = p;}
00077
00078 const StThreeVectorD&
00079 StTofCell::position() const {return mPosition;}
00080
00081 int
00082 StTofCell::operator==(const StTofCell& p) const
00083 {
00084 return ( (p.mTrayIndex == mTrayIndex && p.mModuleIndex == mModuleIndex &&
00085 p.mCellIndex == mCellIndex && p.mDaqIndex == mDaqIndex &&
00086 p.mAdc == mAdc && p.mTdc == mTdc &&
00087 p.mAssociatedTrack == mAssociatedTrack &&
00088 p.mZhit == mZhit &&
00089 p.mMatchFlag == mMatchFlag) ||
00090 (p.mTrayIndex == mTrayIndex && p.mModuleIndex == mModuleIndex &&
00091 p.mCellIndex == mCellIndex && p.mDaqIndex == mDaqIndex &&
00092 p.mLeadingEdgeTime == mLeadingEdgeTime &&
00093 p.mTrailingEdgeTime == mTrailingEdgeTime &&
00094 p.mAssociatedTrack == mAssociatedTrack &&
00095 p.mZhit == mZhit &&
00096 p.mMatchFlag == mMatchFlag) );
00097 }
00098
00099 int
00100 StTofCell::operator!=(const StTofCell& p) const
00101 {
00102 return !(*this == p);
00103 }