00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <iostream>
00013
00014 #include "HepPID/Version.hh"
00015 #include "HepPID/ParticleIDTranslations.hh"
00016 #include "HepPID/ParticleIDMethods.hh"
00017
00018 #define IDMAX 49
00019
00020 namespace HepPID {
00021
00022 int translatePDTtoGeant( const int id )
00023 {
00024 static int IDG2H[IDMAX] = {
00025 22,
00026 -11,
00027 11,
00028 12,
00029 -13,
00030 13,
00031 111,
00032 211,
00033 -211,
00034 130,
00035 321,
00036 -321,
00037 2112,
00038 2212,
00039 -2212,
00040 310,
00041 221,
00042 3122,
00043 3222,
00044 3212,
00045 3112,
00046 3322,
00047 3312,
00048 3334,
00049 -2112,
00050 -3122,
00051 -3112,
00052 -3212,
00053 -3222,
00054 -3322,
00055 -3312,
00056 -3334,
00057 -15,
00058 15,
00059 411,
00060 -411,
00061 421,
00062 -421,
00063 431,
00064 -431,
00065 4122,
00066 24,
00067 -24,
00068 23,
00069 1000010020,
00070 1000010030,
00071 1000020040,
00072 0,
00073 1000020030 };
00074 static int nwhine_max = 10;
00075 int nwhine = 0;
00076 int gtran, i;
00077
00078
00079 if( abspid(id) == 12 || abspid(id) == 14 || abspid(id) == 16 ) {
00080 gtran = 4;
00081 } else {
00082
00083
00084 gtran = IDMAX + 1;
00085 for( i=0; i < IDMAX; ++i ) {
00086 if( IDG2H[i] == id ) { gtran = i; }
00087 }
00088 }
00089 if( gtran > IDMAX || gtran == 48 ) {
00090 gtran = 48;
00091 nwhine = nwhine + 1;
00092 if( nwhine <= nwhine_max ) {
00093 std::cout << "translatePDTtoGeant: HEP particle " << id
00094 << " not known to GEANT (converted to geantino)" << std::endl;
00095 }
00096 }
00097 return gtran;
00098 }
00099
00100 }