1 #include "StMuRpsTrackPoint.h"
2 #include "StMuRpsTrack.h"
4 #include "StEvent/StRpsTrackPoint.h"
5 #include "StEvent/StRpsTrack.h"
12 for(
unsigned int i=0; i<mNumberOfStationsInBranch; ++i)
13 mTrackPoints[ i ] =
nullptr;
18 StMuRpsTrack::StMuRpsTrack(
const StMuRpsTrack&
track) {
22 StMuRpsTrack::~StMuRpsTrack() { }
24 StMuRpsTrack& StMuRpsTrack::operator=(
const StMuRpsTrack&
track) {
26 for(
unsigned int i=0; i<mNumberOfStationsInBranch; ++i){
35 unsigned int StMuRpsTrack::planesUsed()
const {
36 unsigned int nPlanes = 0;
37 for(
unsigned int i=0; i<mNumberOfStationsInBranch; ++i)
38 nPlanes += mTrackPoints[i].GetObject() ? trackPoint(i)->planesUsed() : 0;
42 double StMuRpsTrack::thetaRp(
unsigned int coordinate)
const {
43 if(coordinate>rpsAngleTheta)
return 0.0;
44 if(mType==rpsLocal)
return theta(coordinate);
45 TVector3 deltaVector = trackPoint(1)->positionVec() - trackPoint(0)->positionVec();
46 return atan((coordinate<rpsAngleTheta ? deltaVector[coordinate] : deltaVector.Perp())/abs(deltaVector.z()));
49 double StMuRpsTrack::phiRp()
const{
50 if(mType==rpsLocal)
return phi();
51 TVector3 deltaVector = trackPoint(1)->positionVec() - trackPoint(0)->positionVec();
52 return deltaVector.Phi();
55 double StMuRpsTrack::time()
const{
57 unsigned int numberOfPmtsWithSignal=0;
58 for(
unsigned int i=0; i<mNumberOfStationsInBranch; ++i){
60 for(
int j=0; j<trackPoint(i)->mNumberOfPmtsInRp; ++j){
61 if(trackPoint(i)->time(j)>0){
62 sumTime += trackPoint(i)->time(j);
63 ++numberOfPmtsWithSignal;
67 return numberOfPmtsWithSignal>0 ? sumTime/numberOfPmtsWithSignal : -1;
70 double StMuRpsTrack::theta(
unsigned int coordinate)
const{
71 return coordinate < mNumberOfAngleTypes ? atan((coordinate<rpsAngleTheta ? mP[coordinate] : mP.Perp())/abs(mP.z())) : 0.0;