This commit was generated by cvs2svn to compensate for changes in r7643,
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 May 2003 09:40:32 +0000 (09:40 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 May 2003 09:40:32 +0000 (09:40 +0000)
which included commits to RCS files with non-trunk default branches.

TDPMjet/AliGenDPMjet.cxx [new file with mode: 0644]
TDPMjet/AliGenDPMjet.h [new file with mode: 0644]
TDPMjet/AliGenDPMjetEventHeader.cxx [new file with mode: 0644]
TDPMjet/AliGenDPMjetEventHeader.h [new file with mode: 0644]
TDPMjet/AliIonPDGCodes.cxx [new file with mode: 0644]
TDPMjet/AliIonPDGCodes.h [new file with mode: 0644]
TDPMjet/DPMcommon.h [new file with mode: 0644]
TDPMjet/TDPMjet.cxx [new file with mode: 0644]
TDPMjet/TDPMjet.h [new file with mode: 0644]
TDPMjet/TDPMjetLinkDef.h [new file with mode: 0644]
TDPMjet/libTDPMjet.pkg [new file with mode: 0644]

diff --git a/TDPMjet/AliGenDPMjet.cxx b/TDPMjet/AliGenDPMjet.cxx
new file mode 100644 (file)
index 0000000..4e9cfc9
--- /dev/null
@@ -0,0 +1,588 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+// Generator using DPMJET as an external generator
+// The main DPMJET options are accessable for the user through this interface.
+// Uses the TDPMjet implementation of TGenerator.
+
+#include <TDPMjet.h>
+#include <TRandom.h>
+#include <TArrayI.h>
+#include <TParticle.h>
+#include <TGraph.h>
+#include <TDatabasePDG.h>
+#include <TParticlePDG.h>
+#include <TParticleClassPDG.h>
+#include <TPDGCode.h>
+#include <TLorentzVector.h>
+
+#include "AliGenDPMjet.h"
+#include "AliGenDPMjetEventHeader.h"
+#include "AliPythia.h"
+#include "AliRun.h"
+
+
+ ClassImp(AliGenDPMjet)
+
+
+//______________________________________________________________________________
+AliGenDPMjet::AliGenDPMjet()
+                 :AliGenMC()
+{
+// Constructor
+    fParticles = 0;
+    fDPMjet = 0;
+}
+
+
+//______________________________________________________________________________
+AliGenDPMjet::AliGenDPMjet(Int_t npart)
+    :AliGenMC(npart)
+{
+// Default PbPb collisions at 5. 5 TeV
+//
+    fName = "DPMJET";
+    fTitle= "Particle Generator using DPMJET";
+
+    SetBeamEnergy();
+    SetEnergyCMS();
+    SetTarget();
+    SetProjectile();
+    SetCentral();
+    SetImpactParameterRange();
+    SetBoostLHC();
+    
+    fKeep       =  0;
+    fDecaysOff  =  1;
+    fEvaluate   =  0;
+    fSelectAll  =  0;
+    fFlavor     =  0;
+    fSpectators =  1;
+    fEventVertex.Set(3);
+        
+    fParticles = new TClonesArray("TParticle",10000);    
+
+    // Set random number generator   
+    if (!sRandom) sRandom = fRandom;
+    fDPMjet = 0;
+    // Instance AliPythia
+    AliPythia::Instance(); 
+            
+}
+
+
+//______________________________________________________________________________
+AliGenDPMjet::~AliGenDPMjet()
+{
+// Destructor
+    delete fParticles;
+}
+
+
+//______________________________________________________________________________
+void AliGenDPMjet::Init()
+{
+// Initialization
+    
+    SetMC(new TDPMjet(fAProjectile, fZProjectile, fATarget, fZTarget, 
+                     fBeamEn,fEnergyCMS));
+
+    fDPMjet=(TDPMjet*) fgMCEvGen;
+    //
+    // **** Flag to force central production
+    // fICentr=1. central production forced 
+    // fICentr<0 && fICentr>-100 -> bmin = fMinImpactParam, bmax = fMaxImpactParam       
+    // fICentr<-99 -> fraction of x-sec. = XSFRAC                
+    // fICentr=-1. -> evaporation/fzc suppressed                 
+    // fICentr<-1. -> evaporation/fzc suppressed                 
+    fDPMjet->SetfFCentr(fICentr);  
+    fDPMjet->SetbRange(fMinImpactParam,fMaxImpactParam); 
+    
+//
+//  Initialize DPMjet  
+//    
+    fDPMjet->Initialize();
+    //if (fEvaluate) EvaluateCrossSections();
+
+    //  Initialize AliIonPDGCodes to define ion PDG codes
+    /*AliIonPDGCodes *PDGcodes = new AliIonPDGCodes();
+    PDGcodes->AddParticlesToPdgDataBase();
+    PDGcodes->MapPDGGEant3Codes();*/
+}
+
+
+//______________________________________________________________________________
+void AliGenDPMjet::Generate()
+{
+// Generate one event
+
+  Float_t polar[3]    =   {0,0,0};
+  Float_t origin[3]   =   {0,0,0};
+  Float_t origin0[3]  =   {0,0,0};
+  Float_t p[3], random[6];
+  Float_t tof;
+
+//  converts from mm/c to s
+  const Float_t kconv = 0.001/2.999792458e8;
+  Int_t nt  = 0;
+  Int_t jev = 0;
+  Int_t j, kf, ks, imo;
+  kf = 0;
+        
+  fTrials = 0;
+  for (j = 0;j < 3; j++) origin0[j] = fOrigin[j];
+  if(fVertexSmear == kPerEvent) {
+      Float_t dv[3];
+      dv[2] = 1.e10;
+      while(TMath::Abs(dv[2])>fCutVertexZ*fOsigma[2]) {
+         Rndm(random,6);
+         for (j=0; j < 3; j++) {
+             dv[j] = fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
+                 TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
+         }
+      }
+      for (j=0; j < 3; j++) origin0[j] += dv[j];
+  }
+  
+  while(1)
+  {
+//    Generate one event
+// --------------------------------------------------------------------------
+      fSpecn = 0;  
+      fSpecp = 0;
+// --------------------------------------------------------------------------
+      fDPMjet->GenerateEvent();
+      fTrials++;
+
+      fDPMjet->ImportParticles(fParticles,"All");      
+      if (fLHC) Boost();
+
+      // Temporaneo
+      fGenImpPar = fDPMjet->GetBImpac();
+      
+      Int_t np = fParticles->GetEntriesFast();
+      printf("\n **************************************************%d\n",np);
+      Int_t nc=0;
+      if (np==0) continue;
+      Int_t i;
+      Int_t* newPos     = new Int_t[np];
+      Int_t* pSelected  = new Int_t[np];
+
+      for (i = 0; i<np; i++) {
+         newPos[i]    = i;
+         pSelected[i] = 0;
+      }
+      
+//      Get event vertex
+      
+      //TParticle *iparticle = (TParticle*) fParticles->At(0);
+      fEventVertex[0] = origin0[0];
+      fEventVertex[1] = origin0[1];    
+      fEventVertex[2] = origin0[2];
+      //for(int jj=0; jj<3; jj++) printf("     fEventVertex[%d] = %f\n",jj,fEventVertex[jj]);
+      
+//      First select parent particles
+
+      for (i = 0; i<np; i++) {
+         TParticle *iparticle = (TParticle *) fParticles->At(i);
+          //if(!iparticle) iparticle->Print("");
+
+// Is this a parent particle ?
+
+         if (Stable(iparticle)) continue;
+
+         Bool_t  selected             =  kTRUE;
+         Bool_t  hasSelectedDaughters =  kFALSE;
+         
+         kf = iparticle->GetPdgCode();
+         if (kf == 92) continue;
+         ks = iparticle->GetStatusCode();
+// No initial state partons
+          if (ks==21) continue;
+           
+         if (!fSelectAll) selected = KinematicSelection(iparticle, 0) && 
+                              SelectFlavor(kf);
+         hasSelectedDaughters = DaughtersSelection(iparticle);
+
+// 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++;
+             pSelected[i] = 1;
+         } // selected
+      } // particle loop parents
+
+// Now select the final state particles
+
+
+      for (i=0; i<np; i++) {
+         TParticle *iparticle = (TParticle *) fParticles->At(i);
+         //if(!iparticle) printf("     i = %d -> iparticle==0\n",i);
+
+// Is this a final state particle ?
+
+         if (!Stable(iparticle)) continue;
+      
+         Bool_t  selected =  kTRUE;
+         kf = iparticle->GetPdgCode();
+         ks = iparticle->GetStatusCode();
+
+// --------------------------------------------------------------------------
+// Count spectator neutrons and protons (ks == 13, 14)
+         if(ks == 13 || ks == 14){
+             if(kf == kNeutron) fSpecn += 1;
+             if(kf == kProton)  fSpecp += 1;
+         }
+// --------------------------------------------------------------------------
+
+         if (!fSelectAll) {
+             selected = KinematicSelection(iparticle,0)&&SelectFlavor(kf);
+             if (!fSpectators && selected) selected = (ks == 13 || ks == 14);
+         }
+
+// Put particle on the stack if selected
+
+         if (selected) {
+             nc++;
+             pSelected[i] = 1;
+         } // selected
+      } // particle loop final state
+
+// Write particles to stack
+
+      for (i = 0; i<np; i++) {
+         TParticle *  iparticle = (TParticle *) fParticles->At(i);
+         Bool_t  hasMother   = (iparticle->GetFirstMother()>=0);
+         Bool_t  hasDaughter = (iparticle->GetFirstDaughter()>=0);
+
+         if (pSelected[i]) {
+             
+             kf   = iparticle->GetPdgCode();         
+             if(kf==99999) continue;
+             ks   = iparticle->GetStatusCode();              
+             
+             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;
+             TParticle* mother = 0;
+             if (hasMother) {
+                 imo = iparticle->GetFirstMother();
+                 mother = (TParticle *) fParticles->At(imo);
+                 imo = (mother->GetPdgCode() != 92) ? imo = newPos[imo] : -1;
+             } // if has mother   
+
+             // --- Nucleons and photons from nucleus evaporation
+             //if(ks==-1 && (kf==2212 || kf==2112 || kf==22)) imo=-1;
+             
+             // --- Offset added to nuclei, alpha particles, deuteron 
+             // --- and triton PDG codes (according to TGeant3 PDG codes)
+             //if(ks==1000 || ks==1001) kf += 10000000;
+             if(kf>10000) kf += 10000000;
+             
+             if(kf>10000 || ks==1000 || ks==1001) printf(" kf = %d, ks = %d imo = %d \n", kf,ks,imo);
+            
+
+             Bool_t tFlag = (fTrackIt && (ks == 1));
+             
+/*           // --- Particle NOT to be tracked:
+             // --- (1) chains from valence quark system (idhkk=99999)
+             // --- (2) quark, diquarks and gluons (idhkk=1->8,...,idhkk=21)
+             if(kf==99999 || kf==1 || kf==2 || kf==3 || kf==4 || kf==5 ||
+                kf==6 || kf==7 || kf==8 || kf==21 || 
+                kf==1103 || kf==2101 || kf==2103 || kf==2203 || kf==3101 || 
+                kf==3103 || kf==3201 || kf==3203 || kf==3303 || kf==4101 || 
+                kf==4103 || kf==4201 || kf==4203 || kf==4301 || kf==4303 || 
+                kf==4403 || kf==5101 || kf==5103 || kf==5201 || kf==5203 || 
+                kf==5301 || kf==5303 || kf==5401 || kf==5403 || kf==5503) 
+                tFlag=kFALSE;
+*/           
+             SetTrack(tFlag,imo,kf,p,origin,polar,tof,kPNoProcess,nt, 1., ks);
+             KeepTrack(nt);
+             newPos[i] = nt;
+         } // if selected
+      } // particle loop
+      delete[] newPos;
+      delete[] pSelected;
+      
+      printf("\n I've put %i particles on the stack \n",nc);
+      if (nc>0) {
+         jev += nc;
+         if (jev >= fNpart || fNpart == -1) {
+             printf("\n Trials: %i %i %i\n",fTrials, fNpart, jev);
+             break;
+         }
+         printf("\n Not breaking ### Trials: %i %i %i\n",fTrials, fNpart, jev);
+      }
+  } // event loop
+  MakeHeader();
+  SetHighWaterMark(nt);
+}
+
+
+//______________________________________________________________________________
+void AliGenDPMjet::KeepFullEvent()
+{
+    fKeep=1;
+}
+
+
+//______________________________________________________________________________
+/*void AliGenDPMjet::EvaluateCrossSections()
+{
+//     Glauber Calculation of geometrical x-section
+//
+    Float_t xTot       = 0.;          // barn
+    Float_t xTotHard   = 0.;          // barn 
+    Float_t xPart      = 0.;          // barn
+    Float_t xPartHard  = 0.;          // barn 
+    Float_t sigmaHard  = 0.1;         // mbarn
+    Float_t bMin       = 0.;
+    Float_t bMax       = fDPMjet->GetProjRadius()+fDPMjet->GetTargRadius();
+    const Float_t kdib = 0.2;
+    Int_t   kMax       = Int_t((bMax-bMin)/kdib)+1;
+
+
+    printf("\n Projectile Radius (fm): %f \n",fDPMjet->GetProjRadius());
+    printf("\n Target     Radius (fm): %f \n",fDPMjet->GetTargRadius());    
+    Int_t i;
+    Float_t oldvalue= 0.;
+
+    Float_t* b   = new Float_t[kMax];
+    Float_t* si1 = new Float_t[kMax];    
+    Float_t* si2 = new Float_t[kMax];    
+    
+    for (i = 0; i < kMax; i++)
+    {
+       Float_t xb  = bMin+i*kdib;
+       Float_t ov;
+       ov=fDPMjet->Profile(xb);
+       // ATT!->Manca la x-sec anel. nucleone-nucleone
+       Float_t gb  =  2.*0.01*fDPMjet->TMath::Pi()*kdib*xb*(1.-TMath::Exp(-fDPMjet->GetXSFrac()*ov));
+       Float_t gbh =  2.*0.01*fDPMjet->TMath::Pi()*kdib*xb*sigmaHard*ov;
+       xTot+=gb;
+       xTotHard += gbh;
+       if (xb > fMinImpactParam && xb < fMaxImpactParam)
+       {
+           xPart += gb;
+           xPartHard += gbh;
+       }
+       
+       if(oldvalue) if ((xTot-oldvalue)/oldvalue<0.0001) break;
+       oldvalue = xTot;
+       printf("\n Total cross section (barn): %d %f %f \n",i, xb, xTot);
+       printf("\n Hard  cross section (barn): %d %f %f \n\n",i, xb, xTotHard);
+       if (i>0) {
+           si1[i] = gb/kdib;
+           si2[i] = gbh/gb;
+           b[i]  = xb;
+       }
+    }
+
+    printf("\n Total cross section (barn): %f \n",xTot);
+    printf("\n Hard  cross section (barn): %f \n \n",xTotHard);
+    printf("\n Partial       cross section (barn): %f %f \n",xPart, xPart/xTot*100.);
+    printf("\n Partial  hard cross section (barn): %f %f \n",xPartHard, xPartHard/xTotHard*100.);
+
+//  Store result as a graph
+    b[0] = 0;
+    si1[0] = 0;
+    si2[0]=si2[1];
+    
+    fDsigmaDb  = new TGraph(i, b, si1);
+    fDnDb      = new TGraph(i, b, si2);
+}*/
+
+
+//______________________________________________________________________________
+Bool_t AliGenDPMjet::DaughtersSelection(TParticle* iparticle)
+{
+//
+// Looks recursively if one of the daughters has been selected
+//
+//    printf("\n Consider daughters %d:",iparticle->GetPdgCode());
+    Int_t imin = -1;
+    Int_t imax = -1;
+    Int_t i;
+    Bool_t hasDaughters = (iparticle->GetFirstDaughter() >=0);
+    Bool_t selected = kFALSE;
+    if (hasDaughters) {
+       imin = iparticle->GetFirstDaughter();
+       imax = iparticle->GetLastDaughter();       
+       for (i = imin; i <= imax; i++){
+           TParticle *  jparticle = (TParticle *) fParticles->At(i);   
+           Int_t ip = jparticle->GetPdgCode();
+           if (KinematicSelection(jparticle,0)&&SelectFlavor(ip)) {
+               selected=kTRUE; break;
+           }
+           if (DaughtersSelection(jparticle)) {selected=kTRUE; break; }
+       }
+    } else {
+       return kFALSE;
+    }
+    return selected;
+}
+
+
+
+//______________________________________________________________________________
+Bool_t AliGenDPMjet::SelectFlavor(Int_t pid)
+{
+// Select flavor of particle
+// 0: all
+// 4: charm and beauty
+// 5: beauty
+    Bool_t res = 0;
+    
+    if (fFlavor == 0) {
+       res = kTRUE;
+    } else {
+       Int_t ifl = TMath::Abs(pid/100);
+       if (ifl > 10) ifl/=10;
+       res = (fFlavor == ifl);
+    }
+//
+//  This part if gamma writing is inhibited
+    if (fNoGammas) 
+       res = res && (pid != kGamma && pid != kPi0);
+//
+    return res;
+}
+
+//______________________________________________________________________________
+Bool_t AliGenDPMjet::Stable(TParticle*  particle)
+{
+// Return true for a stable particle
+//
+    
+//    if (particle->GetFirstDaughter() < 0 ) return kTRUE;
+    if (particle->GetStatusCode() == 1) return kTRUE;
+    else return kFALSE;
+
+}
+
+
+
+//______________________________________________________________________________
+/*void AliGenDPMjet::Boost(TClonesArray* particles)
+{
+//
+// Boost cms into LHC lab frame
+//
+    Double_t dy    = - 0.5 * TMath::Log(Double_t(fZProjectile) * Double_t(fATarget) / 
+                                     (Double_t(fZTarget)    * Double_t(fAProjectile)));
+    Double_t beta  = TMath::TanH(dy);
+    Double_t gamma = 1./TMath::Sqrt(1.-beta*beta);
+    Double_t gb    = gamma * beta;
+
+    printf("\n Boosting particles to lab frame %f %f %f", dy, beta, gamma);
+    
+    Int_t i;
+    Int_t np = particles->GetEntriesFast();
+    for (i = 0; i < np; i++) 
+    {
+       TParticle* iparticle = (TParticle*) fParticles->At(i);
+
+       Double_t e   = iparticle->Energy();
+       Double_t px  = iparticle->Px();
+       Double_t py  = iparticle->Py();
+       Double_t pz  = iparticle->Pz();
+
+       Double_t eb  = gamma * e -      gb * pz;
+       Double_t pzb =   -gb * e +   gamma * pz;
+
+       iparticle->SetMomentum(px, py, pzb, eb);
+    }
+}*/
+
+
+
+//______________________________________________________________________________
+void AliGenDPMjet::MakeHeader()
+{
+// Builds the event header, to be called after each event
+    AliGenEventHeader* header = new AliGenDPMjetEventHeader("DPMJET");
+    ((AliGenDPMjetEventHeader*) header)->SetNProduced(fDPMjet->GetNumStablePc());
+    ((AliGenDPMjetEventHeader*) header)->SetImpactParameter(fDPMjet->GetBImpac());
+    ((AliGenDPMjetEventHeader*) header)->SetTotalEnergy(fDPMjet->GetTotEnergy());
+//    ((AliGenDPMjetEventHeader*) header)->SetWounded(fDPMjet->GetProjWounded(),
+//                                                 fDPMjet->GetTargWounded());
+    ((AliGenDPMjetEventHeader*) header)->SetParticipants(fDPMjet->GetfIp(), 
+                                                        fDPMjet->GetfIt());
+    /*((AliGenDPMjetEventHeader*) header)->SetCollisions(fDPMjet->GetN0(),
+                                                      fDPMjet->GetN01(),
+                                                      fDPMjet->GetN10(),
+                                                      fDPMjet->GetN11());*/
+    ((AliGenDPMjetEventHeader*) header)->SetSpectators(fSpecn, fSpecp);
+
+// Bookkeeping for kinematic bias
+    ((AliGenDPMjetEventHeader*) header)->SetTrials(fTrials);
+// Event Vertex
+    header->SetPrimaryVertex(fEventVertex);
+    gAlice->SetGenEventHeader(header);    
+}
+
+
+
+//______________________________________________________________________________
+AliGenDPMjet& AliGenDPMjet::operator=(const  AliGenDPMjet& rhs)
+{
+// Assignment operator
+    return *this;
+}
+
+
+
+//______________________________________________________________________________
+#ifndef WIN32
+# define dt_rndm_dpmjet   dt_rndm_dpmjet_
+# define dt_rndmst_dpmjet dt_rndmst_dpmjet_
+# define dt_rndmin_dpmjet dt_rndmin_dpmjet_
+# define dt_rndmou_dpmjet dt_rndmou_dpmjet_
+# define type_of_call
+#else
+# define dt_rndm_dpmjet   DT_RNDM_DPMJET
+# define dt_rndmst_dpmjet DT_RNDMST_DPMJET
+# define dt_rndmin_dpmjet DT_RNDMIN_DPMJET
+# define dt_rndmou_dpmjet DT_RNDMOU_DPMJET
+# define type_of_call _stdcall
+#endif
+
+
+extern "C" {
+  void type_of_call dt_rndmst_dpmjet(Int_t &, Int_t &, Int_t &, Int_t &)
+  {printf("Dummy version of dt_rndmst reached\n");}
+
+  void type_of_call dt_rndmin_dpmjet(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &)
+  {printf("Dummy version of dt_rndmin reached\n");}
+
+  void type_of_call dt_rndmou_dpmjet(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &)
+  {printf("Dummy version of dt_rndmou reached\n");}
+
+  Double_t type_of_call dt_rndm_dpmjet(Int_t &) 
+  {
+      Float_t r;
+      do r = sRandom->Rndm(); while(0 >= r || r >= 1);
+      return r;
+  }
+}
+
diff --git a/TDPMjet/AliGenDPMjet.h b/TDPMjet/AliGenDPMjet.h
new file mode 100644 (file)
index 0000000..966b46f
--- /dev/null
@@ -0,0 +1,121 @@
+#ifndef ALIGENDPMJET_H
+#define ALIGENDPMJET_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// Generator using DPMJET as an external generator
+// The main DPMJET options are accessable for the user through this interface.
+
+#include "AliGenMC.h"
+#include <TString.h>
+#include <TArrayI.h>
+
+class TDPMjet;
+class TArrayI;
+class TParticle;
+class TClonesArray;
+class TGraph;
+
+class AliGenDPMjet : public AliGenMC
+{
+
+ public:
+    AliGenDPMjet();
+    AliGenDPMjet(Int_t npart);
+    AliGenDPMjet(const AliGenDPMjet &Dpmjet){;}
+    virtual ~AliGenDPMjet(); 
+    virtual void    Generate();
+    virtual void    Init();
+
+    virtual void    SetBeamEnergy(Float_t energy=5400.) {fBeamEn=energy;}
+    virtual void    SetEnergyCMS(Float_t energy=5400.)   {fEnergyCMS=energy;}
+    virtual void    SetProjectile(Int_t a=208, Int_t z=82)
+                       {fAProjectile = a; fZProjectile = z;}    
+    virtual void    SetTarget(Int_t a=208, Int_t z=82)
+                       {fATarget = a; fZTarget = z;}    
+    virtual void    SetImpactParameterRange(Float_t bmin=0., Float_t bmax=16.)
+                       {fMinImpactParam=bmin; fMaxImpactParam=bmax;}
+    virtual void    SetCentral(Int_t icentr=-2) {fICentr = icentr;}
+    virtual void    KeepFullEvent();
+    virtual void    SetDecaysOff(Int_t flag=1)        {fDecaysOff  = 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;}
+    virtual void    SetSpectators(Int_t spects=1)     {fSpectators = spects;}
+    virtual void    SetBoostLHC(Int_t flag=0)         {fLHC        = flag;}
+           
+    virtual Float_t GetEnergyCMS() {return fEnergyCMS;}
+    virtual void    GetProjectile(Int_t& a, Int_t& z)
+                       {a = fAProjectile; z = fZProjectile;}    
+    virtual void    GetTarget(Int_t& a, Int_t& z)
+                       {a = fATarget; z = fZTarget;}    
+    virtual void    GetImpactParameterRange(Float_t& bmin, Float_t& bmax)
+                       {bmin = fMinImpactParam; bmax = fMaxImpactParam;}
+    virtual Int_t   GetSpectators(Int_t spects=1)        {return fSpectators;}
+    virtual Int_t   GetFlavor(Int_t flag=0)              {return fFlavor;}
+
+    // Temporeaneo!?!
+    virtual void    SetGenImpPar(Float_t bValue) {fGenImpPar=bValue;}
+    virtual Float_t GetGenImpPar() {return fGenImpPar;}
+    
+    /*virtual void EvaluateCrossSections();
+    virtual void Boost();
+    virtual TGraph* CrossSection()     {return fDsigmaDb;}
+    virtual TGraph* BinaryCollisions() {return fDnDb;}
+    */
+
+    AliGenDPMjet &  operator=(const AliGenDPMjet & rhs);
+
+ protected:
+    Bool_t SelectFlavor(Int_t pid);
+    void   MakeHeader();
+
+ protected:
+
+    Int_t         fAProjectile;    // Projectile A
+    Int_t         fZProjectile;    // Projectile Z
+    Int_t         fATarget;        // Target A
+    Int_t         fZTarget;        // Target Z
+    Float_t       fBeamEn;        // beam energy
+    Float_t       fEnergyCMS;      // Centre of mass energy
+    Float_t       fMinImpactParam; // minimum impact parameter
+    Float_t       fMaxImpactParam; // maximum impact parameter 
+    Int_t        fICentr;         // Flag to force central production
+    Float_t      fCrossSec;       // Fraction of x-section
+    Int_t         fKeep;           // Flag to keep full event information
+    Int_t         fDecaysOff;      // Flag to turn off decays of pi0, K_s, D, Lambda, sigma
+    Int_t         fEvaluate;       // Evaluate total and partial cross-sections
+    Int_t         fSelectAll;      // Flag to write the full event
+    Int_t         fFlavor;         // Selected particle flavor 4: charm+beauty 5: beauty
+    Int_t         fTrials;         // Number of trials
+    TArrayI       fParentSelect;   // Parent particles to be selected 
+    TArrayI       fChildSelect;    // Decay products to be selected
+    Float_t       fXsection;       // Cross-section
+    Int_t         fSpectators;     // put spectators on stack
+    Int_t        fSpecn;          // Num. of spectator neutrons
+    Int_t        fSpecp;          // Num. of spectator protons
+    TDPMjet      *fDPMjet;         // DPMjet
+    TGraph*       fDsigmaDb;       // dSigma/db for the system
+    TGraph*       fDnDb;           // dNBinaryCollisions/db
+    TClonesArray *fParticles;      // Particle List
+    Int_t         fNoGammas;       // Don't write gammas if flag "on"
+    Int_t         fLHC;            // Assume LHC as lab frame
+    // Temporaneo!
+    Float_t      fGenImpPar;      // GeneratedImpactParameter
+    
+ private:
+    // adjust the weight from kinematic cuts
+    void   AdjustWeights();
+    // check seleted daughters
+    Bool_t DaughtersSelection(TParticle* iparticle);
+    // check if stable
+    Bool_t Stable(TParticle*  particle);
+    
+    ClassDef(AliGenDPMjet,1) // AliGenerator interface to DPMJET
+};
+#endif
+
+
+
+
+
diff --git a/TDPMjet/AliGenDPMjetEventHeader.cxx b/TDPMjet/AliGenDPMjetEventHeader.cxx
new file mode 100644 (file)
index 0000000..b121ec3
--- /dev/null
@@ -0,0 +1,20 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+#include "AliGenDPMjetEventHeader.h"
+ClassImp(AliGenDPMjetEventHeader)
+
+
diff --git a/TDPMjet/AliGenDPMjetEventHeader.h b/TDPMjet/AliGenDPMjetEventHeader.h
new file mode 100644 (file)
index 0000000..3af7400
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef ALIGENDPMJETEVENTHEADER_H
+#define ALIGENDPMJETEVENTHEADER_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include <TLorentzVector.h>
+
+#include "AliGenEventHeader.h"
+#include "AliCollisionGeometry.h"
+
+class AliGenDPMjetEventHeader : public AliGenEventHeader, public AliCollisionGeometry
+{
+ public:
+
+  AliGenDPMjetEventHeader(const char* name){;}
+  AliGenDPMjetEventHeader(){;}
+  virtual ~AliGenDPMjetEventHeader() {}
+
+  // Getters
+  Float_t TotalEnergy()  {return fTotalEnergy;} 
+  Int_t   Trials() {return fTrials;}
+
+  // Setters
+  void SetTotalEnergy(Float_t energy)  {fTotalEnergy=energy;}
+  void SetTrials(Int_t trials) {fTrials = trials;}
+         
+protected:
+  Float_t fTotalEnergy;              // Total energy of produced particles
+  Int_t   fTrials;                   // Number of trials to fulfill trigger condition
+  
+  ClassDef(AliGenDPMjetEventHeader,1) // Event header for dpmjet event
+};
+
+#endif
diff --git a/TDPMjet/AliIonPDGCodes.cxx b/TDPMjet/AliIonPDGCodes.cxx
new file mode 100644 (file)
index 0000000..5e5a874
--- /dev/null
@@ -0,0 +1,176 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+#include <stdlib.h>
+
+#include <TROOT.h> 
+#include <TArrayI.h>
+#include <TParticle.h>
+#include <TDatabasePDG.h>
+#include <TParticlePDG.h>
+#include <TParticleClassPDG.h>
+#include <TPDGCode.h> 
+
+#include "AliIonPDGCodes.h" 
+
+ClassImp(AliIonPDGCodes)
+//______________________________________________________________________________
+AliIonPDGCodes::AliIonPDGCodes()
+{ 
+  fNIon = 200;
+  for(Int_t i=0; i<fNIon; i++) fPDGCode[i]=0;
+
+}
+
+//______________________________________________________________________________
+void AliIonPDGCodes::AddParticlesToPdgDataBase()
+{
+
+  // --- PDG codes for ions are added to the PDGDatabase
+  // --- PDGCode = Z*10000 + A + Offset(to avoid multiple definitions)
+  
+  TDatabasePDG *pdgDB = TDatabasePDG::Instance();
+  
+  const Int_t kOffset=10000000;
+  
+  pdgDB->AddParticle("H","H",1.00794,kTRUE,0,1,"Ion",1*10000+1*10+kOffset,-1,8);
+  //pdgDB->AddParticle("Helium","Helium",4.0026,kTRUE,0,2,"Ion",2*10000+4*10+kOffset,-1,8);
+  pdgDB->AddParticle("Li7","Li7",6.941,kTRUE,0,3,"Ion",3*10000+7*10+kOffset,-1,8);
+  pdgDB->AddParticle("Be","Be",9.01218,kTRUE,0,4,"Ion",4*10000+9*10+kOffset,-1,8);
+  pdgDB->AddParticle("B","B",10.811,kTRUE,0,5,"Ion",5*10000+11*10+kOffset,-1,8);
+  pdgDB->AddParticle("C12","C12",12.0107,kTRUE,0,6,"Ion",6*10000+12*10+kOffset,-1,8);
+  pdgDB->AddParticle("N","N",14.00674,kTRUE,0,7,"Ion",7*10000+14*10+kOffset,-1,8);
+  pdgDB->AddParticle("O","O",15.9994,kTRUE,0,8,"Ion",8*10000+16*10+kOffset,-1,8);
+  pdgDB->AddParticle("F","F",18.9984,kTRUE,0,9,"Ion",9*10000+19*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ne","Ne",20.1797,kTRUE,0,10,"Ion",10*10000+20*10+kOffset,-1,8);
+  pdgDB->AddParticle("Na","Na",22.98977,kTRUE,0,11,"Ion",11*10000+23*10+kOffset,-1,8);
+  pdgDB->AddParticle("Mg","Mg",24.3050,kTRUE,0,12,"Ion",12*10000+24*10+kOffset,-1,8);
+  pdgDB->AddParticle("Al","Al",26.9815,kTRUE,0,13,"Ion",13*10000+27*10+kOffset,-1,8);
+  pdgDB->AddParticle("Si","Si",28.0855,kTRUE,0,14,"Ion",14*10000+28*10+kOffset,-1,8);
+  pdgDB->AddParticle("P","P",30.97376,kTRUE,0,15,"Ion",15*10000+31*10+kOffset,-1,8);
+  pdgDB->AddParticle("S","S",32.066,kTRUE,0,16,"Ion",16*10000+32*10+kOffset,-1,8);
+  pdgDB->AddParticle("Cl","Cl",35.4527,kTRUE,0,17,"Ion",17*10000+35*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ar","Ar",39.948,kTRUE,0,18,"Ion",18*10000+40*10+kOffset,-1,8);
+  pdgDB->AddParticle("K","K",39.0983,kTRUE,0,19,"Ion",19*10000+39*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ca","Ca",40.078,kTRUE,0,20,"Ion",20*10000+40*10+kOffset,-1,8);
+  pdgDB->AddParticle("Sc","Sc",44.95591,kTRUE,0,21,"Ion",21*10000+45*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ti","Ti",47.867,kTRUE,0,22,"Ion",22*10000+48*10+kOffset,-1,8);
+  pdgDB->AddParticle("V","V",50.9415,kTRUE,0,23,"Ion",23*10000+51*10+kOffset,-1,8);
+  pdgDB->AddParticle("Cr","Cr",51.9961,kTRUE,0,24,"Ion",24*10000+52*10+kOffset,-1,8);
+  pdgDB->AddParticle("Mn","Mn",54.938,kTRUE,0,25,"Ion",25*10000+55*10+kOffset,-1,8);
+  pdgDB->AddParticle("Fe","Fe",55.845,kTRUE,0,26,"Ion",26*10000+56*10+kOffset,-1,8);
+  pdgDB->AddParticle("Co","Co",58.933200,kTRUE,0,27,"Ion",27*10000+59*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ni","Ni",58.6934,kTRUE,0,28,"Ion",28*10000+59*10+kOffset,-1,8);
+  pdgDB->AddParticle("Cu","Cu",63.546,kTRUE,0,29,"Ion",29*10000+63*10+kOffset,-1,8);
+  pdgDB->AddParticle("Zn","Zn",65.39,kTRUE,0,30,"Ion",30*10000+65*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ga","Ga",69.723,kTRUE,0,31,"Ion",31*10000+70*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ge","Ge",72.61,kTRUE,0,32,"Ion",32*10000+73*10+kOffset,-1,8);
+  pdgDB->AddParticle("As","As",74.9216,kTRUE,0,33,"Ion",33*10000+75*10+kOffset,-1,8);
+  pdgDB->AddParticle("Se","Se",78.96,kTRUE,0,34,"Ion",34*10000+79*10+kOffset,-1,8);
+  pdgDB->AddParticle("Br","Br",79.904,kTRUE,0,35,"Ion",35*10000+80*10+kOffset,-1,8);
+  pdgDB->AddParticle("Kr","Kr",83.80,kTRUE,0,36,"Ion",36*10000+84*10+kOffset,-1,8);
+  pdgDB->AddParticle("Rb","Rb",85.4678,kTRUE,0,37,"Ion",37*10000+85*10+kOffset,-1,8);
+  pdgDB->AddParticle("Sr","Sr",87.62,kTRUE,0,38,"Ion",38*10000+88*10+kOffset,-1,8);
+  pdgDB->AddParticle("Y","Y",88.90585,kTRUE,0,39,"Ion",39*10000+89*10+kOffset,-1,8);
+  pdgDB->AddParticle("Zr","Zr",91.224,kTRUE,0,40,"Ion",40*10000+91*10+kOffset,-1,8);
+  pdgDB->AddParticle("Nb","Nb",92.90638,kTRUE,0,41,"Ion",41*10000+93*10+kOffset,-1,8);
+  pdgDB->AddParticle("Mo","Mo",95.94,kTRUE,0,42,"Ion",42*10000+96*10+kOffset,-1,8);
+  pdgDB->AddParticle("Tc","Tc",97.907,kTRUE,0,43,"Ion",43*10000+98*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ru","Rut",101.07,kTRUE,0,44,"Ion",44*10000+101*10+kOffset,-1,8);
+  pdgDB->AddParticle("Rh","Rh",102.9055,kTRUE,0,45,"Ion",45*10000+103*10+kOffset,-1,8);
+  pdgDB->AddParticle("Pd","Pd",106.42,kTRUE,0,46,"Ion",46*10000+106*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ag","Ag",107.8682,kTRUE,0,47,"Ion",47*10000+108*10+kOffset,-1,8);
+  pdgDB->AddParticle("Cd","Cd",112.411,kTRUE,0,48,"Ion",48*10000+112*10+kOffset,-1,8);
+  pdgDB->AddParticle("In","In",114.818,kTRUE,0,49,"Ion",49*10000+115*10+kOffset,-1,8);
+  pdgDB->AddParticle("Sn","Sn",118.710,kTRUE,0,50,"Ion",50*10000+119*10+kOffset,-1,8);
+  pdgDB->AddParticle("Sb","Sb",121.760,kTRUE,0,51,"Ion",51*10000+122*10+kOffset,-1,8);
+  pdgDB->AddParticle("Te","Te",127.60,kTRUE,0,52,"Ion",52*10000+128*10+kOffset,-1,8);
+  pdgDB->AddParticle("I","I",126.90447,kTRUE,0,53,"Ion",53*10000+127*10+kOffset,-1,8);
+  pdgDB->AddParticle("Xe","Xe",131.29,kTRUE,0,54,"Ion",54*10000+131*10+kOffset,-1,8);
+  pdgDB->AddParticle("Cs","Cs",132.90545,kTRUE,0,55,"Ion",55*10000+133*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ba","Ba",137.327,kTRUE,0,56,"Ion",56*10000+137*10+kOffset,-1,8);
+  pdgDB->AddParticle("La","La",138.906,kTRUE,0,57,"Ion",57*10000+139*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ce","Ce",140.116,kTRUE,0,58,"Ion",58*10000+140*10+kOffset,-1,8);
+  pdgDB->AddParticle("Pr","Pr",140.908,kTRUE,0,59,"Ion",59*10000+141*10+kOffset,-1,8);
+  pdgDB->AddParticle("Nd","Nd",144.240,kTRUE,0,60,"Ion",60*10000+144*10+kOffset,-1,8);
+  pdgDB->AddParticle("Pm","Pm",144.913,kTRUE,0,61,"Ion",61*10000+145*10+kOffset,-1,8);
+  pdgDB->AddParticle("Sm","Sm",150.360,kTRUE,0,62,"Ion",62*10000+150*10+kOffset,-1,8);
+  pdgDB->AddParticle("Eu","Eu",151.964,kTRUE,0,63,"Ion",63*10000+152*10+kOffset,-1,8);
+  pdgDB->AddParticle("Gd","Gd",157.250,kTRUE,0,64,"Ion",64*10000+157*10+kOffset,-1,8);
+  pdgDB->AddParticle("Tb","Tb",158.925,kTRUE,0,65,"Ion",65*10000+159*10+kOffset,-1,8);
+  pdgDB->AddParticle("Dy","Dy",162.500,kTRUE,0,66,"Ion",66*10000+162*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ho","Ho",164.930,kTRUE,0,67,"Ion",67*10000+165*10+kOffset,-1,8);
+  pdgDB->AddParticle("Er","Er",167.260,kTRUE,0,68,"Ion",68*10000+167*10+kOffset,-1,8);
+  pdgDB->AddParticle("Tm","Tm",168.934,kTRUE,0,69,"Ion",69*10000+169*10+kOffset,-1,8);
+  pdgDB->AddParticle("Yb","Yb",173.040,kTRUE,0,70,"Ion",70*10000+173*10+kOffset,-1,8);
+  pdgDB->AddParticle("Lu","Lu",174.967,kTRUE,0,71,"Ion",71*10000+175*10+kOffset,-1,8);
+  pdgDB->AddParticle("Hf","Hf",178.49,kTRUE,0,72,"Ion",72*10000+178*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ta","Ta",180.9479,kTRUE,0,73,"Ion",73*10000+181*10+kOffset,-1,8);
+  pdgDB->AddParticle("W","W",183.84,kTRUE,0,74,"Ion",74*10000+184*10+kOffset,-1,8);
+  pdgDB->AddParticle("Re","Re",186.207,kTRUE,0,75,"Ion",75*10000+186*10+kOffset,-1,8);
+  pdgDB->AddParticle("Os","Os",190.23,kTRUE,0,76,"Ion",76*10000+190*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ir","Ir",192.217,kTRUE,0,77,"Ion",77*10000+192*10+kOffset,-1,8);
+  pdgDB->AddParticle("Pt","Pt",195.078,kTRUE,0,78,"Ion",78*10000+195*10+kOffset,-1,8);
+  pdgDB->AddParticle("Au","Au",196.96655,kTRUE,0,79,"Ion",79*10000+197*10+kOffset,-1,8);
+  pdgDB->AddParticle("Hg","Hg",200.59,kTRUE,0,80,"Ion",80*10000+200*10+kOffset,-1,8);
+  pdgDB->AddParticle("Tl","Tl",204.38,kTRUE,0,81,"Ion",81*10000+204*10+kOffset,-1,8);
+  pdgDB->AddParticle("Pb","Pb",207.2,kTRUE,0,82,"Ion",82*10000+207*10+kOffset,-1,8);
+  pdgDB->AddParticle("Bi","Bi",208.98038,kTRUE,0,83,"Ion",83*10000+209*10+kOffset,-1,8);
+  // --- Ions added to run DPMJET (Chiara)
+  pdgDB->AddParticle("Mg25","Mg25",25.,kTRUE,0,12,"Ion",12*10000+25*10+kOffset,-1,8);
+  pdgDB->AddParticle("Co58","Co58",58.,kTRUE,0,27,"Ion",27*10000+58*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ti46","Ti46",46.,kTRUE,0,22,"Ion",22*10000+46*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ni58","Ni58",58.,kTRUE,0,28,"Ion",28*10000+58*10+kOffset,-1,8);
+  pdgDB->AddParticle("Zn30","Zn30",67.,kTRUE,0,30,"Ion",30*10000+67*10+kOffset,-1,8);
+  pdgDB->AddParticle("Se74","Se74",74.,kTRUE,0,34,"Ion",34*10000+74*10+kOffset,-1,8);
+  pdgDB->AddParticle("Sr84","Sr84",84.,kTRUE,0,38,"Ion",38*10000+84*10+kOffset,-1,8);
+  pdgDB->AddParticle("Sb147","Sb147",147.,kTRUE,0,51,"Ion",51*10000+147*10+kOffset,-1,8);
+  pdgDB->AddParticle("I131","I131",131.,kTRUE,0,53,"Ion",53*10000+131*10+kOffset,-1,8);
+  pdgDB->AddParticle("Pr132","Pr132",132.,kTRUE,0,59,"Ion",59*10000+132*10+kOffset,-1,8);
+  pdgDB->AddParticle("Nd134","Nd134",134.,kTRUE,0,60,"Ion",60*10000+134*10+kOffset,-1,8);
+  pdgDB->AddParticle("Dy144","Dy144",144.,kTRUE,0,66,"Ion",66*10000+144*10+kOffset,-1,8);
+  pdgDB->AddParticle("Tm156","Tm156",156.,kTRUE,0,69,"Ion",69*10000+156*10+kOffset,-1,8);
+  pdgDB->AddParticle("Yb177","Yb177",177.,kTRUE,0,70,"Ion",70*10000+177*10+kOffset,-1,8);
+  pdgDB->AddParticle("Ir173","Ir173",173.,kTRUE,0,77,"Ion",77*10000+173*10+kOffset,-1,8);
+  pdgDB->AddParticle("Os185","Os185",185.,kTRUE,0,76,"Ion",76*10000+185*10+kOffset,-1,8);
+  
+  printf("\n\n AliIonPDGCodes -> definition of PDG codes for ions\n\n");
+
+}
+
+//_____________________________________________________________________________
+Int_t AliIonPDGCodes::IdFromPDG(Int_t pdg) const 
+{
+  //
+  // Return Geant3 code from PDG and pseudo ENDF code
+  //
+  const Int_t kOffset=10000000;
+  for(Int_t i=0; i<fNIon; ++i)
+    if(pdg==fPDGCode[i]) return i+kOffset;
+  return -1;
+}
+
+//_____________________________________________________________________________
+Int_t AliIonPDGCodes::PDGFromId(Int_t id) const 
+{
+  //
+  // Return PDG code and pseudo ENDF code from Geant3 code
+  //
+  const Int_t kOffset=10000000;
+  if(id>0 && id<fNIon) return fPDGCode[id+kOffset];
+  else return -1;
+}
+
diff --git a/TDPMjet/AliIonPDGCodes.h b/TDPMjet/AliIonPDGCodes.h
new file mode 100644 (file)
index 0000000..073ad76
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef AliIonPDGCodes_h
+#define AliIonPDGCodes_h 
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#include <TArrayI.h>
+#include <TParticlePDG.h>
+#include <TParticleClassPDG.h>
+
+class TArrayI;
+class TParticle;
+class TDatabasePDG;
+
+class AliIonPDGCodes : public TObject
+{
+
+public:
+  
+  AliIonPDGCodes();
+  virtual ~AliIonPDGCodes() {;}
+  AliIonPDGCodes(const AliIonPDGCodes &PDGCodes) {;}
+  virtual void AddParticlesToPdgDataBase();
+//  virtual void MapPDGGEant3Codes();
+  virtual void SetPDGCode(Int_t i, Int_t val) {fPDGCode[i]=val;}
+  Int_t IdFromPDG(Int_t pdg) const;
+  Int_t PDGFromId(Int_t pdg) const;
+  
+protected:
+  
+  Int_t fNIon;
+  Int_t fPDGCode[200]; 
+
+  ClassDef(AliIonPDGCodes,1) 
+
+};
+#endif
diff --git a/TDPMjet/DPMcommon.h b/TDPMjet/DPMcommon.h
new file mode 100644 (file)
index 0000000..effd213
--- /dev/null
@@ -0,0 +1,221 @@
+#ifndef ROOT_DPMCommon
+#define ROOT_DPMCommon
+
+#ifndef __CFORTRAN_LOADED
+//*KEEP,cfortran.
+#include "cfortran.h"
+//*KEND.
+#endif
+
+extern "C" {
+/*========================================================*/
+/* COMMON/DTEVNO/NEVENT,ICASCA                           */
+/*--------------------------------------------------------*/
+typedef struct {
+   Int_t    nevent;
+   Int_t    icasca;
+} DtevnoCommon;
+
+#define DTEVNO COMMON_BLOCK(DTEVNO,dtevno)
+COMMON_BLOCK_DEF(DtevnoCommon,DTEVNO);
+
+/**********************************************************/
+/*           D E S C R I P T I O N :                      */
+/*--------------------------------------------------------*/
+/*                     Event flag                        */
+/*========================================================*/
+
+/*========================================================*/
+/* COMMON/DTEVT1/NHKK,NEVHKK,ISTHKK(NMXHKK),IDHKK(NMXHKK),*/
+/*     JMOHKK(2,NMXHKK),JDAHKK(2,NMXHKK),                */
+/*     PHKK(5,NMXHKK),VHKK(4,NMXHKK),WHKK(4,NMXHKK)      */
+/*--------------------------------------------------------*/
+typedef struct {
+   Int_t    nhkk;
+   Int_t    nevhkk;
+   Int_t    isthkk[200000];
+   Int_t    idhkk[200000];
+   Int_t    jmohkk[200000][2];
+   Int_t    jdahkk[200000][2];
+   Double_t  phkk[200000][5];
+   Double_t  vhkk[200000][4];
+   Double_t  whkk[200000][4];
+} Dtevt1Common;
+
+#define DTEVT1 COMMON_BLOCK(DTEVT1,dtevt1)
+COMMON_BLOCK_DEF(Dtevt1Common,DTEVT1);
+
+/**********************************************************/
+/*           D E S C R I P T I O N :                      */
+/*--------------------------------------------------------*/
+/*                     Event history                     */
+/*                                                       */
+/* NHKK - number of entries in common block              */
+/* NEVHKK - number of the event                                  */
+/* ISTHKK(i) - status code for entry i with following     */
+/*            meanings:                                  */
+/*          = 1 final state particle produced in         */
+/*             photon-/hadron-/nucleon-nucleon collisions*/
+/*              or in intranuclear cascade proc.         */
+/*          =-1 nucleons, deuterons, H3, He3, He4        */
+/*              evaporated from excited nucleus and      */
+/*              photons produced in nuclear deexcitation */
+/*              processes;                               */
+/*          = 1001  residual nucleus (ground state).     */
+/* IDHKK(i) - particle identity according to PDG code;    */
+/*           for nuclei (evaporation products and        */
+/*           residual nucleus): IDHKK(IHKK)=80000        */
+/* JMOHKK(1,i) - pointer to the position where the mother */
+/*              is stored; the initial value is 0        */
+/* JMOHKK(2,i) - pointer to the position of the 2nd mother*/
+/*              Normally only 1 mother exists, in which  */
+/*             case the value 0 is used. In cluster      */
+/*             fragmentation models, the 2 mothers would */
+/*             correspond to the q and qbar which join to*/
+/*             form a cluster. In string fragmentation,  */
+/*             the two mothers of a particle produced in */
+/*             the fragmentation would be the 2 endpoints*/
+/*             of the string.                            */
+/* JDAHKK(1,i) - pointer to the position of the 1st       */
+/*             daughter; if an entry has not decayed =0. */
+/* JDAHKK(1,i) - pointer to the position of the last      */
+/*             daughter; if an entry has not decayed =0. */
+/* PHKK(1,i) - momentum in x direction in GeV/c           */
+/* PHKK(2,i) - momentum in y direction in GeV/c           */
+/* PHKK(3,i) - momentum in z direction in GeV/c           */
+/* PHKK(4,i) - energy in GeV                             */
+/* PHKK(5,i) - mass in GeV/c^2; for space-like partons    */
+/*         it is allowed to use a mass<0, according      */
+/*         PHKK(5,IHKK) = -sqrt(-m^2)                    */ 
+/* VHKK(1,i) - production vertex in x position in mm      */
+/* VHKK(2,i) - production vertex in y position in mm      */
+/* VHKK(3,i) - production vertex in z position in mm      */
+/* VHKK(4,i) - production time in mm/c (=3.33*10^(-12)s   */
+/* WHKK(I,i) - gives positions and times in projectile    */ 
+/*             frame, the chains are created on the posi-*/
+/*             tions of the projectile nucleons in the   */
+/*             projectile frame (target nucleons in target*/
+/*             frame); both positions are therefore not  */
+/*             completely consistent. The times in the   */
+/*             projectile frame are obtained by a Lorentz*/
+/*             transformation from the LAB system.       */
+/*========================================================*/
+
+/*========================================================*/
+/* COMMON/DTEVT2/IDRES(NMXHKK),IDXRES(NMXHKK),NOBAM(NMXHKK),*/
+/*               IDBAM(NMXHKK),IDCH(NMXHKK),NPOINT(10),   */
+/*               IHIST(2,NMXHKK)                         */
+/*--------------------------------------------------------*/
+typedef struct {
+   Int_t    idres[200000];
+   Int_t    idxres[200000];
+   Int_t    nobam[200000];
+   Int_t    idbam[200000];
+   Int_t    idch[200000];
+   Int_t    npoint[10];
+   Int_t    ihist[200000][2];
+} Dtevt2Common;
+
+#define DTEVT2 COMMON_BLOCK(DTEVT2,dtevt2)
+COMMON_BLOCK_DEF(Dtevt2Common,DTEVT2);
+
+/**********************************************************/
+/*           D E S C R I P T I O N :                      */
+/*--------------------------------------------------------*/
+/*             Extended event history                    */
+/*                                                       */
+/* NMXHKK - max. num. of entries (partons/particles) that */
+/*             can be stored in the common block         */
+/* IDRES(IHKK) - mass num. A in case of nuclear fragments */
+/*             or residual nuclei (IDHKK(IHKK)=80000).   */
+/* IDXRES(IHKK) - charge Zin case of nuclear fragments    */
+/*             or residual nuclei (IDHKK(IHKK)=80000).   */
+/* NOBAM(IHKK) =1 for particles from proj. fragmentation  */
+/*            =2 for particles from target fragmentation.*/
+/* IDBAM(IHKK) - internal dpmjet particle code(BAMJET code)*/
+/*========================================================*/
+
+}
+
+/*========================================================*/
+/* COMMON/DTPRTA/IT,ITZ,IP,IPZ,IJPROJ,IBPROJ,IJTARG,IBTARG*/
+/*--------------------------------------------------------*/
+typedef struct {
+   Int_t    it;
+   Int_t    itz;
+   Int_t    ip;
+   Int_t    ipz;
+   Int_t    ijproj;
+   Int_t    ibproj;
+   Int_t    ijtarg;
+   Int_t    ibtarg;
+} DtprtaCommon;
+
+#define DTPRTA COMMON_BLOCK(DTPRTA,dtprta)
+COMMON_BLOCK_DEF(DtprtaCommon,DTPRTA);
+/**********************************************************/
+/*          D E S C R I P T I O N :                      */
+/*--------------------------------------------------------*/
+/* IT, ITZ - nucleon/atomic number of target nucleus     */
+/* IP, IPZ - nucleon/atomic number of projectile nucleus  */
+/*        for incident hadrons IP=IPZ=1                  */
+/*========================================================*/
+
+/*========================================================*/
+/* COMMON /DTIMPA/ BIMIN,BIMAX,XSFRAC,ICENTR             */
+/*--------------------------------------------------------*/
+typedef struct {
+   Double_t    bimin;
+   Double_t    bimax;
+   Double_t    xsfrac;
+   Double_t    icent;
+} DtimpaCommon;
+
+#define DTIMPA COMMON_BLOCK(DTIMPA,dtimpa)
+COMMON_BLOCK_DEF(DtimpaCommon,DTIMPA);
+/**********************************************************/
+/*          D E S C R I P T I O N :                      */
+/*--------------------------------------------------------*/
+/* BIMIN, BIMAX - min., max. b values (default bmin = 0)  */
+/* XSFRAC - fraction of x-section (default: 1)           */
+/* ICENTR =1. central production forced (default: 0)     */
+/*     <0 && >-100 -> bmin = BIMIN, bmax = BIMAX         */
+/*     <-99 -> fraction of x-sec. = XSFRAC               */
+/*     =-1. -> evaporation/fzc suppressed                */
+/*     <-1. -> evaporation/fzc suppressed                */
+/*========================================================*/
+
+
+/*========================================================*/
+/* COMMON /DTGLCP/RPROJ,RTARG,BIMPAC,NWTSAM,NWASAM,NWBSAM,*/
+/*               NWTACC,NWAACC,NWBACC                    */
+/*--------------------------------------------------------*/
+typedef struct {
+   Double_t    rproj;
+   Double_t    rtarg;
+   Double_t    bimpac;
+   Int_t       nwtsam;
+   Int_t       nwasam;
+   Int_t       nwbsam;
+   Int_t       nwtacc;
+   Int_t       nwtaac;
+   Int_t       nwtbac;
+} DtglcpCommon;
+
+#define DTGLCP COMMON_BLOCK(DTGLCP,dtglcp)
+COMMON_BLOCK_DEF(DtglcpCommon,DTGLCP);
+/**********************************************************/
+/*          D E S C R I P T I O N :                      */
+/*--------------------------------------------------------*/
+/* RPROJ  = radius of projectile nucleus                 */
+/* RPROJ  = radius of target nucleus                     */
+/* BIMPAC = impact parameter of the collision            */
+/* NWTSAM = total number of wounded nucleons             */
+/* NWASAM = number of wounded nucleons in projectile     */
+/* NWBSAM = number of wounded nucleons in target         */
+/* NWTACC = total number of interacting nucleons         */
+/* NWTAAC = total number of interacting nucleons in proj. */
+/* NWTBAC = total number of interacting nucleons in target*/
+/*========================================================*/
+
+#endif
diff --git a/TDPMjet/TDPMjet.cxx b/TDPMjet/TDPMjet.cxx
new file mode 100644 (file)
index 0000000..f4b5faa
--- /dev/null
@@ -0,0 +1,465 @@
+//*KEEP,CopyRight,T=C.
+/*************************************************************************
+ * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
+ * All rights reserved.                                                  *
+ *                                                                       *
+ * For the licensing terms see $ROOTSYS/LICENSE.                         *
+ * For the list of contributors see $ROOTSYS/README/CREDITS.             *
+ *************************************************************************/
+//*KEND.
+
+//*    +-------------------------------------------------------------+
+//*    |                                                             |
+//*    |                                                             |
+//*    |                        DPMJET 3.0                           |
+//*    |                                                             |
+//*    |                                                            |
+//*    |        S. Roesler+), R. Engel#), J. Ranft*)                |
+//*    |                                                            |
+//*    |        +) CERN, TIS-RP                                     |
+//*    |           CH-1211 Geneva 23, Switzerland                   |
+//*    |           Email: Stefan.Roesler@cern.ch                    |
+//*    |                                                            |
+//*    |        #) University of Delaware, BRI                      |
+//*    |           Newark, DE 19716, USA                            |
+//*    |                                                            |
+//*    |        *) University of Siegen, Dept. of Physics           |
+//*    |           D-57068 Siegen, Germany                          |
+//*    |                                                            |
+//*    |                                                            |
+//*    |       http://home.cern.ch/sroesler/dpmjet3.html            |
+//*    |                                                            |
+//*    |                                                            |
+//*    |       Monte Carlo models used for event generation:        |
+//*    |         PHOJET 1.12, JETSET 7.4 and LEPTO 6.5.1            |
+//*    |                                                            |
+//*    +-------------------------------------------------------------+
+
+//*KEEP,TDPMjet.
+#include "TDPMjet.h"
+//*KEEP,DPMCOMMON.
+#include "DPMcommon.h"
+//*KEEP,TParticle,T=C++.
+#include "TParticle.h"
+//*KEND.
+
+//*KEEP,TROOT.
+#include "TROOT.h"
+//*KEND.
+
+#ifndef WIN32
+# define dt_dtuini dt_dtuini_
+# define dt_getemu de_getemu_
+# define dt_kkinc  dt_kkinc_
+# define pho_phist pho_phist_
+# define dt_dtuout dt_dtuout_
+# define dt_rndm   dt_rndm_
+# define dt_rndmst dt_rndmst_
+# define dt_rndmin dt_rndmin_
+# define dt_rndmou dt_rndmou_
+# define type_of_call
+#else
+# define dt_dtuini DT_DTUINI
+# define dt_getemu DT_GETEMU
+# define dt_kkinc  DT_KKINC
+# define pho_phist PHO_PHIST
+# define dt_dtuout DT_DTUOUT
+# define dt_rndm   DT_RNDM
+# define dt_rndmst DT_RNDMST
+# define dt_rndmin DT_RNDMIN
+# define dt_rndmou DT_RNDMOU
+# define type_of_call _stdcall
+#endif
+
+#ifndef WIN32
+extern "C" void   type_of_call dt_dtuini(Int_t & , Double_t &, Int_t & , Int_t &, 
+                       Int_t &, Int_t &, Int_t &, Int_t &);
+extern "C" double type_of_call dt_getemu(Int_t &, Int_t &, Int_t &, Int_t &);
+extern "C" void   type_of_call dt_kkinc(Int_t &, Int_t &, Int_t &, Int_t &,
+                                   Int_t &, Double_t &, Int_t &, Int_t &);
+extern "C" void   type_of_call pho_phist(Int_t &, Double_t &);
+extern "C" void   type_of_call dt_dtuout();
+extern "C" void   type_of_call dt_rndm(Int_t &);
+extern "C" void   type_of_call dt_rndmst(Int_t &, Int_t &, Int_t &, Int_t &);
+extern "C" void   type_of_call dt_rndmin(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &);
+extern "C" void   type_of_call dt_rndmou(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &);
+
+#else
+
+#endif
+
+ClassImp(TDPMjet)
+
+//______________________________________________________________________________
+TDPMjet::TDPMjet() : TGenerator("dpmjet","dpmjet")
+{
+
+}
+
+//______________________________________________________________________________
+TDPMjet::TDPMjet(Int_t Ip=208, Int_t Ipz=82, Int_t It=208, Int_t Itz=82, 
+       Double_t Epn=2700., Double_t CMEn=5400.) 
+       : TGenerator("dpmjet","dpmjet")
+{  
+   fNEvent = 0;
+   fIp     = Ip;
+   fIpz    = Ipz;
+   fIt     = It;
+   fItz    = Itz;
+   fEpn    = Epn;
+   fCMEn   = CMEn;
+   fIdp    = 0;
+}
+
+
+//______________________________________________________________________________
+Int_t TDPMjet::ImportParticles(TClonesArray *particles, Option_t *option)
+{
+//
+//  Default primary creation method. It reads the /HEPEVT/ common block which
+//  has been filled by the GenerateEvent method. If the event generator does
+//  not use the HEPEVT common block, This routine has to be overloaded by
+//  the subclasses.
+//  The function loops on the generated particles and store them in
+//  the TClonesArray pointed by the argument particles.
+//  The default action is to store only the stable particles 
+//  This can be demanded explicitly by setting the option = "Final"
+//  If the option = "All", all the particles are stored.
+//
+  if(particles==0) return 0;
+  TClonesArray &Particles = *particles;
+  Particles.Clear();
+  Int_t numpart = 0;    // Total number of produced particles
+  Int_t numStabpart = 0; // Total number of produced stable particles
+  Double_t entot = 0;   // Total energy in final state (from stable particles)
+  
+  numpart = DTEVT1.nhkk;
+  for(Int_t i=0; i<numpart; i++){
+     if(DTEVT1.isthkk[i]==1 || DTEVT1.isthkk[i]==-1 || DTEVT1.isthkk[i]==1001){
+        numStabpart++;
+       entot += DTEVT1.phkk[i][3]; // PHKK[i][3] <-> PHKK(4,i)
+     } 
+  }
+  printf("\n TDPMjet: DPMJET stack contains %d particles", numpart);
+  printf("\n TDPMjet: Final not decayed particles: %d", numStabpart);
+  printf("\n TDPMjet: Total energy: %f GeV          \n", entot);
+  Int_t nump = 0;
+  
+  if(!strcmp(option,"") || !strcmp(option,"Final")){
+      for (Int_t i=0; i < numpart; i++) {
+         
+         if (DTEVT1.isthkk[i] == 1) {
+          //
+          //  Use the common block values for the TParticle constructor
+          //
+          //printf("   DTEVT1.isthkk[i]=1 -> i = %d, nump = %d\n",i,nump);
+             new(Particles[nump]) TParticle(
+                 DTEVT1.idhkk[i],
+                 DTEVT1.isthkk[i],
+                 -1,
+                 -1,
+                 -1,
+                 -1,
+                 DTEVT1.phkk[i][0],
+                 DTEVT1.phkk[i][1],
+                 DTEVT1.phkk[i][2],
+                 DTEVT1.phkk[i][3],
+                 
+                 DTEVT1.vhkk[i][0],
+                 DTEVT1.vhkk[i][1],
+                 DTEVT1.vhkk[i][2],
+                 DTEVT1.vhkk[i][3]);
+             nump++;
+         }
+      }
+  }
+  else if(!strcmp(option,"All")){
+      nump = numpart; 
+      for (Int_t i=0; i <= numpart; i++){
+        
+         // DTEVT1.JMOHKK[i][0] pointer to the entry of the 1st mother of entry i
+         Int_t iParent = DTEVT1.jmohkk[i][0] - 1;
+            
+         if(iParent >= 0){
+             TParticle *mother = (TParticle*) (Particles.UncheckedAt(iParent));
+              //printf("       i = %d, iParent = %d ", i, iParent);
+             //mother->Print();
+             //printf("\n");
+             mother->SetLastDaughter(i);
+             if(mother->GetFirstDaughter() == -1) mother->SetFirstDaughter(i);
+         } 
+         // --- PDGcode for residual nuclei (idhkk=80000) 
+         // ---        10000*Z + 10*A
+         // --- DPMJET -> idres = mass #, idxres = charge
+         if(DTEVT1.idhkk[i] == 80000) 
+             DTEVT1.idhkk[i] = 10000*DTEVT2.idxres[i]+10*DTEVT2.idres[i];
+         if(DTEVT2.idxres[i] != 0) 
+             printf("\n        pc#%d -> A = %d, Z = %d -> PDGcode = %d\n",
+                    i,DTEVT2.idres[i],DTEVT2.idxres[i],DTEVT1.idhkk[i]);
+         
+         new(Particles[i]) TParticle(
+             DTEVT1.idhkk[i],
+             DTEVT1.isthkk[i],
+             iParent,
+             -1,
+             -1,
+             -1,
+             
+             DTEVT1.phkk[i][0],
+             DTEVT1.phkk[i][1],
+             DTEVT1.phkk[i][2],
+             DTEVT1.phkk[i][3],
+             
+             DTEVT1.vhkk[i][0],
+             DTEVT1.vhkk[i][1],
+             DTEVT1.vhkk[i][2],
+             DTEVT1.vhkk[i][3]);
+         printf("%Particle: d %d %d %d \n", i, DTEVT1.idhkk[i],  DTEVT1.isthkk[i], iParent);
+         
+      } // Particle loop  
+  }
+  return nump;
+}
+
+
+//====================== access to dpmjet subroutines =========================
+//______________________________________________________________________________
+void TDPMjet::Initialize()
+{
+//********************************************************************************
+//*Calls DT_DTUINI with the either default parameters or the ones set by the user*
+//********************************************************************************
+
+//   printf("\n-------------------------------------------\n");
+//   printf("\n                TDPMjet initialized with:\n\n");
+//   printf(" Projectile       -> A = %d, Z = %d \n",fIp, fIpz);
+//   printf(" Target           -> A = %d, Z = %d \n",fIt, fItz);
+//   printf(" Proj. LAB E      -> E = %f GeV \n",fEpn);
+//   printf(" CM energy        -> Ecm = %f GeV \n",fCMEn);
+//   printf("\n-------------------------------------------\n");
+
+   Int_t iemu = 0; // No emulsion (default)
+   Dt_Dtuini(1, fEpn, fIp, fIpz, fIt, fItz, fIdp, iemu);
+
+}
+
+
+//______________________________________________________________________________
+void TDPMjet::GenerateEvent()
+{
+   // Generates one event;
+   fNEvent++;
+   DTEVNO.nevent=fNEvent;
+   //printf("\n        fNEvent = %d\n",fNEvent);
+   Int_t kkmat=-1;
+   Float_t Elab = fEpn;
+   Int_t irej=0;
+   Dt_Kkinc(fIp, fIpz, fIt, fItz, fIdp, Elab, kkmat, irej);
+   if(irej!=0) return;
+   //
+   Int_t imode=2000;
+   Double_t weight=1.;
+   Pho_Phist(imode, weight);
+   Dt_Dtuout();
+   
+}
+//______________________________________________________________________________
+void TDPMjet::Dt_Dtuini(int nevts, double epn, int npmass, int npchar, 
+                       int ntmass, int ntchar, int idp, int iemu)
+{
+  // Call dmpjet routine DT_DTUINI passing the parameters 
+  // in a way accepted by Fortran routines                                
+     
+   
+   /*printf("\n-------------------------------------------\n");
+   printf("\n          Dt_Dtuini called with:\n\n");
+   printf(" Projectile -> A = %d, Z = %d \n",npmass, npchar);
+   printf(" Target     -> A = %d, Z = %d \n",ntmass, ntchar);
+   printf(" Proj. LAB E        -> E = %f GeV \n",epn);
+   printf(" nevts = %d, idp = %d, iemu = %d \n",nevts,idp,iemu);
+   printf("\n-------------------------------------------\n");*/
+
+   dt_dtuini(nevts, epn, npmass, npchar, ntmass, ntchar, idp, iemu);
+    
+}
+
+//______________________________________________________________________________
+void TDPMjet::Dt_Kkinc(int npmass, int npchar, int ntmass, int ntchar, 
+                      int idp, double elab, int kkmat, int irej)
+{
+  // Call dmpjet routine DT_KKINC passing the parameters 
+  // in a way accepted by Fortran routines                                
+  
+   /*printf("\n-------------------------------------------\n");
+   printf("\n          Dt_Kkinc called with:\n\n");
+   printf(" Projectile -> A = %d, Z = %d \n",npmass, npchar);
+   printf(" Target     -> A = %d, Z = %d \n",ntmass, ntchar);
+   printf(" LAB Energy -> E = %f GeV \n",elab);
+   printf(" idp = %d,  kkmat = %d, irej = %d \n",idp,kkmat,irej);
+   printf("\n-------------------------------------------\n");*/
+
+  dt_kkinc(npmass, npchar, ntmass, ntchar, idp, elab, kkmat, irej);
+
+}
+
+//______________________________________________________________________________
+void TDPMjet::Pho_Phist(int imode, double weight)
+{
+  // Call dmpjet routine PHO_PHIST passing the parameters 
+  // in a way accepted by Fortran routines
+  
+  pho_phist(imode,weight);                                
+
+}
+
+//______________________________________________________________________________
+void TDPMjet::Dt_Dtuout()
+{
+  // Call dmpjet routine DT_DTUOT passing the parameters 
+  // in a way accepted by Fortran routines                                
+  
+  dt_dtuout();
+
+}
+
+//______________________________________________________________________________
+Int_t TDPMjet::GetEvNum() const
+{
+       return DTEVT1.nevhkk;
+}
+//______________________________________________________________________________
+Int_t TDPMjet::GetEntriesNum() const
+{
+       return DTEVT1.nhkk;
+}
+//______________________________________________________________________________
+Int_t TDPMjet::GetNumStablePc() const
+{
+       Int_t NumStablePc = 0;
+       for(Int_t i=0; i<DTEVT1.nhkk; i++){
+          if(DTEVT1.isthkk[i] == 1) NumStablePc++;
+       }
+       return NumStablePc;
+}
+
+//______________________________________________________________________________
+Float_t TDPMjet::GetTotEnergy() const
+{
+       Float_t TotEnergy = 0.;
+       for(Int_t i=0; i<DTEVT1.nhkk; i++){
+         if(DTEVT1.isthkk[i] == 1)
+           TotEnergy += DTEVT1.phkk[i][3]; // PHKK[i][3] <-> PHKK(4,i)
+       }
+       return TotEnergy;
+}
+
+//______________________________________________________________________________
+Int_t TDPMjet::GetStatusCode(Int_t evnum) const 
+{
+       return DTEVT1.isthkk[evnum];    
+}
+//______________________________________________________________________________
+Int_t TDPMjet::GetPDGCode(Int_t evnum) const   
+{
+       return DTEVT1.idhkk[evnum];
+}
+//______________________________________________________________________________
+Double_t TDPMjet::Getpx(Int_t evnum) const       
+{
+       return DTEVT1.phkk[evnum][0];
+}
+//______________________________________________________________________________
+Double_t TDPMjet::Getpy(Int_t evnum) const      
+{
+       return DTEVT1.phkk[evnum][1];
+}
+//______________________________________________________________________________
+Double_t TDPMjet::Getpz(Int_t evnum) const       
+{
+       return DTEVT1.phkk[evnum][2];
+}
+//______________________________________________________________________________
+Double_t TDPMjet::GetEnergy(Int_t evnum) const       
+{
+       return DTEVT1.phkk[evnum][3];
+}
+//______________________________________________________________________________
+Double_t TDPMjet::GetMass(Int_t evnum) const         
+{
+       return DTEVT1.phkk[evnum][4];
+}
+//______________________________________________________________________________
+Int_t    TDPMjet::GetFragmentA(Int_t evnum) const      
+{
+       return DTEVT2.idres[evnum];
+}
+//______________________________________________________________________________
+Int_t    TDPMjet::GetFragmentZ(Int_t evnum) const      
+{
+       return DTEVT2.idxres[evnum];
+}
+//______________________________________________________________________________
+Double_t TDPMjet::GetXSFrac() const          
+{
+       return DTIMPA.xsfrac;
+}
+//______________________________________________________________________________
+Double_t TDPMjet::GetBImpac() const          
+{
+       return DTGLCP.bimpac;
+}
+//______________________________________________________________________________
+Double_t TDPMjet::GetProjRadius() const              
+{
+       return DTGLCP.rproj;
+}
+//______________________________________________________________________________
+Double_t TDPMjet::GetTargRadius() const              
+{
+       return DTGLCP.rtarg;
+}
+//______________________________________________________________________________
+Int_t TDPMjet::GetProjWounded() const
+{
+       return DTGLCP.nwasam;
+}
+//______________________________________________________________________________
+Int_t TDPMjet::GetTargWounded() const
+{
+       return DTGLCP.nwbsam;
+}
+//______________________________________________________________________________
+Int_t TDPMjet::GetProjSpectators() const
+{
+       return DTGLCP.nwtaac;
+}
+//______________________________________________________________________________
+Int_t TDPMjet::GetTargSpectators() const
+{
+       return DTGLCP.nwtbac;
+}
+
+//______________________________________________________________________________
+void TDPMjet::Dt_Rndm(int idummy)
+{
+       dt_rndm(idummy);
+}
+
+//______________________________________________________________________________
+void TDPMjet::Dt_Rndmst(int na1, int na2, int na3, int nb1)
+{
+       dt_rndmst(na1, na2, na3, nb1);
+}
+
+//______________________________________________________________________________
+void TDPMjet::Dt_Rndmin(int u, int c, int cd, int cm, int i, int j)
+{
+       dt_rndmin(u, c, cd, cm, i, j);
+}
+
+//______________________________________________________________________________
+void TDPMjet::Dt_Rndmou(int u, int c, int cd, int cm, int i, int j)
+{
+       dt_rndmou(u, c, cd, cm, i, j);
+}
+
diff --git a/TDPMjet/TDPMjet.h b/TDPMjet/TDPMjet.h
new file mode 100644 (file)
index 0000000..dd77c83
--- /dev/null
@@ -0,0 +1,136 @@
+#ifndef ROOT_TDPMjet
+#define ROOT_TDPMjet
+
+//+SEQ,CopyRight,T=NOINCLUDE.
+
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+//                               TDPMjet                               //
+//                                                                      //
+// This class implements an interface to the DPMJET 3.0 event generator.//
+//                                                                      //
+//////////////////////////////////////////////////////////////////////////
+
+#ifndef ROOT_TGenerator
+//*KEEP,TGenerator.
+#include "TGenerator.h"
+//*KEND.
+#endif
+
+class TDPMjet : public TGenerator {
+
+public:
+   
+   TDPMjet();
+   TDPMjet(Int_t Ip, Int_t Ipz, Int_t It, Int_t Itz, Double_t Epn, Double_t CMEn);
+
+   virtual       ~TDPMjet() {;}
+
+   virtual void  Initialize();
+
+   virtual void  GenerateEvent();
+
+   virtual Int_t ImportParticles(TClonesArray *particles, Option_t *option="");
+
+   
+   // Parameters for the generation:
+   virtual void  SetNEvent(Int_t iev)    {fNEvent = iev;}
+   virtual Int_t GetNEvent()             {return fNEvent;}
+   
+   virtual void  SetfIp(Int_t Ip)        {fIp = Ip;}
+   virtual Int_t GetfIp() const                 {return fIp;}
+
+   virtual void  SetfIpz(Int_t Ipz)      {fIpz = Ipz;}
+   virtual Int_t GetfIpz() const         {return fIpz;}
+
+   virtual void  SetfIt(Int_t It)        {fIt = It;}
+   virtual Int_t GetfIt() const                 {return fIt;}
+
+   virtual void  SetfItz(Int_t Itz)      {fItz = Itz;}
+   virtual Int_t GetfItz() const         {return fItz;}
+
+   virtual void  SetfEpn(Double_t Epn)   {fEpn = Epn;}
+   virtual Double_t GetfEpn() const      {return fEpn;}
+
+   virtual void  SetfCMEn(Double_t CMEn) {fCMEn = CMEn;}
+   virtual Double_t GetfCMEn() const     {return fCMEn;}
+
+   virtual void  SetfIdp(Int_t idp)      {fIdp = idp;}
+   virtual Int_t GetfIdp() const         {return fIdp;}
+
+   virtual void SetbRange(Double_t bmin, Double_t bmax) 
+               {fBmin = bmin; fBmax = bmax;} 
+   virtual Double_t GetMinImpactParameter() const {return fBmin;}  
+   virtual Double_t GetMaxImpactParameter() const {return fBmax;}  
+   
+   virtual void  SetfFCentr(Int_t icentr)  {fFCentr = icentr;}
+   virtual Int_t GetfFCentr() const        {return fFCentr;}
+
+   // Access to DPMJET common blocks:
+   virtual Int_t    GetEvNum() const;            
+   virtual Int_t    GetEntriesNum() const;               
+   virtual Int_t    GetNumStablePc() const;              
+   virtual Float_t  GetTotEnergy() const;
+   virtual Int_t    GetStatusCode(Int_t evnum) const; 
+   virtual Int_t    GetPDGCode(Int_t evnum) const; 
+   virtual Double_t Getpx(Int_t evnum) const;  
+   virtual Double_t Getpy(Int_t evnum) const;  
+   virtual Double_t Getpz(Int_t evnum) const;  
+   virtual Double_t GetEnergy(Int_t evnum) const;  
+   virtual Double_t GetMass(Int_t evnum) const;
+   
+   virtual Int_t    GetFragmentA(Int_t evnum) const;   
+   virtual Int_t    GetFragmentZ(Int_t evnum) const;   
+   
+   virtual Double_t GetXSFrac() const;
+   virtual Double_t GetBImpac() const;
+   virtual Double_t GetProjRadius() const;
+   virtual Double_t GetTargRadius() const;
+   virtual Int_t GetProjWounded() const;
+   virtual Int_t GetTargWounded() const;
+   virtual Int_t GetProjSpectators() const;
+   virtual Int_t GetTargSpectators() const;
+   
+  
+   // Access to DPMJET routines:
+   virtual void Dt_Dtuini(int nevts, double epn, int npmass, int npchar, 
+                         int ntmass, int ntchar, int idp, int iemu);
+       
+   virtual void Dt_Kkinc(int npmass, int npchar, int ntmass, int ntchar, 
+                        int idp, double elab, int kkmat, int irej);
+
+   virtual void Pho_Phist(int imode, double weight);
+
+   virtual void Dt_Dtuout();
+
+   virtual void Dt_Rndm(int idummy);   
+   virtual void Dt_Rndmst(int na1, int na2, int na3, int nb1);   
+   virtual void Dt_Rndmin(int u, int c, int cd, int cm, int i, int j);   
+   virtual void Dt_Rndmou(int u, int c, int cd, int cm, int i, int j);   
+
+protected:
+
+   Int_t    fNEvent;   // Event number to be generated 
+   Int_t    fIp;       // Projectile mass
+   Int_t    fIpz;      // Projectile charge
+   Int_t    fIt;       // Target mass
+   Int_t    fItz;      // Target charge
+   Double_t fEpn;      // Beam energy
+   Double_t fPpn;      // Beam momentum
+   Double_t fCMEn;     // Energy in CM 
+   Int_t    fIdp;      // Internal particle code
+   Double_t fBmin;     // Minimum impact parameter
+   Double_t fBmax;     // Maximum impact parameter
+   Int_t    fFCentr;   // Flag to force central collisions
+
+   ClassDef(TDPMjet,1)  //Interface to DPMJET Event Generator
+};
+
+#endif
+
+
+
+
+
+
+
diff --git a/TDPMjet/TDPMjetLinkDef.h b/TDPMjet/TDPMjetLinkDef.h
new file mode 100644 (file)
index 0000000..2c70930
--- /dev/null
@@ -0,0 +1,12 @@
+#ifdef __CINT__
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+#pragma link C++ class TDPMjet+;
+#pragma link C++ class AliGenDPMjet+;
+#pragma link C++ class AliGenDPMjetEventHeader+;
+#pragma link C++ class AliIonPDGCodes+;
+
+#endif
diff --git a/TDPMjet/libTDPMjet.pkg b/TDPMjet/libTDPMjet.pkg
new file mode 100644 (file)
index 0000000..07ca5d8
--- /dev/null
@@ -0,0 +1,7 @@
+SRCS= TDPMjet.cxx AliGenDPMjet.cxx AliGenDPMjetEventHeader.cxx AliIonPDGCodes.cxx
+
+HDRS= $(SRCS:.cxx=.h) 
+
+DHDR:=TDPMjetLinkDef.h
+
+EXPORT:=TDPMjet.h AliGenDPMjetEventHeader.h AliIonPDGCodes.h