Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > 8c86774a3e53d77cc119f53a2b94a57a > files > 468

root-tutorial-5.34.14-2.fc18.noarch.rpm

#include <stdlib.h>
#include <Riostream.h>
#include "NdbParticleList.h"

ClassImp(NdbParticleList)

/* -------- TotalCharge -------- */
Int_t
NdbParticleList::TotalCharge()
{
	Int_t	charge = 0;

	for (int i=0; i<mult.GetSize(); i++)
		charge += ((NdbParticle*)part[i])->Charge() * mult[i];

	return charge;
} // TotalCharge

/* -------- TotalMass -------- */
Float_t
NdbParticleList::TotalMass()
{
	Float_t	mass = 0.0;

	for (int i=0; i<mult.GetSize(); i++)
		mass += ((NdbParticle*)part[i])->Mass() * mult[i];

	return mass;
} // TotalMass

/* -------- Name -------- */
TString
NdbParticleList::Name()
{
	TString	nm;

	for (int i=0; i<mult.GetSize(); i++) {
		if (mult[i]>1) {
			char	num[10];
			sprintf(num,"%d",mult[i]);
			nm.Append(num);
		}
		nm.Append(((NdbParticle*)part[i])->Name());
	}
	return nm;
} // Name

/* --------- Add --------- */
void
NdbParticleList::Add(NdbParticle *, Int_t)
{
	cout << "NdbParticleList::add()" << endl;
} // Add