NdbParticleList.cxx

Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include <Riostream.h>
00003 #include "NdbParticleList.h"
00004 
00005 ClassImp(NdbParticleList)
00006 
00007 /* -------- TotalCharge -------- */
00008 Int_t
00009 NdbParticleList::TotalCharge()
00010 {
00011         Int_t   charge = 0;
00012 
00013         for (int i=0; i<mult.GetSize(); i++)
00014                 charge += ((NdbParticle*)part[i])->Charge() * mult[i];
00015 
00016         return charge;
00017 } // TotalCharge
00018 
00019 /* -------- TotalMass -------- */
00020 Float_t
00021 NdbParticleList::TotalMass()
00022 {
00023         Float_t mass = 0.0;
00024 
00025         for (int i=0; i<mult.GetSize(); i++)
00026                 mass += ((NdbParticle*)part[i])->Mass() * mult[i];
00027 
00028         return mass;
00029 } // TotalMass
00030 
00031 /* -------- Name -------- */
00032 TString
00033 NdbParticleList::Name()
00034 {
00035         TString nm;
00036 
00037         for (int i=0; i<mult.GetSize(); i++) {
00038                 if (mult[i]>1) {
00039                         char    num[10];
00040                         sprintf(num,"%d",mult[i]);
00041                         nm.Append(num);
00042                 }
00043                 nm.Append(((NdbParticle*)part[i])->Name());
00044         }
00045         return nm;
00046 } // Name
00047 
00048 /* --------- Add --------- */
00049 void
00050 NdbParticleList::Add(NdbParticle *, Int_t)
00051 {
00052         cout << "NdbParticleList::add()" << endl;
00053 } // Add

Generated on Tue Jul 5 15:15:04 2011 for ROOT_528-00b_version by  doxygen 1.5.1