//
// D.Cussol 
//
// 21/10/2002:
// Implementation of a Fragment class relative to the INDRA experiments
// ROOT beginners course
//

#include <math.h>
#include <stdio.h>
#include "Fragment.h"
#include "TMath.h"

ClassImp(Fragment)

int	Fragment::nb=0;
int	Fragment::nb_crea=0;
int	Fragment::nb_dest=0;
double	Fragment::mnuc=931.5;

//============================================================================
// Basic methods
//============================================================================
 void Fragment::init_Fragment(void)
	{
 //
// Initialisation of the Fragment fields
// This private method is called by the constructors
//
       if(!this->IsOnHeap()) nb++;
	Z=0;
	A=0;
	v.SetXYZ(0.,0.,1.);

	nb_crea++;
	}

 Fragment::Fragment(void):TObject()
	{
//
// Default constructor
//
	init_Fragment();
	}
	
 Fragment::~Fragment(void)
       {
 // 
// Destructor
//
       nb--;
	nb_dest++;
       }
//============================================================================
// Direct field access
//============================================================================
 void Fragment::Set(int aa, int zz, TVector3 vit)
	{
//
// Setting fields values method
//
	A=aa;
	Z=zz;
	v=vit;
	}

 void Fragment::SetA(int aa)
	{
//
// Set the number of mass A
//
	A=aa;
	}

 void Fragment::SetZ(int zz)
	{
//
// Set the charge Z
//
	Z=zz;
	}

 void Fragment::SetVit(TVector3 vit)
	{
//
// Set the velocity with a TVector3
//
	v=vit;
	}

 void Fragment::SetVit(double vx, double vy, double vz)
	{
//
// Set the velocity with coordinates
//
	v.SetXYZ(vx,vy,vz);
	}

 int Fragment::GetA(void)
	{
//
// Get the mass number
//
	return A;
	}

 int Fragment::GetZ(void)
	{
//
// Get the charge
//
	return Z;
	}

 TVector3 Fragment::GetVit(void)
	{
//
// Get the velocity
//	
	return v;
	}

//============================================================================
// Computed quantities
//============================================================================
 void Fragment::SetEnergie(double e)
	{
//
// Set the fragment kinetic energy
//	
	if(A > 0)
	 {
	 double vitesse=TMath::Sqrt(2.*e/GetMasse())*30.;
	 if(v.Mag()==0) v.SetXYZ(0.,0.,1.);
	 v.SetMag(vitesse);
	 }
	else
	 {
	 cerr << "Set the number of mass before setting the kinetic energy..." << endl;
	 }
	}

 void Fragment::SetTheta(double theta)
	{
//
// Set the Theta angle
//	
	double the=theta*TMath::Pi()/180.;
	v.SetTheta(the);
	}

 void Fragment::SetPhi(double phi)
	{
//
// Set the Phi angle
//	
	double p=phi*TMath::Pi()/180.;
	v.SetPhi(p);
	}

 double  Fragment::GetMasse(void)
	{
//
// Get the mass in MeV/c^2
//	
	return A*mnuc;
	}

 double  Fragment::GetTheta(void)
	{
//
// Get the Theta angle
//	
	return v.Theta()*180./TMath::Pi();
	}

 double  Fragment::GetPhi(void)
	{
//
// Get the Phi angle
//	
	return v.Phi()*180./TMath::Pi();
	}

 double Fragment::GetEcin(void)
	{
// 
// Get the kinetic energy
//
	return GetMasse()*v.Mag2()/1800.;
	}

 double Fragment::GetEperp(void)
	{
//
// Get the tranverse energy 
//
	return GetMasse()*v.Perp2()/1800.;
	}

 double Fragment::GetRayon(void)
	{
//
// Get the theoretical radius
//
	return 1.2*TMath::Power((double)A,1./.3);
	}

 double Fragment::GetEgoutliq(void)
	{
//
// Get the binding energy from the "Liquid Drop" parametrisation
//
	double av=16.;
	double as=18.;
	double ac=0.72;
	double aa=23.5;
	
	return av*A
	       -as*TMath::Power((double)A,2./.3)
	       -ac*Z*(Z-1.)/TMath::Power((double)A,1./3.)
	       -aa*TMath::Power(A-2*Z,2)/(double)A;
	}	

 void Fragment::Print(Option_t* option) const
	{
//
// Printout
//
	char mes[80];
	sprintf(mes,"%3d, %2d : %8.2f %8.2f %8.2f",A,Z,v.X(),v.Y(),v.Z());
	cout << mes << endl;
	}



ROOT page - Class index - Class Hierarchy - Top of the page

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.