]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenHijing.cxx
Introducing new Rndm and QA classes
[u/mrichter/AliRoot.git] / EVGEN / AliGenHijing.cxx
index d5d7a44e05326e3d51a72263e988e43590c91cc9..ad9434f7b93c5d79fe1b8596428c7c622044a3bc 100644 (file)
 
 /*
 $Log$
+Revision 1.13  2000/11/09 17:40:27  morsch
+Possibility to select/unselect spectator protons and neutrons.
+Method SetSpectators(Int_t spect) added. (FCA, Ch. Oppedisano)
+
+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.
 
@@ -52,7 +64,6 @@ AliGenerator interface class to HIJING using THijing (test version)
 #include "AliGenHijing.h"
 #include "AliGenHijingEventHeader.h"
 #include "AliRun.h"
-#include "AliMC.h"
 
 #include <TArrayI.h>
 #include <TParticle.h>
@@ -83,6 +94,7 @@ AliGenHijing::AliGenHijing(Int_t npart)
     fEvaluate=0;
     fSelectAll=0;
     fFlavor=0;
+    fSpectators=1;
 }
 
 AliGenHijing::AliGenHijing(const AliGenHijing & Hijing)
@@ -146,7 +158,7 @@ void AliGenHijing::Generate()
     fTrials=0;
     for (j=0;j<3;j++) origin0[j]=fOrigin[j];
     if(fVertexSmear==kPerEvent) {
-       gMC->Rndm(random,6);
+       Rndm(random,6);
        for (j=0;j<3;j++) {
            origin0[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
                TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
@@ -211,10 +223,10 @@ void AliGenHijing::Generate()
                    imo = (mother->GetPdgCode() != 92) ? imo=*(newPos+imo) : -1;
                }
 // Put particle on the stack ... 
-               printf("\n set track mother: %d %d %d %d %d %d ",i,imo, kf, nt+1, selected, hasSelectedDaughters);
+//             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);
+                                tof,kPPrimary,nt);
 // ... and keep it there
                gAlice->KeepTrack(nt);
 //
@@ -233,13 +245,16 @@ void AliGenHijing::Generate()
            Bool_t  hasMother            =  (iparticle->GetFirstMother()   >=0);
            Bool_t  selected             =  kTRUE;
            kf        = iparticle->GetPdgCode();
-           if (!fSelectAll) selected = KinematicSelection(iparticle)&&SelectFlavor(kf);
+           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++;
-               ks        = iparticle->GetStatusCode();
                p[0]=iparticle->Px();
                p[1]=iparticle->Py();
                p[2]=iparticle->Pz();
@@ -256,9 +271,10 @@ void AliGenHijing::Generate()
                }
 // Put particle on the stack
                gAlice->SetTrack(fTrackIt,imo,kf,p,origin,polar,
-                                tof,"Secondary",nt);
+                                tof,kPNoProcess,nt);
+//                              tof,"Secondary",nt);
 
-               printf("\n set track final: %d %d %d",imo, kf, nt);
+//             printf("\n set track final: %d %d %d",imo, kf, nt);
                gAlice->KeepTrack(nt);
                *(newPos+i)=nt;
            } // selected
@@ -407,7 +423,6 @@ Bool_t AliGenHijing::DaughtersSelection(TParticle* iparticle, TClonesArray* part
            TParticle *  jparticle       = (TParticle *) particles->At(i);      
            Int_t ip=jparticle->GetPdgCode();
            if (KinematicSelection(jparticle)&&SelectFlavor(ip)) {
-               printf("\n selected ip %d %d %d ", ip, imin, imax);
                selected=kTRUE; break;
            }
            if (DaughtersSelection(jparticle, particles)) {selected=kTRUE; break; }
@@ -470,6 +485,30 @@ AliGenHijing& AliGenHijing::operator=(const  AliGenHijing& rhs)
     return *this;
 }
 
+#ifndef WIN32
+# define rluget_hijing rluget_hijing_
+# define rluset_hijing rluset_hijing_
+# define rlu_hijing    rlu_hijing_
+# define type_of_call
+#else
+# define rluget_hijing RLUGET_HIJING
+# define rluset_hijing RLUSET_HIJING
+# define rlu_hijing    RLU_HIJING
+# define type_of_call _stdcall
+#endif
+
+
+extern "C" {
+  void type_of_call rluget_hijing(Int_t & /*lfn*/, Int_t & /*move*/)
+  {printf("Dummy version of rluget_hijing reached\n");}
+
+  void type_of_call rluset_hijing(Int_t & /*lfn*/, Int_t & /*move*/)
+  {printf("Dummy version of rluset_hijing reached\n");}
+
+  Double_t type_of_call rlu_hijing(Int_t & /*idum*/) 
+  {return sRandom->Rndm();}
+}
+