#include "THaVDCTrackPair.h"
#include "THaVDCUVTrack.h"
#include "TClass.h"
#include <iostream>
using namespace std;
THaVDCTrackPair& THaVDCTrackPair::operator=( const THaVDCTrackPair& rhs )
{
TObject::operator=(rhs);
if ( this != &rhs ) {
fLowerTrack = rhs.fLowerTrack;
fUpperTrack = rhs.fUpperTrack;
fError = rhs.fError;
fStatus = rhs.fStatus;
}
return *this;
}
void THaVDCTrackPair::Analyze( Double_t spacing )
{
fError = GetProjectedDistance( fLowerTrack, fUpperTrack, spacing );
fError += GetProjectedDistance( fUpperTrack, fLowerTrack, -spacing );
return;
}
Double_t THaVDCTrackPair::GetProjectedDistance( pUV here, pUV there,
Double_t spacing )
{
Double_t px = here->GetX() + spacing * here->GetTheta();
Double_t py = here->GetY() + spacing * here->GetPhi();
Double_t x = there->GetX();
Double_t y = there->GetY();
return (px-x)*(px-x) + (py-y)*(py-y);
}
Int_t THaVDCTrackPair::Compare( const TObject* obj ) const
{
if( !obj || IsA() != obj->IsA() )
return -1;
const THaVDCTrackPair* rhs = static_cast<const THaVDCTrackPair*>( obj );
if( fError < rhs->fError )
return -1;
if( fError > rhs->fError )
return 1;
return 0;
}
void THaVDCTrackPair::Print( Option_t* ) const
{
cout << fError << endl;
}
ClassImp(THaVDCTrackPair)
Last change: Sat Nov 7 21:26:55 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.