From eb342d2dfc0bbda5c1f1a7e54f4b831973231b76 Mon Sep 17 00:00:00 2001 From: morsch Date: Thu, 15 Jun 2000 14:15:05 +0000 Subject: [PATCH] Add possibility for heavy flavor selection: charm and beauty. --- EVGEN/AliGenHijing.cxx | 39 ++++++++++++++++++++++++++------------- EVGEN/AliGenHijing.h | 10 +++++----- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/EVGEN/AliGenHijing.cxx b/EVGEN/AliGenHijing.cxx index 073da1c1bc6..e82373349a3 100644 --- a/EVGEN/AliGenHijing.cxx +++ b/EVGEN/AliGenHijing.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.1 2000/06/09 20:47:27 morsch +AliGenerator interface class to HIJING using THijing (test version) + */ #include "AliGenHijing.h" @@ -48,6 +51,7 @@ AliGenHijing::AliGenHijing(Int_t npart) fDecaysOff=1; fEvaluate=0; fSelectAll=0; + fFlavor=0; } AliGenHijing::AliGenHijing(const AliGenHijing & Hijing) @@ -96,7 +100,8 @@ void AliGenHijing::Generate() 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; @@ -126,9 +131,9 @@ void AliGenHijing::Generate() if (np == 0 ) continue; Int_t i; Int_t * newPos = new Int_t[np]; - for (i = 0; iAt(i); Bool_t hasMother = (iparticle->GetFirstMother() >=0); @@ -136,12 +141,9 @@ void AliGenHijing::Generate() 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 @@ -308,13 +310,10 @@ Bool_t AliGenHijing::DaughtersSelection(TParticle* iparticle, TClonesArray* part 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 { @@ -325,6 +324,20 @@ Bool_t AliGenHijing::DaughtersSelection(TParticle* iparticle, TClonesArray* part } +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) { diff --git a/EVGEN/AliGenHijing.h b/EVGEN/AliGenHijing.h index 23e4c896186..666c5764d54 100644 --- a/EVGEN/AliGenHijing.h +++ b/EVGEN/AliGenHijing.h @@ -45,13 +45,15 @@ class AliGenHijing : public AliGenerator 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 @@ -69,9 +71,7 @@ class AliGenHijing : public AliGenerator 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 -- 2.31.1