26 #include "StRpsTrackPoint.h"
27 #include "StRpsTrack.h"
33 for(
unsigned int i=0; i<mNumberOfStationsInBranch; ++i)
34 mTrackPoints.push_back(
nullptr);
39 StRpsTrack::StRpsTrack(
const StRpsTrack&
track) {
43 StRpsTrack::~StRpsTrack() { }
45 StRpsTrack& StRpsTrack::operator=(
const StRpsTrack&
track) {
47 for(
unsigned int i=0; i<mNumberOfStationsInBranch; ++i)
48 mTrackPoints[i] = track.trackPoint(i);
55 unsigned int StRpsTrack::planesUsed()
const {
56 unsigned int nPlanes = 0;
57 for(
unsigned int i=0; i<mNumberOfStationsInBranch; ++i)
58 nPlanes += mTrackPoints[i] ? mTrackPoints[i]->planesUsed() : 0;
62 double StRpsTrack::thetaRp(
unsigned int coordinate)
const {
63 if(coordinate>rpsAngleTheta)
return 0.0;
64 if(mType==rpsLocal)
return theta(coordinate);
65 StThreeVectorF deltaVector = mTrackPoints[1]->positionVec() - mTrackPoints[0]->positionVec();
66 return atan((coordinate<rpsAngleTheta ? deltaVector[coordinate] : deltaVector.perp())/abs(deltaVector.z()));
69 double StRpsTrack::phiRp()
const{
70 if(mType==rpsLocal)
return phi();
71 StThreeVectorF deltaVector = mTrackPoints[1]->positionVec() - mTrackPoints[0]->positionVec();
72 return deltaVector.phi();
75 double StRpsTrack::time()
const{
77 unsigned int numberOfPmtsWithSignal=0;
78 for(
unsigned int i=0; i<mNumberOfStationsInBranch; ++i){
80 for(
int j=0; j<mTrackPoints[i]->mNumberOfPmtsInRp; ++j){
81 if(mTrackPoints[i]->time(j)>0){
82 sumTime += mTrackPoints[i]->time(j);
83 ++numberOfPmtsWithSignal;
87 return numberOfPmtsWithSignal>0 ? sumTime/numberOfPmtsWithSignal : -1;
90 double StRpsTrack::theta(
unsigned int coordinate)
const
92 return coordinate < mNumberOfAngleTypes ? atan((coordinate<rpsAngleTheta ? mP[coordinate] : mP.perp())/abs(mP.z())) : 0.0;