The conversion between ID and PDG now uses Fluka routines and arrays which is more...
authoriglez2 <iglez2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Nov 2002 16:00:46 +0000 (16:00 +0000)
committeriglez2 <iglez2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Nov 2002 16:00:46 +0000 (16:00 +0000)
TFluka/TFluka.cxx
TFluka/TFluka.h

index 90644ae340205cc1c4b07c262eea0e266114894c..dbf5e1ff5ab1e70d4fcab3f6914c03389178f278 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.3  2002/10/22 15:12:14  alibrary
+Introducing Riostream.h
+
 Revision 1.2  2002/10/14 14:57:40  hristov
 Merging the VirtualMC branch to the main development branch (HEAD)
 
@@ -56,6 +59,7 @@ First commit of Fluka interface.
 #include "Fdblprc.h"       //(DBLPRC) fluka common
 #include "Fiounit.h"       //(IOUNIT) fluka common
 #include "Fepisor.h"       //(EPISOR) fluka common
+#include "Fpart.h"         //(PART)   fluka common
 #include "TVirtualMC.h"
 
 // Fluka methods that may be needed.
@@ -63,10 +67,14 @@ First commit of Fluka interface.
 # define flukam  flukam_
 # define fluka_openinp fluka_openinp_
 # define fluka_closeinp fluka_closeinp_
+# define mcihad mcihad_
+# define mpdgha mpdgha_
 #else 
 # define flukam  FLUKAM
 # define fluka_openinp FLUKA_OPENINP
 # define fluka_closeinp FLUKA_CLOSEINP
+# define mcihad MCIHAD
+# define mpdgha MPDGHA
 #endif
 
 extern "C" 
@@ -77,6 +85,8 @@ extern "C"
   void type_of_call flukam(const int&);
   void type_of_call fluka_openinp(const int&, DEFCHARA);
   void type_of_call fluka_closeinp(const int&);
+  int  type_of_call mcihad(const int&);
+  int  type_of_call mpdgha(const int&);
 }
 
 //
