#include "THaSAProtonEP.h"
#include "THaRunBase.h"
#include "THaTrackingModule.h"
#include "THaBeam.h"
#include "TMath.h"
using namespace std;
static const Double_t electron_mass = 0.511e-3;
static const Double_t Mp = 0.938272;
THaSAProtonEP::THaSAProtonEP( const char* name, const char* description,
const char* spectro,
Double_t target_mass )
: THaPrimaryKine(name,description,spectro,electron_mass,
(target_mass > 0.0) ? target_mass : Mp )
{
}
THaSAProtonEP::THaSAProtonEP( const char* name, const char* description,
const char* spectro, const char* beam,
Double_t target_mass )
: THaPrimaryKine(name,description,spectro,beam,
(target_mass > 0.0) ? target_mass : Mp )
{
SetMass( electron_mass );
}
THaSAProtonEP::~THaSAProtonEP()
{
}
Int_t THaSAProtonEP::Process( const THaEvData& )
{
if( !IsOK() || !gHaRun ) return -1;
THaTrackInfo* trkifo = fSpectro->GetTrackInfo();
if( !trkifo || !trkifo->IsOK() ) return 1;
if( fBeam ) {
fP0.SetVectM( fBeam->GetBeamInfo()->GetPvect(), fM );
} else {
Double_t p_in = gHaRun->GetParameters()->GetBeamP();
fP0.SetXYZM( 0.0, 0.0, p_in, fM );
}
fA.SetXYZM( 0.0, 0.0, 0.0, fMA );
fA1.SetVectM( trkifo->GetPvect(), fMA );
fQ = fA1 - fA;
fP1 = fP0 - fQ;
fQ2 = -fQ.M2();
fQ3mag = fQ.P();
fOmega = fQ.E();
fW2 = fA1.M2();
fScatAngle = fP0.Angle( fP1.Vect() );
fEpsilon = 1.0 / ( 1.0 + 2.0*fQ3mag*fQ3mag/fQ2*
pow( tan(fScatAngle/2.0), 2.0 ));
fThetaQ = fQ.Theta();
fPhiQ = fQ.Phi();
fXbj = fQ2/(2.0*Mp*fOmega);
fDataValid = true;
return 0;
}
ClassImp(THaSAProtonEP)
Last change: Sat Nov 7 21:26:50 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.