]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TUHKMgen/UHKM/ParticlePDG.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / TUHKMgen / UHKM / ParticlePDG.cxx
index 2a82d42a7ba3c2d46b7d7cd9995ab10f63415d76..0754ec65e7b8e22a502f8143172b87b326c6e7b1 100644 (file)
@@ -1,23 +1,21 @@
-/*
-  Copyright   : The FASTMC and SPHMC Collaboration
-  Author      : Ionut Cristian Arsene 
-  Affiliation : Oslo University, Norway & Institute for Space Sciences, Bucharest, Romania
-  e-mail      : i.c.arsene@fys.uio.no
-  Date        : 2007/05/30
-
-  This class is using the particle and decay lists provided by the 
-  THERMINATOR (Computer Physics Communications 174 669 (2006)) and
-  SHARE (Computer Physics Communications 167 229 (2005)) collaborations.
-*/
-
-#ifndef PARTICLE_PDG
-#include "ParticlePDG.h"
-#endif
+//
+//  Copyright   : The FASTMC and SPHMC Collaboration
+//  Author      : Ionut Cristian Arsene 
+//  Affiliation : Oslo University, Norway & Institute for Space Sciences, Bucharest, Romania
+//  e-mail      : i.c.arsene@fys.uio.no
+//  Date        : 2007/05/30
+//
+//  This class is using the particle and decay lists provided by the 
+//  THERMINATOR (Computer Physics Communications 174 669 (2006)) and
+//  SHARE (Computer Physics Communications 167 229 (2005)) collaborations.
+//
 
 #include <iostream>
-using std::cout;
-using std::endl;
+#include <string>
+using namespace std;
+#include "ParticlePDG.h"
 
+//________________________________________________________________________
 ParticlePDG::ParticlePDG() :
   fPDG(kNonsensePDG),
   fMass(-1.0),
@@ -34,10 +32,15 @@ ParticlePDG::ParticlePDG() :
   fNDecayChannels(0),
   fStable(0.0)
 {
+//
+// default constructor
+//
+  memset(fName,'a',9);
   for(Int_t i=0; i<kMaxDecayChannels; i++)
     fDecayChannels[i] = new DecayChannel();
 }
 
+//________________________________________________________________________
 ParticlePDG::ParticlePDG(const Char_t * const name, Int_t pdg, Double_t mass, Double_t width) :
   fPDG(pdg),
   fMass(mass),
@@ -54,6 +57,9 @@ ParticlePDG::ParticlePDG(const Char_t * const name, Int_t pdg, Double_t mass, Do
   fNDecayChannels(0),
   fStable(0.0)
 {
+  //
+  // constructor
+  //
   for(Int_t i=0; i<9; i++)
     if(*(name+i) != '\0') fName[i] = *(name+i);
     else break;
@@ -61,19 +67,31 @@ ParticlePDG::ParticlePDG(const Char_t * const name, Int_t pdg, Double_t mass, Do
     fDecayChannels[i] = new DecayChannel();
 }
 
+//________________________________________________________________________
 ParticlePDG::~ParticlePDG() {
+  //
+  // destructor
+  //
   for(Int_t i=0; i<kMaxDecayChannels; i++)
     delete fDecayChannels[i];
 }
 
+//________________________________________________________________________
 Double_t ParticlePDG::GetFullBranching() {
+  //
+  // calculate the sum of branching ratios from all decay channels (should add up to 1)
+  //
   Double_t fullBranching = 0.0;
   for(Int_t i=0; i<fNDecayChannels; i++)
     fullBranching += fDecayChannels[i]->GetBranching();
   return fullBranching;
 }
 
+//________________________________________________________________________
 void ParticlePDG::AddChannel(DecayChannel* channel) {
+  //
+  // add a decay channel
+  //
   if(channel->GetMotherPDG() != fPDG) {
     cout << "ERROR in ParticlePDG::AddChannel() : You try to add a channel which has a different mother PDG" << endl;
     return;