Bug in passing the number of produced particle to the header corrected.
authormorsch <andreas.morsch@cern.ch>
Fri, 4 Jul 2014 12:49:17 +0000 (14:49 +0200)
committermorsch <andreas.morsch@cern.ch>
Fri, 4 Jul 2014 12:49:17 +0000 (14:49 +0200)
ALIROOT-5509

TDPMjet/AliGenDPMjet.cxx
TDPMjet/AliGenDPMjet.h

index e2cf80b..25a4a0f 100644 (file)
@@ -53,6 +53,7 @@ AliGenDPMjet::AliGenDPMjet()
      fSelectAll(0),
      fFlavor(0),
      fTrials(0),
+     fNprimaries(0),
      fSpectators(1),
      fSpecn(0),
      fSpecp(0),
@@ -92,6 +93,7 @@ AliGenDPMjet::AliGenDPMjet(Int_t npart)
      fSelectAll(0),
      fFlavor(0),
      fTrials(0),
+     fNprimaries(0),
      fSpectators(1),
      fSpecn(0),
      fSpecp(0),
@@ -136,6 +138,7 @@ AliGenDPMjet::AliGenDPMjet(const AliGenDPMjet &/*Dpmjet*/)
      fSelectAll(0),
      fFlavor(0),
      fTrials(0),
+     fNprimaries(0),
      fSpectators(1),
      fSpecn(0),
      fSpecp(0),
@@ -218,6 +221,7 @@ void AliGenDPMjet::Generate()
   Int_t kf, ks, imo;
   kf = 0;
   fTrials = 0;
+  fNprimaries = 0;
   //  Set collision vertex position 
   if (fVertexSmear == kPerEvent) Vertex();
   
@@ -411,6 +415,7 @@ void AliGenDPMjet::Generate()
                        polar[0], polar[1], polar[2],
                        kPNoProcess, nt, 1., ks);
              KeepTrack(nt);
+             fNprimaries++;
              newPos[i] = nt;
          } // if selected
       } // particle loop
@@ -497,7 +502,7 @@ Bool_t AliGenDPMjet::Stable(TParticle*  particle)
 void AliGenDPMjet::MakeHeader()
 {
 // Builds the event header, to be called after each event
-    fHeader.SetNProduced(fDPMjet->GetNumStablePc());
+    fHeader.SetNProduced(fNprimaries);
     fHeader.SetImpactParameter(fDPMjet->GetBImpac());
     fHeader.SetTotalEnergy(fDPMjet->GetTotEnergy());
     fHeader.SetParticipants(fDPMjet->GetProjParticipants(), 
index 5c6e726..499da27 100644 (file)
@@ -83,6 +83,7 @@ class AliGenDPMjet : public AliGenMC
     Int_t         fSelectAll;      // Flag to write the full event
     Int_t         fFlavor;         // Selected particle flavor 4: charm+beauty 5: beauty
     Int_t         fTrials;         // Number of trials
+    Int_t         fNprimaries;     // Number of generated particles
     Int_t         fSpectators;     // put spectators on stack
     Int_t        fSpecn;          // Num. of spectator neutrons
     Int_t        fSpecp;          // Num. of spectator protons