@@ -169,93 +179,23 @@ void TFluka::ProcessRun(Int_t nevent) {
 Int_t TFluka::IdFromPDG(Int_t pdg) const 
 {
   //
-  // Return Geant3 code from PDG and pseudo ENDF code
-  //
-  for(Int_t i=0;i<fNPDGCodes;++i)
-    if(pdg==fPDGCode[i])
-      return i;
-  return -99;
+  // Return Fluka code from PDG and pseudo ENDF code
+
+  // MCIHAD() goes from pdg to fluka internal.
+  Int_t intfluka = mcihad(pdg);
+  // KPTOIP array goes from internal to official
+  return GetFlukaKPTOIP(intfluka);
 }
 
 //_____________________________________________________________________________
 Int_t TFluka::PDGFromId(Int_t id) const 
 {
   //
-  // Return PDG code and pseudo ENDF code from Geant3 code
-  //
-  if(id>0 && id<fNPDGCodes) 
-    return fPDGCode[id];
-  else 
-    return -1;
-}
+  // Return PDG code and pseudo ENDF code from Fluka code
 
-//_____________________________________________________________________________
-void TFluka::DefineParticles() 
-{
-  // Load standard numbers for GEANT particles and PDG conversion
-  fPDGCode[fNPDGCodes++]=  -99; //  0 = Psudoparticle (Ray)
-  fPDGCode[fNPDGCodes++]= 2212; //  1 = Proton
-  fPDGCode[fNPDGCodes++]=-2212; //  2 = Anti Proton
-  fPDGCode[fNPDGCodes++]=   11; //  3 = Electron
-  fPDGCode[fNPDGCodes++]=  -11; //  4 = Positron
-  fPDGCode[fNPDGCodes++]=   12; //  5 = Electron Neutrino
-  fPDGCode[fNPDGCodes++]=  -12; //  6 = Electron Antineutrino
-  fPDGCode[fNPDGCodes++]=   22; //  7 = Photon
-  fPDGCode[fNPDGCodes++]= 2112; //  8 = Neutron
-  fPDGCode[fNPDGCodes++]=-2112; //  9 = Anti Neutron
-  fPDGCode[fNPDGCodes++]=  -13; // 10 = Mu+
-  fPDGCode[fNPDGCodes++]=   13; // 11 = Mu-
-  fPDGCode[fNPDGCodes++]=  130; // 12 = Kaon 0 long
-  fPDGCode[fNPDGCodes++]=  211; // 13 = Pi+
-  fPDGCode[fNPDGCodes++]= -211; // 14 = Pi-
-  fPDGCode[fNPDGCodes++]=  321; // 15 = Kaon+
-  fPDGCode[fNPDGCodes++]= -321; // 16 = Kaon-
-  fPDGCode[fNPDGCodes++]= 3122; // 17 = Lambda
-  fPDGCode[fNPDGCodes++]=-3122; // 18 = Anti Lambda
-  fPDGCode[fNPDGCodes++]=  310; // 19 = Kaon 0 short
-  fPDGCode[fNPDGCodes++]= 3112; // 20 = Sigma -
-  fPDGCode[fNPDGCodes++]= 3222; // 21 = Sigma +
-  fPDGCode[fNPDGCodes++]= 3212; // 22 = Sigma 0
-  fPDGCode[fNPDGCodes++]=  111; // 23 = Pi0
-  fPDGCode[fNPDGCodes++]=  311; // 24 = Kaon 0
-  fPDGCode[fNPDGCodes++]= -311; // 25 = Antikaon 0
-  fPDGCode[fNPDGCodes++]=  -99; // 26 = --Reserved
-  fPDGCode[fNPDGCodes++]=   14; // 27 = Muon neutrino
-  fPDGCode[fNPDGCodes++]=  -14; // 28 = Muon antineutrino
-  fPDGCode[fNPDGCodes++]=  -99; // 29 = --Reserved
-  fPDGCode[fNPDGCodes++]=  -99; // 30 = --Reserved
-  fPDGCode[fNPDGCodes++]=-3222; // 31 = Antisigma -
-  fPDGCode[fNPDGCodes++]=-3212; // 32 = Antisigma 0
-  fPDGCode[fNPDGCodes++]=-3112; // 33 = Antisigma +
-  fPDGCode[fNPDGCodes++]= 3322; // 34 = Xi 0
-  fPDGCode[fNPDGCodes++]=-3322; // 35 = AntiXi 0
-  fPDGCode[fNPDGCodes++]= 3312; // 36 = Xi -
-  fPDGCode[fNPDGCodes++]=-3312; // 37 = Xi +
-  fPDGCode[fNPDGCodes++]= 3334; // 38 = Omega -
-  fPDGCode[fNPDGCodes++]=-3334; // 39 = Antiomega
-  fPDGCode[fNPDGCodes++]=  -99; // 40 = --Reserved
-  fPDGCode[fNPDGCodes++]=  -15; // 41 = Tau+
-  fPDGCode[fNPDGCodes++]=   15; // 42 = Tau-
-  fPDGCode[fNPDGCodes++]=   16; // 43 = Tau neutrino
-  fPDGCode[fNPDGCodes++]=  -16; // 44 = Tau antineutrino
-  fPDGCode[fNPDGCodes++]=  411; // 45 = D+
-  fPDGCode[fNPDGCodes++]= -411; // 46 = D-
-  fPDGCode[fNPDGCodes++]=  421; // 47 = D0
-  fPDGCode[fNPDGCodes++]= -421; // 48 = AntiD 0
-  fPDGCode[fNPDGCodes++]=  431; // 49 = D_s +
-  fPDGCode[fNPDGCodes++]= -431; // 50 = D_s -
-  fPDGCode[fNPDGCodes++]= 4122; // 51 = Lambda_c +
-  fPDGCode[fNPDGCodes++]= 4232; // 52 = Xi_c +
-  fPDGCode[fNPDGCodes++]= 4112; // 53 = Xi_c -
-  fPDGCode[fNPDGCodes++]= 4322; // 54 = Xi'_c +
-  fPDGCode[fNPDGCodes++]= 4312; // 55 = Xi'_c 0
-  fPDGCode[fNPDGCodes++]= 4332; // 56 = Omega_c 0
-  fPDGCode[fNPDGCodes++]=-4122; // 57 = Antilambda_c -
-  fPDGCode[fNPDGCodes++]=-4232; // 58 = Antixsi_c -
-  fPDGCode[fNPDGCodes++]=-4112; // 59 = Antixsi_c 0
-  fPDGCode[fNPDGCodes++]=-4322; // 60 = AntiXi'_c -
-  fPDGCode[fNPDGCodes++]=-4312; // 61 = AntiXi'_c 0
-  fPDGCode[fNPDGCodes++]=-4332; // 62 = AntiOmega_c 0
-  fPDGCode[fNPDGCodes++]=  -99; // 63 = --Reserved
-  fPDGCode[fNPDGCodes++]=  -99; // 64 = --Reserved
+  //IPTOKP array goes from official to internal
+  Int_t intfluka = GetFlukaIPTOKP(id);
+  //MPKDHA() goes from internal to PDG
+  return mpdgha(intfluka);
+  
 }
index d047cd1881f13df0b40fcf9fe7d56b6c87735323..99106e0471535c024dcb816afb90507be55071bf 100644 (file)
@@ -155,11 +155,9 @@ class TFluka : public TVirtualMC {
   
   // particle table usage         
   virtual Int_t   IdFromPDG(Int_t id) const;
-    //{printf("WARNING: IdFromPDG not yet implemented !\n"); return -1;}  
   virtual Int_t   PDGFromId(Int_t pdg) const;
-    //{printf("WARNING: PDGFromId not yet implemented !\n"); return -1;}  
-  virtual void    DefineParticles();
-    //{printf("WARNING: DefineParticles not yet implemented !\n");}     
+  virtual void    DefineParticles()
+  {printf("WARNING: DefineParticles not yet implemented !\n");}     
   
   //
   // methods for step management
@@ -300,15 +298,12 @@ class TFluka : public TVirtualMC {
   //
   
   virtual void Init();
-  //{printf("WARNING:  not yet implemented !\n");}
   virtual void FinishGeometry()
     {printf("WARNING: FinishGeometry not yet implemented !\n");}
   virtual void BuildPhysics()
     {printf("WARNING: BuildPhysics not yet implemented !\n");}
   virtual void ProcessEvent();
-  //{printf("WARNING: ProcessEvent not yet implemented !\n");}
   virtual void ProcessRun(Int_t nevent);
-  //{printf("WARNING: ProcessRun not yet implemented !\n");}
   
 
   //