/*
$Log$
+Revision 1.1 2000/06/09 20:47:27 morsch
+AliGenerator interface class to HIJING using THijing (test version)
+
*/
#include "AliGenHijing.h"
fDecaysOff=1;
fEvaluate=0;
fSelectAll=0;
+ fFlavor=0;
}
AliGenHijing::AliGenHijing(const AliGenHijing & Hijing)
Int_t nt=0;
Int_t jev=0;
Int_t j, kf, ks, imo;
-
+ kf=0;
+
if(!particles) particles=new TClonesArray("TParticle",10000);
fTrials=0;
if (np == 0 ) continue;
Int_t i;
Int_t * newPos = new Int_t[np];
- for (i = 0; i<np-1; i++) *(newPos+i)=i;
+ for (i = 0; i<np; i++) *(newPos+i)=i;
- for (i = 0; i<np-1; i++) {
+ for (i = 0; i<np; i++) {
TParticle * iparticle = (TParticle *) particles->At(i);
Bool_t hasMother = (iparticle->GetFirstMother() >=0);
Bool_t selected = kTRUE;
Bool_t hasSelectedDaughters = kFALSE;
- if (!fSelectAll) selected = KinematicSelection(iparticle);
- kf = iparticle->GetPdgCode();
-// Int_t id1=iparticle->GetFirstDaughter();
-// Int_t id2=iparticle->GetLastDaughter();
-// printf("\n particle %d %d %d %d %d %d\n",i, kf, id1, id2, hasDaughter, selected);
+ kf = iparticle->GetPdgCode();
+ if (!fSelectAll) selected = KinematicSelection(iparticle)&&SelectFlavor(kf);
if (hasDaughter && !selected) hasSelectedDaughters = DaughtersSelection(iparticle, particles);
//
// Put particle on the stack if it is either selected or it is the mother of at least one seleted particle
if (hasDaughters) {
imin=iparticle->GetFirstDaughter();
imax=iparticle->GetLastDaughter();
-// printf("\n Has daughters %d %d:", imin, imax);
for (i=imin; i<= imax; i++){
TParticle * jparticle = (TParticle *) particles->At(i);
-// Int_t ip=jparticle->GetPdgCode();
-// printf("\n consider daughter %d %d", i,ip);
-
- if (KinematicSelection(jparticle)) {selected=kTRUE; break;}
+ Int_t ip=jparticle->GetPdgCode();
+ if (KinematicSelection(jparticle)&&SelectFlavor(ip)) {selected=kTRUE; break;}
if (DaughtersSelection(jparticle, particles)) {selected=kTRUE; break; }
}
} else {
}
+Bool_t AliGenHijing::SelectFlavor(Int_t pid)
+{
+// Select flavor of particle
+// 0: all
+// 4: charm and beauty
+// 5: beauty
+ if (fFlavor == 0) return kTRUE;
+
+ Int_t ifl=TMath::Abs(pid/100);
+ if (ifl > 10) ifl/=10;
+ return ((fFlavor==4 && (ifl==4 || ifl==5)) ||
+ (fFlavor==5 && ifl==5));
+
+}
AliGenHijing& AliGenHijing::operator=(const AliGenHijing& rhs)
{
virtual void SetShadowing(Int_t flag=1) {fShadowing = flag;}
virtual void SetDecaysOff(Int_t flag=1) {fDecaysOff = flag;}
virtual void SetTrigger(Int_t flag=kNoTrigger) {fTrigger = flag;}
+ virtual void SetFlavor(Int_t flag=0) {fFlavor = flag;}
virtual void SetEvaluate(Int_t flag=0) {fEvaluate = flag;}
virtual void SetSelectAll(Int_t flag=0) {fSelectAll = flag;}
- AliGenHijing & operator=(const AliGenHijing & rhs);
+ AliGenHijing & operator=(const AliGenHijing & rhs);
// Physics Routines
virtual void EvaluateCrossSections();
-
+ protected:
+ Bool_t SelectFlavor(Int_t pid);
protected:
char *fFrame; // Reference frame
char *fProjectile; // Projectile
Int_t fTrigger; // Trigger type
Int_t fEvaluate; // Evaluate total and partial cross-sections
Int_t fSelectAll; // Flag to write the full event
-
- Process_t fProcess; // Process type
- StrucFunc_t fStrucFunc; // Structure Function
+ Int_t fFlavor; // Selected particle flavor 4: charm+beauty 5: beauty
Decay_t fForceDecay; // Decay channel are forced
Float_t fEnergyCMS; // Centre of mass energy
Float_t fKineBias; // Bias from kinematic selection