/*
$Log$
+Revision 1.23 2001/07/13 17:30:22 morsch
+Derive from AliGenMC.
+
Revision 1.22 2001/06/11 13:09:23 morsch
- Store cross-Section and number of binary collisions as a function of impact parameter
- Pass AliGenHijingEventHeader to gAlice.
#include "AliGenHijing.h"
#include "AliGenHijingEventHeader.h"
#include "AliRun.h"
+#include "AliPDG.h"
#include <TArrayI.h>
#include <TParticle.h>
while(1)
{
// Generate one event
+// --------------------------------------------------------------------------
+ fSpecn = 0;
+ fSpecp = 0;
+// --------------------------------------------------------------------------
fHijing->GenerateEvent();
fTrials++;
fHijing->ImportParticles(particles,"All");
TParticle * iparticle = (TParticle *) particles->At(i);
// Is this a final state particle ?
if (!Stable(iparticle)) continue;
-//
+
Bool_t hasMother = (iparticle->GetFirstMother() >=0);
Bool_t selected = kTRUE;
kf = iparticle->GetPdgCode();
ks = iparticle->GetStatusCode();
+// --------------------------------------------------------------------------
+// Count spectator neutrons and protons
+ if(ks == 0 || ks == 1 || ks == 10 || ks == 11){
+ if(kf == kNeutron) fSpecn += 1;
+ if(kf == kProton) fSpecp += 1;
+ }
+// --------------------------------------------------------------------------
+//
if (!fSelectAll) {
selected = KinematicSelection(iparticle,0)&&SelectFlavor(kf);
if (!fSpectators && selected) selected = (ks != 0 && ks != 1 && ks != 10
fHijing->GetN01(),
fHijing->GetN10(),
fHijing->GetN11());
+ ((AliGenHijingEventHeader*) header)->SetSpectators(fSpecn, fSpecp);
gAlice->SetGenEventHeader(header);
}
Int_t fSpectators; // put spectators on stack
TGraph* fDsigmaDb; // dSigma/db for the system
TGraph* fDnDb; // dNBinaryCollisions/db
+// ZDC proposal (by Chiara) to store num. of SPECTATORS protons and neutrons
+ Int_t fSpecn; // Num. of spectator neutrons
+ Int_t fSpecp; // Num. of spectator protons
+
private:
// adjust the weight from kinematic cuts
void AdjustWeights();
Float_t TotalEnergy() {return fTotalEnergy;}
Int_t HardScatters() {return fNHardScatters;}
Int_t ProjectileParticipants() {return fNProjectileParticipants;}
- Int_t TargetParticipants() {return fNTargetParticipants;}
+ Int_t TargetParticipants() {return fNTargetParticipants;}
+ Int_t Spectatorsn() {return fSpecn;}
+ Int_t Spectatorsp() {return fSpecp;}
Int_t NN() {return fNNColl;}
Int_t NNw() {return fNNwColl;}
Int_t NwN() {return fNwNColl;}
{fNProjectileParticipants=np, fNTargetParticipants=nt;}
void SetCollisions(Int_t nn, Int_t nnw, Int_t nwn, Int_t nwnw)
{fNNColl=nn, fNNwColl=nnw, fNwNColl=nwn, fNwNwColl=nwnw;}
+ void SetSpectators(Int_t nspecn, Int_t nspecp)
+ {fSpecn=nspecn, fSpecp=nspecp;}
protected:
Float_t fTotalEnergy; // Total energy of produced particles
Int_t fNNwColl; // Number of N-Nwounded collisions
Int_t fNwNColl; // Number of Nwounded-N collisons
Int_t fNwNwColl; // Number of Nwounded-Nwounded collisions
+ Int_t fSpecn; // Number of spectators neutrons
+ Int_t fSpecp; // Number of spectators protons
ClassDef(AliGenHijingEventHeader,1) // Event header for hijing event