/*
$Log$
+Revision 1.12 2000/10/20 13:38:38 morsch
+Debug printouts commented.
+
+Revision 1.11 2000/10/20 13:22:26 morsch
+- skip particle type 92 (string)
+- Charmed and beauty baryions (5122, 4122) are considered as stable consistent with
+ mesons.
+
+Revision 1.10 2000/10/17 15:10:20 morsch
+Write first all the parent particles to the stack and then the final state particles.
+
+Revision 1.9 2000/10/17 13:38:59 morsch
+Protection against division by zero in EvaluateCrossSection() and KinematicSelection(..) (FCA)
+
Revision 1.8 2000/10/17 12:46:31 morsch
Protect EvaluateCrossSections() against division by zero.
fEvaluate=0;
fSelectAll=0;
fFlavor=0;
+ fSpectators=1;
}
AliGenHijing::AliGenHijing(const AliGenHijing & Hijing)
if (np == 0 ) continue;
Int_t i;
Int_t * newPos = new Int_t[np];
+
for (i = 0; i<np; i++) *(newPos+i)=i;
-
+//
+// First write parent particles
+//
+
for (i = 0; i<np; i++) {
TParticle * iparticle = (TParticle *) particles->At(i);
-
+// Is this a parent particle ?
+ if (Stable(iparticle)) continue;
+//
Bool_t hasMother = (iparticle->GetFirstMother() >=0);
- Bool_t hasDaughter = (iparticle->GetFirstDaughter() >=0);
Bool_t selected = kTRUE;
Bool_t hasSelectedDaughters = kFALSE;
-
-
+
+
kf = iparticle->GetPdgCode();
+ ks = iparticle->GetStatusCode();
+ if (kf == 92) continue;
+
if (!fSelectAll) selected = KinematicSelection(iparticle)&&SelectFlavor(kf);
- if (hasDaughter && !selected) hasSelectedDaughters = DaughtersSelection(iparticle, particles);
+ 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 (selected || hasSelectedDaughters) {
nc++;
- ks = iparticle->GetStatusCode();
p[0]=iparticle->Px();
p[1]=iparticle->Py();
p[2]=iparticle->Pz();
imo=-1;
if (hasMother) {
imo=iparticle->GetFirstMother();
- imo=*(newPos+imo);
+ TParticle* mother= (TParticle *) particles->At(imo);
+ imo = (mother->GetPdgCode() != 92) ? imo=*(newPos+imo) : -1;
}
-
-// printf("\n selected iparent %d %d %d \n",i, kf, imo);
- if (hasDaughter) {
- gAlice->SetTrack(0,imo,kf,p,origin,polar,
- tof,"Primary",nt);
- } else {
- gAlice->SetTrack(fTrackIt,imo,kf,p,origin,polar,
- tof,"Secondary",nt);
+// Put particle on the stack ...
+// printf("\n set track mother: %d %d %d %d %d %d ",i,imo, kf, nt+1, selected, hasSelectedDaughters);
+
+ gAlice->SetTrack(0,imo,kf,p,origin,polar,
+ tof,"Primary",nt);
+// ... and keep it there
+ gAlice->KeepTrack(nt);
+//
+ *(newPos+i)=nt;
+ } // selected
+ } // particle loop parents
+//
+// Now write the final state particles
+//
+
+ for (i = 0; i<np; i++) {
+ 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();
+ if (!fSelectAll) {
+ selected = KinematicSelection(iparticle)&&SelectFlavor(kf);
+ if (!fSpectators && selected) selected = (ks != 0 && ks != 10);
+ }
+//
+// Put particle on the stack if selected
+//
+ if (selected) {
+ nc++;
+ p[0]=iparticle->Px();
+ p[1]=iparticle->Py();
+ p[2]=iparticle->Pz();
+ origin[0]=origin0[0]+iparticle->Vx()/10;
+ origin[1]=origin0[1]+iparticle->Vy()/10;
+ origin[2]=origin0[2]+iparticle->Vz()/10;
+ tof=kconv*iparticle->T();
+ imo=-1;
+
+ if (hasMother) {
+ imo=iparticle->GetFirstMother();
+ TParticle* mother= (TParticle *) particles->At(imo);
+ imo = (mother->GetPdgCode() != 92) ? imo=*(newPos+imo) : -1;
}
+// Put particle on the stack
+ gAlice->SetTrack(fTrackIt,imo,kf,p,origin,polar,
+ tof,"Secondary",nt);
+
+// printf("\n set track final: %d %d %d",imo, kf, nt);
+ gAlice->KeepTrack(nt);
*(newPos+i)=nt;
} // selected
- } // particle loop
+ } // particle loop final state
+
delete newPos;
+
printf("\n I've put %i particles on the stack \n",nc);
if (nc > 0) {
jev+=nc;
for (i=imin; i<= imax; i++){
TParticle * jparticle = (TParticle *) particles->At(i);
Int_t ip=jparticle->GetPdgCode();
- if (KinematicSelection(jparticle)&&SelectFlavor(ip)) {selected=kTRUE; break;}
+ if (KinematicSelection(jparticle)&&SelectFlavor(ip)) {
+ selected=kTRUE; break;
+ }
if (DaughtersSelection(jparticle, particles)) {selected=kTRUE; break; }
}
} else {
Int_t ifl=TMath::Abs(pid/100);
if (ifl > 10) ifl/=10;
- return ((fFlavor==4 && (ifl==4 || ifl==5)) ||
- (fFlavor==5 && ifl==5));
+ return (fFlavor == ifl);
+}
+Bool_t AliGenHijing::Stable(TParticle* particle)
+{
+ Int_t kf = TMath::Abs(particle->GetPdgCode());
+
+ if ( (particle->GetFirstDaughter() < 0 ) || (kf == 1000*fFlavor+122))
+
+ {
+ return kTRUE;
+ } else {
+ return kFALSE;
+ }
}
void AliGenHijing::MakeHeader()
// Assignment operator
return *this;
}
+
+
+
+
+
+
+
+
+
+
+
+
+