#include "THaSpectrometerDetector.h"
#include "THaTrack.h"
#include "TMath.h"
ClassImp(THaSpectrometerDetector)
THaSpectrometerDetector::THaSpectrometerDetector( const char* name,
const char* description,
THaApparatus* apparatus )
: THaDetector(name,description,apparatus)
{
}
THaSpectrometerDetector::THaSpectrometerDetector( )
{
}
THaSpectrometerDetector::~THaSpectrometerDetector()
{
}
void THaSpectrometerDetector::DefineAxes(Double_t rotation_angle)
{
fXax.SetXYZ( TMath::Cos(rotation_angle), 0.0, TMath::Sin(rotation_angle) );
fYax.SetXYZ( 0.0, 1.0, 0.0 );
fZax = fXax.Cross(fYax);
}
bool THaSpectrometerDetector::CalcTrackIntercept(THaTrack* theTrack,
Double_t& t, Double_t& xcross,
Double_t& ycross)
{
TVector3 t0( theTrack->GetX(), theTrack->GetY(), 0.0 );
Double_t norm = TMath::Sqrt(1.0 + theTrack->GetTheta()*theTrack->GetTheta() +
theTrack->GetPhi()*theTrack->GetPhi());
TVector3 t_hat( theTrack->GetTheta()/norm, theTrack->GetPhi()/norm, 1.0/norm );
TVector3 v;
if( !IntersectPlaneWithRay( fXax, fYax, fOrigin, t0, t_hat, t, v ))
return false;
v -= fOrigin;
xcross = v.Dot(fXax);
ycross = v.Dot(fYax);
return true;
}
bool THaSpectrometerDetector::CheckIntercept(THaTrack *track)
{
Double_t x, y, t;
return CalcTrackIntercept(track, t, x, y);
}
bool THaSpectrometerDetector::CalcInterceptCoords(THaTrack* track, Double_t& x, Double_t& y)
{
Double_t t;
return CalcTrackIntercept(track, t, x, y);
}
bool THaSpectrometerDetector::CalcPathLen(THaTrack* track, Double_t& t)
{
Double_t x, y;
return CalcTrackIntercept(track, t, x, y);
}
Last change: Sat Nov 7 21:26:52 2009
Last generated: 2009-11-07 21:26
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.